function render() { global $TPL; $defaults = array("showHeader" => true, "showTaskID" => true, "taskView" => "prioritised", "showStatus" => "true", "url_form_action" => $TPL["url_alloc_home"], "form_name" => "taskListHome_filter"); $current_user =& singleton("current_user"); if (!$current_user->prefs["taskListHome_filter"]) { $defaults["taskStatus"] = "open"; $defaults["personID"] = $current_user->get_id(); $defaults["showStatus"] = true; $defaults["showProject"] = true; $defaults["limit"] = 10; $defaults["applyFilter"] = true; } $_FORM = task::load_form_data($defaults); $TPL["taskListRows"] = task::get_list($_FORM); $TPL["_FORM"] = $_FORM; return true; }
function show_projects($template_name) { global $TPL; global $default; $_FORM = task::load_form_data($defaults); $arr = task::load_task_filter($_FORM); is_array($arr) and $TPL = array_merge($TPL, $arr); if (is_array($_FORM["projectID"])) { $projectIDs = $_FORM["projectID"]; foreach ($projectIDs as $projectID) { $project = new project(); $project->set_id($projectID); $project->select(); $_FORM["projectID"] = array($projectID); $TPL["graphTitle"] = urlencode($project->get_value("projectName")); $arr = task::load_task_filter($_FORM); is_array($arr) and $TPL = array_merge($TPL, $arr); include_template($template_name); } } }
* 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/>. */ require_once "../alloc.php"; $TPL["main_alloc_title"] = "Task List - " . APPLICATION_NAME; $defaults = array("showHeader" => true, "showTaskID" => true, "showEdit" => true, "taskView" => "byProject", "showStatus" => "true", "showTotals" => "true", "padding" => 1, "url_form_action" => $TPL["url_alloc_taskList"], "form_name" => "taskList_filter"); // Load task list $_FORM = task::load_form_data($defaults); $TPL["taskListRows"] = task::get_list($_FORM); $TPL["_FORM"] = $_FORM; // Load filter $arr = task::load_task_filter($_FORM); is_array($arr) and $TPL = array_merge($TPL, $arr); // Check for updates if ($_POST["mass_update"]) { if ($_POST["select"]) { $allowed_auto_fields = array("dateTargetStart", "dateTargetCompletion", "dateActualStart", "dateActualCompletion", "managerID", "timeLimit", "timeBest", "timeWorst", "timeExpected", "priority", "taskTypeID", "taskStatus", "personID"); foreach ($_POST["select"] as $taskID => $selected) { $task = new task(); $task->set_id($taskID); $task->select(); // Special case: projectID and parentTaskID have to be done together if ($_POST["update_action"] == "projectIDAndParentTaskID") {