当前位置: 首页>>代码示例>>PHP>>正文


PHP Issue::getCustomerID方法代码示例

本文整理汇总了PHP中Issue::getCustomerID方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::getCustomerID方法的具体用法?PHP Issue::getCustomerID怎么用?PHP Issue::getCustomerID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Issue的用法示例。


在下文中一共展示了Issue::getCustomerID方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processResult

 private function processResult(&$data, $date_field, $issue_field)
 {
     $timezone = Date_Helper::getPreferredTimezone($this->usr_id);
     foreach ($data as &$res) {
         if (!Issue::canAccess($res[$issue_field], $this->usr_id)) {
             continue;
         }
         $res['customer'] = null;
         if ($this->crm) {
             try {
                 $customer = $this->crm->getCustomer(Issue::getCustomerID($res[$issue_field]));
                 $res['customer'] = $customer->getName();
             } catch (CRMException $e) {
             }
         }
         $res['date'] = Date_Helper::getFormattedDate($res[$date_field], $timezone);
         // need to decode From:, To: mail headers
         if (isset($res['sup_from'])) {
             $res['sup_from'] = Mime_Helper::fixEncoding($res['sup_from']);
         }
         if (isset($res['sup_to'])) {
             $res['sup_to'] = Mime_Helper::fixEncoding($res['sup_to']);
         }
     }
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:25,代码来源:RecentActivity.php

示例2: count

        $tpl->assign("associate_result", $res);
    }
    @$tpl->assign('total_emails', count($HTTP_POST_VARS['item']));
} else {
    @$tpl->assign('emails', $HTTP_GET_VARS['item']);
    @$tpl->assign('total_emails', count($HTTP_GET_VARS['item']));
    $prj_id = Issue::getProjectID($HTTP_GET_VARS['issue']);
    if (Customer::hasCustomerIntegration($prj_id)) {
        // check if the selected emails all have sender email addresses that are associated with the issue' customer
        $senders = Support::getSender($HTTP_GET_VARS['item']);
        $sender_emails = array();
        for ($i = 0; $i < count($senders); $i++) {
            $email = Mail_API::getEmailAddress($senders[$i]);
            $sender_emails[$email] = $senders[$i];
        }
        $customer_id = Issue::getCustomerID($HTTP_GET_VARS['issue']);
        if (!empty($customer_id)) {
            $contact_emails = array_keys(Customer::getContactEmailAssocList($prj_id, $customer_id));
            $unknown_contacts = array();
            foreach ($sender_emails as $email => $address) {
                if (!@in_array($email, $contact_emails)) {
                    $usr_id = User::getUserIDByEmail($email);
                    if (empty($usr_id)) {
                        $unknown_contacts[] = $address;
                    } else {
                        // if we got a real user ID, check if the customer user is the correct one
                        // (i.e. a contact from the customer associated with the selected issue)
                        if (User::getRoleByUser($usr_id, $prj_id) == User::getRoleID('Customer')) {
                            // also check if the associated customer ID, if any, matches the one in the issue
                            $user_customer_id = User::getCustomerID($usr_id);
                            if ($user_customer_id != $customer_id) {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:associate.php

示例3: getAddressBookAssocList

 /**
  * Method used to get an associative array of names and emails 
  * that are associated with a given project and issue.
  *
  * @access  public
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @return  array List of names and emails
  */
 function getAddressBookAssocList($prj_id, $issue_id = FALSE)
 {
     if ($issue_id) {
         $customer_id = Issue::getCustomerID($issue_id);
     }
     $stmt = "SELECT\n                    usr_full_name,\n                    usr_email\n                 FROM\n                    " . ETEL_USER_TABLE . ",\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_user\n                 WHERE\n                    pru_prj_id=" . Misc::escapeInteger($prj_id) . " AND\n                    pru_usr_id=usr_id AND\n                    usr_status='active' AND\n                    usr_id <> " . APP_SYSTEM_USER_ID;
     if (!empty($customer_id)) {
         $stmt .= " AND (usr_customer_id IS NULL OR usr_customer_id IN (0, " . Misc::escapeInteger($customer_id) . ")) ";
     } else {
         $stmt .= " AND (usr_customer_id IS NULL OR usr_customer_id=0) ";
     }
     $stmt .= "\n                 ORDER BY\n                    usr_customer_id DESC,\n                    usr_full_name ASC";
     $res = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return "";
     } else {
         return $res;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:29,代码来源:class.project.php

示例4: getIncidentTypes

function getIncidentTypes($p)
{
    $email = XML_RPC_decode($p->getParam(0));
    $password = XML_RPC_decode($p->getParam(1));
    $auth = authenticate($email, $password);
    if (is_object($auth)) {
        return $auth;
    }
    $issue_id = XML_RPC_decode($p->getParam(2));
    $redeemed_only = XML_RPC_decode($p->getParam(3));
    $prj_id = Issue::getProjectID($issue_id);
    createFakeCookie($email, $prj_id);
    $customer_id = Issue::getCustomerID($issue_id);
    if (!Customer::hasCustomerIntegration($prj_id)) {
        // no customer integration
        return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "No customer integration for issue #{$issue_id}");
    } elseif (!Customer::hasPerIncidentContract($prj_id, $customer_id)) {
        // check if is per incident contract
        return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "Customer for issue #{$issue_id} does not have a per-incident contract");
    }
    $details = Customer::getDetails($prj_id, $customer_id);
    foreach ($details['incident_details'] as $type_id => $type_details) {
        $is_redeemed = Customer::isRedeemedIncident($prj_id, $issue_id, $type_id);
        if ($redeemed_only && !$is_redeemed || !$redeemed_only && $is_redeemed) {
            unset($details['incident_details'][$type_id]);
        }
    }
    return new XML_RPC_Response(XML_RPC_Encode($details['incident_details']));
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:29,代码来源:xmlrpc.php

示例5: getIncidentTypes

 /**
  * @param int $issue_id
  * @param bool $redeemed_only
  * @return array
  * @access protected
  */
 public function getIncidentTypes($issue_id, $redeemed_only)
 {
     $prj_id = Issue::getProjectID($issue_id);
     AuthCookie::setProjectCookie($prj_id);
     // FIXME: $customer_id unused
     $customer_id = Issue::getCustomerID($issue_id);
     if (!CRM::hasCustomerIntegration($prj_id)) {
         // no customer integration
         throw new RemoteApiException("No customer integration for issue #{$issue_id}");
     }
     $crm = CRM::getInstance($prj_id);
     // FIXME: $all_types unused
     $all_types = $crm->getIncidentTypes();
     $contract = $crm->getContract(Issue::getContractID($issue_id));
     if (!$contract->hasPerIncident()) {
         // check if is per incident contract
         throw new RemoteApiException("Customer for issue #{$issue_id} does not have a per-incident contract");
     }
     $incidents = $contract->getIncidents();
     foreach ($incidents as $type_id => $type_details) {
         $is_redeemed = $contract->isRedeemedIncident($issue_id, $type_id);
         if ($redeemed_only && !$is_redeemed || !$redeemed_only && $is_redeemed) {
             unset($incidents[$type_id]);
         }
     }
     return $incidents;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:33,代码来源:RemoteApi.php

示例6: isAllowedToEmail

 /**
  * Checks whether the given email address is allowed to send emails in the
  * issue ID.
  *
  * @access  public
  * @param   integer $issue_id The issue ID
  * @param   string $sender_email The email address
  * @return  boolean
  */
 function isAllowedToEmail($issue_id, $sender_email)
 {
     $prj_id = Issue::getProjectID($issue_id);
     // check the workflow
     $workflow_can_email = Workflow::canEmailIssue($prj_id, $issue_id, $sender_email);
     if ($workflow_can_email != null) {
         return $workflow_can_email;
     }
     $is_allowed = true;
     $sender_usr_id = User::getUserIDByEmail($sender_email);
     if (empty($sender_usr_id)) {
         if (Customer::hasCustomerIntegration($prj_id)) {
             // check for a customer contact with several email addresses
             $customer_id = Issue::getCustomerID($issue_id);
             $contact_emails = array_keys(Customer::getContactEmailAssocList($prj_id, $customer_id, Issue::getContractID($issue_id)));
             $contact_emails = array_map('strtolower', $contact_emails);
             if (!in_array(strtolower($sender_email), $contact_emails) && !Authorized_Replier::isAuthorizedReplier($issue_id, $sender_email)) {
                 $is_allowed = false;
             }
         } else {
             if (!Authorized_Replier::isAuthorizedReplier($issue_id, $sender_email)) {
                 $is_allowed = false;
             }
         }
     } else {
         // check if this user is not a customer and
         // also not in the assignment list for the current issue and
         // also not in the authorized repliers list
         // also not the reporter
         $details = Issue::getDetails($issue_id);
         if (!Issue::canAccess($issue_id, $sender_usr_id)) {
             $is_allowed = false;
         }
         if ($sender_usr_id != $details['iss_usr_id'] && !Authorized_Replier::isUserAuthorizedReplier($issue_id, $sender_usr_id) && !Issue::isAssignedToUser($issue_id, $sender_usr_id) && User::getRoleByUser($sender_usr_id, Issue::getProjectID($issue_id)) != User::getRoleID('Customer')) {
             $is_allowed = false;
         } elseif (User::getRoleByUser($sender_usr_id, Issue::getProjectID($issue_id)) == User::getRoleID('Customer') && User::getCustomerID($sender_usr_id) != Issue::getCustomerID($issue_id)) {
             $is_allowed = false;
         }
     }
     return $is_allowed;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:50,代码来源:class.support.php

示例7: getAddressBookAssocList

 /**
  * Method used to get an associative array of names and emails
  * that are associated with a given project and issue.
  *
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @return  array List of names and emails
  */
 public static function getAddressBookAssocList($prj_id, $issue_id = false)
 {
     if ($issue_id) {
         $customer_id = Issue::getCustomerID($issue_id);
     }
     $stmt = "SELECT\n                    usr_full_name,\n                    usr_email\n                 FROM\n                    {{%user}},\n                    {{%project_user}}\n                 WHERE\n                    pru_prj_id=? AND\n                    pru_usr_id=usr_id AND\n                    usr_status='active' AND\n                    usr_id <> ?";
     $params = array($prj_id, APP_SYSTEM_USER_ID);
     if (!empty($customer_id)) {
         $stmt .= ' AND (usr_customer_id IS NULL OR usr_customer_id IN (0, ?)) ';
         $params[] = $customer_id;
     } else {
         $stmt .= ' AND (usr_customer_id IS NULL OR usr_customer_id=0) ';
     }
     $stmt .= '
              ORDER BY
                 usr_customer_id DESC,
                 usr_full_name ASC';
     try {
         $res = DB_Helper::getInstance()->fetchAssoc($stmt, $params);
     } catch (DbException $e) {
         return '';
     }
     return $res;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:32,代码来源:class.project.php

示例8: updateRedeemedIncidents

 /**
  * Updates the incident counts
  * 
  * @access  public
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @param   array $data An array of data containing which incident types to update.
  * @return  integer 1 if all updates were successful, -1 or -2 otherwise.
  */
 function updateRedeemedIncidents($prj_id, $issue_id, $data)
 {
     $details = Customer::getDetails($prj_id, Issue::getCustomerID($issue_id));
     foreach ($details['incident_details'] as $type_id => $type_details) {
         $is_redeemed = Customer::isRedeemedIncident($prj_id, $issue_id, $type_id);
         if ($is_redeemed && @$data[$type_id] != 1) {
             // un-redeem issue
             $res = Customer::unflagIncident($prj_id, $issue_id, $type_id);
         } elseif (!$is_redeemed && @$data[$type_id] == 1) {
             // redeem issue
             if ($type_details['total'] - $type_details['redeemed'] > 0) {
                 $res = Customer::flagIncident($prj_id, $issue_id, $type_id);
             } else {
                 $res = -1;
             }
         } else {
             $res = 1;
         }
         if ($res != 1) {
             return $res;
         }
     }
     return $res;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:33,代码来源:class.customer.php

示例9: processResult

function processResult($res, $date_field, $issue_field)
{
    global $prj_id;
    global $usr_id;
    $data = array();
    for ($i = 0; $i < count($res); $i++) {
        if (!Issue::canAccess($res[$i][$issue_field], $usr_id)) {
            continue;
        }
        if (Customer::hasCustomerIntegration($prj_id)) {
            $details = Customer::getDetails($prj_id, Issue::getCustomerID($res[$i][$issue_field]));
            $res[$i]["customer"] = @$details['customer_name'];
        }
        $res[$i]["date"] = Date_API::getFormattedDate($res[$i][$date_field], Date_API::getPreferredTimezone($usr_id));
        // need to decode From:, To: mail headers
        if (isset($res[$i]["sup_from"])) {
            $res[$i]["sup_from"] = Mime_Helper::fixEncoding($res[$i]["sup_from"]);
        }
        if (isset($res[$i]["sup_to"])) {
            $res[$i]["sup_to"] = Mime_Helper::fixEncoding($res[$i]["sup_to"]);
        }
        $data[] = $res[$i];
    }
    return $data;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:25,代码来源:recent_activity.php

示例10: Template_API

// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 59 Temple Place - Suite 330                                          |
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Bryan Alsdorf <bryan@mysql.com>                             |
// +----------------------------------------------------------------------+
//
// This page handles marking an issue as 'redeeming' an incident.
include_once "config.inc.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.customer.php";
include_once APP_INC_PATH . "db_access.php";
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$prj_id = Auth::getCurrentProject();
$issue_id = $_REQUEST['iss_id'];
$tpl = new Template_API();
$tpl->setTemplate('redeem_incident.tpl.html');
if (!empty($_REQUEST['submit'])) {
    // update counts
    $res = Customer::updateRedeemedIncidents($prj_id, $issue_id, @$_REQUEST['redeem']);
    $tpl->assign('res', $res);
}
$details = Customer::getDetails($prj_id, Issue::getCustomerID($issue_id), true);
$tpl->assign(array('issue_id' => $issue_id, 'redeemed' => Customer::getRedeemedIncidentDetails($prj_id, $issue_id), 'incident_details' => $details['incident_details']));
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:redeem_incident.php

示例11: getSpecializedHeaders

 /**
  * Generates the specialized headers for an email.
  *
  * @access  public
  * @param   integer $issue_id The issue ID
  * @param   string $type The type of message this is
  * @param   string $headers The existing headers of this message.
  * @param   integer $sender_usr_id The id of the user sending this email.
  * @return  array An array of specialized headers
  */
 function getSpecializedHeaders($issue_id, $type, $headers, $sender_usr_id)
 {
     $new_headers = array();
     if (!empty($issue_id)) {
         $prj_id = Issue::getProjectID($issue_id);
         if (count(Group::getAssocList($prj_id)) > 0) {
             // group issue is currently assigned too
             $new_headers['X-Eventum-Group-Issue'] = Group::getName(Issue::getGroupID($issue_id));
             // group of whoever is sending this message.
             if (empty($sender_usr_id)) {
                 $new_headers['X-Eventum-Group-Replier'] = $new_headers['X-Eventum-Group-Issue'];
             } else {
                 $new_headers['X-Eventum-Group-Replier'] = Group::getName(User::getGroupID($sender_usr_id));
             }
             // group of current assignee
             $assignees = Issue::getAssignedUserIDs($issue_id);
             if (empty($assignees[0])) {
                 $new_headers['X-Eventum-Group-Assignee'] = '';
             } else {
                 $new_headers['X-Eventum-Group-Assignee'] = @Group::getName(User::getGroupID($assignees[0]));
             }
         }
         if (Customer::hasCustomerIntegration($prj_id)) {
             if (empty($support_levels)) {
                 $support_levels = Customer::getSupportLevelAssocList($prj_id);
             }
             $customer_id = Issue::getCustomerID($issue_id);
             if (!empty($customer_id)) {
                 $customer_details = Customer::getDetails($prj_id, $customer_id);
                 $new_headers['X-Eventum-Customer'] = $customer_details['customer_name'];
             }
             if (count($support_levels) > 0) {
                 $new_headers['X-Eventum-Level'] = $support_levels[Customer::getSupportLevelID($prj_id, $customer_id)];
             }
         }
         $new_headers['X-Eventum-Category'] = Category::getTitle(Issue::getCategory($issue_id));
         $new_headers['X-Eventum-Project'] = Project::getName($prj_id);
     }
     $new_headers['X-Eventum-Type'] = $type;
     return $new_headers;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:51,代码来源:class.mail.php

示例12: getSpecializedHeaders

 /**
  * Generates the specialized headers for an email.
  *
  * @param   integer $issue_id The issue ID
  * @param   string $type The type of message this is
  * @param   string $headers The existing headers of this message.
  * @param   integer $sender_usr_id The id of the user sending this email.
  * @return  array An array of specialized headers
  */
 public static function getSpecializedHeaders($issue_id, $type, $headers, $sender_usr_id)
 {
     $new_headers = array();
     if (!empty($issue_id)) {
         $prj_id = Issue::getProjectID($issue_id);
         if (count(Group::getAssocList($prj_id)) > 0) {
             // group issue is currently assigned too
             $new_headers['X-Eventum-Group-Issue'] = Group::getName(Issue::getGroupID($issue_id));
             // group of whoever is sending this message.
             if (empty($sender_usr_id)) {
                 $new_headers['X-Eventum-Group-Replier'] = $new_headers['X-Eventum-Group-Issue'];
             } else {
                 $new_headers['X-Eventum-Group-Replier'] = Group::getName(User::getGroupID($sender_usr_id));
             }
             // group of current assignee
             $assignees = Issue::getAssignedUserIDs($issue_id);
             if (empty($assignees[0])) {
                 $new_headers['X-Eventum-Group-Assignee'] = '';
             } else {
                 $new_headers['X-Eventum-Group-Assignee'] = @Group::getName(User::getGroupID($assignees[0]));
             }
         }
         if (CRM::hasCustomerIntegration($prj_id)) {
             $crm = CRM::getInstance($prj_id);
             try {
                 $customer = $crm->getCustomer(Issue::getCustomerID($issue_id));
                 $new_headers['X-Eventum-Customer'] = $customer->getName();
             } catch (CustomerNotFoundException $e) {
             }
             try {
                 $contract = $crm->getContract(Issue::getContractID($issue_id));
                 $support_level = $contract->getSupportLevel();
                 if (is_object($support_level)) {
                     $new_headers['X-Eventum-Level'] = $support_level->getName();
                 }
             } catch (ContractNotFoundException $e) {
             }
         }
         // add assignee header
         $new_headers['X-Eventum-Assignee'] = implode(',', User::getEmail(Issue::getAssignedUserIDs($issue_id)));
         $new_headers['X-Eventum-Category'] = Category::getTitle(Issue::getCategory($issue_id));
         $new_headers['X-Eventum-Project'] = Project::getName($prj_id);
         $new_headers['X-Eventum-Priority'] = Priority::getTitle(Issue::getPriority($issue_id));
         // handle custom fields
         $cf_values = Custom_Field::getValuesByIssue($prj_id, $issue_id);
         $cf_titles = Custom_Field::getFieldsToBeListed($prj_id);
         foreach ($cf_values as $fld_id => $values) {
             // skip empty titles
             // TODO: why they are empty?
             if (!isset($cf_titles[$fld_id])) {
                 continue;
             }
             // skip empty values
             if (empty($values)) {
                 continue;
             }
             $cf_value = implode(', ', (array) $values);
             // value could be empty after multivalued field join
             if (empty($cf_value)) {
                 continue;
             }
             // convert spaces for header fields
             $cf_title = str_replace(' ', '_', $cf_titles[$fld_id]);
             $new_headers['X-Eventum-CustomField-' . $cf_title] = $cf_value;
         }
     }
     $new_headers['X-Eventum-Type'] = $type;
     return $new_headers;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:78,代码来源:class.mail_helper.php

示例13: Template_API

include_once APP_INC_PATH . "class.notification.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("close.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$prj_id = Auth::getCurrentProject();
$issue_id = @$HTTP_POST_VARS["issue_id"] ? $HTTP_POST_VARS["issue_id"] : $HTTP_GET_VARS["id"];
$tpl->assign("extra_title", "Close Issue #{$issue_id}");
$notification_list = Notification::getSubscribers($issue_id, 'closed');
$tpl->assign("notification_list_all", $notification_list['all']);
$notification_list_internal = Notification::getSubscribers($issue_id, 'closed', User::getRoleID("standard User"));
$tpl->assign("notification_list_internal", $notification_list_internal['all']);
if (@$HTTP_POST_VARS["cat"] == "close") {
    $res = Issue::close(Auth::getUserID(), $HTTP_POST_VARS["issue_id"], $HTTP_POST_VARS["send_notification"], $HTTP_POST_VARS["resolution"], $HTTP_POST_VARS["status"], $HTTP_POST_VARS["reason"], @$_REQUEST['notification_list']);
    if (!empty($HTTP_POST_VARS['time_spent'])) {
        $HTTP_POST_VARS['summary'] = 'Time entry inserted when closing issue.';
        Time_Tracking::insertEntry();
    }
    if (Customer::hasCustomerIntegration($prj_id) && Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($issue_id))) {
        Customer::updateRedeemedIncidents($prj_id, $issue_id, @$_REQUEST['redeem']);
    }
    $tpl->assign("close_result", $res);
}
$tpl->assign("statuses", Status::getClosedAssocList($prj_id));
$tpl->assign("resolutions", Resolution::getAssocList());
$tpl->assign("time_categories", Time_Tracking::getAssocCategories());
if (Customer::hasCustomerIntegration($prj_id) && Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($issue_id))) {
    $details = Issue::getDetails($issue_id);
    $tpl->assign(array('redeemed' => Customer::getRedeemedIncidentDetails($prj_id, $issue_id), 'incident_details' => $details['customer_info']['incident_details']));
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:close.php

示例14: getListing


//.........这里部分代码省略.........
         $stmt .= "\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user_replier\n                 ON\n                    iur_iss_id=iss_id\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n                 ON\n                    isu_iss_id=iss_id";
     } else {
         if (!empty($options["users"])) {
             $stmt .= "\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n                 ON\n                    isu_iss_id=iss_id";
         }
     }
     // END ETEL MODIFIED
     if (!empty($options["show_notification_list_issues"])) {
         $stmt .= "\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription\n                 ON\n                    sub_iss_id=iss_id";
     }
     $stmt .= "\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . ".`" . APP_TABLE_PREFIX . "group`\n                 ON\n                    iss_grp_id=grp_id\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category\n                 ON\n                    iss_prc_id=prc_id\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release\n                 ON\n                    iss_pre_id = pre_id\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status\n                 ON\n                    iss_sta_id=sta_id\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority\n                 ON\n                    iss_pri_id=pri_id\n                 LEFT JOIN\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_quarantine\n                 ON\n                    iss_id=iqu_iss_id AND\n                    (iqu_expiration > '" . Date_API::getCurrentDateGMT() . "' OR iqu_expiration IS NULL)\n                 WHERE\n                    iss_prj_id= " . Misc::escapeInteger($prj_id);
     $stmt .= Issue::buildWhereClause($options);
     //echo $stmt;
     if (strstr($options["sort_by"], 'custom_field') !== false) {
         $sort_by = 'cf_sort.icf_value';
     } else {
         $sort_by = Misc::escapeString($options["sort_by"]);
     }
     $stmt .= "\n                 GROUP BY\n                    iss_id\n                 ORDER BY\n                    " . $sort_by . " " . Misc::escapeString($options["sort_order"]) . ",\n                    iss_id DESC";
     $total_rows = Pager::getTotalRows($stmt);
     if ($max > 100) {
         $max = 100;
     }
     $stmt .= "\n                 LIMIT\n                    " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max);
     $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
     // echo  $stmt;
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return array("list" => "", "info" => "");
     } else {
         if (count($res) > 0) {
             if ($get_reporter) {
                 Issue::getReportersByIssues($res);
             }
             Issue::getAssignedUsersByIssues($res);
             Time_Tracking::getTimeSpentByIssues($res);
             // need to get the customer titles for all of these issues...
             if (Customer::hasCustomerIntegration($prj_id)) {
                 Customer::getCustomerTitlesByIssues($prj_id, $res);
             }
             Issue::formatLastActionDates($res);
             Issue::getLastStatusChangeDates($prj_id, $res);
         } elseif ($current_row > 0) {
             // if there are no results, and the page is not the first page reset page to one and reload results
             Auth::redirect(APP_RELATIVE_URL . "list.php?pagerRow=0&rows={$max}");
         }
         $groups = Group::getAssocList($prj_id);
         $categories = Category::getAssocList($prj_id);
         $column_headings = Issue::getColumnHeadings($prj_id);
         if (count($custom_fields) > 0) {
             $column_headings = array_merge($column_headings, $custom_fields);
         }
         $csv[] = @implode("\t", $column_headings);
         for ($i = 0; $i < count($res); $i++) {
             $res[$i]["time_spent"] = Misc::getFormattedTime($res[$i]["time_spent"]);
             $res[$i]["iss_expected_resolution_date"] = Date_API::getSimpleDate($res[$i]["iss_expected_resolution_date"], false);
             $fields = array($res[$i]['pri_title'], $res[$i]['iss_id']);
             // hide the group column from the output if no
             // groups are available in the database
             if (count($groups) > 0) {
                 $fields[] = $res[$i]['group'];
             }
             $fields[] = $res[$i]['assigned_users'];
             $fields[] = $res[$i]['time_spent'];
             // hide the category column from the output if no
             // categories are available in the database
             if (count($categories) > 0) {
                 $fields[] = $res[$i]['prc_title'];
             }
             if (Customer::hasCustomerIntegration($prj_id)) {
                 $fields[] = @$res[$i]['customer_title'];
                 // check if current user is acustomer and has a per incident contract.
                 // if so, check if issue is redeemed.
                 if (User::getRoleByUser($usr_id, $prj_id) == User::getRoleID('Customer')) {
                     if (Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($res[$i]['iss_id'])) && Customer::isRedeemedIncident($prj_id, $res[$i]['iss_id'])) {
                         $res[$i]['redeemed'] = true;
                     }
                 }
             }
             $fields[] = $res[$i]['sta_title'];
             $fields[] = $res[$i]["status_change_date"];
             $fields[] = $res[$i]["last_action_date"];
             $fields[] = $res[$i]['iss_summary'];
             if (count($custom_fields) > 0) {
                 $res[$i]['custom_field'] = array();
                 $custom_field_values = Custom_Field::getListByIssue($prj_id, $res[$i]['iss_id']);
                 foreach ($custom_field_values as $this_field) {
                     if (!empty($custom_fields[$this_field['fld_id']])) {
                         $res[$i]['custom_field'][$this_field['fld_id']] = $this_field['icf_value'];
                         $fields[] = $this_field['icf_value'];
                     }
                 }
             }
             $csv[] = @implode("\t", $fields);
         }
         $total_pages = ceil($total_rows / $max);
         $last_page = $total_pages - 1;
         return array("list" => $res, "info" => array("current_page" => $current_row, "start_offset" => $start, "end_offset" => $start + count($res), "total_rows" => $total_rows, "total_pages" => $total_pages, "previous_page" => $current_row == 0 ? "-1" : $current_row - 1, "next_page" => $current_row == $last_page ? "-1" : $current_row + 1, "last_page" => $last_page, "custom_fields" => $custom_fields), "csv" => @implode("\n", $csv));
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:class.issue.php


注:本文中的Issue::getCustomerID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。