[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/include/workflow/ -> class.abstract_workflow_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 workflow backends should extend. This is so any new
  31   * workflow methods added in future releases will not break current backends.
  32   *
  33   * @author  Bryan Alsdorf <bryan@mysql.com>
  34   */
  35  class Abstract_Workflow_Backend
  36  {
  37      /**
  38       * Called when an issue is updated.
  39       *
  40       * @param integer $prj_id The project ID.
  41       * @param integer $issue_id The ID of the issue.
  42       * @param integer $usr_id The ID of the user.
  43       * @param array $old_details The old details of the issues.
  44       * @param array $changes The changes that were applied to this issue (the $_POST)
  45       */
  46      function handleIssueUpdated($prj_id, $issue_id, $usr_id, $old_details, $changes)
  47      {
  48      }
  49  
  50  
  51      /**
  52       * Called when an issue is assigned.
  53       *
  54       * @param   integer $prj_id The projectID
  55       * @param   integer $issue_id The ID of the issue.
  56       * @param   integer $usr_id The id of the user who assigned the issue.
  57       */
  58      function handleAssignment($prj_id, $issue_id, $usr_id)
  59      {
  60      }
  61  
  62  
  63      /**
  64       * Called when a file is attached to an issue.
  65       *
  66       * @param   integer $prj_id The projectID
  67       * @param   integer $issue_id The ID of the issue.
  68       * @param   integer $usr_id The id of the user who locked the issue.
  69       */
  70      function handleAttachment($prj_id, $issue_id, $usr_id)
  71      {
  72      }
  73  
  74  
  75      /**
  76       * Called when the priority of an issue changes.
  77       *
  78       * @param   integer $prj_id The projectID
  79       * @param   integer $issue_id The ID of the issue.
  80       * @param   integer $usr_id The id of the user who locked the issue.
  81       * @param   array $old_details The old details of the issue.
  82       * @param   array $changes The changes that were applied to this issue (the $_POST)
  83       */
  84      function handlePriorityChange($prj_id, $issue_id, $usr_id, $old_details, $changes)
  85      {
  86      }
  87  
  88  
  89      /**
  90       * Called when an email is blocked.
  91       *
  92       * @param   integer $prj_id The projectID
  93       * @param   integer $issue_id The ID of the issue.
  94       * @param   array $email_details Details of the issue
  95       * @param   string $type What type of blocked email this is.
  96       */
  97      function handleBlockedEmail($prj_id, $issue_id, $email_details, $type)
  98      {
  99      }
 100  
 101  
 102      /**
 103       * Called when a note is routed.
 104       *
 105       * @param   integer $prj_id The projectID
 106       * @param   integer $issue_id The ID of the issue.
 107       * @param   integer $usr_id The user ID of the person posting this new note
 108       * @param   boolean $closing If the issue is being closed
 109       * @param   integer $note_id The ID of the new note
 110       */
 111      function handleNewNote($prj_id, $issue_id, $usr_id, $closing, $note_id)
 112      {
 113      }
 114  
 115  
 116      /**
 117       * Called when the assignment on an issue changes.
 118       *
 119       * @param   integer $prj_id The projectID
 120       * @param   integer $issue_id The ID of the issue.
 121       * @param   integer $usr_id The id of the user who locked the issue.
 122       * @param   array $issue_details The old details of the issue.
 123       * @param   array $new_assignees The new assignees of this issue.
 124       * @param   boolean $remote_assignment If this issue was remotely assigned.
 125       */
 126      function handleAssignmentChange($prj_id, $issue_id, $usr_id, $issue_details, $new_assignees, $remote_assignment)
 127      {
 128      }
 129  
 130  
 131      /**
 132       * Called when a new issue is created.
 133       *
 134       * @param   integer $prj_id The projectID
 135       * @param   integer $issue_id The ID of the issue.
 136       * @param   boolean $has_TAM If this issue has a technical account manager.
 137       * @param   boolean $has_RR If Round Robin was used to assign this issue.
 138       */
 139      function handleNewIssue($prj_id, $issue_id, $has_TAM, $has_RR)
 140      {
 141      }
 142  
 143  
 144  
 145      /**
 146       * Called when an email is associated with an issue.
 147       *
 148       * @access  public
 149       * @param   integer $prj_id The projectID
 150       * @param   integer $issue_id The issue ID
 151       */
 152      function handleManualEmailAssociation($prj_id, $issue_id)
 153      {
 154      }
 155  
 156  
 157      /**
 158       * Called when a new message is recieved.
 159       *
 160       * @param   integer $prj_id The projectID
 161       * @param   integer $issue_id The ID of the issue.
 162       * @param   object $message An object containing the new email
 163       * @param   array $row The array of data that was inserted into the database.
 164       * @param   boolean $closing If we are closing the issue.
 165       */
 166      function handleNewEmail($prj_id, $issue_id, $message, $row = false, $closing = false)
 167      {
 168      }
 169  
 170  
 171      /**
 172       * Method is called to return the list of statuses valid for a specific issue.
 173       *
 174       * @param   integer $prj_id The projectID
 175       * @param   integer $issue_id The ID of the issue.
 176       * @return  array An associative array of statuses valid for this issue.
 177       */
 178      function getAllowedStatuses($prj_id, $issue_id)
 179      {
 180          return Status::getAssocStatusList($prj_id, false);
 181      }
 182  
 183  
 184      /**
 185       * Called when issue is closed.
 186       *
 187       * @param   integer $prj_id The project ID
 188       * @param   integer $issue_id The ID of the issue.
 189       * @param   boolean $send_notification Whether to send a notification about this action or not
 190       * @param   integer $resolution_id The resolution ID
 191       * @param   integer $status_id The status ID
 192       * @param   string $reason The reason for closing this issue
 193       * @return  void
 194       */
 195      function handleIssueClosed($prj_id, $issue_id, $send_notification, $resolution_id, $status_id, $reason)
 196      {
 197      }
 198  
 199  
 200      /**
 201       * Called when custom fields are updated
 202       *
 203       * @param   integer $prj_id The project ID
 204       * @param   integer $issue_id The ID of the issue
 205       * @param   array $old The custom fields before the update.
 206       * @param   array $new The custom fields after the update.
 207       */
 208      function handleCustomFieldsUpdated($prj_id, $issue_id, $old, $new)
 209      {
 210      }
 211  
 212  
 213      /**
 214       * Called when an attempt is made to add a user or email address to the
 215       * notification list.
 216       *
 217       * @param   integer $prj_id The project ID
 218       * @param   integer $issue_id The ID of the issue.
 219       * @param   integer $subscriber_usr_id The ID of the user to subscribe if this is a real user (false otherwise).
 220       * @param   string $email The email address to subscribe to subscribe (if this is not a real user).
 221       * @param   array $types The action types.
 222       * @return  mixed An array of information or true to continue unchanged or false to prevent the user from being added.
 223       */
 224      function handleSubscription($prj_id, $issue_id, &$subscriber_usr_id, &$email, &$actions)
 225      {
 226          return true;
 227      }
 228  
 229  
 230      /**
 231       * Called when SCM checkin is associated.
 232       *
 233       * @param   integer $prj_id The project ID.
 234       * @param   integer $issue_id The ID of the issue.
 235       * @param   string $module The SCM module commit was made.
 236       * @param   array $files File list with their version numbers changes made on.
 237       * @param   string $username SCM user doing the checkin.
 238       * @param   string $commit_msg Message associated with the SCM commit.
 239       * @return  void
 240       */
 241      function handleSCMCheckins($prj_id, $issue_id, $module, $files, $username, $commit_msg)
 242      {
 243      }
 244  
 245  
 246      /**
 247       * Determines if the address should should be emailed.
 248       *
 249       * @param   integer $prj_id The project ID
 250       * @param   string $address The email address to check
 251       * @return  boolean
 252       */
 253      function shouldEmailAddress($prj_id, $address)
 254      {
 255          return true;
 256      }
 257  
 258  
 259      /**
 260       * Returns additional email addresses that should be notified for a specific event..
 261       *
 262       * @param    integer $prj_id The project ID.
 263       * @param    integer $issue_id The ID of the issue.
 264       * @param    string  $event The event to return additional email addresses for. Currently only "new_issue" is supported.
 265       * @return   array   An array of email addresses to be notified.
 266       */
 267      function getAdditionalEmailAddresses($prj_id, $issue_id, $event)
 268      {
 269          return array();
 270      }
 271  
 272  
 273      /**
 274       * Indicates if the the specified email address can email the issue. Can be
 275       * used to disable email blocking by always returning true.
 276       *
 277       * @param   integer $prj_id The project ID.
 278       * @param   integer $issue_id The ID of the issue
 279       * @param   string The email address that is trying to send an email
 280       * @return  boolean true if the sender can email the issue, false if the sender
 281       *          should not email the issue and null if the default rules should be used.
 282       */
 283      function canEmailIssue($prj_id, $issue_id, $email)
 284      {
 285          return null;
 286      }
 287  
 288  
 289      /**
 290       * Handles when an authorized replier is added
 291       *
 292       * @param   integer $prj_id The project ID
 293       * @param   integer $issue_id The ID of the issue
 294       * @param   string  $email The email address added
 295       * @return  boolean
 296       */
 297      function handleAuthorizedReplierAdded($prj_id, $issue_id, $email)
 298      {
 299      }
 300  
 301  
 302      /**
 303       * Called at the begining of the email download process. If it returns true, the
 304       * rest of the email code will not be executed.
 305       *
 306       * @param   integer $prj_id The project ID
 307       * @param   array $info An array containing the information on the email account.
 308       * @param   resource $mbox The imap connection resource
 309       * @param   integer $num The sequential email number
 310       * @param   string $message The complete email message
 311       * @param   object $email An object containing the decoded email
 312       * @return  mixed null by default, -1 if the rest of the email script should not be processed.
 313       */
 314      function preEmailDownload($prj_id, $info, $mbox, $num, &$message, &$email)
 315      {
 316          return null;
 317      }
 318  
 319  
 320      /**
 321       * Indicates if the email addresses should automatically be added to the NL from notes and emails.
 322       *
 323       * @param   integer $prj_id The project ID.
 324       * @return  boolean
 325       */
 326      function shouldAutoAddToNotificationList($prj_id)
 327      {
 328          return true;
 329      }
 330  }


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