/** * @param int $issue_id * @param int $cat_id * @param string $summary * @param int $time_spent * @return string * @access protected * @since 3.0.2 checks access via Issue::canUpdate */ public function recordTimeWorked($issue_id, $cat_id, $summary, $time_spent) { $usr_id = Auth::getUserID(); if (!Issue::canUpdate($issue_id, $usr_id)) { throw new RemoteApiException("No access to issue #{$issue_id}"); } $res = Time_Tracking::recordRemoteTimeEntry($issue_id, $usr_id, $cat_id, $summary, $time_spent); if ($res == -1) { throw new RemoteApiException('Could not record the time tracking entry'); } return 'OK'; }
$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']); }
Workflow::prePage($prj_id, 'update'); // check if the requested issue is a part of the 'current' project. If it doesn't // check if issue exists in another project and if it does, switch projects $iss_prj_id = Issue::getProjectID($issue_id); $auto_switched_from = false; if (!empty($iss_prj_id) && $iss_prj_id != $prj_id && in_array($iss_prj_id, $associated_projects)) { $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE); Auth::setCurrentProject($iss_prj_id, $cookie['remember'], true); $auto_switched_from = $iss_prj_id; $prj_id = $iss_prj_id; Misc::setMessage(ev_gettext('Note: Project automatically switched to "%1$s" from "%2$s".', Auth::getCurrentProjectName(), Project::getName($iss_prj_id))); } $tpl->assign('issue', $details); $tpl->assign('extra_title', ev_gettext('Update Issue #%1$s', $issue_id)); // in the case of a customer user, also need to check if that customer has access to this issue if ($role_id == User::getRoleID('customer') && (empty($details) || User::getCustomerID($usr_id) != $details['iss_customer_id']) || !Issue::canAccess($issue_id, $usr_id) || !($role_id > User::getRoleID('Reporter')) || !Issue::canUpdate($issue_id, $usr_id)) { $tpl->setTemplate('base_full.tpl.html'); Misc::setMessage(ev_gettext('Sorry, you do not have the required privileges to update this issue.'), Misc::MSG_ERROR); $tpl->displayTemplate(); exit; } if (Issue_Lock::acquire($issue_id, $usr_id)) { $issue_lock = false; } else { $issue_lock = Issue_Lock::getInfo($issue_id); $issue_lock['locker'] = User::getDetails($issue_lock['usr_id']); $issue_lock['expires_formatted_time'] = Date_Helper::getFormattedDate($issue_lock['expires']); } $tpl->assign('issue_lock', $issue_lock); $new_prj_id = Issue::getProjectID($issue_id); $cancel_update = isset($_POST['cancel']);
// | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('custom_fields_form.tpl.html'); Auth::checkAuthentication(APP_COOKIE); $prj_id = Auth::getCurrentProject(); $issue_id = @$_POST['issue_id'] ? $_POST['issue_id'] : $_GET['issue_id']; if (!Issue::canUpdate($issue_id, Auth::getUserID())) { $tpl = new Template_Helper(); $tpl->setTemplate('permission_denied.tpl.html'); $tpl->displayTemplate(); exit; } if (@$_POST['cat'] == 'update_values') { $res = Custom_Field::updateValues(); $tpl->assign('update_result', $res); } $prefs = Prefs::get(Auth::getUserID()); $tpl->assign('current_user_prefs', $prefs); // XXX: use 'user_prefs' recursively $tpl->assign('user_prefs', $prefs); $tpl->assign('issue_id', $issue_id); $tpl->assign('custom_fields', Custom_Field::getListByIssue($prj_id, $issue_id));