public function __invoke(Template_Helper $tpl) { $units = array('hour' => 'Hours', 'day' => 'Days'); $type_list = array('phone' => 'Phone Calls', 'note' => 'Notes', 'email' => 'Email', 'draft' => 'Drafts', 'time' => 'Time Tracking', 'reminder' => 'Reminders'); $tpl->assign(array('units' => $units, 'users' => Project::getUserAssocList($this->prj_id, 'active', User::ROLE_CUSTOMER), 'developer' => $this->usr_id, 'type_list' => $type_list, 'activity_types' => $this->activity_types ?: array_keys($type_list), 'unit' => $this->unit, 'amount' => $this->amount, 'start_date' => $this->start_date, 'end_date' => $this->end_date, 'sort_order' => $this->sort_order)); if (!$this->unit && !$this->amount) { return; } $data = array(); if (in_array('phone', $this->activity_types)) { $data['phone'] = $this->phoneActivity(); } if (in_array('note', $this->activity_types)) { $data['note'] = $this->noteActivity(); } if (in_array('email', $this->activity_types)) { $data['email'] = $this->emailActivity(); } if (in_array('draft', $this->activity_types)) { $data['draft'] = $this->draftActivity(); } if (in_array('time', $this->activity_types)) { $data['time'] = $this->timeActivity(); } if (!$this->developer && in_array('reminder', $this->activity_types)) { $data['reminder'] = $this->reminderActivity(); } $tpl->assign(array('data' => $data, 'developer' => $this->developer)); }
if (!Access::canAccessReports(Auth::getUserID())) { echo 'Invalid role'; exit; } $prj_id = Auth::getCurrentProject(); if (count(@$_REQUEST['start']) > 0 && @$_REQUEST['start']['Year'] != 0 && @$_REQUEST['start']['Month'] != 0 && @$_REQUEST['start']['Day'] != 0) { $start_date = implode('-', $_REQUEST['start']); } elseif (!empty($_GET['start_date'])) { $start_date = $_GET['start_date']; } if (count(@$_REQUEST['end']) > 0 && @$_REQUEST['end']['Year'] != 0 && @$_REQUEST['end']['Month'] != 0 && @$_REQUEST['end']['Day'] != 0) { $end_date = implode('-', $_REQUEST['end']); } elseif (!empty($_GET['end_date'])) { $end_date = $_GET['end_date']; } $tpl->assign(array('weeks' => Date_Helper::getWeekOptions(3, 0), 'users' => Project::getUserAssocList($prj_id, 'active', User::ROLE_CUSTOMER), 'start_date' => @$start_date, 'end_date' => @$end_date, 'report_type' => @$_REQUEST['report_type'])); if (!empty($_REQUEST['developer'])) { //split date up if (@$_REQUEST['report_type'] == 'weekly') { $dates = explode('_', $_REQUEST['week']); } else { $dates = array($start_date, $end_date); } // print out emails $developer = $_REQUEST['developer']; $prj_id = Auth::getCurrentProject(); $options = array('separate_closed' => @$_REQUEST['separate_closed'], 'separate_not_assigned_to_user' => @$_REQUEST['separate_not_assigned_to_user'], 'ignore_statuses' => @$_REQUEST['ignore_statuses'], 'show_per_issue' => !empty($_REQUEST['show_per_issue']), 'separate_no_time' => !empty($_REQUEST['separate_no_time'])); $data = Report::getWeeklyReport($developer, $prj_id, $dates[0], $dates[1], $options); // order issues by time spent on them if (isset($_REQUEST['show_per_issue'])) { $sort_function = function ($a, $b) {
include_once APP_INC_PATH . "db_access.php"; $tpl = new Template_API(); $tpl->setTemplate("reports/weekly.tpl.html"); Auth::checkAuthentication(APP_COOKIE); if (Auth::getCurrentRole() <= User::getRoleID("Customer")) { echo "Invalid role"; exit; } $prj_id = Auth::getCurrentProject(); if (count(@$HTTP_POST_VARS["start"]) > 0 && @$HTTP_POST_VARS["start"]["Year"] != 0 && @$HTTP_POST_VARS["start"]["Month"] != 0 && @$HTTP_POST_VARS["start"]["Day"] != 0) { $start_date = join("-", $HTTP_POST_VARS["start"]); } if (count(@$HTTP_POST_VARS["end"]) > 0 && @$HTTP_POST_VARS["end"]["Year"] != 0 && @$HTTP_POST_VARS["end"]["Month"] != 0 && @$HTTP_POST_VARS["end"]["Day"] != 0) { $end_date = join("-", $HTTP_POST_VARS["end"]); } $tpl->assign(array("weeks" => Date_API::getWeekOptions(3, 0), "users" => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), "start_date" => @$start_date, "end_date" => @$end_date, "report_type" => @$HTTP_POST_VARS["report_type"])); if (!empty($HTTP_POST_VARS["developer"])) { //split date up if (@$HTTP_POST_VARS["report_type"] == "weekly") { $dates = explode("_", $HTTP_POST_VARS["week"]); } else { $dates = array($start_date, $end_date); } // print out emails $data = Report::getWeeklyReport($HTTP_POST_VARS["developer"], $dates[0], $dates[1], @$_REQUEST['separate_closed']); $tpl->assign("data", $data); } if (empty($HTTP_POST_VARS["week"])) { $tpl->assign("week", Date_API::getCurrentWeek()); } else { $tpl->assign("week", $HTTP_POST_VARS["week"]);
$tpl->setTemplate('reports/stalled_issues.tpl.html'); Auth::checkAuthentication(); if (!Access::canAccessReports(Auth::getUserID())) { echo 'Invalid role'; exit; } $prj_id = Auth::getCurrentProject(); if (count(@$_REQUEST['before']) < 1) { $before = date('Y-m-d', time() - Date_Helper::MONTH); } else { $before = implode('-', $_REQUEST['before']); } if (count(@$_REQUEST['after']) < 1) { $after = date('Y-m-d', time() - Date_Helper::YEAR); } else { $after = implode('-', $_REQUEST['after']); } if (empty($_REQUEST['sort_order'])) { $_REQUEST['sort_order'] = 'ASC'; } $data = Report::getStalledIssuesByUser($prj_id, @$_REQUEST['developers'], @$_REQUEST['status'], $before, $after, $_REQUEST['sort_order']); $groups = Group::getAssocList($prj_id); $assign_options = array(); if (count($groups) > 0 && Auth::getCurrentRole() > User::ROLE_CUSTOMER) { foreach ($groups as $grp_id => $grp_name) { $assign_options["grp:{$grp_id}"] = 'Group: ' . $grp_name; } } $assign_options += Project::getUserAssocList($prj_id, 'active', User::ROLE_USER); $tpl->assign(array('users' => $assign_options, 'before_date' => $before, 'after_date' => $after, 'data' => $data, 'developers' => @$_REQUEST['developers'], 'status_list' => Status::getAssocStatusList($prj_id), 'status' => @$_REQUEST['status'], 'sort_order' => $_REQUEST['sort_order'])); $tpl->displayTemplate();
$tpl->setTemplate("reports/stalled_issues.tpl.html"); Auth::checkAuthentication(APP_COOKIE); if (Auth::getCurrentRole() <= User::getRoleID("Customer")) { echo "Invalid role"; exit; } $prj_id = Auth::getCurrentProject(); if (count(@$_REQUEST['before']) < 1) { $before = date("Y-m-d", time() - MONTH); } else { $before = join('-', $_REQUEST['before']); } if (count(@$_REQUEST['after']) < 1) { $after = date("Y-m-d", time() - YEAR); } else { $after = join('-', $_REQUEST['after']); } if (empty($_REQUEST['sort_order'])) { $_REQUEST['sort_order'] = 'ASC'; } $data = Report::getStalledIssuesByUser($prj_id, @$_REQUEST['developers'], @$_REQUEST['status'], $before, $after, $_REQUEST['sort_order']); $groups = Group::getAssocList($prj_id); $assign_options = array(); if (count($groups) > 0 && Auth::getCurrentRole() > User::getRoleID("Customer")) { foreach ($groups as $grp_id => $grp_name) { $assign_options["grp:{$grp_id}"] = "Group: " . $grp_name; } } $assign_options += Project::getUserAssocList($prj_id, 'active', User::getRoleID('Standard User')); $tpl->assign(array("users" => $assign_options, "before_date" => $before, "after_date" => $after, "data" => $data, "developers" => @$_REQUEST['developers'], "status_list" => Status::getAssocStatusList($prj_id), "status" => @$_REQUEST['status'], "sort_order" => $_REQUEST['sort_order'])); $tpl->displayTemplate();
if (@$HTTP_POST_VARS["cat"] == "update") { $res = Issue::update($HTTP_POST_VARS["issue_id"]); $tpl->assign("update_result", $res); if (Issue::hasDuplicates($HTTP_POST_VARS["issue_id"])) { $tpl->assign("has_duplicates", "yes"); } } $prj_id = Auth::getCurrentProject(); $setup = Setup::load(); $tpl->assign("allow_unassigned_issues", @$setup["allow_unassigned_issues"]); // if currently selected release is in the past, manually add it to list $releases = Release::getAssocList($prj_id); if ($details["iss_pre_id"] != 0 && empty($releases[$details["iss_pre_id"]])) { $releases = array($details["iss_pre_id"] => $details["pre_title"]) + $releases; } if (Workflow::hasWorkflowIntegration($prj_id)) { $statuses = Workflow::getAllowedStatuses($prj_id, $issue_id); // if currently selected release is not on list, go ahead and add it. } else { $statuses = Status::getAssocStatusList($prj_id, false); } if (!empty($details['iss_sta_id']) && empty($statuses[$details['iss_sta_id']])) { $statuses[$details['iss_sta_id']] = Status::getStatusTitle($details['iss_sta_id']); } $tpl->assign(array("subscribers" => Notification::getSubscribers($issue_id), "categories" => Category::getAssocList($prj_id), "priorities" => Priority::getAssocList($prj_id), "status" => $statuses, "releases" => $releases, "resolutions" => Resolution::getAssocList(), "users" => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), "assoc_issues" => array_map("htmlspecialchars", array()), "one_week_ts" => time() + 7 * DAY, "allow_unassigned_issues" => @$setup["allow_unassigned_issues"], "groups" => Group::getAssocList($prj_id))); $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE); if (!empty($cookie['auto_switched_from'])) { $tpl->assign(array("project_auto_switched" => 1, "old_project" => Project::getName($cookie['auto_switched_from']))); } } $tpl->displayTemplate();
if (is_array($fields) && count($fields) > 0) { foreach ($fields as $field) { $custom_fields[$field['fld_id']] = $field['fld_title']; $options[$field['fld_id']] = Custom_Field::getOptions($field['fld_id']); } } else { echo ev_gettext('No custom fields for this project'); exit; } if (!empty($_REQUEST['start']['Year']) && !empty($_REQUEST['start']['Month']) && !empty($_REQUEST['start']['Day'])) { $start = implode('-', $_REQUEST['start']); } else { $start = false; } if (!empty($_REQUEST['end']['Year']) && !empty($_REQUEST['end']['Month']) && !empty($_REQUEST['end']['Day'])) { $end = implode('-', $_REQUEST['end']); } else { $end = false; } if (count(@$_GET['custom_field']) > 0) { $data = Report::getCustomFieldReport(@$_GET['custom_field'], @$_GET['custom_options'], @$_GET['group_by'], $start, $end, true, @$_REQUEST['interval'], @$_REQUEST['assignee']); } if ($start == false || ($end = false)) { $start = '--'; $end = '--'; } $tpl->assign(array('custom_fields' => $custom_fields, 'custom_field' => @$_GET['custom_field'], 'options' => $options, 'custom_options' => @$_GET['custom_options'], 'group_by' => @$_GET['group_by'], 'selected_options' => @$_REQUEST['custom_options'], 'data' => @$data, 'start_date' => $start, 'end_date' => $end, 'assignees' => Project::getUserAssocList($prj_id, 'active', User::ROLE_CUSTOMER), 'assignee' => @$_REQUEST['assignee'])); if (isset($_GET['custom_field'])) { $tpl->assign(array('field_info' => Custom_Field::getDetails($_GET['custom_field']))); } $tpl->displayTemplate();
if (count($item) == 1) { $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($item[0]), $item[0]); $tpl->assign(array('issue_summary' => $email_details['sup_subject'], 'issue_description' => $email_details['seb_body'])); // also auto pre-fill the customer contact text fields 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));
/** * Method used to get an associative array of the list of users and the * total number of issues associated with each of them. * * @access public * @return array List of users */ function getAssocUser() { $prj_id = Auth::getCurrentProject(); $list = Project::getUserAssocList($prj_id, 'stats', User::getRoleID('Customer')); $stats = array(); foreach ($list as $usr_id => $usr_full_name) { $stmt = "SELECT\n COUNT(*) AS total_items\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n WHERE\n isu_iss_id=iss_id AND\n iss_prj_id={$prj_id} AND\n isu_usr_id=" . $usr_id; $res = (int) $GLOBALS["db_api"]->dbh->getOne($stmt); if ($res > 0) { $stats[$usr_full_name] = $res; } } arsort($stats); return $stats; }
/** * Returns the options associated with a specific field * * @param string $field_name The name of the field * @param integer $issue_id The ID of the issue * @return array An array of options for the specified field */ private static function getOptions($field_name, $issue_id) { $prj_id = Issue::getProjectID($issue_id); switch ($field_name) { case 'assignee': $users = Project::getUserAssocList($prj_id, 'active', User::ROLE_CUSTOMER); $current_assignees = Issue::getAssignedUserIDs($issue_id); foreach ($current_assignees as $usr_id) { if (!isset($users[$usr_id])) { $users[$usr_id] = User::getFullName($usr_id); } asort($users); } return $users; case 'priority': return Priority::getAssocList($prj_id); case 'severity': return Severity::getAssocList($prj_id); } return array(); }
if (!isset($issue_fields_display['percent_complete']) || $issue_fields_display['percent_complete'] != false) { $columns[0][] = array('title' => ev_gettext('Percentage Complete'), 'data' => (empty($details['iss_percent_complete']) ? 0 : $details['iss_percent_complete']) . '%', 'field' => 'percentage_complete'); } $columns[0][] = array('title' => ev_gettext('Reporter'), 'field' => 'reporter'); $products = Product::getAssocList(false); if (count($products) > 0) { $columns[0][] = array('title' => ev_gettext('Product'), 'field' => 'product'); $columns[0][] = array('title' => ev_gettext('Product Version'), 'field' => 'product_version'); } $columns[0][] = array('title' => ev_gettext('Assignment'), 'data' => $details['assignments'], 'field' => 'assignment'); $columns[1][] = array('title' => ev_gettext('Notification List'), 'field' => 'notification_list'); $columns[1][] = array('title' => ev_gettext('Submitted Date'), 'data' => $details['iss_created_date']); $columns[1][] = array('title' => ev_gettext('Last Updated Date'), 'data' => $details['iss_updated_date']); $columns[1][] = array('title' => ev_gettext('Associated Issues'), 'field' => 'associated_issues'); if (!isset($issue_fields_display['expected_resolution']) || $issue_fields_display['expected_resolution'] != false) { $columns[1][] = array('title' => ev_gettext('Expected Resolution Date'), 'field' => 'expected_resolution'); } if (!isset($issue_fields_display['estimated_dev_time']) || $issue_fields_display['estimated_dev_time'] != false) { $columns[1][] = array('title' => ev_gettext('Estimated Dev. Time'), 'data' => $details['iss_dev_time'] . empty($details['iss_dev_time']) ? '' : ' hours', 'field' => 'estimated_dev_time'); } if ($role_id > User::getRoleID('Customer')) { $columns[1][] = array('title' => ev_gettext('Duplicates'), 'field' => 'duplicates', 'title_bgcolor' => APP_INTERNAL_COLOR); $columns[1][] = array('title' => ev_gettext('Authorized Repliers'), 'field' => 'authorized_repliers', 'title_bgcolor' => APP_INTERNAL_COLOR); } $groups = Group::getAssocList($prj_id); if ($role_id > User::getRoleID('Customer') && count($groups) > 0) { $columns[1][] = array('title' => ev_gettext('Group'), 'data' => isset($details['group']) ? $details['group']['grp_name'] : '', 'title_bgcolor' => APP_INTERNAL_COLOR); } $tpl->assign(array('subscribers' => Notification::getSubscribers($issue_id), 'categories' => $categories, 'priorities' => $priorities, 'severities' => $severities, 'status' => $statuses, 'releases' => $releases, 'resolutions' => Resolution::getAssocList(), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'one_week_ts' => time() + 7 * Date_Helper::DAY, 'groups' => Group::getAssocList($prj_id), 'current_year' => date('Y'), 'products' => Product::getList(false), 'grid' => $columns)); $tpl->assign('usr_role_id', User::getRoleByUser($usr_id, $prj_id)); $tpl->displayTemplate();
/** * Method used to get an associative array of the list of users and the * total number of issues associated with each of them. * * @param boolean $hide_closed If closed issues should be hidden. * @return array List of users */ public static function getAssocUser($hide_closed = false) { $prj_id = Auth::getCurrentProject(); $list = Project::getUserAssocList($prj_id, 'stats', User::ROLE_CUSTOMER); $stats = array(); foreach ($list as $usr_id => $usr_full_name) { $stmt = 'SELECT COUNT(*) AS total_items FROM {{%issue}}, {{%issue_user}}, {{%status}} WHERE iss_sta_id = sta_id AND isu_iss_id=iss_id AND iss_prj_id=? AND isu_usr_id=?'; if ($hide_closed) { $stmt .= ' AND sta_is_closed = 0'; } $res = (int) DB_Helper::getInstance()->getOne($stmt, array($prj_id, $usr_id)); if ($res > 0) { $stats[$usr_full_name] = $res; } } arsort($stats); return $stats; }
} // if we are dealing with just one message, use the subject line as the // summary for the issue, and the body as the description if (count($HTTP_GET_VARS["item"]) == 1) { $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($HTTP_GET_VARS["item"][0]), $HTTP_GET_VARS["item"][0]); $tpl->assign(array('issue_summary' => $email_details['sup_subject'], 'issue_description' => $email_details['message'])); // also auto pre-fill the customer contact text fields if (Customer::hasCustomerIntegration($prj_id)) { $sender_email = Mail_API::getEmailAddress($email_details['sup_from']); list(, $contact_id) = Customer::getCustomerIDByEmails($prj_id, array($sender_email)); if (!empty($contact_id)) { $tpl->assign("contact_details", Customer::getContactDetails($prj_id, $contact_id)); } } } } } $tpl->assign(array("cats" => Category::getAssocList($prj_id), "priorities" => Priority::getAssocList($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(), "field_display_settings" => Project::getFieldDisplaySettings($prj_id), "groups" => Group::getAssocList($prj_id))); $setup = Setup::load(); $tpl->assign("allow_unassigned_issues", @$setup["allow_unassigned_issues"]); $prefs = Prefs::get($usr_id); $tpl->assign("user_prefs", $prefs); $tpl->assign("zones", Date_API::getTimezoneList()); if (User::getRole(Auth::getCurrentRole()) == "Customer") { $customer_contact_id = User::getCustomerContactID($usr_id); $tpl->assign("contact_details", Customer::getContactDetails($prj_id, $customer_contact_id)); $customer_id = User::getCustomerID($usr_id); $tpl->assign("contacts", Customer::getContactEmailAssocList($prj_id, $customer_id)); $tpl->assign(array("customer_id" => User::getCustomerID($usr_id), "contact_id" => User::getCustomerContactID($usr_id))); } $tpl->displayTemplate();
$columns[1][] = array('title' => ev_gettext('Associated Issues'), 'field' => 'associated_issues'); if (!isset($issue_fields_display['expected_resolution']) || $issue_fields_display['expected_resolution'] != false) { $columns[1][] = array('title' => ev_gettext('Expected Resolution Date'), 'field' => 'expected_resolution'); } if (!isset($issue_fields_display['estimated_dev_time']) || $issue_fields_display['estimated_dev_time'] != false) { $columns[1][] = array('title' => ev_gettext('Estimated Dev. Time'), 'data' => empty($details['iss_dev_time']) ? '' : $details['iss_dev_time'] . ' hours', 'field' => 'estimated_dev_time'); } if ($role_id > User::getRoleID('Customer')) { $columns[1][] = array('title' => ev_gettext('Duplicates'), 'field' => 'duplicates', 'title_bgcolor' => APP_INTERNAL_COLOR); $columns[1][] = array('title' => ev_gettext('Authorized Repliers'), 'field' => 'authorized_repliers', 'title_bgcolor' => APP_INTERNAL_COLOR); } $groups = Group::getAssocList($prj_id); if ($role_id > User::getRoleID('Customer') && count($groups) > 0) { $columns[1][] = array('title' => ev_gettext('Group'), 'data' => isset($details['group']) ? $details['group']['grp_name'] : '', 'title_bgcolor' => APP_INTERNAL_COLOR); } $tpl->assign(array('next_issue' => @$sides['next'], 'previous_issue' => @$sides['previous'], 'subscribers' => Notification::getSubscribers($issue_id), 'custom_fields' => Custom_Field::getListByIssue($prj_id, $issue_id), 'files' => Attachment::getList($issue_id), 'emails' => Support::getEmailsByIssue($issue_id), 'zones' => Date_Helper::getTimezoneList(), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'ema_id' => Email_Account::getEmailAccount(), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'quarantine' => Issue::getQuarantineInfo($issue_id), 'grid' => $columns, 'can_update' => Issue::canUpdate($issue_id, $usr_id), 'enabled_partners' => Partner::getPartnersByProject($prj_id), 'partners' => Partner::getPartnersByIssue($issue_id), 'issue_access' => Access::getIssueAccessArray($issue_id, $usr_id), 'is_user_notified' => Notification::isUserNotified($issue_id, $usr_id))); if ($role_id != User::getRoleID('customer')) { if (@$_COOKIE['show_all_drafts'] == 1) { $show_all_drafts = true; } else { $show_all_drafts = false; } if (Workflow::hasWorkflowIntegration($prj_id)) { $statuses = Workflow::getAllowedStatuses($prj_id, $issue_id); // if currently selected release is not on list, go ahead and add it. } else { $statuses = Status::getAssocStatusList($prj_id, false); } if (!empty($details['iss_sta_id']) && empty($statuses[$details['iss_sta_id']])) { $statuses[$details['iss_sta_id']] = Status::getStatusTitle($details['iss_sta_id']); }
// | 59 Temple Place - Suite 330 | // | Boston, MA 02111-1307, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ // // @(#) $Id: s.searchbar.php 1.3 03/09/26 02:06:54-00:00 jpradomaia $ // include_once "config.inc.php"; include_once APP_INC_PATH . "db_access.php"; include_once APP_INC_PATH . "class.template.php"; include_once APP_INC_PATH . "class.auth.php"; include_once APP_INC_PATH . "class.category.php"; include_once APP_INC_PATH . "class.priority.php"; include_once APP_INC_PATH . "class.misc.php"; include_once APP_INC_PATH . "class.release.php"; include_once APP_INC_PATH . "class.project.php"; include_once APP_INC_PATH . "class.filter.php"; include_once APP_INC_PATH . "class.status.php"; $tpl = new Template_API(); $tpl->setTemplate("searchbar.tpl.html"); Auth::checkAuthentication(APP_COOKIE); $prj_id = Auth::getCurrentProject(); $tpl->assign("priorities", Priority::getList($prj_id)); $tpl->assign("status", Status::getAssocStatusList($prj_id)); $tpl->assign("users", Project::getUserAssocList($prj_id)); $tpl->assign("categories", Category::getAssocList($prj_id)); $tpl->assign("custom", Filter::getListing($prj_id)); $options = Issue::saveSearchParams(); $tpl->assign("options", $options); $tpl->displayTemplate();
* @copyright (c) Eventum Team * @license GNU General Public License, version 2 or later (GPL-2+) * * For the full copyright and license information, * please see the COPYING and AUTHORS files * that were distributed with this source code. */ require_once __DIR__ . '/../../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('manage/anonymous.tpl.html'); Auth::checkAuthentication(); @($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']); $role_id = Auth::getCurrentRole(); if ($role_id < User::ROLE_MANAGER) { Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR); $tpl->displayTemplate(); exit; } if (@$_POST['cat'] == 'update') { $res = Project::updateAnonymousPost($prj_id); $tpl->assign('result', $res); Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the information was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the information.'), Misc::MSG_ERROR))); } // load the form fields $tpl->assign('project', Project::getDetails($prj_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', Project::getAnonymousPostOptions($prj_id)); $tpl->assign('prj_id', $prj_id); $tpl->displayTemplate();
$show_releases = 0; } // get if categories should be displayed $cats = Category::getList($prj_id); if (count($cats) > 0) { $show_category = 1; } else { $show_category = 0; } $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE); if (!empty($auto_switched_from)) { $tpl->assign(array("project_auto_switched" => 1, "old_project" => Project::getName($auto_switched_from))); } $setup = Setup::load(); $tpl->assign("allow_unassigned_issues", @$setup["allow_unassigned_issues"]); $tpl->assign(array('next_issue' => @$sides['next'], 'previous_issue' => @$sides['previous'], 'subscribers' => Notification::getSubscribers($issue_id), 'custom_fields' => Custom_Field::getListByIssue($prj_id, $issue_id), 'files' => Attachment::getList($issue_id), 'emails' => Support::getEmailsByIssue($issue_id), 'zones' => Date_API::getTimezoneList(), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'ema_id' => Email_Account::getEmailAccount(), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'show_releases' => $show_releases, 'show_category' => $show_category, 'categories' => Category::getAssocList($prj_id), 'quarantine' => Issue::getQuarantineInfo($issue_id))); if ($role_id != User::getRoleID('customer')) { if (@$_REQUEST['show_all_drafts'] == 1) { $show_all_drafts = true; } else { $show_all_drafts = false; } if (Workflow::hasWorkflowIntegration($prj_id)) { $statuses = Workflow::getAllowedStatuses($prj_id, $issue_id); // if currently selected release is not on list, go ahead and add it. } else { $statuses = Status::getAssocStatusList($prj_id); } if (!empty($details['iss_sta_id']) && empty($statuses[$details['iss_sta_id']])) { $statuses[$details['iss_sta_id']] = Status::getStatusTitle($details['iss_sta_id']); }
include_once APP_INC_PATH . "db_access.php"; $tpl = new Template_API(); $tpl->setTemplate("reports/recent_activity.tpl.html"); Auth::checkAuthentication(APP_COOKIE); if (Auth::getCurrentRole() <= User::getRoleID("Customer")) { echo "Invalid role"; exit; } $units = array("hour" => "Hours", "day" => "Days"); $type_list = array("phone" => "Phone Calls", "note" => "Notes", "email" => "Email", "draft" => "Drafts", "time" => "Time Tracking", "reminder" => "Reminders"); if (empty($_REQUEST['activity_types'])) { $_REQUEST['activity_types'] = array_keys($type_list); } $prj_id = Auth::getCurrentProject(); $usr_id = Auth::getUserID(); $tpl->assign(array("units" => $units, "users" => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), "type_list" => $type_list, "activity_types" => $_REQUEST['activity_types'])); if (!empty($_REQUEST['unit']) && !empty($_REQUEST['amount']) || @count($_REQUEST['start']) == 3) { if (count(@$_REQUEST["start"]) > 0 && @$_REQUEST["start"]["Year"] != 0 && @$_REQUEST["start"]["Month"] != 0 && @$_REQUEST["start"]["Day"] != 0) { $start_date = join("-", $HTTP_POST_VARS["start"]); } if (count(@$_REQUEST["end"]) > 0 && @$_REQUEST["end"]["Year"] != 0 && @$_REQUEST["end"]["Month"] != 0 && @$_REQUEST["end"]["Day"] != 0) { $end_date = join("-", $HTTP_POST_VARS["end"]); } $data = array(); if (in_array('phone', $_REQUEST['activity_types'])) { $sql = "SELECT\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "phone_support.*,\n phc_title,\n usr_full_name,\n iss_summary,\n sta_color\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "phone_support,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_phone_category,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,\n " . ETEL_USER_TABLE . ",\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status\n WHERE\n iss_sta_id = sta_id AND\n phs_phc_id = phc_id AND\n phs_iss_id = iss_id AND\n phs_usr_id = usr_id AND\n iss_prj_id = {$prj_id} AND\n"; $sql .= createWhereClause('phs_created_date', 'usr_id'); $res = $GLOBALS["db_api"]->dbh->getAll($sql, DB_FETCHMODE_ASSOC); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); } else {
include_once APP_INC_PATH . "class.project.php"; include_once APP_INC_PATH . "class.filter.php"; include_once APP_INC_PATH . "class.status.php"; include_once APP_INC_PATH . "class.user.php"; $tpl = new Template_API(); $tpl->setTemplate("adv_search.tpl.html"); Auth::checkAuthentication(APP_COOKIE); // customers should not be able to see this page $role_id = Auth::getCurrentRole(); if ($role_id < User::getRoleID('Standard User')) { Auth::redirect(APP_RELATIVE_URL . "list.php"); } $prj_id = Auth::getCurrentProject(); // generate options for assign list. If there are groups and user is above a customer, include groups $groups = Group::getAssocList($prj_id); $users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')); $assign_options = array("" => "Any", "-1" => "un-assigned", "-2" => "myself and un-assigned"); if (User::getGroupID(Auth::getUserID()) != '') { $assign_options['-3'] = 'myself and my group'; $assign_options['-4'] = 'myself, un-assigned and my group'; } if (count($groups) > 0 && $role_id > User::getRoleID("Customer")) { foreach ($groups as $grp_id => $grp_name) { $assign_options["grp:{$grp_id}"] = "Group: " . $grp_name; } } $assign_options += $users; $tpl->assign(array("cats" => Category::getAssocList($prj_id), "priorities" => Priority::getList($prj_id), "status" => Status::getAssocStatusList($prj_id), "users" => $assign_options, "releases" => Release::getAssocList($prj_id, TRUE), "custom" => Filter::getListing($prj_id), "custom_fields" => Custom_Field::getListByProject($prj_id, ''), "reporters" => Project::getReporters($prj_id))); if (!empty($HTTP_GET_VARS["custom_id"])) { $check_perm = true; if (Filter::isGlobal($HTTP_GET_VARS["custom_id"])) {
if (!@empty($HTTP_POST_VARS['new_status'])) { $res = Issue::setStatus($issue_id, $HTTP_POST_VARS['new_status']); if ($res != -1) { $new_status = Status::getStatusTitle($HTTP_POST_VARS['new_status']); History::add($issue_id, $usr_id, History::getTypeID('status_changed'), "Status changed to '{$new_status}' by " . User::getFullName($usr_id)); } } $res = Note::insert($usr_id, $issue_id); $tpl->assign("post_result", $res); // enter the time tracking entry about this phone support entry if (!empty($HTTP_POST_VARS['time_spent'])) { $HTTP_POST_VARS['issue_id'] = $issue_id; $HTTP_POST_VARS['category'] = $HTTP_POST_VARS['time_category']; $HTTP_POST_VARS['summary'] = 'Time entry inserted when sending an internal note.'; Time_Tracking::insertEntry(); } } elseif (@$HTTP_GET_VARS["cat"] == "reply") { if (!@empty($HTTP_GET_VARS["id"])) { $note = Note::getDetails($HTTP_GET_VARS["id"]); $date = Misc::formatReplyDate($note["timestamp"]); $header = "\n\n\nOn {$date}, " . $note["not_from"] . " wrote:\n>\n"; $note["not_body"] = $header . Misc::formatReply($note["not_note"]); $tpl->bulkAssign(array("note" => $note, "parent_note_id" => $HTTP_GET_VARS["id"])); $reply_subject = Mail_API::removeExcessRe($note['not_title']); } } if (empty($reply_subject)) { $reply_subject = 'Re: ' . $details['iss_summary']; } $tpl->assign(array('from' => User::getFromHeader($usr_id), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'current_user_prefs' => Prefs::get($usr_id), 'subscribers' => Notification::getSubscribers($issue_id, false, User::getRoleID("Standard User")), 'statuses' => Status::getAssocStatusList($prj_id, false), 'current_issue_status' => Issue::getStatusID($issue_id), 'time_categories' => Time_Tracking::getAssocCategories(), 'note_category_id' => Time_Tracking::getCategoryID('Note Discussion'), 'reply_subject' => $reply_subject)); $tpl->displayTemplate();
} $rows = Issue::getParam('rows'); if (empty($rows)) { $rows = APP_DEFAULT_PAGER_SIZE; } if (@$_REQUEST['view'] == 'my_assignments') { $profile = Search_Profile::getProfile($usr_id, $prj_id, 'issue'); Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect(APP_RELATIVE_URL . "list.php?users={$usr_id}&hide_closed=1&hide_answered=1&rows={$rows}&sort_by=" . $profile['sort_by'] . "&sort_order=" . $profile['sort_order']); } $options = Issue::saveSearchParams(); $tpl->assign("options", $options); $tpl->assign("sorting", Issue::getSortingInfo($options)); // generate options for assign list. If there are groups and user is above a customer, include groups $groups = Group::getAssocList($prj_id); $users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Developer')); $assign_options = array("" => "Any", "-1" => "un-assigned", "-2" => "myself and un-assigned"); if (User::getGroupID($usr_id) != '') { $assign_options['-3'] = 'myself and my group'; $assign_options['-4'] = 'myself, un-assigned and my group'; } if (count($groups) > 0 && Auth::getCurrentRole() > User::getRoleID("Customer")) { foreach ($groups as $grp_id => $grp_name) { $assign_options["grp:{$grp_id}"] = "Group: " . $grp_name; } } $assign_options += $users; // get display values for custom fields $custom_fields_display = array(); if (is_array($options['custom_field']) && count($options['custom_field']) > 0) { foreach ($options['custom_field'] as $fld_id => $search_value) {