本文整理汇总了PHP中Access::canCloneIssue方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::canCloneIssue方法的具体用法?PHP Access::canCloneIssue怎么用?PHP Access::canCloneIssue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::canCloneIssue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
if (CRM::hasCustomerIntegration($prj_id)) {
$sender_email = Mail_Helper::getEmailAddress($email_details['sup_from']);
try {
$contact = $crm->getContactByEmail($sender_email);
$tpl->assign('contact_details', $contact->getDetails());
} catch (CRMException $e) {
}
}
}
}
}
$tpl->assign(array('cats' => Category::getAssocList($prj_id), 'priorities' => Priority::getAssocList($prj_id), 'severities' => Severity::getList($prj_id), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'releases' => Release::getAssocList($prj_id), 'custom_fields' => Custom_Field::getListByProject($prj_id, 'report_form'), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'max_attachment_bytes' => Attachment::getMaxAttachmentSize(true), 'field_display_settings' => Project::getFieldDisplaySettings($prj_id), 'groups' => Group::getAssocList($prj_id), 'products' => Product::getList(false)));
$prefs = Prefs::get($usr_id);
$tpl->assign('user_prefs', $prefs);
$tpl->assign('zones', Date_Helper::getTimezoneList());
if (Auth::getCurrentRole() == User::getRoleID('Customer')) {
$crm = CRM::getInstance(Auth::getCurrentProject());
$customer_contact_id = User::getCustomerContactID($usr_id);
$contact = $crm->getContact($customer_contact_id);
$customer_id = Auth::getCurrentCustomerID();
$customer = $crm->getCustomer($customer_id);
// TODOCRM: Pull contacts via ajax when user selects contract
$tpl->assign(array('customer_id' => $customer_id, 'contact_id' => $customer_contact_id, 'customer' => $customer, 'contact' => $contact));
}
$clone_iss_id = isset($_GET['clone_iss_id']) ? (int) $_GET['clone_iss_id'] : null;
if ($clone_iss_id && Access::canCloneIssue($clone_iss_id, $usr_id)) {
$tpl->assign(Issue::getCloneIssueTemplateVariables($clone_iss_id));
} else {
$tpl->assign('defaults', $_REQUEST);
}
$tpl->displayTemplate();
示例2: createFromPost
/**
* Method used to add a new issue using the normal report form.
*
* @return integer The new issue ID
*/
public static function createFromPost()
{
$keys = array('add_primary_contact', 'attached_emails', 'category', 'contact', 'contact_email', 'contact_extra_emails', 'contact_person_fname', 'contact_person_lname', 'contact_phone', 'contact_timezone', 'contract', 'customer', 'custom_fields', 'description', 'estimated_dev_time', 'group', 'notify_customer', 'notify_senders', 'priority', 'private', 'release', 'severity', 'summary', 'users', 'product', 'product_version', 'expected_resolution_date', 'associated_issues');
$data = array();
foreach ($keys as $key) {
if (isset($_POST[$key])) {
$data[$key] = $_POST[$key];
}
}
$prj_id = Auth::getCurrentProject();
$current_usr_id = Auth::getUserID();
$usr_id = $current_usr_id;
// if we are creating an issue for a customer, put the
// main customer contact as the reporter for it
if (CRM::hasCustomerIntegration($prj_id)) {
$crm = CRM::getInstance($prj_id);
$contact_usr_id = User::getUserIDByContactID($data['contact']);
if (empty($contact_usr_id)) {
$contact_usr_id = $usr_id;
}
$data['reporter'] = $contact_usr_id;
} else {
$data['reporter'] = $usr_id;
}
$data['msg_id'] = Mail_Helper::generateMessageID();
$issue_id = self::insertIssue($prj_id, $data);
if ($issue_id == -1) {
return -1;
}
$has_RR = false;
$info = User::getNameEmail($usr_id);
// log the creation of the issue
History::add($issue_id, $current_usr_id, 'issue_opened', 'Issue opened by {user}', array('user' => User::getFullName($current_usr_id)));
$clone_iss_id = isset($_POST['clone_iss_id']) ? (int) $_POST['clone_iss_id'] : null;
if ($clone_iss_id && Access::canCloneIssue($clone_iss_id, $current_usr_id)) {
History::add($issue_id, $current_usr_id, 'issue_cloned_from', 'Issue cloned from #{issue_id}', array('issue_id' => $clone_iss_id));
History::add($clone_iss_id, $current_usr_id, 'issue_cloned_to', 'Issue cloned to #{issue_id}', array('issue_id' => $issue_id));
self::addAssociation($issue_id, $clone_iss_id, $usr_id, true);
}
$emails = array();
if (CRM::hasCustomerIntegration($prj_id)) {
$customer = $crm->getCustomer($data['customer']);
$contract = $crm->getContract($data['contract']);
if (!empty($data['contact_extra_emails']) && count($data['contact_extra_emails']) > 0) {
$emails = $data['contact_extra_emails'];
}
// add the primary contact to the notification list
if (isset($data['add_primary_contact']) && $data['add_primary_contact'] == 'yes') {
$contact_email = User::getEmailByContactID($data['contact']);
if (!empty($contact_email)) {
$emails[] = $contact_email;
}
}
// if there are any technical account managers associated with this customer, add these users to the notification list
$managers = $customer->getEventumAccountManagers();
foreach ($managers as $manager) {
$emails[] = $manager['usr_email'];
}
}
// add the reporter to the notification list
$emails[] = $info['usr_email'];
$emails = array_unique($emails);
foreach ($emails as $address) {
Notification::subscribeEmail($usr_id, $issue_id, $address, Notification::getDefaultActions($issue_id, $address, 'new_issue'));
}
// only assign the issue to an user if the associated customer has any technical account managers
$users = array();
$has_TAM = false;
if (CRM::hasCustomerIntegration($prj_id) && count($managers) > 0) {
foreach ($managers as $manager) {
if ($manager['cam_type'] == 'intpart') {
continue;
}
$users[] = $manager['cam_usr_id'];
self::addUserAssociation($usr_id, $issue_id, $manager['cam_usr_id'], false);
History::add($issue_id, $usr_id, 'issue_auto_assigned', 'Issue auto-assigned to {assignee} (TAM)', array('assignee' => User::getFullName($manager['cam_usr_id'])));
}
$has_TAM = true;
}
// now add the user/issue association (aka assignments)
if (!empty($data['users']) && count($data['users']) > 0) {
foreach ($data['users'] as $user) {
$actions = Notification::getDefaultActions($issue_id, User::getEmail($user), 'new_issue');
Notification::subscribeUser($usr_id, $issue_id, $user, $actions);
self::addUserAssociation($usr_id, $issue_id, $user);
if ($user != $usr_id) {
$users[] = $user;
}
}
} else {
// only use the round-robin feature if this new issue was not
// already assigned to a customer account manager
if (@count($managers) < 1) {
$assignee = Round_Robin::getNextAssignee($prj_id);
// assign the issue to the round robin person
//.........这里部分代码省略.........