* @param int The group project ID
* @param int The starting month
* @param int The starting day
+ * @param int The starting year
+ * @param int The starting hour
+ * @param int The starting minute
* @param int The ending month
* @param int The ending day
* @param int The ending year
- * @param string The task summary
- * @param string Details of the task
+ * @param int The ending hour
+ * @param int The ending minute
+ * @param string The task summary
+ * @param string Details of the task
* @param int The completed percentage of the task
* @param int The task priority
* @param int The number of hours exptected to complete this task
* @returns Nnew project_task_id or false and $feedback
*
*/
-function pm_data_create_task ($group_project_id,$start_month,$start_day,$start_year,$end_month,$end_day,
- $end_year,$summary,$details,$percent_complete,$priority,$hours,$assigned_to,$dependent_on) {
+function pm_data_create_task ($group_project_id,$start_month,$start_day,$start_year,$start_hour,$start_minute,$end_month,$end_day,
+ $end_year,$end_hour,$end_minute,$summary,$details,$percent_complete,$priority,$hours,$assigned_to,$dependent_on) {
global $feedback;
if (!$group_project_id || !$start_month || !$start_day || !$start_year || !$end_month || !$end_day ||
return false;
}
- if (mktime(0,0,0,$start_month,$start_day,$start_year) > mktime(0,0,0,$end_month,$end_day,$end_year)) {
+ if (mktime($start_hour,$start_minute,0,$start_month,$start_day,$start_year) > mktime($end_hour,$end_minute,0,$end_month,
+ $end_day,$end_year)) {
exit_error('Error','End Date Must Be Greater Than Begin Date');
}
"priority,hours,start_date,end_date,".
"created_by,status_id) VALUES ('$group_project_id','".htmlspecialchars($summary)."',".
"'".htmlspecialchars($details)."','$percent_complete','$priority','$hours','".
- mktime(0,0,0,$start_month,$start_day,$start_year)."','".
- mktime(0,0,0,$end_month,$end_day,$end_year)."','".user_getid()."','1')";
+ mktime($start_hour,$start_minute,0,$start_month,$start_day,$start_year)."','".
+ mktime($end_hour,$end_minute,0,$end_month,$end_day,$end_year)."','".user_getid()."','1')";
db_begin();
*
*/
function pm_data_update_task ($group_project_id,$project_task_id,$start_month,$start_day,$start_year,
- $end_month,$end_day,$end_year,$summary,$details,$percent_complete,$priority,$hours,
- $status_id,$assigned_to,$dependent_on,$new_group_project_id,$group_id) {
+ $start_hour,$start_minute,$end_month,$end_day,$end_year,$end_hour,$end_minute,$summary,$details,$percent_complete,
+ $priority,$hours,$status_id,$assigned_to,$dependent_on,$new_group_project_id,$group_id) {
global $feedback;
if (!$group_project_id || !$project_task_id || !$status_id || !$start_month || !$start_day || !$start_year ||
!$end_month || !$end_day || !$end_year || !$summary || !$priority || !$new_group_project_id || !$group_id ||
- !$start_hour || !$end_hour ) {
- $feedback .= ' ERROR - Missing Parameters ';
+ !$start_hour || !$start_minute || !$end_hour || !$end_minute) {
+ $feedback .= ' ERROR - Missing Parameters: YEah! ';
return false;
}
$sql="SELECT * FROM project_task WHERE project_task_id='$project_task_id' AND group_project_id='$group_project_id'";
/*
Enforce start date > end date
*/
- if (mktime($start_hour,0,0,$start_month,$start_day,$start_year) > mktime($end_hour,0,0,$end_month,$end_day,$end_year)) {
+ if (mktime($start_hour,$start_minute,0,$start_month,$start_day,$start_year) > mktime($end_hour,$end_minute,0,$end_month,$end_day,$end_year)) {
$feedback .= ' ERROR - End Date Must Be Greater Than Start Date ';
return false;
}
if (db_result($result,0,'hours') != $hours)
{ pm_data_create_history ('hours',db_result($result,0,'hours'),$project_task_id); }
- if (db_result($result,0,'start_date') != mktime($start_hour,0,0,$start_month,$start_day,$start_year))
+ if (db_result($result,0,'start_date') != mktime($start_hour,$start_minute,0,$start_month,$start_day,$start_year))
{ pm_data_create_history ('start_date',db_result($result,0,'start_date'),$project_task_id); }
- if (db_result($result,0,'end_date') != mktime($end_hour,0,0,$end_month,$end_day,$end_year))
+ if (db_result($result,0,'end_date') != mktime($end_hour,$end_minute,0,$end_month,$end_day,$end_year))
{ pm_data_create_history ('end_date',db_result($result,0,'end_date'),$project_task_id); }
/*
*/
$sql="UPDATE project_task SET status_id='$status_id', priority='$priority',".
"summary='".htmlspecialchars($summary)."',start_date='".
- mktime($start_hour,0,0,$start_month,$start_day,$start_year)."',end_date='".
- mktime($end_hour,0,0,$end_month,$end_day,$end_year)."',hours='$hours',".
+ mktime($start_hour,$start_minute,0,$start_month,$start_day,$start_year)."',end_date='".
+ mktime($end_hour,$end_minute,0,$end_month,$end_day,$end_year)."',hours='$hours',".
"percent_complete='$percent_complete', ".
"group_project_id='$new_group_project_id' ".
"WHERE project_task_id='$project_task_id' AND group_project_id='$group_project_id'";
case 'postaddtask' : {
if (user_isloggedin() && $perm->isPMAdmin()) {
if (pm_data_create_task ($group_project_id,$start_month,$start_day,$start_year,
- $start_hour,$end_month,$end_day,$end_year,
- $end_hour,$summary,$details,$percent_complete,
+ $start_hour,$start_minute,$end_month,$end_day,$end_year,
+ $end_hour,$end_minute,$summary,$details,$percent_complete,
$priority,$hours,$assigned_to,$dependent_on)) {
$feedback='Task Created Successfully';
include '../pm/browse_task.php';
case 'postmodtask' : {
if (user_isloggedin() && $perm->isPMAdmin()) {
if (pm_data_update_task ($group_project_id,$project_task_id,$start_month,$start_day,
- $start_year,$start_hour,$end_month,$end_day,$end_year,$end_hour,
- $summary,$details,$percent_complete,$priority,$hours,$status_id,$assigned_to,
- $dependent_on,$new_group_project_id,$group_id)) {
+ $start_year,$start_hour,$start_minute,$end_month,$end_day,$end_year,$end_hour,
+ $end_minute,$summary,$details,$percent_complete,$priority,$hours,$status_id,
+ $assigned_to,$dependent_on,$new_group_project_id,$group_id)) {
$feedback='Task Updated Successfully';
include '../pm/browse_task.php';
} else {