Example #1
0
 public function __construct()
 {
     parent::__construct();
     trigger_error("CProjectDesignerOptions has been deprecated in v3.0 and will be removed by v4.0. Please use CProjectDesigner instead.", E_USER_NOTICE);
 }
<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// @todo    refactor to use a core controller
global $AppUI;
$perms =& $AppUI->acl();
if (!canAdd('tasks')) {
    $AppUI->redirect(ACCESS_DENIED);
}
//Lets store the panels view options of the user:
$pdo = new CProjectDesigner();
$pdo->bind($_POST);
$pdo->store();
//Lets store the task lines
$elements = $_POST;
$project_id = (int) w2PgetParam($_POST, 'project', 0);
$taskErrors = array();
foreach ($elements as $element => $on) {
    if (substr($element, 0, 14) == 'add_task_line_' && $on != '') {
        $tline = new CTask();
        //TODO: clean this whole thing up..
        $tline->task_id = 0;
        $tline->task_name = $elements['add_task_name_' . $on];
        $tline->task_project = $project_id;
        $start_date = '';
        if ($elements['add_task_start_date_' . $on]) {
            $date = new w2p_Utilities_Date($elements['add_task_start_date_' . $on]);
            $start_date = $date->format(FMT_DATETIME_MYSQL);
            $start_date = $AppUI->convertToSystemTZ($start_date);