Skip to content
Snippets Groups Projects
Commit e260336b authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #309 event_id can be an integer

parent 251824fe
No related branches found
No related tags found
No related merge requests found
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
<h3 mat-subheader>{{lang.activeCron}}</h3> <h3 mat-subheader>{{lang.activeCron}}</h3>
<mat-chip-list #chipList class="mat-chip-list-stacked"> <mat-chip-list #chipList class="mat-chip-list-stacked">
<span *ngFor="let notif of crontab;let i = index"> <span *ngFor="let notif of crontab;let i = index">
<mat-chip color="primary" *ngIf="notif.state == 'normal'" style="cursor:pointer;margin:5px;border-radius:0px;display:flex;" <mat-chip color="primary" *ngIf="notif.state == 'normal'" style="margin:5px;border-radius:0px;display:flex;"
selectable="false" removable="true" (remove)="deleteCron(i)"> selectable="false" removable="true" (remove)="deleteCron(i)">
{{notif.description}} {{notif.description}}
<span style="flex: 1 1 auto;"></span> <span style="flex: 1 1 auto;"></span>
......
...@@ -30,7 +30,7 @@ class NotificationModelAbstract ...@@ -30,7 +30,7 @@ class NotificationModelAbstract
$aNotifications = DatabaseModel::select([ $aNotifications = DatabaseModel::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['notifications'], 'table' => ['notifications'],
]); ]);
return $aNotifications; return $aNotifications;
...@@ -42,9 +42,9 @@ class NotificationModelAbstract ...@@ -42,9 +42,9 @@ class NotificationModelAbstract
$aNotification = DatabaseModel::select([ $aNotification = DatabaseModel::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['notifications'], 'table' => ['notifications'],
'where' => ['notification_sid = ?'], 'where' => ['notification_sid = ?'],
'data' => [$aArgs['notification_sid']], 'data' => [$aArgs['notification_sid']],
]); ]);
if (empty($aNotification[0])) { if (empty($aNotification[0])) {
...@@ -60,9 +60,9 @@ class NotificationModelAbstract ...@@ -60,9 +60,9 @@ class NotificationModelAbstract
$aNotification = DatabaseModel::select([ $aNotification = DatabaseModel::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['notifications'], 'table' => ['notifications'],
'where' => ['notification_id = ?'], 'where' => ['notification_id = ?'],
'data' => [$aArgs['notificationId']], 'data' => [$aArgs['notificationId']],
]); ]);
if (empty($aNotification[0])) { if (empty($aNotification[0])) {
...@@ -80,7 +80,7 @@ class NotificationModelAbstract ...@@ -80,7 +80,7 @@ class NotificationModelAbstract
DatabaseModel::delete([ DatabaseModel::delete([
'table' => 'notifications', 'table' => 'notifications',
'where' => ['notification_sid = ?'], 'where' => ['notification_sid = ?'],
'data' => [$aArgs['notification_sid']], 'data' => [$aArgs['notification_sid']],
]); ]);
return true; return true;
...@@ -90,20 +90,20 @@ class NotificationModelAbstract ...@@ -90,20 +90,20 @@ class NotificationModelAbstract
{ {
ValidatorModel::notEmpty($aArgs, ['notification_id', 'description', 'is_enabled', 'event_id', 'notification_mode', 'template_id', 'diffusion_type']); ValidatorModel::notEmpty($aArgs, ['notification_id', 'description', 'is_enabled', 'event_id', 'notification_mode', 'template_id', 'diffusion_type']);
ValidatorModel::intVal($aArgs, ['template_id']); ValidatorModel::intVal($aArgs, ['template_id']);
ValidatorModel::stringType($aArgs, ['notification_id', 'description', 'is_enabled', 'event_id', 'notification_mode']); ValidatorModel::stringType($aArgs, ['notification_id', 'description', 'is_enabled', 'notification_mode']);
DatabaseModel::insert([ DatabaseModel::insert([
'table' => 'notifications', 'table' => 'notifications',
'columnsValues' => [ 'columnsValues' => [
'notification_id' => $aArgs['notification_id'], 'notification_id' => $aArgs['notification_id'],
'description' => $aArgs['description'], 'description' => $aArgs['description'],
'is_enabled' => $aArgs['is_enabled'], 'is_enabled' => $aArgs['is_enabled'],
'event_id' => $aArgs['event_id'], 'event_id' => $aArgs['event_id'],
'notification_mode' => $aArgs['notification_mode'], 'notification_mode' => $aArgs['notification_mode'],
'template_id' => $aArgs['template_id'], 'template_id' => $aArgs['template_id'],
'diffusion_type' => $aArgs['diffusion_type'], 'diffusion_type' => $aArgs['diffusion_type'],
'diffusion_properties' => $aArgs['diffusion_properties'], 'diffusion_properties' => $aArgs['diffusion_properties'],
'attachfor_type' => $aArgs['attachfor_type'], 'attachfor_type' => $aArgs['attachfor_type'],
'attachfor_properties' => $aArgs['attachfor_properties'], 'attachfor_properties' => $aArgs['attachfor_properties'],
], ],
]); ]);
...@@ -122,9 +122,9 @@ class NotificationModelAbstract ...@@ -122,9 +122,9 @@ class NotificationModelAbstract
$aReturn = DatabaseModel::update([ $aReturn = DatabaseModel::update([
'table' => 'notifications', 'table' => 'notifications',
'set' => $aArgs, 'set' => $aArgs,
'where' => ['notification_sid = ?'], 'where' => ['notification_sid = ?'],
'data' => [$notification_sid], 'data' => [$notification_sid],
]); ]);
return $aReturn; return $aReturn;
...@@ -134,15 +134,15 @@ class NotificationModelAbstract ...@@ -134,15 +134,15 @@ class NotificationModelAbstract
{ {
$tabEvent_Type = DatabaseModel::select([ $tabEvent_Type = DatabaseModel::select([
'select' => ['id, label_action'], 'select' => ['id, label_action'],
'table' => ['actions'], 'table' => ['actions'],
]); ]);
$loadedXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/notifications/xml/event_type.xml']); $loadedXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/notifications/xml/event_type.xml']);
if ($loadedXml) { if ($loadedXml) {
foreach ($loadedXml->event_type as $eventType) { foreach ($loadedXml->event_type as $eventType) {
$tabEvent_Type[] = [ $tabEvent_Type[] = [
'id' => (string) $eventType->id, 'id' => (string) $eventType->id,
'label_action' => (string) $eventType->label 'label_action' => (string) $eventType->label
]; ];
} }
} }
...@@ -154,9 +154,9 @@ class NotificationModelAbstract ...@@ -154,9 +154,9 @@ class NotificationModelAbstract
{ {
$tabTemplate = DatabaseModel::select([ $tabTemplate = DatabaseModel::select([
'select' => ['template_id, template_label'], 'select' => ['template_id, template_label'],
'table' => ['templates'], 'table' => ['templates'],
'where' => ['template_target = ?'], 'where' => ['template_target = ?'],
'data' => ['notifications'], 'data' => ['notifications'],
]); ]);
return $tabTemplate; return $tabTemplate;
...@@ -167,50 +167,50 @@ class NotificationModelAbstract ...@@ -167,50 +167,50 @@ class NotificationModelAbstract
$diffusionTypes = []; $diffusionTypes = [];
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'group', 'id' => 'group',
'label' => 'Groupe', 'label' => 'Groupe',
'add_attachment' => 'true', 'add_attachment' => 'true',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'entity', 'id' => 'entity',
'label' => 'Entité', 'label' => 'Entité',
'add_attachment' => 'true', 'add_attachment' => 'true',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'dest_entity', 'id' => 'dest_entity',
'label' => 'Service de l\'utilisateur destinataire', 'label' => 'Service de l\'utilisateur destinataire',
'add_attachment' => 'false', 'add_attachment' => 'false',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'dest_user', 'id' => 'dest_user',
'label' => 'Liste de diffusion du document', 'label' => 'Liste de diffusion du document',
'add_attachment' => 'false', 'add_attachment' => 'false',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'dest_user_visa', 'id' => 'dest_user_visa',
'label' => 'Viseur actuel du document', 'label' => 'Viseur actuel du document',
'add_attachment' => 'true', 'add_attachment' => 'true',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'dest_user_sign', 'id' => 'dest_user_sign',
'label' => 'Signataire actuel du document', 'label' => 'Signataire actuel du document',
'add_attachment' => 'true', 'add_attachment' => 'true',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'user', 'id' => 'user',
'label' => 'Utilisateur désigné', 'label' => 'Utilisateur désigné',
'add_attachment' => 'true', 'add_attachment' => 'true',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'copy_list', 'id' => 'copy_list',
'label' => 'Liste de diffusion du document', 'label' => 'Liste de diffusion du document',
'add_attachment' => 'false', 'add_attachment' => 'false',
); );
$diffusionTypes[] = array( $diffusionTypes[] = array(
'id' => 'contact', 'id' => 'contact',
'label' => 'Contact du document', 'label' => 'Contact du document',
'add_attachment' => 'true' 'add_attachment' => 'true'
); );
...@@ -228,7 +228,7 @@ class NotificationModelAbstract ...@@ -228,7 +228,7 @@ class NotificationModelAbstract
{ {
$users = DatabaseModel::select([ $users = DatabaseModel::select([
'select' => ["user_id as id, concat(firstname,' ',lastname) as label"], 'select' => ["user_id as id, concat(firstname,' ',lastname) as label"],
'table' => ['users'], 'table' => ['users'],
]); ]);
return $users; return $users;
...@@ -252,9 +252,9 @@ class NotificationModelAbstract ...@@ -252,9 +252,9 @@ class NotificationModelAbstract
{ {
$aReturn = DatabaseModel::select([ $aReturn = DatabaseModel::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['notifications'], 'table' => ['notifications'],
'where' => ['is_enabled = ?'], 'where' => ['is_enabled = ?'],
'data' => ['Y'], 'data' => ['Y'],
]); ]);
return $aReturn; return $aReturn;
......
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