Location: PHPKode > projects > Eventum > eventum-2.2/docs/Customer_API.html
<html>
<head>
<title>Eventum - Customer API</title>
</head>
<body>
<h1>Customer API</h1>
<p>
    Author: <i><a href="mailto:hide@address.com">Bryan Alsdorf</a></i><br />
    Created: <i>2004-09-07</i>
</p>
<p>
The Customer API allows Eventum to interact with with your customer database. This document
will cover what is needed to implement the class needed to interact with your customer database system.
</p>
<h2>Getting Started</h2>
<p>To write your own Customer class create a file named "class.my_name.php" in <i>/eventum/include/customer/</i>.
In that file, create a class named "my_name_Customer_Backend" that extends "Abstract_Customer_Backend".
Now you can add methods to that class to handle specific events. You can copy the method signatures
from <i>/eventum/include/customer/class.abstract_customer_backend.php</i> to get started. <br />
An example customer implementation is in <i>/eventum/include/customer/class.example_customer.php</i>. If you want
to use this example implemenation, follow the steps below to enable customer integration and run
<i>/eventum/customer/example/create_customers.php</i>.
</p>
<p>
Once you have your class created you must set your project to use it.
<ul>
    <li>Login to eventum with your administrative account.</li>
    <li>Go to &quot;Administration&quot; and click the the name of the project you want to
        use the customer class.</li>
    <li>Select &quot;my_name&quot; from the dropdown list next to &quot;Customer Integration Backend&quot;</li>
    <li>Click &quot;Update Project&quot;</li>
</ul>
Your project should now be using your customer class.
</p>
<h2>Individual methods</h2>
<p>
Please see <i>/eventum/include/customer/class.abstract_customer_backend.php</i> for the
individual methods you can override.
</p>
<h2>Database Structure</h2>
<p>While most customer information is stored outside Eventum, certain key information is kept in the Eventum database.
Tables are listed without a prefix.
<ul>
    <li>user</li>
    <ul>
        <li>usr_customer_id - The ID of the customer (company) in your customer database</li>
        <li>usr_customer_contract_id - The ID of the contact (person) in your customer database. Multiple contacts
                can belong to the same company.</li>
    </ul>
    <li>issue</li>
    <ul>
        <li>iss_customer_id - The ID of the customer that this issue is for</li>
        <li>iss_customer_contract_id - The ID of the contact who this issue is for.</li>
    </ul>
    <li>customer_account_manager - This table is used to store who the account manager for a customer is.</li>
    <li>customer_note - This table stores customer specific notes.</li>
</ul>
</p>
<h2>Per-Incident Support</h2>
<p>Per-Incident support allows for control of how many issues a customer opens. When a customer opens an issue,
it is not counted as an incident because it could be a duplicate, a mistake or not meet whatever requirement you set
for an issue to count. Once you decide to count an issue, you can &quot;redeem&quot; the incident by clicking the
&quot;Mark as Redeemed Incident&quot; button. When this happens, the method <i>Customer::flagIncident()</i> is called.
</p>
<p>
Per-Incident support is not included in the example API.
<h2>File Structure</h2>
<p>Any templates that are customer related should be located in <i>/eventum/templates/en/customer/<b>my_name</b>/</i>. Any
customer files that are not templates should be located in <i>/eventum/customer/<b>my_name</b>/</i>. The following is a list
of files you need to implement to create a customer backend.
<ul>
    <li>Templates</li>
    <ul>
        <li>customer_report.tpl.html - Displays customer information to customer on main page when they login.</li>
        <li>report_form_fields.tpl.html - Display on the create issue form to customers.</li>
        <li>customer_info.tpl.html - Displays customer information on the issue page.</li>
    </ul>
</ul>
<h2>Future Direction</h2>
<p>
As Eventum is developed more methods will be added to the customer class and some methods will be changed. We will try to
minimize any changes. If you have any feedback on this API please email the 
<a href="mailto:eventum-hide@address.com">Eventum development list</a>.
</p>
</body>
</html>
Return current item: Eventum