@@ 109-131 (lines=23) @@ | ||
106 | </tr>"; |
|
107 | echo "</table></form>"; |
|
108 | include_once "admin_footer.php"; |
|
109 | } else { |
|
110 | $hRole =& xhelpGetHandler('role'); |
|
111 | ||
112 | $role =& $hRole->create(); |
|
113 | $role->setVar('name', $_POST['roleName']); |
|
114 | $role->setVar('description', $_POST['roleDescription']); |
|
115 | if(isset($_POST['tasks'])){ |
|
116 | $tasksValue = array_sum($_POST['tasks']); |
|
117 | } else { |
|
118 | $tasksValue = 0; |
|
119 | } |
|
120 | $role->setVar('tasks', $tasksValue); |
|
121 | ||
122 | $lastPage = $_xhelpSession->get("xhelp_return_op"); |
|
123 | ||
124 | if($hRole->insert($role)){ |
|
125 | $message = _AM_XHELP_MESSAGE_ROLE_INSERT; |
|
126 | header("Location: ".XHELP_ADMIN_URL."/staff.php?op=$lastPage"); |
|
127 | } else { |
|
128 | $message = _AM_XHELP_MESSAGE_ROLE_INSERT_ERROR; |
|
129 | redirect_header(XHELP_ADMIN_URL."/staff.php?op=$lastPage", 3, $message); |
|
130 | } |
|
131 | } |
|
132 | } |
|
133 | ||
134 | function clearOrphanedStaff() |
|
@@ 476-499 (lines=24) @@ | ||
473 | </tr>"; |
|
474 | echo "</table></form>"; |
|
475 | include_once "admin_footer.php"; |
|
476 | } else { |
|
477 | $role->setVar('name', $_POST['roleName']); |
|
478 | $role->setVar('description', $_POST['roleDescription']); |
|
479 | if(isset($_POST['tasks'])){ |
|
480 | $tasksValue = array_sum($_POST['tasks']); |
|
481 | } else { |
|
482 | $tasksValue = 0; |
|
483 | } |
|
484 | $role->setVar('tasks', $tasksValue); |
|
485 | ||
486 | if(!$lastPage = $_xhelpSession->get("xhelp_return_op2")){ |
|
487 | $lastPage = $_xhelpSession->get("xhelp_return_op"); |
|
488 | } |
|
489 | ||
490 | if($hRole->insert($role)){ |
|
491 | xhelpResetStaffUpdatedTime(); |
|
492 | ||
493 | $message = _AM_XHELP_MESSAGE_ROLE_UPDATE; |
|
494 | header("Location: ".XHELP_ADMIN_URL."/staff.php?op=$lastPage&uid=$uid"); |
|
495 | } else { |
|
496 | $message = _AM_XHELP_MESSAGE_ROLE_UPDATE_ERROR; |
|
497 | redirect_header(XHELP_ADMIN_URL."/staff.php?op=$lastPage&uid=$uid", 3, $message); |
|
498 | } |
|
499 | } |
|
500 | } |
|
501 | ||
502 | function editStaff() |