Example #1
0
 function eventUnShareMultiple(EventControler $evtcl)
 {
     $idcoworker = $evtcl->co_worker_id;
     $contacts = $evtcl->getParam("ck");
     if (is_array($contacts)) {
         $do_unshare = new ContactSharing();
         foreach ($contacts as $idcontact) {
             $do_unshare->unshareContact($idcontact, $idcoworker);
         }
     }
     $idcontacts = $do_unshare->getSharedContacts($idcoworker);
     if (is_array($idcontacts)) {
         $idcontacts = implode(",", $idcontacts);
     } else {
         $this->set_unshare = false;
     }
     $this->setSqlQuery("SELECT contact.idcontact as idcontact,contact.firstname as firstname,contact.lastname as lastname,contact.company as company,contact.idcompany as idcompany,contact.position as position,contact.picture as picture,contact.email_address as email_address, contact.phone_number\n        FROM " . $this->getSqlViewName() . " as contact\n        WHERE contact.idcontact IN (" . $idcontacts . ") \n        GROUP BY contact.idcontact\n        ORDER BY " . $this->sql_view_order . " LIMIT " . $this->sql_view_limit);
 }