function Task_LogSystemComment($workID, $newComment) { $tmpwork = new manageWorks(); $tmpwork->addComment($workID, APPNAME, $newComment); }
<?php include_once "include_db.php"; include_once "include_functions.php"; $USERNAME = $_POST['username']; $USERPASS = $_POST['password']; if (!authenticateUser($USERNAME, $USERPASS)) { echo "Invalid Username or Password!"; exit; } else { $_SESSION["uname"] = $USERNAME; } $projectName = DEFAULTPERSONALPROJECT; $briefDesc = urldecode($_POST['newtask']); $deadline = getTomorrowCaldate(2); $manageWorks = new manageWorks(); $manageWorks->newWork(array(work_userAssigned => $USERNAME, work_addedBy => $USERNAME, work_deadLine => $deadline, work_briefDesc => $briefDesc, work_Notes => '', work_status => $DE_GLOBALS_WORK_NEW, work_priority => 'N', work_projectName => $projectName, work_isPrivate => 'Y', daysb4deadline => 0, afterCompletionID => 0)); $this_taskid = mysql_insert_id(); $COMMENTLOGMESSAGE = "<B>{$USERNAME}</B> Created New Task -- User Assigned:{$USERNAME}, DeadLine:{$deadline}, Project:{$projectName}"; $manageWorks->addComment($this_taskid, APPNAME, $COMMENTLOGMESSAGE); echo "Task '{$this_taskid}' Created !";
$reminder_emailSubject = "[Reminder] {$reminder_emailBody}"; if ($DEVELOPMENT_MODE) { echo "\n\t\t\t<PRE>\n\t\t\tIncoming Subject : {$thisemail_subject}\n\t\t\t-------------------------------------------\n\t\t\tReminder to : {$reminder_emailTo}\n\t\t\tReminder email body : {$reminder_emailBody}\n\t\t\tReminder email Subject : {$reminder_emailSubject}\n\t\t\tReminder email when : {$reminder_emailWhen}\n\t\t\tReminder email Hour : {$reminder_emailHour}\n\t\t\tSubdomain User : {$SUBDOMAIN_USER}\n\t\t\t</PRE>\n\t\t"; scheduleNewEmail_temp($reminder_emailTo, $reminder_emailBody, $reminder_emailSubject, $reminder_emailWhen, $reminder_emailHour, $SUBDOMAIN_USER); } else { scheduleNewEmail_temp($reminder_emailTo, $reminder_emailBody, $reminder_emailSubject, $reminder_emailWhen, $reminder_emailHour, $SUBDOMAIN_USER); } simpleEmail($thisemail_fromAddress, "Reminder Added", "Added Reminder on {$reminder_emailWhen}"); $processemail_debugoutput = "Added Reminder on {$reminder_emailWhen} \n for {$reminder_emailBody}"; } if ($before_underscore == 'comments') { if (preg_match('/TN(?<digit>\\d+)(.*)/i', $thisemail_subject, $matches)) { $manageWorks = new manageWorks(); // $matches[2] = trim($matches[2]); rest of the subject after 'TNXXX' $WORK_ID = $matches[1]; $manageWorks->addComment($WORK_ID, $SUBDOMAIN_USER, $thisemail_body); $processemail_debugoutput = "Added Comment to Task {$WORK_ID} \n Comment: {$thisemail_body} "; // If the email received has attachments , put attach those files to this task $attachments = $Parser->getAttachments(); if (count($attachments)) { $tmp_uploadedOn = get_currentPHPTimestamp(); foreach ($attachments as $attachment) { $upload_filename = $attachment->filename; $TMP_SOMENAME = '/tmp/' . getaRandomString(9); if ($fp = fopen($TMP_SOMENAME, 'w')) { while ($bytes = $attachment->read()) { fwrite($fp, $bytes); } fclose($fp); $fp = fopen($TMP_SOMENAME, 'r'); $TMP_SOMENAME_SIZE = filesize($TMP_SOMENAME);
case 'briefDesc': $actualFieldName = 'work_briefDesc'; break; case 'Notes': $actualFieldName = 'work_Notes'; break; case 'isPrivate': $actualFieldName = 'work_isPrivate'; $fieldValue = $fieldValue == 'yes' ? 'Y' : 'N'; break; } $somearray = array(); $somearray[$actualFieldName] = $fieldValue; $manageWorks = new manageWorks(); $manageWorks->updateWork($workid, $somearray); $manageWorks->addComment($workid, APPNAME, "<B>{$USERNAME}</B> updated field {$fieldName} to {$fieldValue}"); send_Action_Response('Success', "updated Task {$workid} !"); exit; break; case 'newRoutineTask': $nrt = get_POST_var('nrt'); $result = execute_sqlInsert("dailychecklist", array(username => $USERNAME, task => $nrt)); send_Action_Response('Success', "Note Routine task added !"); exit; break; case 'resetRoutineTasksStatus': $result = execute_sqlUpdate("dailychecklist", array(status => 'N'), array(username => $USERNAME)); send_Action_Response('Success', "Status Reset !"); exit; break; case 'updateTasksStatus':