예제 #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);
예제 #2
0
파일: actions.php 프로젝트: pari/rand0m
         $ThisWorkDetails = $manageWorks->get_workDetails($workid);
         $userassigned = $ThisWorkDetails['work_userAssigned'];
         $userOwner = $ThisWorkDetails['work_addedBy'];
         $work_briefDesc = $ThisWorkDetails['work_briefDesc'];
         $OtherPerson = $USERNAME == $userassigned ? $userOwner : $userassigned;
         $tmp_notify_subject = "[#DE] new comment by {$USERNAME} on  '{$work_briefDesc}' ";
         $tmp_notify_body = " <BR> New Comment :<BR> <B> {$comment} </B>\n\t\t\t\t\t\t\t\t<BR> -------------------------------------------\n\t\t\t\t\t\t\t\t<BR> Quick link to task : http://{$_SESSION['subdomain']}.discreteevents.com/taskdetails.php?taskid={$workid} ";
         NotifyEventEmail($OtherPerson, $USERNAME, $tmp_notify_subject, $tmp_notify_body);
     }
     send_Action_Response('Success', "Comment Added !");
     exit;
     break;
 case 'AddNote':
     $newNote = get_POST_var('NewNoteText');
     $manageNotes = new manageNotes();
     $manageNotes->insertNote($newNote);
     send_Action_Response('Success', "Note Added !");
     exit;
     break;
 case 'DeleteNote':
     $nid = get_POST_var('noteId');
     $manageNotes = new manageNotes();
     $manageNotes->deleteNoteWithID($nid);
     send_Action_Response('Success', "Note Deleted !");
     exit;
     break;
 case 'EmailNote':
     $nid = get_POST_var('noteId');
     $emailTo = get_POST_var('emailTo');
     $manageNotes = new manageNotes();
     $note_content = $manageNotes->getNoteWithID($nid);