[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/include/customer/ -> class.abstract_customer_backend.php (source)

   1  <?php
   2  /* vim: set expandtab tabstop=4 shiftwidth=4 encoding=utf-8: */
   3  // +----------------------------------------------------------------------+
   4  // | Eventum - Issue Tracking System                                      |
   5  // +----------------------------------------------------------------------+
   6  // | Copyright (c) 2003, 2004, 2005, 2006, 2007 MySQL AB                  |
   7  // |                                                                      |
   8  // | This program is free software; you can redistribute it and/or modify |
   9  // | it under the terms of the GNU General Public License as published by |
  10  // | the Free Software Foundation; either version 2 of the License, or    |
  11  // | (at your option) any later version.                                  |
  12  // |                                                                      |
  13  // | This program is distributed in the hope that it will be useful,      |
  14  // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
  15  // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
  16  // | GNU General Public License for more details.                         |
  17  // |                                                                      |
  18  // | You should have received a copy of the GNU General Public License    |
  19  // | along with this program; if not, write to:                           |
  20  // |                                                                      |
  21  // | Free Software Foundation, Inc.                                       |
  22  // | 59 Temple Place - Suite 330                                          |
  23  // | Boston, MA 02111-1307, USA.                                          |
  24  // +----------------------------------------------------------------------+
  25  // | Authors: Bryan Alsdorf <bryan@mysql.com>                             |
  26  // +----------------------------------------------------------------------+
  27  //
  28  
  29  /**
  30   * Abstract class that all customer backends should extend. This is so any new
  31   * customer methods added in future releases won't break existing backends.
  32   *
  33   * @author Bryan Alsdorf <bryan@mysql.com>
  34   */
  35  class Abstract_Customer_Backend
  36  {
  37  
  38      /**
  39       * Return what business hours a customer falls into. Mainly used for international
  40       * customers.
  41       *
  42       * @access  public
  43       * @param   integer $customer_id The customer ID
  44       * @return  string The business hours
  45       */
  46      function getBusinessHours($customer_id)
  47      {
  48      }
  49  
  50  
  51      /**
  52       * Returns a message to be displayed to a customer on the top of the issue creation page.
  53       *
  54       * @param   array $customer_id Customer ID.
  55       */
  56      function getNewIssueMessage($customer_id)
  57      {
  58      }
  59  
  60  
  61      /**
  62       * Checks whether the given customer has a support contract that
  63       * enforces limits for the minimum first response time or not.
  64       *
  65       * @access  public
  66       * @param   integer $customer_id The customer ID
  67       * @param   integer $contract_id The contract ID
  68       * @return  boolean
  69       */
  70      function hasMinimumResponseTime($customer_id, $contract_id = false)
  71      {
  72      }
  73  
  74  
  75      /**
  76       * Returns the minimum first response time in seconds for the
  77       * support level associated with the given customer.
  78       *
  79       * @access  public
  80       * @param   integer $customer_id The customer ID
  81       * @param   integer $contract_id The contract ID
  82       * @return  integer The minimum first response time
  83       */
  84      function getMinimumResponseTime($customer_id, $contract_id = false)
  85      {
  86      }
  87  
  88  
  89      /**
  90       * Returns the maximum first response time associated with the
  91       * support contract of the given customer.
  92       *
  93       * @access  public
  94       * @param   integer $customer_id The customer ID
  95       * @param   integer $contract_id The contract ID
  96       * @return  integer The maximum first response time, in seconds
  97       */
  98      function getMaximumFirstResponseTime($customer_id, $contract_id = false)
  99      {
 100      }
 101  
 102  
 103      /**
 104       * Returns an array of incident types
 105       *
 106       * @return  array An array of incident types.
 107       */
 108      function getIncidentTypes()
 109      {
 110          return array();
 111      }
 112  
 113  
 114      /**
 115       * Returns true if the backend uses support levels, false otherwise
 116       *
 117       * @access  public
 118       * @return  boolean True if the project uses support levels.
 119       */
 120      function usesSupportLevels()
 121      {
 122          return false;
 123      }
 124  }
 125  
 126  Class blah
 127  {
 128      /**
 129       * Connect to the customer database
 130       *
 131       * @access  public
 132       */
 133      function connect()
 134      {
 135      }
 136  
 137  
 138      /**
 139       * Returns the contract status associated with the given customer ID.
 140       * Possible return values are 'active', 'in_grace_period' and 'expired'.
 141       *
 142       * @access  public
 143       * @param   integer $customer_id The customer ID
 144       * @param   integer $contract_id The contract ID
 145       * @return  string The contract status
 146       */
 147      function getContractStatus($customer_id, $contract_id = false)
 148      {
 149      }
 150  
 151  
 152      /**
 153       * Retrieves the customer titles associated with the given list of issues.
 154       *
 155       * @access  public
 156       * @param   array $result The list of issues
 157       * @see     Issue::getListing()
 158       */
 159      function getCustomerTitlesByIssues(&$result)
 160      {
 161      }
 162  
 163  
 164      /**
 165       * Method used to get the details of the given customer.
 166       *
 167       * @access  public
 168       * @param   integer $customer_id The customer ID
 169       * @return  array The customer details
 170       */
 171      function getDetails($customer_id)
 172      {
 173      }
 174  
 175  
 176      /**
 177       * Returns true if this issue has been counted a valid incident
 178       *
 179       * @see /docs/Customer_API.html
 180       * @access  public
 181       * @param   integer $issue_id The ID of the issue
 182       * @return  boolean True if this is a redeemed incident.
 183       */
 184      function isRedeemedIncident($issue_id)
 185      {
 186      }
 187  
 188  
 189      /**
 190       * Marks an issue as a redeemed incident.
 191       *
 192       * @see /docs/Customer_API.html
 193       * @access  public
 194       * @param   integer $issue_id The ID of the issue
 195       */
 196      function flagIncident($issue_id)
 197      {
 198      }
 199  
 200  
 201      /**
 202       * Marks an issue as not a redeemed incident.
 203       *
 204       * @see /docs/Customer_API.html
 205       * @access  public
 206       * @param   integer $issue_id The ID of the issue
 207       */
 208      function unflagIncident($issue_id)
 209      {
 210      }
 211  
 212  
 213      /**
 214       * Checks whether the active per-incident contract associated with the given
 215       * customer ID has any incidents available to be redeemed.
 216       *
 217       * @access  public
 218       * @param   integer $customer_id The customer ID
 219       * @return  boolean
 220       */
 221      function hasIncidentsLeft($customer_id)
 222      {
 223      }
 224  
 225  
 226      /**
 227       * Checks whether the active contract associated with the given customer ID
 228       * is a per-incident contract or not.
 229       *
 230       * @access  public
 231       * @param   integer $customer_id The customer ID
 232       * @return  boolean
 233       */
 234      function hasPerIncidentContract($customer_id)
 235      {
 236          return false;
 237      }
 238  
 239  
 240      /**
 241       * Returns the total number of allowed incidents for the given support
 242       * contract ID.
 243       *
 244       * @access  public
 245       * @param   integer $prj_id The project ID
 246       * @param   integer $support_no The support contract ID
 247       * @return  integer The total number of incidents
 248       */
 249      function getTotalIncidents($support_no)
 250      {
 251      }
 252  
 253  
 254      /**
 255       * Returns the number of incidents remaining for the given support
 256       * contract ID.
 257       *
 258       * @access  public
 259       * @param   integer $support_no The support contract ID
 260       * @return  integer The number of incidents remaining.
 261       */
 262      function getIncidentsRemaining($support_no)
 263      {
 264      }
 265  
 266  
 267      /**
 268       * Method used to send a notice that the per-incident limit being reached.
 269       *
 270       * @access  public
 271       * @param   integer $contact_id The customer contact ID
 272       * @param   integer $customer_id The customer ID
 273       * @param   boolean $new_issue If the customer just tried to create a new issue.
 274       * @return  void
 275       */
 276      function sendIncidentLimitNotice($contact_id, $customer_id, $new_issue = false)
 277      {
 278      }
 279  
 280  
 281      /**
 282       * Returns a list of customers (companies) in the customer database.
 283       *
 284       * @access  public
 285       * @return  array An associated array of customers.
 286       */
 287      function getAssocList()
 288      {
 289      }
 290  
 291  
 292      /**
 293       * Method used to get the customer names for the given customer id.
 294       *
 295       * @access  public
 296       * @param   integer $customer_id The customer ID
 297       * @return  string The customer name
 298       */
 299      function getTitle($customer_id)
 300      {
 301      }
 302  
 303  
 304      /**
 305       * Method used to get an associative array of the customer names
 306       * for the given list of customer ids.
 307       *
 308       * @access  public
 309       * @param   array $customer_ids The list of customers
 310       * @return  array The associative array of customer id => customer name
 311       */
 312      function getTitles($prj_id, $customer_ids)
 313      {
 314      }
 315  
 316  
 317      /**
 318       * Method used to get the list of email addresses associated with the
 319       * contacts of a given customer.
 320       *
 321       * @access  public
 322       * @param   integer $customer_id The customer ID
 323       * @return  array The list of email addresses
 324       */
 325      function getContactEmailAssocList($customer_id)
 326      {
 327      }
 328  
 329  
 330      /**
 331       * Method used to get the customer and customer contact IDs associated
 332       * with a given list of email addresses.
 333       *
 334       * @access  public
 335       * @param   array $emails The list of email addresses
 336       * @return  array The customer and customer contact ID
 337       */
 338      function getCustomerIDByEmails($emails)
 339      {
 340      }
 341  
 342  
 343      /**
 344       * Method used to get the overall statistics of issues in the system for a
 345       * given customer.
 346       *
 347       * @access  public
 348       * @param   integer $customer_id The customer ID
 349       * @return  array The customer related issue statistics
 350       */
 351      function getOverallStats($customer_id)
 352      {
 353      }
 354  
 355  
 356      /**
 357       * Method used to build the overall customer profile from the information
 358       * stored in the customer database.
 359       *
 360       * @access  public
 361       * @param   integer $usr_id The Eventum user ID
 362       * @return  array The customer profile information
 363       */
 364      function getProfile($usr_id)
 365      {
 366      }
 367  
 368  
 369      /**
 370       * Method used to get the contract details for a given customer contact.
 371       *
 372       * @access  public
 373       * @param   integer $contact_id The customer contact ID
 374       * @return  array The customer contract details
 375       */
 376      function getContractDetails($contact_id, $restrict_expiration = TRUE)
 377      {
 378      }
 379  
 380  
 381      /**
 382       * Method used to get the details associated with a customer contact.
 383       *
 384       * @access  public
 385       * @param   integer $contact_id The customer contact ID
 386       * @return  array The contact details
 387       */
 388      function getContactDetails($contact_id)
 389      {
 390      }
 391  
 392  
 393      /**
 394       * Returns the list of customer IDs that are associated with the given
 395       * email value (wildcards welcome).
 396       *
 397       * @access  public
 398       * @param   string $email The email value
 399       * @return  array The list of customer IDs
 400       */
 401      function getCustomerIDsLikeEmail($email)
 402      {
 403      }
 404  
 405  
 406      /**
 407       * Method used to notify the customer contact that an existing issue
 408       * associated with him was just marked as closed.
 409       *
 410       * @access  public
 411       * @param   integer $issue_id The issue ID
 412       * @param   integer $contact_id The customer contact ID
 413       * @return  void
 414       */
 415      function notifyIssueClosed($issue_id, $contact_id)
 416      {
 417      }
 418  
 419  
 420      /**
 421       * Performs a customer lookup and returns the matches, if
 422       * appropriate.
 423       *
 424       * @access  public
 425       * @param   string $field The field that we are trying to search against
 426       * @param   string $value The value that we are searching for
 427       * @return  array The list of customers
 428       */
 429      function lookup($field, $value)
 430      {
 431      }
 432  
 433  
 434      /**
 435       * Method used to notify the customer contact that a new issue was just
 436       * created and associated with his Eventum user.
 437       *
 438       * @access  public
 439       * @param   integer $issue_id The issue ID
 440       * @param   integer $contact_id The customer contact ID
 441       * @return  void
 442       */
 443      function notifyCustomerIssue($issue_id, $contact_id)
 444      {
 445      }
 446  
 447  
 448      /**
 449       * Method used to get the list of available support levels.
 450       *
 451       * @access  public
 452       * @return  array The list of available support levels
 453       */
 454      function getSupportLevelAssocList()
 455      {
 456      }
 457  
 458  
 459      /**
 460       * Returns the support level of the current support contract for a given
 461       * customer ID.
 462       *
 463       * @access  public
 464       * @param   integer $customer_id The customer ID
 465       * @param   integer $contract_id The contract ID
 466       * @return  string The support contract level
 467       */
 468      function getSupportLevelID($customer_id, $contract_id = false)
 469      {
 470      }
 471  
 472  
 473      /**
 474       * Returns the list of customer IDs for a given support contract level.
 475       *
 476       * @access  public
 477       * @param   integer $support_level_id The support level ID
 478       * @param   mixed $support_options An integer or array of integers indicating various options to get customers with.
 479       * @return  array The list of customer IDs
 480       */
 481      function getListBySupportLevel($support_level_id, $support_options = false)
 482      {
 483      }
 484  
 485  
 486      /**
 487       * Returns an array of support levels grouped together.
 488       *
 489       * @access  public
 490       * @return  array an array of support levels.
 491       */
 492      function getGroupedSupportLevels()
 493      {
 494      }
 495  
 496  
 497      /**
 498       * Method used to send an expiration notice.
 499       *
 500       * @access  public
 501       * @param   integer $contact_id The customer contact ID
 502       * @param   boolean $is_expired Whether this customer is expired or not
 503       * @return  void
 504       */
 505      function sendExpirationNotice($contact_id, $is_expired = FALSE)
 506      {
 507      }
 508  
 509  
 510      /**
 511       * Checks whether the given technical contact ID is allowed in the current
 512       * support contract or not.
 513       *
 514       * @access  public
 515       * @param   integer $customer_contact_id The customer technical contact ID
 516       * @return  boolean
 517       */
 518      function isAllowedSupportContact($customer_contact_id)
 519      {
 520      }
 521  
 522  
 523      /**
 524       * Method used to get the associated customer and customer contact from
 525       * a given set of support emails. This is especially useful to automatically
 526       * associate an issue to the appropriate customer contact that sent a
 527       * support email.
 528       *
 529       * @access  public
 530       * @param   array $sup_ids The list of support email IDs
 531       * @return  array The customer and customer contact ID
 532       */
 533      function getCustomerInfoFromEmails($sup_ids)
 534      {
 535      }
 536  
 537  
 538      /**
 539       * Method used to send an email notification to the sender of a
 540       * set of email messages that were manually converted into an
 541       * issue.
 542       *
 543       * @access  public
 544       * @param   integer $issue_id The issue ID
 545       * @param   array $sup_ids The email IDs
 546       * @param   integer $customer_id The customer ID
 547       * @return  array The list of recipient emails
 548       */
 549      function notifyEmailConvertedIntoIssue($issue_id, $sup_ids, $customer_id = FALSE)
 550      {
 551      }
 552  
 553  
 554      /**
 555       * Method used to send an email notification to the sender of an
 556       * email message that was automatically converted into an issue.
 557       *
 558       * @access  public
 559       * @param   integer $issue_id The issue ID
 560       * @param   string $sender The sender of the email message (and the recipient of this notification)
 561       * @param   string $date The arrival date of the email message
 562       * @param   string $subject The subject line of the email message
 563       * @return  void
 564       */
 565      function notifyAutoCreatedIssue($issue_id, $sender, $date, $subject)
 566      {
 567      }
 568  
 569  
 570      /**
 571       * Method used to get the customer login grace period (number of days).
 572       *
 573       * @access  public
 574       * @return  integer The customer login grace period
 575       */
 576      function getExpirationOffset()
 577      {
 578      }
 579  
 580  
 581      /**
 582       * Method used to get the details of the given customer contact.
 583       *
 584       * @access  public
 585       * @param   integer $contact_id The customer contact ID
 586       * @return  array The customer details
 587       */
 588      function getContactLoginDetails($contact_id)
 589      {
 590      }
 591  
 592  
 593      /**
 594       * Returns the end date of the current support contract for a given
 595       * customer ID.
 596       *
 597       * @access  public
 598       * @param   integer $customer_id The customer ID
 599       * @param   integer $contract_id The contract ID
 600       * @return  string The support contract end date
 601       */
 602      function getContractEndDate($customer_id, $contract_id = false)
 603      {
 604      }
 605  
 606  
 607      /**
 608       * Returns the name and email of the sales account manager of the given customer ID.
 609       *
 610       * @access  public
 611       * @param   integer $customer_id The customer ID
 612       * @return  array An array containing the name and email of the sales account manager
 613       */
 614      function getSalesAccountManager($customer_id)
 615      {
 616      }
 617  
 618  
 619      /**
 620       * Returns the start date of the current support contract for a given
 621       * customer ID.
 622       *
 623       * @access  public
 624       * @param   integer $customer_id The customer ID
 625       * @param   integer $contract_id The contract ID
 626       * @return  string The support contract start date
 627       */
 628      function getContractStartDate($customer_id, $contract_id = false)
 629      {
 630      }
 631  }


Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7