-ADD_DESCR("admin", __FILE__);
-
-$whereStatement = "";
-if (empty($_GET['type'])) $_GET['type'] = "your";
-
-switch ($_GET['type'])
-{
-case "your": // List only your own open (new) tasks
- $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='NEW' AND task_type != 'EXTENSION_UPDATE'";
- break;
-
-case "updates": // List only updates assigned to you
- $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='NEW' AND task_type = 'EXTENSION_UPDATE'";
- break;
-
-case "solved": // List only solved tasks assigned to you
- $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='SOLVED'";
- break;
-
-case "unassigned": // List unassigned (but not deleted) tasks
- $whereStatement = "assigned_admin='0' AND status != 'DELETED'";
- break;
-
-case "deleted": // List all deleted
- $whereStatement = "status='DELETED'";
- break;
-
-case "closed": // List all closed
- $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='CLOSED'";
- break;
-
-default: // Unknown type
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $_GET['type']));
- LOAD_TEMPLATE("admin_settings_saved", false, TASK_ADMIN_UNKNOWN_MODE_1.$_GET['type'].TASK_ADMIN_UNKNOWN_MODE_2);
- break;
-}
-
-if (!empty($whereStatement))
-{
- $SEL = 0;
- if (isset($_POST['task'])) $SEL = SELECTION_COUNT($_POST['task']);
- if ((isset($_POST['assign'])) && ($SEL > 0)) {
+addYouAreHereLink('admin', __FILE__);
+
+if (!isExtensionActive('task')) {
+ loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('task'));
+ return;
+} // END - if
+
+$whereStatement = '';
+if (!isGetRequestParameterSet('type')) setGetRequestParameter('type', 'your');
+
+switch (getRequestParameter('type')) {
+ case 'your': // List only your own open (new) tasks
+ $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='NEW' AND `task_type` != 'EXTENSION_UPDATE'";
+ break;
+
+ case 'updates': // List only updates assigned to you
+ $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'";
+ break;
+
+ case 'solved': // List only solved tasks assigned to you
+ $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='SOLVED'";
+ break;
+
+ case 'unassigned': // List unassigned (but not deleted) tasks
+ $whereStatement = "`assigned_admin`=0 AND `status` != 'DELETED'";
+ break;
+
+ case 'deleted': // List all deleted
+ $whereStatement = "`status`='DELETED'";
+ break;
+
+ case 'closed': // List all closed
+ $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='CLOSED'";
+ break;
+
+ default: // Unknown type
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", getRequestParameter('type')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_TASK_UNKNOWN_MODE', getRequestParameter('type')));
+ break;
+} // END - switch
+
+if (!empty($whereStatement)) {
+ if ((isPostRequestParameterSet('assign')) && (ifPostContainsSelections())) {