예제 #1
0
 /**
  * Overriding add() method from the parent class
  */
 function add()
 {
     $do_NoteDraft = new NoteDraft();
     $idnote_draft = $do_NoteDraft->isDraftExist($this->idproject_task, 'project_discuss');
     if ($idnote_draft) {
         $do_NoteDraft->getId($idnote_draft);
         $do_NoteDraft->delete();
     }
     if (get_magic_quotes_gpc()) {
         $project_discuss = $this->discuss;
     } else {
         $project_discuss = addslashes($this->discuss);
     }
     $this->query("INSERT INTO project_discuss (idproject_task,discuss,date_added,document,hours_work,iduser,discuss_edit_access,type)\n                      VALUES \n                      (" . $this->idproject_task . ",'" . $project_discuss . "','" . $this->date_added . "','" . $this->document . "'," . $this->hours_work . "," . $this->iduser . ",'" . $this->discuss_edit_access . "','Note')");
     $this->setPrimaryKeyValue($this->getInsertId($this->getTable(), $this->getPrimaryKey()));
 }
예제 #2
0
 /**
  * eventFormatNoteInsert
  * This event format the note upon insert in the database.
  * Should be run before eventAdd or eventUpdate
  * It will modify the event_controler values.
  */
 function eventFormatNoteInsert(EventControler $event_controler)
 {
     $Parsedown = new Parsedown();
     $do_NoteDraft = new NoteDraft();
     $idnote_draft = $do_NoteDraft->isDraftExist($this->idcontact, 'contact_note');
     if ($idnote_draft) {
         $do_NoteDraft->getId($idnote_draft);
         $do_NoteDraft->delete();
     }
     $fields = $event_controler->fields;
     $fields['note'] = $Parsedown->text(htmlentities($fields['note']));
     $event_controler->fields = $fields;
 }
예제 #3
0
$do_task_category = new TaskCategory();
$do_contact_task = new Contact();
if ($do_contact->isContactRelatedToUser($idcontact)) {
    $contact_access = true;
    $do_contact->getContactDetails($idcontact);
    $do_contact->setBreadcrumb();
    // Set this contact in the session so it can be edited on the contact_edit.php page.
    $do_contact->sessionPersistent("ContactEditSave", "contact.php", OFUZ_TTL);
} else {
    $contact_access = false;
}
// For the ajax expend
$ContactNoteExpend = new ContactNotes($GLOBALS['conx']);
$ContactNoteExpend->sessionPersistent("ContactNoteExpend", "contacts.php", OFUZ_TTL);
if (!is_object($_SESSION['do_note_draft'])) {
    $do_note_draft = new NoteDraft();
    $do_note_draft->sessionPersistent("do_note_draft", "project.php", OFUZ_TTL);
}
/**
 * resetting the sql query limit start whenever this page is loaded
 */
if (is_object($_SESSION['ContactNotes'])) {
    $_SESSION['ContactNotes']->sql_qry_start = 0;
}
$pageTitle = $_SESSION['do_cont']->getContactFullName() . ' :: Ofuz';
include_once 'includes/header.inc.php';
?>

<script type="text/javascript">
//<![CDATA[