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


PHP Customer::hasCustomerIntegration方法代码示例

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


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

示例1: getColumnsToDisplay

 /**
  * Returns the columns that should be displayed for the specified page.
  * This method will remove columns that should not be displayed, due to
  * lack of customer integration or insufficient role.
  *
  * @access  public
  * @param   integer $prj_id The ID of the project.
  * @param   string $page The page to return columns for.
  * @return  array An array of columns that should be displayed.
  */
 function getColumnsToDisplay($prj_id, $page)
 {
     static $returns;
     // poor man's caching system
     if (!empty($returns[$prj_id][$page])) {
         return $returns[$prj_id][$page];
     }
     $current_role = Auth::getCurrentRole();
     $data = Display_Column::getSelectedColumns($prj_id, $page);
     $has_customer_integration = Customer::hasCustomerIntegration($prj_id);
     $only_with_customers = array('iss_customer_id');
     // remove groups if there are no groups in the system.
     if (count(Group::getAssocList($prj_id)) < 1) {
         unset($data['iss_grp_id']);
     }
     // remove category column if there are no categories in the system
     if (count(Category::getAssocList($prj_id)) < 1) {
         unset($data['prc_title']);
     }
     // remove custom fields column if there are no custom fields
     if (count(Custom_Field::getFieldsToBeListed($prj_id)) < 1) {
         unset($data['custom_fields']);
     }
     // remove customer field if user has a role of customer
     if ($current_role == User::getRoleID("Customer")) {
         unset($data['iss_customer_id']);
     }
     foreach ($data as $field => $info) {
         // remove fields based on role
         if ($info['min_role'] > $current_role) {
             unset($data[$field]);
             continue;
         }
         // remove fields based on customer integration
         if (!$has_customer_integration && in_array($field, $only_with_customers)) {
             unset($data[$field]);
             continue;
         }
         // get title
         $data[$field] = Display_Column::getColumnInfo($page, $field);
     }
     $returns[$prj_id][$page] = $data;
     return $data;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:54,代码来源:class.display_column.php

示例2: array_flip

        // issue, so let's remove that as an option
        $priorities = array_flip(Priority::getAssocList($info['rem_prj_id']));
        unset($priorities['Not Prioritized']);
        $tpl->assign("priorities", array_flip($priorities));
    } elseif (@$HTTP_GET_VARS["cat"] == "change_rank") {
        Reminder::changeRank($HTTP_GET_VARS['id'], $HTTP_GET_VARS['rank']);
    } elseif (!empty($HTTP_GET_VARS['prj_id'])) {
        $tpl->assign("info", array('rem_prj_id' => $HTTP_GET_VARS['prj_id']));
        $tpl->assign('issues', Reminder::getIssueAssocListByProject($HTTP_GET_VARS['prj_id']));
        // wouldn't make much sense to create a reminder for a 'Not Prioritized'
        // issue, so let's remove that as an option
        $priorities = array_flip(Priority::getAssocList($HTTP_GET_VARS['prj_id']));
        unset($priorities['Not Prioritized']);
        $tpl->assign("priorities", array_flip($priorities));
        // only show customers and support levels if the selected project really needs it
        $project_has_customer_integration = Customer::hasCustomerIntegration($HTTP_GET_VARS['prj_id']);
        $tpl->assign("project_has_customer_integration", $project_has_customer_integration);
        if ($project_has_customer_integration) {
            $tpl->assign("customers", Customer::getAssocList($HTTP_GET_VARS['prj_id']));
            $backend_uses_support_levels = Customer::doesBackendUseSupportLevels($HTTP_GET_VARS['prj_id']);
            if ($backend_uses_support_levels) {
                $tpl->assign("support_levels", Customer::getSupportLevelAssocList($HTTP_GET_VARS['prj_id']));
            }
            $tpl->assign("backend_uses_support_levels", $backend_uses_support_levels);
        }
    }
    $tpl->assign("project_list", Project::getAll());
    $tpl->assign("list", Reminder::getAdminList());
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:reminders.php

示例3: 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

示例4: getCustomFieldReport

 /**
  * Returns data for the custom fields report, based on the field and options passed in.
  *
  * @access  public
  * @param   integer $fld_id The id of the custom field.
  * @param   array $cfo_ids An array of option ids.
  * @param   string $group_by How the data should be grouped.
  * @param   boolean $list If the values should be listed out instead of just counted.
  * @return  array An array of data.
  */
 function getCustomFieldReport($fld_id, $cfo_ids, $group_by = "issue", $list = false)
 {
     $prj_id = Auth::getCurrentProject();
     $fld_id = Misc::escapeInteger($fld_id);
     $cfo_ids = array_map(array('Misc', 'escapeString'), $cfo_ids);
     $backend = Custom_Field::getBackend($fld_id);
     if (is_object($backend)) {
         $options = array();
         foreach ($cfo_ids as $cfo_id) {
             $options[$cfo_id] = Custom_Field::getOptionValue($fld_id, $cfo_id);
         }
         $in_field = 'icf_value';
     } else {
         // get field values
         $stmt = "SELECT\n                        cfo_id,\n                        cfo_value\n                     FROM\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field_option\n                     WHERE\n                        cfo_fld_id = {$fld_id} AND\n                        cfo_id IN('" . join("','", $cfo_ids) . "')\n                     ORDER BY\n                        cfo_id";
         $options = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
         if (PEAR::isError($options)) {
             Error_Handler::logError(array($options->getMessage(), $options->getDebugInfo()), __FILE__, __LINE__);
             return array();
         }
         $in_field = 'cfo_id';
     }
     if ($group_by == "customer") {
         $group_by_field = "iss_customer_id";
     } else {
         $group_by_field = "iss_id";
     }
     if ($list == true) {
         $sql = "SELECT\n                        DISTINCT({$group_by_field}),\n                        iss_id,\n                        iss_summary,\n                        iss_customer_id,\n                        count(DISTINCT(iss_id)) as row_count\n                    FROM\n";
         if (!is_object($backend)) {
             $sql .= APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field_option,\n";
         }
         $sql .= APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field,\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                    WHERE\n";
         if (!is_object($backend)) {
             $sql .= "cfo_id = icf_value AND";
         }
         $sql .= "\nicf_iss_id = iss_id AND\n                        icf_fld_id = {$fld_id} AND\n                        {$in_field} IN('" . join("','", array_keys($options)) . "')\n                    GROUP BY\n                        {$group_by_field}\n                    ORDER BY\n                        row_count DESC";
         $res = $GLOBALS["db_api"]->dbh->getAll($sql, DB_FETCHMODE_ASSOC);
         if (PEAR::isError($res)) {
             Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
             return array();
         }
         if (Customer::hasCustomerIntegration($prj_id)) {
             Customer::getCustomerTitlesByIssues($prj_id, $res);
             if ($group_by == "issue") {
                 usort($res, create_function('$a,$b', 'if ($a["customer_title"] < $b["customer_title"]) {
                     return -1;
                 } elseif ($a["customer_title"] > $b["customer_title"]) {
                     return 1;
                 } else {
                     return 0;
                 }'));
             }
         }
         return $res;
     }
     $data = array();
     foreach ($options as $cfo_id => $value) {
         $stmt = "SELECT\n                        COUNT(DISTINCT {$group_by_field})\n                    FROM\n";
         if (!is_object($backend)) {
             $stmt .= APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field_option,\n";
         }
         $stmt .= APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field,\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                    WHERE\n";
         if (!is_object($backend)) {
             $stmt .= "cfo_id = icf_value AND";
         }
         $stmt .= "\nicf_iss_id = iss_id AND\n                        icf_fld_id = {$fld_id} AND\n                        {$in_field} = '" . Misc::escapeString($cfo_id) . "'";
         $count = $GLOBALS["db_api"]->dbh->getOne($stmt);
         if (PEAR::isError($count)) {
             Error_Handler::logError(array($count->getMessage(), $count->getDebugInfo()), __FILE__, __LINE__);
             return array();
         }
         $data[$value] = $count;
     }
     // include count of all other values (used in pie chart)
     $stmt = "SELECT\n                    COUNT(DISTINCT {$group_by_field})\n                FROM\n";
     if (!is_object($backend)) {
         $stmt .= APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field_option,\n";
     }
     $stmt .= APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field,\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                WHERE\n";
     if (!is_object($backend)) {
         $stmt .= "cfo_id = icf_value AND";
     }
     $stmt .= "\nicf_iss_id = iss_id AND\n                    icf_fld_id = {$fld_id} AND\n                    {$in_field} NOT IN('" . join("','", $cfo_ids) . "')";
     $res = $GLOBALS["db_api"]->dbh->getOne($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return array();
     }
     $data["All Others"] = $res;
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:class.report.php

示例5: _recordNoRecipientError

 /**
  * Method used to send an alert to a set of email addresses when
  * a reminder action was triggered, but no action was really
  * taken because no recipients could be found.
  *
  * @access  private
  * @param   integer $issue_id The issue ID
  * @param   string $type Which reminder are we trying to send, email or sms
  * @param   array $reminder The reminder details
  * @param   array $action The action details
  * @return  void
  */
 function _recordNoRecipientError($issue_id, $type, $reminder, $action)
 {
     $to = Reminder::_getReminderAlertAddresses();
     if (count($to) > 0) {
         $tpl = new Template_API();
         $tpl->setTemplate('reminders/alert_no_recipients.tpl.text');
         $tpl->bulkAssign(array("type" => $type, "data" => $data, "reminder" => $reminder, "action" => $action, "conditions" => $conditions, "has_customer_integration" => Customer::hasCustomerIntegration(Issue::getProjectID($issue_id))));
         $text_message = $tpl->getTemplateContents();
         foreach ($to as $address) {
             // send email (use PEAR's classes)
             $mail = new Mail_API();
             $mail->setTextBody($text_message);
             $setup = $mail->getSMTPSettings();
             $mail->send($setup["from"], $address, "[#{$issue_id}] Reminder Not Triggered: " . $action['rma_title'], 0, $issue_id);
         }
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:29,代码来源:class.reminder_action.php

示例6: handleExpiredCustomer

function handleExpiredCustomer($prj_id)
{
    global $tpl;
    if (Customer::hasCustomerIntegration($prj_id)) {
        // check if customer is expired
        $usr_id = Auth::getUserID();
        $contact_id = User::getCustomerContactID($usr_id);
        if (!empty($contact_id) && $contact_id != -1) {
            $status = Customer::getContractStatus($prj_id, User::getCustomerID($usr_id));
            $email = User::getEmailByContactID($contact_id);
            if ($status == 'expired') {
                Customer::sendExpirationNotice($prj_id, $contact_id, true);
                Auth::saveLoginAttempt($email, 'failure', 'expired contract');
                Auth::removeCookie(APP_PROJECT_COOKIE);
                $contact_id = User::getCustomerContactID($usr_id);
                $tpl->setTemplate("customer/" . Customer::getBackendImplementationName($prj_id) . "/customer_expired.tpl.html");
                $tpl->assign('customer', Customer::getContractDetails($prj_id, $contact_id, false));
                $tpl->displayTemplate();
                exit;
            } elseif ($status == 'in_grace_period') {
                Customer::sendExpirationNotice($prj_id, $contact_id);
                $tpl->setTemplate("customer/" . Customer::getBackendImplementationName($prj_id) . "/grace_period.tpl.html");
                $tpl->assign('customer', Customer::getContractDetails($prj_id, $contact_id, false));
                $tpl->assign('expiration_offset', Customer::getExpirationOffset($prj_id));
                $tpl->displayTemplate();
                exit;
            }
            // check with cnt_support to see if this contact is allowed in this support contract
            if (!Customer::isAllowedSupportContact($prj_id, $contact_id)) {
                Auth::saveLoginAttempt($email, 'failure', 'not allowed as technical contact');
                Auth::redirect(APP_RELATIVE_URL . "index.php?err=4&email=" . $email);
            }
        }
    }
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:35,代码来源:select_project.php

示例7: Template_API

include_once APP_INC_PATH . "class.misc.php";
include_once APP_INC_PATH . "class.project.php";
include_once APP_INC_PATH . "class.setup.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("manage/index.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$tpl->assign("type", "issue_auto_creation");
@($ema_id = $HTTP_POST_VARS["ema_id"] ? $HTTP_POST_VARS["ema_id"] : $HTTP_GET_VARS["ema_id"]);
$role_id = Auth::getCurrentRole();
if ($role_id == User::getRoleID('administrator') || $role_id == User::getRoleID('manager')) {
    if ($role_id == User::getRoleID('administrator')) {
        $tpl->assign("show_setup_links", true);
    }
    $prj_id = Email_Account::getProjectID($ema_id);
    if (@$HTTP_POST_VARS["cat"] == "update") {
        @Email_Account::updateIssueAutoCreation($ema_id, $HTTP_POST_VARS['issue_auto_creation'], $HTTP_POST_VARS['options']);
    }
    // load the form fields
    $tpl->assign("info", Email_Account::getDetails($ema_id));
    $tpl->assign("cats", Category::getAssocList($prj_id));
    $tpl->assign("priorities", Priority::getList($prj_id));
    $tpl->assign("users", Project::getUserAssocList($prj_id, 'active'));
    $tpl->assign("options", Email_Account::getIssueAutoCreationOptions($ema_id));
    $tpl->assign("ema_id", $ema_id);
    $tpl->assign("prj_title", Project::getName($prj_id));
    $tpl->assign("uses_customer_integration", Customer::hasCustomerIntegration($prj_id));
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:issue_auto_creation.php

示例8: elseif

$tpl->setTemplate("manage/index.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$tpl->assign("type", "customize_listing");
$role_id = Auth::getCurrentRole();
if ($role_id == User::getRoleID('administrator')) {
    $tpl->assign("show_setup_links", true);
    if (@$HTTP_POST_VARS["cat"] == "new") {
        $tpl->assign("result", Status::insertCustomization($HTTP_POST_VARS['project'], $HTTP_POST_VARS['status'], $HTTP_POST_VARS['date_field'], $HTTP_POST_VARS['label']));
    } elseif (@$HTTP_POST_VARS["cat"] == "update") {
        $tpl->assign("result", Status::updateCustomization($HTTP_POST_VARS['id'], $HTTP_POST_VARS['project'], $HTTP_POST_VARS['status'], $HTTP_POST_VARS['date_field'], $HTTP_POST_VARS['label']));
    } elseif (@$HTTP_POST_VARS["cat"] == "delete") {
        Status::removeCustomization($HTTP_POST_VARS['items']);
    }
    if (@$HTTP_GET_VARS["cat"] == "edit") {
        $details = Status::getCustomizationDetails($HTTP_GET_VARS["id"]);
        $tpl->assign(array("info" => $details, 'project_id' => $details['psd_prj_id'], 'status_list' => Status::getAssocStatusList($details['psd_prj_id'], TRUE)));
    }
    $display_customer_fields = false;
    @($prj_id = $HTTP_POST_VARS["prj_id"] ? $HTTP_POST_VARS["prj_id"] : $HTTP_GET_VARS["prj_id"]);
    if (!empty($prj_id)) {
        $tpl->assign("status_list", Status::getAssocStatusList($prj_id, TRUE));
        $tpl->assign('project_id', $prj_id);
        $display_customer_fields = Customer::hasCustomerIntegration($prj_id);
    }
    $tpl->assign("date_fields", Issue::getDateFieldsAssocList($display_customer_fields));
    $tpl->assign("project_list", Project::getAll());
    $tpl->assign("list", Status::getCustomizationList());
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:customize_listing.php

示例9: getBackendImplementationName

 function getBackendImplementationName($prj_id)
 {
     if (!Customer::hasCustomerIntegration($prj_id)) {
         return '';
     }
     $backend =& Customer::_getBackend($prj_id);
     if ($backend) {
         return $backend->getName();
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:10,代码来源:class.customer.php

示例10: elseif

Auth::checkAuthentication(APP_COOKIE);
$tpl->assign("type", "custom_fields");
$role_id = Auth::getCurrentRole();
if ($role_id == User::getRoleID('administrator')) {
    $tpl->assign("show_setup_links", true);
    if (@$HTTP_POST_VARS["cat"] == "new") {
        $tpl->assign("result", Custom_Field::insert());
    } elseif (@$HTTP_POST_VARS["cat"] == "update") {
        $tpl->assign("result", Custom_Field::update());
    } elseif (@$HTTP_POST_VARS["cat"] == "delete") {
        Custom_Field::remove();
    } elseif (@$_REQUEST["cat"] == "change_rank") {
        Custom_Field::changeRank();
    }
    if (@$HTTP_GET_VARS["cat"] == "edit") {
        $tpl->assign("info", Custom_Field::getDetails($HTTP_GET_VARS["id"]));
    }
    $excluded_roles = array();
    if (!Customer::hasCustomerIntegration(Auth::getCurrentProject())) {
        $excluded_roles[] = "customer";
    }
    $user_roles = User::getRoles($excluded_roles);
    $user_roles[9] = "Never Display";
    $tpl->assign("list", Custom_Field::getList());
    $tpl->assign("project_list", Project::getAll());
    $tpl->assign("user_roles", $user_roles);
    $tpl->assign("backend_list", Custom_Field::getBackendList());
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:custom_fields.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: 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

示例13: canAccess

 /**
  * Method to determine if user can access a particular issue
  *
  * @access  public
  * @param   integer $issue_id The ID of the issue.
  * @param   integer $usr_id The ID of the user
  * @return  boolean If the user can access the issue
  */
 function canAccess($issue_id, $usr_id)
 {
     static $access;
     if (empty($issue_id)) {
         return true;
     }
     if (isset($access[$issue_id . "-" . $usr_id])) {
         return $access[$issue_id . "-" . $usr_id];
     }
     $details = Issue::getDetails($issue_id);
     if (empty($details)) {
         return true;
     }
     $usr_details = User::getDetails($usr_id);
     $usr_role = User::getRoleByUser($usr_id, $details['iss_prj_id']);
     $prj_id = Issue::getProjectID($issue_id);
     // check customer permissions
     if (Customer::hasCustomerIntegration($details['iss_prj_id']) && $usr_role == User::getRoleID("Customer") && $details['iss_customer_id'] != $usr_details['usr_customer_id']) {
         $return = false;
     } elseif ($details['iss_private'] == 1) {
         // check if the issue is even private
         // check role, reporter, assigment and group
         if (User::getRoleByUser($usr_id, $details['iss_prj_id']) > User::getRoleID("Developer")) {
             $return = true;
         } elseif ($details['iss_usr_id'] == $usr_id) {
             $return = true;
         } elseif (Issue::isAssignedToUser($issue_id, $usr_id)) {
             $return = true;
         } elseif (!empty($details['iss_grp_id']) && !empty($usr_details['usr_grp_id']) && $details['iss_grp_id'] == $usr_details['usr_grp_id']) {
             $return = true;
         } elseif (Authorized_Replier::isUserAuthorizedReplier($issue_id, $usr_id)) {
             $return = true;
         } else {
             $return = false;
         }
     } elseif (Auth::getCurrentRole() <= User::getRoleID("Standard User") && Project::getSegregateReporters($prj_id) && $details['iss_usr_id'] != $usr_id && !Issue::isAssignedToUser($issue_id, $usr_id) && !Authorized_Replier::isUserAuthorizedReplier($issue_id, $usr_id)) {
         return false;
     } else {
         $return = true;
     }
     $access[$issue_id . "-" . $usr_id] = $return;
     return $return;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:51,代码来源:class.issue.php

示例14: notifyEmailConvertedIntoIssue

 /**
  * Method used to send an email notification to the sender of a
  * set of email messages that were manually converted into an
  * issue.
  *
  * @access  public
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @param   array $sup_ids The email IDs
  * @param   integer $customer_id The customer ID
  * @return  array The list of recipient emails
  */
 function notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id = FALSE)
 {
     if (Customer::hasCustomerIntegration($prj_id)) {
         return Customer::notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id);
     } else {
         // build the list of recipients
         $recipients = array();
         $recipient_emails = array();
         for ($i = 0; $i < count($sup_ids); $i++) {
             $senders = Support::getSender(array($sup_ids[$i]));
             if (count($senders) > 0) {
                 $sender_email = Mail_API::getEmailAddress($senders[0]);
                 $recipients[$sup_ids[$i]] = $senders[0];
                 $recipient_emails[] = $sender_email;
             }
         }
         if (count($recipients) == 0) {
             return false;
         }
         $data = Issue::getDetails($issue_id);
         foreach ($recipients as $sup_id => $recipient) {
             // open text template
             $tpl = new Template_API();
             $tpl->setTemplate('notifications/new_auto_created_issue.tpl.text');
             $tpl->bulkAssign(array("data" => $data, "sender_name" => Mail_API::getName($recipient)));
             $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($sup_id), $sup_id);
             $tpl->assign(array('email' => array('date' => $email_details['sup_date'], 'from' => $email_details['sup_from'], 'subject' => $email_details['sup_subject'])));
             $text_message = $tpl->getTemplateContents();
             // send email (use PEAR's classes)
             $mail = new Mail_API();
             $mail->setTextBody($text_message);
             $setup = $mail->getSMTPSettings();
             $from = Notification::getFixedFromHeader($issue_id, $setup["from"], 'issue');
             $mail->setHeaders(Mail_API::getBaseThreadingHeaders($issue_id));
             $mail->send($from, $recipient, 'New Issue Created', 1, $issue_id, 'email_converted_to_issue');
         }
         return $recipient_emails;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:51,代码来源:class.notification.php

示例15: 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


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