Skip to content
Snippets Groups Projects
Commit 93c86627 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

No commit message

No commit message
parent eef6044d
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,16 @@ while ($state <> 'END') { ...@@ -68,6 +68,16 @@ while ($state <> 'END') {
// Diffusion type specific recipients // Diffusion type specific recipients
$recipients = array(); $recipients = array();
$recipients = $diffusion_type_controler->getRecipients($notification, $event); $recipients = $diffusion_type_controler->getRecipients($notification, $event);
// Diffusion type specific res_id
$logger->write("Getting document ids using diffusion type '" .$notification->diffusion_type . "'", 'INFO');
$res_id = false;
if($event->table_name == $coll_table || $event->table_name == $coll_view) {
$res_id = $event->record_id;
} else {
$res_id = $diffusion_type_controler->getResId($notification, $event);
}
$event->res_id = $res_id;
$nbRecipients = count($recipients); $nbRecipients = count($recipients);
if ($nbRecipients === 0) { if ($nbRecipients === 0) {
$logger->write('No recipient found' , 'WARNING'); $logger->write('No recipient found' , 'WARNING');
...@@ -139,15 +149,13 @@ while ($state <> 'END') { ...@@ -139,15 +149,13 @@ while ($state <> 'END') {
$logger->write('Adding attachments', 'INFO'); $logger->write('Adding attachments', 'INFO');
foreach($tmpNotif['events'] as $event) { foreach($tmpNotif['events'] as $event) {
// Check if event is related to document in collection // Check if event is related to document in collection
$logger->write('Checking table/view of event VS config:' if($event->res_id != '') {
. $event->table_name . ' ?= ' . $coll_view . ' or ' . $coll_table, 'INFO'); $query = "SELECT "
if($event->table_name == $coll_table || $event->table_name == $coll_view) {
$query = "SELECT "
. "ds.path_template ," . "ds.path_template ,"
. "mlb.path, " . "mlb.path, "
. "mlb.filename " . "mlb.filename "
. "FROM ".$coll_view." mlb LEFT JOIN docservers ds ON mlb.docserver_id = ds.docserver_id " . "FROM ".$coll_view." mlb LEFT JOIN docservers ds ON mlb.docserver_id = ds.docserver_id "
. "WHERE mlb.res_id = " . $event->record_id; . "WHERE mlb.res_id = " . $event->res_id;
Bt_doQuery($db, $query); Bt_doQuery($db, $query);
$path_parts = $db->fetch_object(); $path_parts = $db->fetch_object();
$path = $path_parts->path_template . str_replace('#', '/', $path_parts->path) . $path_parts->filename; $path = $path_parts->path_template . str_replace('#', '/', $path_parts->path) . $path_parts->filename;
......
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