* Copyright (C) 2005-2011 Laurent Destailleur * * 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 2 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"); // 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) { $mesg = "".$langs->trans("SetupSaved").""; } else { $mesg = "".$langs->trans("Error").""; } } /* * 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']; print ''; print ''; print ''; print ''; print ''; } print '
'.$langs->trans("Module").''.$langs->trans("Code").''.$langs->trans("Label").'
'.$notifiedevent['elementtype'].''.$notifiedevent['code'].''.$label.'
'; dol_htmloutput_mesg($mesg); $db->close(); llxFooter(); ?>