Example #1
0
        $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);
                    $TMP_SOMENAME_CONTENT = bin2hex(fread($fp, $TMP_SOMENAME_SIZE));
                    $success = execute_sqlInsert('attachments', array('workid' => $WORK_ID, 'uploadname' => $upload_filename, 'uploadedby' => $SUBDOMAIN_USER, 'filecontent' => $TMP_SOMENAME_CONTENT, 'filesize' => $TMP_SOMENAME_SIZE, 'uploadedOn' => $tmp_uploadedOn));
                    fclose($fp);
                    unlink($TMP_SOMENAME);
                }
            }
        }
    }
}
if ($before_underscore == 'notes') {
    $manageNotes = new manageNotes();
    $manageNotes->USERNAME = $SUBDOMAIN_USER;
    $note_body = "{$thisemail_subject} \n --------------------- \n {$thisemail_body} ";
    $manageNotes->insertNote($note_body);
}
$processemail_debugoutput = " \n before_underscore is {$before_underscore} ";
// email $processemail_debugoutput to your email id to see the debug information
exit(0);
Example #2
0
     $nid = get_POST_var('noteId');
     $emailTo = get_POST_var('emailTo');
     $manageNotes = new manageNotes();
     $note_content = $manageNotes->getNoteWithID($nid);
     $email = new sendaMail();
     $email->messageTo($emailTo);
     $email->subject("Note from Discrete Events");
     $email->body($note_content);
     $email->send();
     send_Action_Response('Success', "Note Emailed !");
     exit;
     break;
 case 'UpdateNote':
     $nid = get_POST_var('noteId');
     $updatedContent = get_POST_var('updatedContent');
     $manageNotes = new manageNotes();
     $manageNotes->updateNote($nid, $updatedContent);
     send_Action_Response('Success', "Note Updated !");
     exit;
     break;
 case 'editTaskField':
     $workid = get_POST_var('workid');
     $fieldName = get_POST_var('fieldName');
     $fieldValue = get_POST_var('fieldValue');
     if (!checkPermissions_canUserEditTask($USERNAME, $workid)) {
         send_Action_Response('Fail', 'insufficient privilege !');
         return;
     }
     switch ($fieldName) {
         case 'userAssigned':
             $actualFieldName = 'work_userAssigned';