Ejemplo n.º 1
0
       $do_contact->getUserContacts($_SESSION['do_coworker']->idcoworker);
       if($do_contact->getNumRows()){
       while($do_contact->next()){
       $co_workers[] = $do_->idcoworker;
       $user_picture = $do_contact->picture;
       $contact_id = $do_contact->idcontact;
       }
       }
 if($user_picture ==''){
       $user_pic="/images/empty_avatar.gif";
       }else{
       $user_pic="/dbimage/".$user_picture;
       }
 */
 $do_contact = new Contact();
 $do_contact->getContactPictureDetails($_SESSION['do_coworker']->idcoworker);
 if ($do_contact->getNumRows()) {
     if ($do_contact->picture != '') {
         $thumb_name = $_SERVER['DOCUMENT_ROOT'] . '/dbimage/thumbnail/' . $do_contact->picture;
         if (file_exists($thumb_name)) {
             $contact_picture = "/dbimage/thumbnail/" . $do_contact->picture;
         } else {
             $contact_picture = "/images/empty_avatar.gif";
         }
     } else {
         $contact_picture = '/images/empty_avatar.gif';
     }
     $contact_id = $do_contact->idcontact;
 }
 $do_user = new User();
 $username = $do_user->getUserLoginId($_SESSION['do_coworker']->idcoworker);
 /**
  *  Add the note to the workfeed
  *  Select all other Co-Worker on the project and push the note to them.
  *  Every Co-Worker in the project get the feed except the one posting the note.
  *  @param EventControler object
  */
 function eventAddFeed(EventControler $evtcl)
 {
     $prefix_note = $evtcl->block_unblock_flag == "Block" ? "<b>Task Block </b>" : "<b>Task Unblock </b>";
     $this->idproject_task = $evtcl->ofuz_idprojecttask;
     $this->discuss = $prefix_note . $evtcl->block_unblock_reason;
     $this->iduser = $_SESSION['do_User']->iduser;
     $this->idproject_discuss = $evtcl->idproject_discuss;
     $this->idproject = $_SESSION['do_project_task']->idproject;
     $this->block_unblock_flag = $evtcl->block_unblock_flag;
     $do_project = new Project();
     $do_project->getId($this->idproject);
     $this->project_name = $do_project->getProjectName();
     $user = new User();
     $user->getId($this->iduser);
     $this->user_full_name = $user->getFullName();
     $do_contact = new Contact();
     $do_contact->getContactPictureDetails($this->iduser);
     if ($do_contact->getNumRows()) {
         while ($do_contact->next()) {
             $this->user_picture = $do_contact->picture;
             $this->contact_id = $do_contact->idcontact;
         }
     }
     $do_proj_task_feed = new ProjectTask();
     $do_proj_task_feed->getProjectTaskDetails($this->idproject_task);
     $this->task_description = $do_proj_task_feed->task_description;
     if (strlen($this->discuss) > 200) {
         $this->discuss = substr($this->discuss, 0, 200);
         $this->more = True;
     } else {
         $this->more = False;
     }
     $do_project_sharing = new ProjectSharing();
     $project_users = $do_project_sharing->getCoWorkersAsArray($do_project);
     $project_users[] = $do_project->getProjectOwner();
     $users = array();
     foreach ($project_users as $project_user) {
         if ($_SESSION['do_User']->iduser != $project_user) {
             $users[] = $project_user;
         }
     }
     $this->addFeed($users);
 }
Ejemplo n.º 3
0
 $e_PrioritySort->addParam('goto', 'contact.php');
 $e_PrioritySort->addParam('idnote', $do_notes->idcontact_note);
 // Priority sort Ends here
 $star_title = $do_notes->priority > 0 ? 'Unstar this note' : 'Star this note to move it on top';
 $star_img_url = '<img src="/images/' . ($do_notes->priority > 0 ? 'star_priority.gif' : 'star_normal.gif') . '" class="star_icon" width="14" height="14" alt="' . _($star_title) . '" />';
 // Generate the delete event
 if (is_object($_SESSION["ContactNotes"])) {
     $e_note_del = new Event("ContactNotes->eventTempDelNoteById");
 }
 $e_note_del->addParam("goto", "contact.php");
 $e_note_del->addParam("id", $do_notes->idcontact_note);
 $e_note_del->addParam("context", "ContactNote");
 $del_img_url = _('delete ') . '<img src="/images/delete.gif" width="14px" height="14px" alt="" />';
 //delete event ends here
 $do_contact = new Contact();
 $do_contact->getContactPictureDetails($do_notes->iduser);
 if ($do_contact->getNumRows()) {
     if ($do_contact->picture != '') {
         $thumb_name = $_SERVER['DOCUMENT_ROOT'] . '/dbimage/thumbnail/' . $do_contact->picture;
         if (file_exists($thumb_name)) {
             $contact_picture = "/dbimage/thumbnail/" . $do_contact->picture;
         } else {
             $contact_picture = "/images/empty_avatar.gif";
         }
     } else {
         $contact_picture = '/images/empty_avatar.gif';
     }
     $contact_id = $do_contact->idcontact;
 }
 $user_name = $do_user->getUserNameByIdUser($do_notes->iduser);
 // Start displaying the note
 /**
  *  Add the note to the workfeed from drop box email 
  *  Select all other Co-Worker on the project and push the note to them.
  *  Every Co-Worker in the project get the feed except the one posting the note.
  *  @param EventControler object
  */
 function AddProjectDiscussFeedFromDropBox($idproject_task, $discuss, $iduser, $idproject_discuss, $idproject)
 {
     $this->idproject_task = $idproject_task;
     $this->discuss = $discuss;
     $this->iduser = $iduser;
     $this->idproject_discuss = $idproject_discuss;
     $this->idproject = $idproject;
     $do_project = new Project();
     $do_project->getId($this->idproject);
     $this->project_name = $do_project->getProjectName();
     $user = new User();
     $user->getId($this->iduser);
     $this->user_full_name = $user->getFullName();
     $do_contact = new Contact();
     $do_contact->getContactPictureDetails($this->iduser);
     if ($do_contact->getNumRows()) {
         while ($do_contact->next()) {
             $co_workers[] = $do_->idcoworker;
             $this->user_picture = $do_contact->picture;
             $this->contact_id = $do_contact->idcontact;
         }
     }
     $do_proj_task_feed = new ProjectTask();
     $do_proj_task_feed->getProjectTaskDetails($this->idproject_task);
     $this->task_description = $do_proj_task_feed->task_description;
     if (strlen($this->discuss) > 200) {
         $this->discuss = substr($this->discuss, 0, 200);
         $this->more = True;
     } else {
         $this->more = False;
     }
     $do_project_sharing = new ProjectSharing();
     $project_users = $do_project_sharing->getCoWorkersAsArray($do_project);
     $project_users[] = $do_project->getProjectOwner();
     $users = array();
     foreach ($project_users as $project_user) {
         if ($iduser != $project_user) {
             $users[] = $project_user;
         }
     }
     $this->addFeed($users);
 }
Ejemplo n.º 5
0
     $file = '<br /><a href="' . $file_url . '" target="_blank">' . $do_discuss->document . '</a>';
     //$file = '<br /><a href="/files_download.php?e=ProjectTask&id='.$idproject_task.'&file='.$do_discuss->document.'" target="_blank">'.$do_discuss->document.'</a>';
 }
 $item_text = $do_discuss->formatDiscussionItemDisplay($do_discuss->discuss, 500);
 //if (substr_count($item_text, '<br />') > 4) {
 //	$preview_item = preg_replace('/(.*?<br \/>.*?<br \/>.*?<br \/>.*?<br \/>)(.*)/','$1',str_replace("\n",'',$item_text)).' ';
 //} else if (strlen($item_text) > 500) {
 //    $preview_item = substr($item_text, 0, 500);
 //}
 // profile
 $do_user = new User();
 if ($do_discuss->iduser) {
     $added_by = $_SESSION['do_User']->getFullName($do_discuss->iduser);
     $user_name = $do_user->getUserNameByIdUser($do_discuss->iduser);
     $do_contact = new Contact();
     $do_contact->getContactPictureDetails($do_discuss->iduser);
     if ($do_contact->getNumRows()) {
         if ($do_contact->picture != '') {
             $thumb_name = $_SERVER['DOCUMENT_ROOT'] . '/dbimage/thumbnail/' . $do_contact->picture;
             if (file_exists($thumb_name)) {
                 $contact_picture = "/dbimage/thumbnail/" . $do_contact->picture;
             } else {
                 $contact_picture = "/images/empty_avatar.gif";
             }
         } else {
             $contact_picture = '/images/empty_avatar.gif';
         }
         $contact_id = $do_contact->idcontact;
     } else {
         $contact_picture = '/images/empty_avatar.gif';
     }