From b6e39960b4f2d724723302f2015c9cc24e4f1e0a Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 13 Mar 2016 00:20:29 +0100 Subject: [PATCH 1/4] new:handle user notification in notification module Conflicts: htdocs/core/lib/usergroups.lib.php --- htdocs/core/class/notify.class.php | 36 +++++++++++++++++++++++++----- htdocs/core/lib/usergroups.lib.php | 32 +++++++++++++++++++++++++- htdocs/langs/en_US/companies.lang | 3 ++- htdocs/langs/fr_FR/companies.lang | 1 + 4 files changed, 64 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 98a06174595..423e912e1be 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -94,10 +94,11 @@ class Notify * * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) * @param int $socid Id of third party or 0 for all thirdparties + * @param int $userid Id of user or 0 for all users * @param Object $object Object the notification is about (need it to check threshold value of some notifications) * @return array|int <0 if KO, array of notifications to send if OK */ - function getNotificationsArray($notifcode,$socid,$object=null) + function getNotificationsArray($notifcode,$socid= 0,$userid= 0,$object=null) { global $conf, $user; @@ -111,7 +112,8 @@ class Notify { $sql = "SELECT a.code, c.email, c.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n,"; - $sql.= " ".MAIN_DB_PREFIX."socpeople as c,"; + if ($userid > 0) $sql.= " ".MAIN_DB_PREFIX."user as c,"; + else $sql.= " ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE n.fk_contact = c.rowid"; @@ -124,6 +126,7 @@ class Notify } $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; + elseif ($userid > 0) $sql.= " AND u.rowid = ".$userid; dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG); @@ -253,7 +256,7 @@ class Notify $newref=(empty($object->newref)?$object->ref:$object->newref); // Check notification per third party - $sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,"; + $sql = "SELECT 0 as user, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,"; $sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; @@ -265,6 +268,20 @@ class Notify else $sql.= " AND a.code = '".$notifcode."'"; // New usage $sql .= " AND s.rowid = ".$object->socid; + // Check notification per user + $sql.= "\nUNION\n"; + $sql.= "SELECT 1 as user, c.email, c.rowid as cid, c.lastname, c.firstname, '$langs->defaultlang' as default_lang,"; + $sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type"; + $sql.= " FROM ".MAIN_DB_PREFIX."user as c,"; + $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; + $sql.= " ".MAIN_DB_PREFIX."notify_def as n,"; + $sql.= " ".MAIN_DB_PREFIX."element_contact as ec"; + $sql.= " WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action"; + $sql.= " AND n.fk_user = ec.fk_socpeople"; + if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage + else $sql.= " AND a.code = '".$notifcode."'"; // New usage + $sql .= " AND ec.element_id = ".$object->id; + $result = $this->db->query($sql); if ($result) { @@ -386,9 +403,16 @@ class Notify ); if ($mailfile->sendfile()) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)"; - $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')"; + { if ($obj->user==1){ + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_user, type, objet_type, objet_id, email)"; + $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')"; + + } + else { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)"; + $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')"; + + } if (! $this->db->query($sql)) { dol_print_error($this->db); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 8b9c6c3406f..0b4e2abbc05 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -32,7 +32,7 @@ */ function user_prepare_head($object) { - global $db, $langs, $conf, $user; + global $langs, $conf, $user, $db; $langs->load("users"); @@ -88,6 +88,36 @@ function user_prepare_head($object) $h++; } + // Notifications + if ($user->societe_id == 0 && ! empty($conf->notification->enabled)) + { + $nbNote = 0; + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; + $sql.= " WHERE fk_user = ".$object->id; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $nbNote=$obj->nb; + $i++; + } + } + else { + dol_print_error($db); + } + + $head[$h][0] = DOL_URL_ROOT.'/user/notify/card.php?id='.$object->id; + $head[$h][1] = $langs->trans("Notifications"); + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + $head[$h][2] = 'notify'; + $h++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 92fef1d9d33..42485f4771a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -416,6 +416,7 @@ Organization=Organization AutomaticallyGenerated=Automatically generated FiscalYearInformation=Information on the fiscal year FiscalMonthStart=Starting month of the fiscal year +YouMustAssignUserMailFirst=You must create email for this user first to be able to add emails notifications for him. YouMustCreateContactFirst=You must create emails contacts for third party first to be able to add emails notifications. ListSuppliersShort=List of suppliers ListProspectsShort=List of prospects @@ -442,4 +443,4 @@ ThirdpartiesMergeSuccess=Thirdparties have been merged ErrorThirdpartiesMerge=There was an error when deleting the thirdparties. Please check the log. Changes have been reverted. SaleRepresentativeLogin=Login of sale representative SaleRepresentativeFirstname=Firstname of sale representative -SaleRepresentativeLastname=Lastname of sale representative \ No newline at end of file +SaleRepresentativeLastname=Lastname of sale representative diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index bdf503511ce..ae6e38d6ea6 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -416,6 +416,7 @@ Organization=Organisme AutomaticallyGenerated=Généré automatiquement FiscalYearInformation=Information sur l'année fiscale FiscalMonthStart=Mois de début d'exercice +YouMustAssignUserMailFirst=Vous devez créer une adresse email pour cet utilisateur avant de pouvoir lui définir des notifications par emails. YouMustCreateContactFirst=Vous devez créer un contact avec une adresse email sur le tiers avant de pouvoir lui définir des notifications par emails. ListSuppliersShort=Liste fournisseurs ListProspectsShort=Liste prospects From e53510b0c44d0b281102335c7abe00b27809de2d Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 13 Mar 2016 00:20:29 +0100 Subject: [PATCH 2/4] new:handle user notification in notification module --- htdocs/user/notify/card.php | 448 ++++++++++++++++++++++++++++++++++++ 1 file changed, 448 insertions(+) create mode 100644 htdocs/user/notify/card.php diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php new file mode 100644 index 00000000000..ec7698a4cc9 --- /dev/null +++ b/htdocs/user/notify/card.php @@ -0,0 +1,448 @@ + + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2015 Marcos García + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/user/notify/card.php + * \ingroup user notification + * \brief Tab for notifications of third party + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; + +$langs->load("companies"); +$langs->load("mails"); +$langs->load("admin"); +$langs->load("other"); + +$id = GETPOST("id",'int'); +$action = GETPOST('action'); +$actionid=GETPOST('actionid'); + +// Security check +if ($user->societe_id) $id=$user->societe_id; +$result = restrictedArea($user, 'societe','',''); + +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="c.lastname"; + +$now=dol_now(); + + +/* + * Actions + */ + +// Add a notification +if ($action == 'add') +{ + $error=0; + + if ($actionid <= 0) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors'); + $error++; + } + + if (! $error) + { + $db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; + $sql .= " WHERE fk_user=".$id." AND fk_action=".$actionid; + if ($db->query($sql)) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_action)"; + $sql .= " VALUES ('".$db->idate($now)."',".$id.",".$actionid.")"; + + if (! $db->query($sql)) + { + $error++; + dol_print_error($db); + } + } + else + { + dol_print_error($db); + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + } +} + +// Remove a notification +if ($action == 'delete') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"]; + $db->query($sql); +} + + + +/* + * View + */ + +$form = new Form($db); + +$object = new User($db); +$result=$object->fetch($id); + +$title=$langs->trans("ThirdParty").' - '.$langs->trans("Notification"); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Notification"); +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$title,$help_url); + + +if ($result > 0) +{ + $langs->load("other"); + + $head = user_prepare_head($object); + + dol_fiche_head($head, 'notify', $langs->trans("User"),0,'user'); + + + print ''; + + // Ref + print ''; + print ''; + print ''."\n"; + + print ''; + print ''; + + // Firstname + print ''; + print ''; + print ''."\n"; + + // EMail + print ''; + print ''; + print "\n"; + + print '
'.$langs->trans("Ref").''; + print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); + print '
'.$langs->trans("Lastname").''.$object->lastname.'
'.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("EMail").''.dol_print_email($object->email,0,0,1).'
'; + + dol_fiche_end(); + + // Help + print $langs->trans("NotificationsDesc").'

'; + + print "\n"; + + // Add notification form + print_fiche_titre($langs->trans("AddNewNotification"),'',''); + + print '
'; + print ''; + print ''; + + $param="&id=".$id; + + // Line with titles + print ''; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder); + print_liste_field_titre(''); + print "\n"; + + $var=false; +// $listofemails=$object->thirdparty_and_contact_email_array(); + if ($object->email) + { + $actions=array(); + + // Load array of available notifications + $notificationtrigger=new InterfaceNotification($db); + $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); + + foreach($listofnotifiedevents as $notifiedevent) + { + $label=($langs->trans("Notify_".$notifiedevent['code'])!="Notify_".$notifiedevent['code']?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']); + $actions[$notifiedevent['rowid']]=$label; + } + print ''; + print ''; + print ''; + print ''; + print ''; + } + else + { + print ''; + } + + print '
'; + print $object->email; + print ''; + print $form->selectarray("actionid",$actions,'',1); + print ''; + $type=array('email'=>$langs->trans("EMail")); + print $form->selectarray("typeid",$type); + print '
'; + print $langs->trans("YouMustAssignUserMailFirst"); + print '
'; + + print '
'; + print '
'; + + // List of active notifications + print_fiche_titre($langs->trans("ListOfActiveNotifications"),'',''); + $var=true; + + // Line with titles + print ''; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder); + print_liste_field_titre('','',''); + print ''; + + $langs->load("errors"); + $langs->load("other"); + + // List of notifications enabled for contacts + $sql = "SELECT n.rowid, n.type,"; + $sql.= " a.code, a.label,"; + $sql.= " c.rowid as userid, c.lastname, c.firstname, c.email"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; + $sql.= " ".MAIN_DB_PREFIX."notify_def as n,"; + $sql.= " ".MAIN_DB_PREFIX."user c"; + $sql.= " WHERE a.rowid = n.fk_action"; + $sql.= " AND c.rowid = n.fk_user"; + $sql.= " AND c.rowid = ".$object->id; + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + $userstatic=new user($db); + + while ($i < $num) + { + $var = !$var; + + $obj = $db->fetch_object($resql); + + $userstatic->id=$obj->userid; + $userstatic->lastname=$obj->lastname; + $userstatic->firstname=$obj->firstname; + print ''; + print ''; + print ''; + print ''; + print ''; + $i++; + } + $db->free($resql); + } + else + { + dol_print_error($db); + } + + // List of notifications enabled for fixed email + /* + foreach($conf->global as $key => $val) + { + if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; + $var = ! $var; + print ''; + print ''; + print ''; + print ''; + print ''; + }*/ + if ($user->admin) + { + $var = ! $var; + print ''; + } + + print '
'.$userstatic->getNomUrl(1); + if ($obj->type == 'email') + { + if (isValidEmail($obj->email)) + { + print ' <'.$obj->email.'>'; + } + else + { + $langs->load("errors"); + print '   '.img_warning().' '.$langs->trans("ErrorBadEMail",$obj->email); + } + } + print ''; + $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); + print $label; + print ''; + if ($obj->type == 'email') print $langs->trans("Email"); + if ($obj->type == 'sms') print $langs->trans("SMS"); + print ''.img_delete().'
'; + $listtmp=explode(',',$val); + $first=1; + foreach($listtmp as $keyemail => $valemail) + { + if (! $first) print ', '; + $first=0; + $valemail=trim($valemail); + //print $keyemail.' - '.$valemail.' - '.$reg[1].'
'; + if (isValidEmail($valemail, 1)) + { + if ($valemail == '__SUPERVISOREMAIL__') print $valemail; + else print ' <'.$valemail.'>'; + } + else + { + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail); + } + } + print '
'; + $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]); + $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]); + $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode); + print $label; + if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) + { + print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]); + } + print ''; + print $langs->trans("Email"); + print ''.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'
'; + print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).''; + print '
'; + print '
'; + + + // List of notifications done + print_fiche_titre($langs->trans("ListOfNotificationsDone"),'',''); + $var=true; + + // Line with titles + print ''; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder); + //print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.daten",'',$param,'align="right"',$sortfield,$sortorder); + print ''; + + // List + $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,"; + $sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"; + $sql.= " a.code, a.label"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; + $sql.= " ".MAIN_DB_PREFIX."notify as n "; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid"; + $sql.= " WHERE a.rowid = n.fk_action"; + $sql.= " AND n.fk_user = ".$object->id; + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + $userstatic=new User($db); + + while ($i < $num) + { + $var = !$var; + + $obj = $db->fetch_object($resql); + + print ''; + print ''; + print ''; + // TODO Add link to object here for other types + /*print '';*/ + // print + print''; + print ''; + $i++; + } + $db->free($resql); + } + else + { + dol_print_error($db); + } + + print '
'; + if ($obj->id > 0) + { + $userstatic->id=$obj->id; + $userstatic->lastname=$obj->lastname; + $userstatic->firstname=$obj->firstname; + print $userstatic->getNomUrl(1); + print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail"); + } + else + { + print $obj->email; + } + print ''; + $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); + print $label; + print ''; + if ($obj->type == 'email') print $langs->trans("Email"); + if ($obj->type == 'sms') print $langs->trans("Sms"); + print ''; + if ($obj->object_type == 'order') + { + $orderstatic->id=$obj->object_id; + $orderstatic->ref=... + print $orderstatic->getNomUrl(1); + } + print ''.dol_print_date($db->jdate($obj->daten), 'dayhour').'
'; +} +else dol_print_error('','RecordNotFound'); + + +llxFooter(); + +$db->close(); From 3f9126e66370a868eebc60aa43e8815e15924204 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Mon, 14 Mar 2016 23:29:21 +0100 Subject: [PATCH 3/4] Update card.php --- htdocs/user/notify/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index ec7698a4cc9..e631c8d0ab2 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -1,8 +1,9 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2016 Abbes Bahfir * * 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 From a1ed41646eebd606405cf79740402fbb12987637 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Mon, 21 Mar 2016 19:15:01 +0100 Subject: [PATCH 4/4] moved userid parameter to end of list in getNotificationArray function --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 423e912e1be..798faefb289 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -98,7 +98,7 @@ class Notify * @param Object $object Object the notification is about (need it to check threshold value of some notifications) * @return array|int <0 if KO, array of notifications to send if OK */ - function getNotificationsArray($notifcode,$socid= 0,$userid= 0,$object=null) + function getNotificationsArray($notifcode,$socid= 0,$object=null,$userid= 0) { global $conf, $user;