$rem_id = @$HTTP_POST_VARS['rem_id'] ? $HTTP_POST_VARS['rem_id'] : $HTTP_GET_VARS['rem_id']; $rma_id = @$HTTP_POST_VARS['rma_id'] ? $HTTP_POST_VARS['rma_id'] : $HTTP_GET_VARS['rma_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); } if (@$HTTP_POST_VARS["cat"] == "new") { $tpl->assign("result", Reminder_Condition::insert()); } elseif (@$HTTP_POST_VARS["cat"] == "update") { $tpl->assign("result", Reminder_Condition::update()); } elseif (@$HTTP_POST_VARS["cat"] == "delete") { Reminder_Condition::remove(); } if (@$HTTP_GET_VARS["cat"] == "edit") { $info = Reminder_Condition::getDetails($HTTP_GET_VARS["id"]); if (!empty($HTTP_GET_VARS['field'])) { $info['rlc_rmf_id'] = $HTTP_GET_VARS['field']; } else { $HTTP_GET_VARS['field'] = $info['rlc_rmf_id']; } $tpl->assign("info", $info); } if (!empty($HTTP_GET_VARS['field'])) { $field_title = Reminder_Condition::getFieldTitle($HTTP_GET_VARS['field']); if (Reminder_Condition::canFieldBeCompared($HTTP_GET_VARS['field'])) { $tpl->assign(array('show_field_options' => 'yes', 'comparable_fields' => Reminder_Condition::getFieldAdminList(true))); } elseif (strtolower($field_title) == 'status') { $prj_id = Reminder::getProjectID($rem_id); $tpl->assign(array('show_status_options' => 'yes', 'statuses' => Status::getAssocStatusList($prj_id))); } elseif (strtolower($field_title) == 'category') {
if ($role_id < User::getRoleID('manager')) { Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR); $tpl->displayTemplate(); exit; } if (@$_POST['cat'] == 'new') { $res = Reminder_Condition::insert(); Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the condition was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new condition.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this new condition.'), Misc::MSG_ERROR))); } elseif (@$_POST['cat'] == 'update') { $res = Reminder_Condition::update(); Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the condition was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the condition.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this condition.'), Misc::MSG_ERROR))); } elseif (@$_POST['cat'] == 'delete') { Reminder_Condition::remove(); } if (@$_GET['cat'] == 'edit') { $info = Reminder_Condition::getDetails($_GET['id']); if (!empty($_GET['field'])) { $info['rlc_rmf_id'] = $_GET['field']; } else { $_GET['field'] = $info['rlc_rmf_id']; } $tpl->assign('info', $info); } if (!empty($_GET['field'])) { $field_title = Reminder_Condition::getFieldTitle($_GET['field']); if (Reminder_Condition::canFieldBeCompared($_GET['field'])) { $tpl->assign(array('show_field_options' => 'yes', 'comparable_fields' => Reminder_Condition::getFieldAdminList(true))); } elseif (strtolower($field_title) == 'status') { $prj_id = Reminder::getProjectID($rem_id); $tpl->assign(array('show_status_options' => 'yes', 'statuses' => Status::getAssocStatusList($prj_id))); } elseif (strtolower($field_title) == 'category') {