diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index f48fb39c8e0..0d54b3af304 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2011 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 @@ -30,24 +31,27 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); +$action = getpost("action"); -if ($_POST["action"] == 'setvalue' && $user->admin) +/* + * Actions + */ +if ($action == 'setvalue' && $user->admin) { - $result=dolibarr_set_const($db, "CLICKTODIAL_URL",$_POST["url"],'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "CLICKTODIAL_URL",GETPOST("url"),'chaine',0,'',$conf->entity); if ($result >= 0) { - $mesg='
'.$langs->trans("RecordModifiedSuccessfully").'
'; + $mesg = "".$langs->trans("SetupSaved").""; } else { - dol_print_error($db); + $mesg = "".$langs->trans("Error").""; } } /* - * - * + * View */ $wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; @@ -58,9 +62,6 @@ print_fiche_titre($langs->trans("ClickToDialSetup"),$linkback,'setup'); print $langs->trans("ClickToDialDesc")."
\n"; - -if ($mesg) print '
'.$mesg; - print '
'; print '
'; print ''; @@ -92,6 +93,8 @@ print '
'; } */ +dol_htmloutput_mesg($mesg); + $db->close(); llxFooter(); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 631ab4322bf..a7ee6e67a56 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2011 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 @@ -59,10 +60,10 @@ else dol_print_error($db); } -if ($action == 'add' || $_POST["modify"]) +if ($action == 'add' || GETPOST("modify")) { - $external_rss_title = "external_rss_title_" . $_POST["norss"]; - $external_rss_urlrss = "external_rss_urlrss_" . $_POST["norss"]; + $external_rss_title = "external_rss_title_" . GETPOST("norss"); + $external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss"); if (! empty($_POST[$external_rss_urlrss])) { @@ -90,7 +91,7 @@ if ($action == 'add' || $_POST["modify"]) { // Ajoute boite box_external_rss dans definition des boites $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; - $sql.= " VALUES ('box_external_rss.php','".$db->escape($_POST["norss"].' ('.$_POST[$external_rss_title]).")')"; + $sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss").' ('.GETPOST($external_rss_title)).")')"; if (! $db->query($sql)) { dol_print_error($db); @@ -98,8 +99,8 @@ if ($action == 'add' || $_POST["modify"]) } } - $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . $_POST["norss"],$_POST[$external_rss_title],'chaine',0,'',$conf->entity); - if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . $_POST["norss"],$_POST[$external_rss_urlrss],'chaine',0,'',$conf->entity); + $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"),GETPOST($external_rss_title),'chaine',0,'',$conf->entity); + if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),GETPOST($external_rss_urlrss),'chaine',0,'',$conf->entity); if ($result1 && $result2) { @@ -118,13 +119,13 @@ if ($action == 'add' || $_POST["modify"]) if ($_POST["delete"]) { - if(isset($_POST["norss"])) + if(GETPOST("norss")) { $db->begin(); // Supprime boite box_external_rss de definition des boites $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; - $sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$_POST["norss"]." %'"; + $sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".GETPOST("norss")." %'"; $resql=$db->query($sql); if ($resql) @@ -163,8 +164,8 @@ if ($_POST["delete"]) } - $result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . $_POST["norss"],$conf->entity); - if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . $_POST["norss"],$conf->entity); + $result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . GETPOST("norss"),$conf->entity); + if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),$conf->entity); if ($result1 && $result2) { diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 77e14830599..9f74670571f 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2009 Laurent Destailleur + * Copyright (C) 2011 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 2 of the License, or @@ -32,21 +33,36 @@ accessforbidden(); $langs->load("admin"); $langs->load("errors"); +$action = GETPOST("action"); + /* * Actions */ -if ($_POST["action"] == 'set') +if ($action == 'set') { $error=0; - if (! empty($_POST["GEOIPMAXMIND_COUNTRY_DATAFILE"]) && ! file_exists($_POST["GEOIPMAXMIND_COUNTRY_DATAFILE"])) + + $gimcdf= getpost("GEOIPMAXMIND_COUNTRY_DATAFILE"); + + if (! $gimcdf && ! file_exists($gimcdf)) { - $mesg='
'.$langs->trans("ErrorFileNotFound",$_POST["GEOIPMAXMIND_COUNTRY_DATAFILE"]).'
'; + $mesg='
'.$langs->trans("ErrorFileNotFound",$gimcdf).'
'; $error++; } if (! $error) { - dolibarr_set_const($db,"GEOIPMAXMIND_COUNTRY_DATAFILE",$_POST["GEOIPMAXMIND_COUNTRY_DATAFILE"],'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db,"GEOIPMAXMIND_COUNTRY_DATAFILE",$gimcdf,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } } } @@ -64,8 +80,6 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("GeoIPMaxmindSetup"),$linkback,'setup'); print '
'; -if ($mesg) print $mesg; - $version=''; $geoip=''; if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE)) @@ -126,5 +140,9 @@ if ($geoip) $geoip->close(); } +dol_htmloutput_mesg($mesg); + +$db->close(); + llxFooter(); ?> diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 58617e87df4..73db19d4d61 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -27,27 +27,28 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/includes/triggers/interface_modNotification_Notification.class.php"); $langs->load("admin"); -$langs->load("mails"); +$langs->load("other"); // Security check if (!$user->admin) accessforbidden(); +$action = GETPOST("action"); /* * Actions */ -if ($_POST["action"] == 'setvalue' && $user->admin) +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("Success").'
'; + $mesg = "".$langs->trans("SetupSaved").""; } else { - dol_print_error($db); + $mesg = "".$langs->trans("Error").""; } } @@ -62,9 +63,7 @@ llxHeader(); $linkback='
'.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup'); -print $langs->trans("NotificationsDesc").'

'; - -dol_htmloutput_mesg($mesg); +print $langs->trans("NotificationsDesc").'

'; print '
'; print ''; @@ -109,7 +108,7 @@ $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']; + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; print ''; print ''.$notifiedevent['elementtype'].''; print ''.$notifiedevent['code'].''; @@ -118,9 +117,9 @@ foreach($listofnotifiedevents as $notifiedevent) } print ''; +dol_htmloutput_mesg($mesg); $db->close(); - llxFooter(); ?>