<?php /* * Copyright (C) 2006-2011 Alex Lance, Clancy Malcolm, Cyber IT Solutions * Pty. Ltd. * * This file is part of the allocPSA application <*****@*****.**>. * * allocPSA is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * allocPSA is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public * License for more details. * * You should have received a copy of the GNU Affero General Public License * along with allocPSA. If not, see <http://www.gnu.org/licenses/>. */ define("NO_REDIRECT", 1); require_once "../alloc.php"; usleep(400000); echo project::get_list_dropdown($_GET["projectType"]);
function load_task_filter($_FORM) { $current_user =& singleton("current_user"); $db = new db_alloc(); // Load up the forms action url $rtn["url_form_action"] = $_FORM["url_form_action"]; $rtn["hide_field_options"] = $_FORM["hide_field_options"]; //time Load up the filter bits has("project") and $rtn["projectOptions"] = project::get_list_dropdown($_FORM["projectType"], $_FORM["projectID"]); $_FORM["projectType"] and $rtn["projectType_checked"][$_FORM["projectType"]] = " checked"; $ops = array("0" => "Nobody"); $rtn["personOptions"] = page::select_options($ops + person::get_username_list($_FORM["personID"]), $_FORM["personID"]); $rtn["managerPersonOptions"] = page::select_options($ops + person::get_username_list($_FORM["managerID"]), $_FORM["managerID"]); $rtn["creatorPersonOptions"] = page::select_options(person::get_username_list($_FORM["creatorID"]), $_FORM["creatorID"]); $rtn["all_tags"] = task::get_tags(true); $rtn["tags"] = $_FORM["tags"]; $taskType = new meta("taskType"); $taskType_array = $taskType->get_assoc_array("taskTypeID", "taskTypeID"); $rtn["taskTypeOptions"] = page::select_options($taskType_array, $_FORM["taskTypeID"]); $_FORM["taskView"] and $rtn["taskView_checked_" . $_FORM["taskView"]] = " checked"; $taskStatii = task::get_task_statii_array(); $rtn["taskStatusOptions"] = page::select_options($taskStatii, $_FORM["taskStatus"]); $_FORM["showDescription"] and $rtn["showDescription_checked"] = " checked"; $_FORM["showDates"] and $rtn["showDates_checked"] = " checked"; $_FORM["showCreator"] and $rtn["showCreator_checked"] = " checked"; $_FORM["showAssigned"] and $rtn["showAssigned_checked"] = " checked"; $_FORM["showTimes"] and $rtn["showTimes_checked"] = " checked"; $_FORM["showPercent"] and $rtn["showPercent_checked"] = " checked"; $_FORM["showPriority"] and $rtn["showPriority_checked"] = " checked"; $_FORM["showTaskID"] and $rtn["showTaskID_checked"] = " checked"; $_FORM["showManager"] and $rtn["showManager_checked"] = " checked"; $_FORM["showProject"] and $rtn["showProject_checked"] = " checked"; $_FORM["showTags"] and $rtn["showTags_checked"] = " checked"; $_FORM["showParentID"] and $rtn["showParentID_checked"] = " checked"; $arrow = " -->"; $taskDateOps = array("" => "", "new" => "New Tasks", "due_today" => "Due Today", "overdue" => "Overdue", "d_created" => "Date Created" . $arrow, "d_assigned" => "Date Assigned" . $arrow, "d_targetStart" => "Estimated Start" . $arrow, "d_targetCompletion" => "Estimated Completion" . $arrow, "d_actualStart" => "Date Started" . $arrow, "d_actualCompletion" => "Date Completed" . $arrow); $rtn["taskDateOptions"] = page::select_options($taskDateOps, $_FORM["taskDate"], 45, false); if (!in_array($_FORM["taskDate"], array("new", "due_today", "overdue"))) { $rtn["dateOne"] = $_FORM["dateOne"]; $rtn["dateTwo"] = $_FORM["dateTwo"]; } $task_num_ops = array("" => "All results", 1 => "1 result", 2 => "2 results", 3 => "3 results", 4 => "4 results", 5 => "5 results", 10 => "10 results", 15 => "15 results", 20 => "20 results", 30 => "30 results", 40 => "40 results", 50 => "50 results", 100 => "100 results", 150 => "150 results", 200 => "200 results", 300 => "300 results", 400 => "400 results", 500 => "500 results", 1000 => "1000 results", 2000 => "2000 results", 3000 => "3000 results", 4000 => "4000 results", 5000 => "5000 results", 10000 => "10000 results"); $rtn["limitOptions"] = page::select_options($task_num_ops, $_FORM["limit"]); // unset vars that aren't necessary foreach ((array) $_FORM as $k => $v) { if (!$v) { unset($_FORM[$k]); } } // Get $rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM)); return $rtn; }