camp_html_add_msg(getGS('You must fill in the $1 field.', '"' . getGS('New issue URL name') . '"')); camp_html_goto_page($backLink); } if (!camp_is_valid_url_name($f_issue_urlname)) { camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('New issue URL name') . '"')); camp_html_goto_page($backLink); } $translationIssueObj->create($f_issue_urlname); if (!$translationIssueObj->exists()) { camp_html_add_msg(getGS('Unable to create the issue for translation $1.', $translationLanguageObj->getName())); camp_html_goto_page($backLink); } } else { $f_issue_name = Input::Get('f_issue_name', 'string', $issueObj->getName()); $f_issue_urlname = Input::Get('f_issue_urlname', 'string', $issueObj->getUrlName()); $translationIssueObj->update(array('Name' => $f_issue_name, 'ShortName' => $f_issue_urlname)); } $f_section_number = $articleObj->getSectionNumber(); $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number); if (!$sectionObj->exists()) { camp_html_display_error(getGS('No such section.'), $backLink); exit; } $translationSectionObj = new Section($f_publication_id, $f_issue_number, $f_translation_language, $f_section_number); if (!$translationSectionObj->exists()) { if (!$g_user->hasPermission("ManageSection")) { camp_html_add_msg(getGS('A section must be created for the selected language but you do not have the right to create a section.')); camp_html_goto_page($backLink); } foreach ($sectionObj->getData() as $field => $fieldValue) { if ($field != 'IdLanguage') {
$auto_switched_from = $iss_prj_id; $prj_id = $iss_prj_id; } $details = Issue::getDetails($issue_id); //if(!trim($details['reporter'])) // $details['reporter'] = $tpl->assign("issue", $details); $tpl->assign("extra_title", "Update Issue #{$issue_id}"); if ($role_id == User::getRoleID('customer') && User::getCustomerID($usr_id) != $details['iss_customer_id']) { $tpl->assign("auth_customer", 'denied'); } elseif (!Issue::canAccess($issue_id, $usr_id)) { $tpl->assign("auth_customer", 'denied'); } else { $new_prj_id = Issue::getProjectID($issue_id); 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);
$cancel_update = isset($_POST['cancel']); if ($cancel_update) { // be sure not to unlock somebody else's lock if (!$issue_lock) { Issue_Lock::release($issue_id); Misc::setMessage(ev_gettext('Cancelled Issue #%1$s update.', $issue_id), Misc::MSG_INFO); } Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $issue_id); exit; } elseif (@$_POST['cat'] == 'update') { if ($issue_lock) { Misc::setMessage(ev_gettext("Sorry, you can't update issue if it's locked by another user"), Misc::MSG_ERROR); $tpl->displayTemplate(); exit; } $res = Issue::update($issue_id); Issue_Lock::release($issue_id); if ($res == -1) { Misc::setMessage(ev_gettext('Sorry, an error happened while trying to update this issue.'), Misc::MSG_ERROR); $tpl->displayTemplate(); exit; } elseif ($res == 1) { Misc::setMessage(ev_gettext('Thank you, issue #%1$s was updated successfully.', $issue_id), Misc::MSG_INFO); } $notify_list = Notification::getLastNotifiedAddresses($issue_id); $has_duplicates = Issue::hasDuplicates($_POST['issue_id']); if ($has_duplicates || count($errors) > 0 || count($notify_list) > 0) { $update_tpl = new Template_Helper(); $update_tpl->setTemplate('include/update_msg.tpl.html'); $update_tpl->assign('update_result', $res); $update_tpl->assign('errors', $errors);
/** * used by proposals.php and proposal.php */ function action_proposal_select_period() { Login::access_action("admin"); action_required_parameters('issue', 'period'); $issue = new Issue($_POST['issue']); if (!$issue) { warning("The requested issue does not exist!"); redirect(); } $period = new Period($_POST['period']); if (!$period) { warning("The selected period does not exist!"); redirect(); } $available =& $issue->available_periods(); if (!isset($available[$period->id])) { warning("The selected period is not available for the issue!"); redirect(); } $issue->period = $period->id; $issue->update(["period"]); redirect("#issue".$issue->id); }