Skip to content
Snippets Groups Projects
Commit 97499daa authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #12510 TIME 6:00 contacts in notifications

parent a8955ba3
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,12 @@ ...@@ -31,8 +31,12 @@
[res_letterbox] = record of view + link to detail/doc page [res_letterbox] = record of view + link to detail/doc page
*/ */
use Contact\controllers\ContactController;
use Contact\models\ContactModel;
use Resource\models\ResourceContactModel;
$dbDatasource = new Database(); $dbDatasource = new Database();
$contacts = new contacts_v2(); //$contacts = new contacts_v2();
$datasources['recipient'][0] = (array) $recipient; $datasources['recipient'][0] = (array) $recipient;
...@@ -105,27 +109,20 @@ foreach ($events as $event) { ...@@ -105,27 +109,20 @@ foreach ($events as $event) {
// Insertion // Insertion
$datasources['res_letterbox'][] = $res; $datasources['res_letterbox'][] = $res;
//multicontact $resourceContacts = ResourceContactModel::get([
// $stmt = $dbDatasource->query('SELECT * FROM contacts_res WHERE res_id = ? AND contact_id = ? ', array($res['res_id'], $res['contact_id'])); 'where' => ['res_id = ?', "mode='sender'", "type='contact'"],
// $datasources['res_letterbox_contact'][] = $stmt->fetch(PDO::FETCH_ASSOC); 'data' => [$res['res_id']],
// if ($datasources['res_letterbox_contact'][0]['contact_id'] != '') { ]);
// // $datasources['contact'] = array();
// $stmt = $dbDatasource->query('SELECT * FROM view_contacts WHERE contact_id = ? and ca_id = ? ', array($datasources['res_letterbox_contact'][0]['contact_id'], $datasources['res_letterbox_contact'][0]['address_id'])); foreach ($resourceContacts as $resourceContact) {
// $myContact = $stmt->fetch(PDO::FETCH_ASSOC); $contact = ContactModel::getById(['id' => $resourceContact['item_id'], 'select' => ['*']]);
// $myContact['contact_title'] = $contacts->get_civility_contact($myContact['contact_title']);
// $datasources['contact'][] = $myContact; $postalAddress = ContactController::getContactAfnor($contact);
unset($postalAddress[0]);
// // single Contact $contact['postal_address'] = implode("\n", $postalAddress);
// } elseif (isset($res['contact_id']) && isset($res['address_id'])) {
// $stmt = $dbDatasource->query('SELECT * FROM view_contacts WHERE contact_id = ? and ca_id = ? ', array($res['contact_id'], $res['address_id'])); $datasources['contact'][] = $contact;
// $myContact = $stmt->fetch(PDO::FETCH_ASSOC); }
// $myContact['contact_title'] = $contacts->get_civility_contact($myContact['contact_title']);
// $datasources['contact'][] = $myContact;
// } else {
// $stmt = $dbDatasource->query('SELECT * FROM view_contacts WHERE contact_id = 0');
// $myContact = $stmt->fetch(PDO::FETCH_ASSOC);
// $datasources['contact'][] = $myContact;
// }
} }
$datasources['images'][0]['imgdetail'] = $maarchUrl.'/apps/'.$maarchApps.'/img/object.gif'; $datasources['images'][0]['imgdetail'] = $maarchUrl.'/apps/'.$maarchApps.'/img/object.gif';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment