Merge pull request #4807 from bafbes/abb-13

added handle to trigger FICHINTER_ADD_CONTACT in notify module
This commit is contained in:
Laurent Destailleur 2016-03-18 02:40:27 +01:00
commit 44dc07a61b
5 changed files with 22 additions and 1 deletions

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Bahfir Abbes <contact@dolibarrpar.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -169,6 +170,7 @@ if ($conf->societe->enabled)
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
print '<tr '.$bc[$var].'>';
print '<td>'.$elementLabel.'</td>';
@ -213,6 +215,7 @@ foreach($listofnotifiedevents as $notifiedevent)
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
print '<tr '.$bc[$var].'>';
print '<td>'.$elementLabel.'</td>';

View File

@ -238,6 +238,7 @@ class Notify
'ORDER_VALIDATE',
'PROPAL_VALIDATE',
'FICHINTER_VALIDATE',
'FICHINTER_ADD_CONTACT',
'ORDER_SUPPLIER_VALIDATE',
'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE',
@ -315,6 +316,12 @@ class Notify
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'FICHINTER_ADD_CONTACT':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$object->ref);
break;
case 'FICHINTER_VALIDATE':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;
@ -427,7 +434,7 @@ class Notify
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
$threshold = (float) $reg[1];
if ($object->total_ht <= $threshold)
if (!empty($object->total_ht) && $object->total_ht <= $threshold)
{
dol_syslog("A notification is requested for notifcode = ".$notifcode." but amount = ".$object->total_ht." so lower than threshold = ".$threshold.". We discard this notification");
continue;
@ -468,6 +475,12 @@ class Notify
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'FICHINTER_ADD_CONTACT':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$newref);
break;
case 'FICHINTER_VALIDATE':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;

View File

@ -41,6 +41,7 @@ class InterfaceNotification extends DolibarrTriggers
'ORDER_VALIDATE',
'PROPAL_VALIDATE',
'FICHINTER_VALIDATE',
'FICHINTER_ADD_CONTACT',
'ORDER_SUPPLIER_VALIDATE',
'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE',

View File

@ -8,6 +8,7 @@ BirthdayDate=Birthday
DateToBirth=Date of birth
BirthdayAlertOn= birthday alert active
BirthdayAlertOff= birthday alert inactive
Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention
Notify_FICHINTER_VALIDATE=Intervention validated
Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail
Notify_ORDER_VALIDATE=Customer order validated
@ -164,6 +165,7 @@ NumberOfUnitsCustomerOrders=Number of units on customer orders on last 12 month
NumberOfUnitsCustomerInvoices=Number of units on customer invoices on last 12 month
NumberOfUnitsSupplierOrders=Number of units on supplier orders on last 12 month
NumberOfUnitsSupplierInvoices=Number of units on supplier invoices on last 12 month
EMailTextInterventionAddedContact=A newintervention %s has been assigned to you.
EMailTextInterventionValidated=The intervention %s has been validated.
EMailTextInvoiceValidated=The invoice %s has been validated.
EMailTextProposalValidated=The proposal %s has been validated.

View File

@ -8,6 +8,7 @@ BirthdayDate=Date anniversaire
DateToBirth=Date de naissance
BirthdayAlertOn= alerte anniversaire active
BirthdayAlertOff= alerte anniversaire inactive
Notify_FICHINTER_ADD_CONTACT=Ajout contact à Intervention
Notify_FICHINTER_VALIDATE=Validation fiche intervention
Notify_FICHINTER_SENTBYMAIL=Envoi fiche d'intervention par email
Notify_ORDER_VALIDATE=Validation commande client
@ -164,6 +165,7 @@ NumberOfUnitsCustomerOrders=Nombre d'unités sur les commandes clients des 12 de
NumberOfUnitsCustomerInvoices=Nombre d'unités sur les factures clients des 12 derniers mois
NumberOfUnitsSupplierOrders=Nombre d'unités sur les commandes fournisseur des 12 derniers mois
NumberOfUnitsSupplierInvoices=Nombre d'unités sur les factures fournisseurs des 12 derniers mois
EMailTextInterventionAddedContact=Une nouvelle intervention %s vous a été assignée.
EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée.
EMailTextInvoiceValidated=La facture %s vous concernant a été validée.
EMailTextProposalValidated=La proposition commerciale %s vous concernant a été validée.