Example #1
0
 $newrec = array_merge($newrec, ppGetData($mytextvars, false, 'POST', 'text'));
 // Integer only Variables
 $myintvars = array('priority_id', 'duration', 'duration_type_id', 'status_id', 'progress_id', 'progress', 'resource', 'parent_task');
 $newrec = array_merge($newrec, ppGetData($myintvars, false, 'POST', 'int'));
 // Basic Text Variables which should not contain quote's or other special characters
 $myvars = array('start_date', 'estimated_end_date', 'actual_end_date', 'planned_end_date', 'last_updated_date', 'notification_enabled_flag', 'make_private_enabled_flag');
 $newrec = array_merge($newrec, ppGetData($myvars, false, 'POST'));
 // Convert Date to a timestamp
 $newrec['start_date'] = pm_convertdate($newrec['start_date']);
 $newrec['estimated_end_date'] = pm_convertdate($newrec['estimated_end_date']);
 if ($newrec['actual_end_date'] == '') {
     $newrec['actual_end_date'] = $newrec['estimated_end_date'];
 } else {
     $newrec['actual_end_date'] = pm_convertdate($newrec['actual_end_date']);
 }
 $newrec['planned_end_date'] = pm_convertdate($newrec['planned_end_date']);
 $newrec['create_date'] = pm_getdate();
 $newrec['last_updated_date'] = pm_getdate();
 if ($newrec['actual_end_date'] < $newrec['start_date']) {
     $newrec['actual_end_date'] = $newrec['start_date'] + 604800;
     //add 1 week to the start date...
 }
 if ($newrec['estimated_end_date'] < $newrec['start_date']) {
     $newrec['estimated_end_date'] = $newrec['start_date'] + 604800;
     //add 1 week to the start date...
 }
 $newrec['tid'] = prj_insertTask($pid, $parent_task);
 // Insert the new record and update the lhs and rhs values
 prj_updateTask($newrec);
 // Update the new record values
 if (empty($newrec['resource'])) {
Example #2
0
 $_CLEAN = array_merge($_CLEAN, ppGetData($mytextvars, false, 'POST', 'text'));
 // Integer only Variables
 $myintvars = array('priority', 'status', 'progress', 'objective', 'percent', 'location', 'department', 'category', 'resources', 'department');
 $_CLEAN = array_merge($_CLEAN, ppGetData($myintvars, false, 'POST', 'int'));
 // Basic Text Variables which should not contain quote's or other special characters
 $myvars = array('start_date', 'estimated_end_date', 'actual_end_date', 'notification', 'document', 'forum', 'private', 'template');
 $_CLEAN = array_merge($_CLEAN, ppGetData($myvars, false, 'POST'));
 $uid = $_USER['uid'];
 $_CLEAN['percent'] = $_CLEAN['percent'] < 0 ? 0 : $_CLEAN['percent'] > 100 ? 100 : $_CLEAN['percent'];
 $_CLEAN['createdate'] = pm_getdate();
 $_CLEAN['startdate'] = pm_convertdate($_CLEAN['start_date']);
 $_CLEAN['estimateddate'] = pm_convertdate($_CLEAN['estimated_end_date']);
 if ($_CLEAN['actual_end_date'] == '') {
     $_CLEAN['actual_end_date'] = $_CLEAN['estimated_end_date'];
 } else {
     $_CLEAN['actual_end_date'] = pm_convertdate($_CLEAN['actual_end_date']);
 }
 if ($_CLEAN['actual_end_date'] < $_CLEAN['startdate']) {
     $_CLEAN['actual_end_date'] = $_CLEAN['startdate'] + 604800;
     //add 1 week to the start date...
 }
 if ($_CLEAN['estimateddate'] < $_CLEAN['startdate']) {
     $_CLEAN['estimateddate'] = $_CLEAN['startdate'] + 604800;
     //add 1 week to the start date...
 }
 $_CLEAN['document'] = $_CLEAN['document'] == 'Y' ? 'Y' : 'N';
 $_CLEAN['forum'] = $_CLEAN['forum'] == 'Y' ? 'Y' : 'N';
 //randy's comments:
 //we're inserting a new blank project with the appropriate Parent ID
 //in order to retrieve back the next useful LHS and RHS values.
 //If there is a parent, then the LHS and RHS need to have valid values