function caldateTS_to_humanWithTS($caldatets, $shorthour = false) { // $caldatets = 'YYYY-mm-dd hr:m:s' if (!$caldatets) { return ''; } $pieces = explode(" ", $caldatets); $tmp_datepart = $pieces[0]; $tmp_timepart = $pieces[1]; $hms = explode(":", $tmp_timepart); if ($shorthour) { $tmp_timestring = @date(" ga", mktime($hms[0], $hms[1], 0, 1, 1, 2000)); } else { $tmp_timestring = @date(" g:i a", mktime($hms[0], $hms[1], 0, 1, 1, 2000)); } return caldate_to_human($tmp_datepart) . ', ' . $tmp_timestring; // }
$selectedYear = @$_GET['year'] ? $_GET['year'] : date('Y'); $sqlquery = "select jid,task_day, task_mins, task_desc, DATE(task_enteredon) as task_enteredDate , projectName from VIEW_journals_human where task_user='******' and MONTH(task_day)='{$selectedMonth}' and YEAR(task_day)='{$selectedYear}' order by task_day DESC"; } else { $sqlquery = "select jid,task_day, task_mins, task_desc, DATE(task_enteredon) as task_enteredDate , projectName from VIEW_journals_human where task_user='******' order by task_day DESC LIMIT 70"; } $query = mysql_query($sqlquery) or die("Invalid query: " . mysql_error()); while ($row = @mysql_fetch_array($query)) { // extract($row) ; // $pkgId $trclass = $trclass == 'even' ? 'odd' : 'even'; ?> <TR class='<?php echo $trclass; ?> '> <td align='center' valign='top'><?php echo caldate_to_human($row['task_day']); ?> </td> <td class='mins' align='right' valign='top'> <span style='margin-left:10px;'><?php echo $row['task_mins']; ?> mins<span> </td> <td valign='top'><?php echo $row['task_desc']; ?> </td> <?php if ($row['task_enteredDate'] == date('Y-m-d')) { echo "<td align=center valign='top'>\n\t\t\t\t\t\t\t<span class='blueTextButtonSmall' onclick=\"do_deleteTask('" . $row['jid'] . "')\">Delete</span>\n\t\t\t\t\t\t\t</td>";
</TD> <TD class='evenrow'>Deadline :</TD> <TD class='evenrow'> <?php if ($taskDetails["work_addedBy"] == $USERNAME) { ?> <span class="editspan" fieldname="deadLine"><?php echo caldate_to_human($taskDetails["work_deadLine"]); ?> </span> <?php } else { ?> <?php echo caldate_to_human($taskDetails["work_deadLine"]); ?> <?php } ?> <div style="display:none;" class="editdiv" fieldname="deadLine"> <input size=10 class='date_input' id='editinput_deadLine' value="<?php echo $taskDetails["work_deadLine"]; ?> "> <span class='bluebuttonSmall updatespan' fieldname="deadLine">update</span> <span class='bluebuttonSmall cancelspan' fieldname="deadLine">cancel</span> </div> </TD>
public function listWorksClosed() { global $DE_GLOBALS_WORK_CLOSED; if (!$this->formedsql) { $this->formSqlSelector(); } $sqltoExecute = "select * from WORKS where work_status = '{$DE_GLOBALS_WORK_CLOSED}' {$this->sql_closedTasks} {$this->sqlselector}"; //echo "<BR><BR>$sqltoExecute<BR><BR>"; $query = mysql_query($sqltoExecute) or die("Invalid query: " . mysql_error()); $wcCount = @mysql_num_rows($query); if ($wcCount == 0) { echo "<center><div onclick='ManageTasksJsFunction.allClosedThisYear();' class='linkTextButton' style='margin-top:10px;'>Show all tasks closed this year</div></center>"; echo "<center><div onclick=\"ManageTasksJsFunction.allClosedThisYear('all');\" class='linkTextButton' style='margin-top:10px;'>Show all closed tasks </div></center>"; return; } ?> <div class='listclosedtasks'><span onclick="var ckval = String(jQuery('.WorksClosedTable').is(':hidden')); My_JsLibrary.cookies.setCookie( 'WCLT' , ckval ); $('.WorksClosedTable').toggle();"><?php echo "Closed Tasks {$this->closedTasksPeriod} ({$wcCount})"; ?> </span></div> <table align=center cellpadding=0 cellspacing=0 class="WorksClosedTable"> <TR><TD class="firstRow" width="110" align='right' style='cursor:pointer;' onclick="My_JsLibrary.updatePageWithGetVar('sortby', 'workID');"> <span style='margin-right:20px;'>Task ID<?php if ($this->orderbyfield == 'workID') { echo ' ↓'; } ?> </span> </TD> <TD class="firstRow" width="125" style='cursor:pointer;' onclick="My_JsLibrary.updatePageWithGetVar('sortby', 'work_userAssigned');"> Assigned To<?php if ($this->orderbyfield == 'work_userAssigned') { echo ' ↓'; } ?> </TD> <?php if (!$this->PersonalTasks) { ?> <TD class="firstRow" width="145" style='cursor:pointer;' onclick="My_JsLibrary.updatePageWithGetVar('sortby', 'work_projectName');"> Project Name<?php if ($this->orderbyfield == 'work_projectName') { echo ' ↓'; } ?> </TD> <?php } ?> <TD class="firstRow" style='cursor:pointer;' onclick="My_JsLibrary.updatePageWithGetVar('sortby', 'work_priority');"> Task Description<?php if ($this->orderbyfield == 'work_priority') { echo ' ↓'; } ?> </TD> <TD class="firstRow" style='cursor:pointer;' onclick="My_JsLibrary.updatePageWithGetVar('sortby', 'work_closedDate');" width="125">Closed On<?php if ($this->orderbyfield == 'work_closedDate') { echo ' ↓'; } ?> </TD> <TD class="firstRow" style='cursor:pointer;' onclick="My_JsLibrary.updatePageWithGetVar('sortby', 'work_deadLine');" width="110"> Deadline<?php if ($this->orderbyfield == 'work_deadLine') { echo ' ↓'; } ?> </TD> </TR> <?php $tdclass = "oddrow"; $tmp_manageWorks = new manageWorks(); while ($row = @mysql_fetch_array($query)) { extract($row); $tdclass = $tdclass == "oddrow" ? 'evenrow' : 'oddrow'; // `workID`, `work_userAssigned`, `work_addedBy`, `work_dateAdded`, `work_deadLine`, `work_startDate`, `work_completeDate`, // `work_briefDesc`, `work_Notes`, `work_status`, `work_priority`, `work_projectName`, `work_isPrivate`, if ($work_priority == 'H') { $work_briefDesc = HIGHPRIORITYAPPENDSTRING . $work_briefDesc; } elseif ($work_priority == 'L') { $work_briefDesc = LOWPRIORITYAPPENDSTRING . $work_briefDesc; } $work_briefDesc = $work_briefDesc ? $work_briefDesc : 'No Description'; ?> <TR><TD align='center' class='<?php echo $tdclass; ?> '> <span style='float:right; margin-right:10px;'><?php echo $workID; ?> </span> <?php if ($tmp_manageWorks->taskHasAttachments($workID)) { echo "<img src='/images/attach1.gif' width=15 height=15 border=0 class='image_attachment' taskid='" . $workID . "'>"; } ?> <span style='float:right; margin-right:5px;'> <img src='/images/letter.png' border=0 class='emailTaskBescImg' title='e-mail task description' taskid='<?php echo $workID; ?> '> </span> </TD> <TD class='<?php echo $tdclass; ?> AssignedUser' style='cursor:default;' assignedto='<?php echo $work_userAssigned; ?> ' assignedby='<?php echo $work_addedBy; ?> '> <?php if ($work_addedBy == $_SESSION["uname"] && $work_userAssigned == $_SESSION["uname"]) { echo "<i>Self</i>"; } else { $str_work_userAssigned = $work_userAssigned; $str_work_addedBy = $work_addedBy; if ($work_addedBy == $_SESSION["uname"]) { $str_work_addedBy = YOUSTRING; } if ($work_userAssigned == $_SESSION["uname"]) { $str_work_userAssigned = YOUSTRING; } echo "{$str_work_userAssigned}←{$str_work_addedBy}"; } ?> </TD> <?php if (!$this->PersonalTasks) { echo "<TD class='{$tdclass}'>{$work_projectName}</TD>"; } ?> <TD class='<?php echo $tdclass; ?> OMOhilitLink' onclick="ManageTasksJsFunction.detailsWork('<?php echo $workID; ?> ');" TITLE="<?php echo $work_Notes; ?> "> <?php if ($tmp_manageWorks->taskHasNewComments($workID)) { echo "<img src='/images/newcommentsblue.png' width=15 height=15 border=0 class='image_newcomments'>"; } ?> <?php if ($work_RTID) { echo "<img src='/images/rt.png' border=0 width='31' height='15'>"; } echo getNwordsOfLengthFromString(stripslashes($work_briefDesc), 90); ?> </TD> <TD class='<?php echo $tdclass; ?> '> <NOBR> <?php echo caldateTS_to_humanWithOutTS($work_closedDate); ?> </NOBR> </TD> <TD class='<?php echo $tdclass; ?> '> <NOBR> <?php echo caldate_to_human($work_deadLine, true); ?> </NOBR> </TD> </TR> <?php } echo "</table>"; if ($this->closedTasksPeriod != 'in this Year') { echo "<center><div onclick='ManageTasksJsFunction.allClosedThisYear();' class='linkTextButton' style='margin-top:10px;'>Show all tasks closed this year</div></center>"; echo "<center><div onclick=\"ManageTasksJsFunction.allClosedThisYear('all');\" class='linkTextButton' style='margin-top:10px;'>Show all closed tasks </div></center>"; } }
if ($daysb4deadline > 0) { $work_status = $DE_GLOBALS_WORK_SCHEDULED; } if ($onCompletionOf > 0) { $work_status = $DE_GLOBALS_WORK_TASKONTASK; } $manageWorks = new manageWorks(); $manageWorks->newWork(array(work_userAssigned => $userassigned, work_addedBy => $USERNAME, work_deadLine => $deadline, work_briefDesc => $briefDesc, work_Notes => $notes, work_status => $work_status, work_priority => $priority, work_projectName => $projectName, work_isPrivate => $isprivate, daysb4deadline => $daysb4deadline, afterCompletionID => $onCompletionOf)); $this_taskid = mysql_insert_id(); $COMMENTLOGMESSAGE = "<B>{$USERNAME}</B> Created New Task -- User Assigned:{$userassigned}, DeadLine:{$deadline}, Project:{$projectName}, Appear {$daysb4deadline} days before deadline, Appear after completion of task {$onCompletionOf}"; $manageWorks->addComment($this_taskid, APPNAME, $COMMENTLOGMESSAGE); if ($nutask_notify == 'Y') { $tmp_notify_subject = "[#DE New Task] TN{$this_taskid} created by user {$USERNAME} under project '{$projectName}'"; $tmp_email_body = array(); $tmp_email_body[] = "Task Description: {$briefDesc}"; $tmp_email_body[] = "Task Deadline: " . caldate_to_human($deadline); $tmp_email_body[] = "Task URL : http://{$_SESSION['subdomain']}.discreteevents.com/taskdetails.php?taskid={$this_taskid} "; if ($notes) { $tmp_email_body[] = "Task Notes: {$notes}"; } $tmp_notify_body = implode("<BR>", $tmp_email_body); NotifyEventEmail($userassigned, $USERNAME, $tmp_notify_subject, $tmp_notify_body); } send_Action_Response('Success', "Task number '{$this_taskid}' Created !"); exit; break; case 'startTask': $workid = get_POST_var('workid'); $manageWorks = new manageWorks(); $manageWorks->startWork($workid); $manageWorks->updateWork($workid, array(work_hasbeenReset => 'N'));