* Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2013 Juanjo Menent * * 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/admin/notification.php * \ingroup notification * \brief Page to setup notification module */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; $langs->load("admin"); $langs->load("other"); $langs->load("orders"); $langs->load("propal"); $langs->load("bills"); // Security check if (!$user->admin) accessforbidden(); $action = GETPOST("action"); /* * Actions */ if ($action == 'setvalue' && $user->admin) { $result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM",$_POST["email_from"],'chaine',0,'',$conf->entity); if ($result >= 0) { setEventMessage($langs->trans("SetupSaved")); } else { setEventMessage($langs->trans("Error"),'errors'); } } /* * View */ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup'); print $langs->trans("NotificationsDesc").'

'; print '
'; print ''; print ''; $var=true; print ''; print ''; print ''; print ''; print "\n"; $var=!$var; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $langs->trans("NotificationEMailFrom").''; print ''; if (! empty($conf->global->NOTIFICATION_EMAIL_FROM) && ! isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; print '
'; print '
'; print '
'; print '
'; print_fiche_titre($langs->trans("ListOfAvailableNotifications"),'',''); print ''; print ''; print ''; print ''; print ''; print "\n"; // Load array of available notifications $notificationtrigger=new InterfaceNotification($db); $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); foreach($listofnotifiedevents as $notifiedevent) { $var=!$var; $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal'); elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill'); elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order'); print ''; print ''; print ''; print ''; print ''; } print '
'.$langs->trans("Module").''.$langs->trans("Code").''.$langs->trans("Label").'
'.$elementLabel.''.$notifiedevent['code'].''.$label.'
'; $db->close(); llxFooter(); ?>