diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index fb5afb0959e..62b4b37079b 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2010 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 @@ -22,7 +23,7 @@ * \file htdocs/admin/societe.php * \ingroup company * \brief Third party module setup page - * \version $Id: societe.php,v 1.62 2011/08/16 16:49:24 simnandez Exp $ + * \version $Id: societe.php,v 1.63 2011/08/17 07:50:29 simnandez Exp $ */ require("../main.inc.php"); @@ -34,10 +35,12 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); +$action=GETPOST("action"); + /* * Actions */ -if ($_GET["action"] == 'setcodeclient') +if ($action == 'setcodeclient') { if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON",$_GET["value"],'chaine',0,'',$conf->entity) > 0) { @@ -50,7 +53,7 @@ if ($_GET["action"] == 'setcodeclient') } } -if ($_GET["action"] == 'setcodecompta') +if ($action == 'setcodecompta') { if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON",$_GET["value"],'chaine',0,'',$conf->entity) > 0) { @@ -63,7 +66,7 @@ if ($_GET["action"] == 'setcodecompta') } } -if ($_POST["action"] == 'COMPANY_USE_SEARCH_TO_SELECT') +if ($action == 'COMPANY_USE_SEARCH_TO_SELECT') { if (dolibarr_set_const($db, "COMPANY_USE_SEARCH_TO_SELECT", $_POST["activate_COMPANY_USE_SEARCH_TO_SELECT"],'chaine',0,'',$conf->entity)) { @@ -77,7 +80,7 @@ if ($_POST["action"] == 'COMPANY_USE_SEARCH_TO_SELECT') } // define constants for models generator that need parameters -if ($_POST["action"] == 'setModuleOptions') +if ($action == 'setModuleOptions') { $post_size=count($_POST); for($i=0;$i < $post_size;$i++) @@ -92,7 +95,7 @@ if ($_POST["action"] == 'setModuleOptions') } // Activate a document generator module -if ($_GET["action"] == 'set') +if ($action == 'set') { $type='company'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; @@ -108,7 +111,7 @@ if ($_GET["action"] == 'set') } // Disable a document generator module -if ($_GET["action"] == 'del') +if ($action== 'del') { $type='company'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; @@ -121,7 +124,7 @@ if ($_GET["action"] == 'del') } // Define default generator -if ($_GET["action"] == 'setdoc') +if ($action == 'setdoc') { $db->begin(); @@ -158,7 +161,7 @@ if ($_GET["action"] == 'setdoc') } //Activate ProfId -if ($_GET["action"] == 'setprofid') +if ($action == 'setprofid') { $idprof="SOCIETE_IDPROF".$_GET["value"]."_UNIQUE"; if (dolibarr_set_const($db, $idprof,$_GET["status"],'chaine',0,'',$conf->entity) > 0) @@ -179,7 +182,7 @@ if ($_GET["action"] == 'setprofid') $form=new Form($db); -$help_url='EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers'; +$help_url='EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros'; llxHeader('',$langs->trans("CompanySetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; @@ -236,13 +239,13 @@ if (is_resource($handle)) if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") { print "\n"; - print img_picto($langs->trans("Activated"),'on'); + print img_picto($langs->trans("Activated"),'switch_on'); print "\n"; } else { print ''; - print img_picto($langs->trans("Disabled"),'off'); + print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } @@ -302,13 +305,13 @@ if (is_resource($handle)) if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") { print ''; - print img_picto($langs->trans("Activated"),'on'); + print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { print ''; - print img_picto($langs->trans("Disabled"),'off'); + print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } print ' '; @@ -401,7 +404,7 @@ foreach ($conf->file->dol_document_root as $dirroot) //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'on'); + print img_picto($langs->trans("Enabled"),'switch_on'); print ''; //} //else @@ -415,13 +418,13 @@ foreach ($conf->file->dol_document_root as $dirroot) if (versioncompare($module->phpmin,versionphparray()) > 0) { print "\n"; - print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'off'); + print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'switch_off'); print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } } @@ -578,5 +581,5 @@ dol_fiche_end(); $db->close(); -llxFooter('$Date: 2011/08/16 16:49:24 $ - $Revision: 1.62 $'); +llxFooter('$Date: 2011/08/17 07:50:29 $ - $Revision: 1.63 $'); ?>