* 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/notification.php * \ingroup notification * \brief Page to setup notification module * \version $Id$ */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/includes/triggers/interface_modNotification_Notification.class.php"); $langs->load("admin"); // Security check if (!$user->admin) accessforbidden(); /* * Actions */ if ($_POST["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("Success").'
'; } else { dol_print_error($db); } } /* * View */ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup'); print $langs->trans("NotificationsDesc").'

'; if ($mesg) print $mesg.'
'; 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 ''; 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.'
'; $db->close(); llxFooter('$Date$ - $Revision$'); ?>