Пример #1
0
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);
        }
    }
}
Пример #2
0
 * 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") {
                // Can't set self to be parent
                if ($_POST["parentTaskID"] != $task->get_id()) {
                    $task->set_value("parentTaskID", $_POST["parentTaskID"]);
                }