-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_CURRENT_ADMIN_ID()."' AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'";
- break;
-
-case "updates": // List only updates assigned to you
- $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='NEW' AND task_type = 'EXTENSION_UPDATE'";
- break;
-
-case "solved": // List only solved tasks assigned to you
- $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." 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_CURRENT_ADMIN_ID()." 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, sprintf(getMessage('ADMIN_TASK_UNKNOWN_MODE'), $_GET['type']));
- 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')) {
+ displayMessage(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 OR `assigned_admin` IS NULL) 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')));
+ displayMessage(getMaskedMessage('ADMIN_TASK_UNKNOWN_MODE', getRequestParameter('type')));
+ break;
+} // END - switch
+
+if (!empty($whereStatement)) {
+ if ((isPostRequestParameterSet('assign')) && (ifPostContainsSelections())) {