* Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * 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/societe.php \ingroup company \brief Page d'administration/configuration du module Societe \version $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); $langs->load("admin"); if (!$user->admin) accessforbidden(); /* * Actions */ if ($_GET["action"] == 'setcodeclient') { if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON",$_GET["value"]) > 0) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dolibarr_print_error($db); } } if ($_GET["action"] == 'setcodecompta') { if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON",$_GET["value"]) > 0) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dolibarr_print_error($db); } } if ($_POST["action"] == 'usesearchtoselectcompany') { if (dolibarr_set_const($db, "COMPANY_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectcompany"])) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dolibarr_print_error($db); } } // define constants for tigre model if ($_POST["action"] == 'updateMask') { dolibarr_set_const($db, "CODE_TIGRE_MASK_CUSTOMER",$_POST["maskcustomer"]); dolibarr_set_const($db, "CODE_TIGRE_MASK_SUPPLIER",$_POST["masksupplier"]); } /* * Affichage page configuration module societe * */ $form=new Form($db); llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup'); print "
"; // Choix du module de gestion des codes clients / fournisseurs print_titre($langs->trans("CompanyCodeChecker")); print "\n"; print "\n"; print ' '; print ' '; print ' '; print ' '; print ' '; print "\n"; clearstatcache(); $dir = "../includes/modules/societe/"; $handle = opendir($dir); if ($handle) { $var = true; // Loop on each module find in opened directory while (($file = readdir($handle))!==false) { if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php') { $file = substr($file, 0, strlen($file)-4); require_once(DOL_DOCUMENT_ROOT ."/includes/modules/societe/".$file.".php"); $modCodeTiers = new $file; // Show modules according to features level if ($modCodeTiers->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; $var = !$var; print "\n \n \n"; print '\n"; if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") { print "\n"; } else { print ''; } print ''; print ''; } } closedir($handle); } print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Activated").''.$langs->trans("Infos").'
".$modCodeTiers->nom.""; print $modCodeTiers->info($langs); print "'.$modCodeTiers->getExample($langs)."\n"; print img_tick(); print "'.$langs->trans("Activate").''; $s=$modCodeTiers->getToolTip($langs,$soc,-1); print $form->textwithhelp('',$s,1); print '
'; print "
"; // Choix du module de gestion des codes compta print_titre($langs->trans("AccountCodeManager")); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; clearstatcache(); $dir = "../includes/modules/societe/"; $handle = opendir($dir); if ($handle) { $var = true; while (($file = readdir($handle))!==false) { if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php') { $file = substr($file, 0, strlen($file)-4); require_once(DOL_DOCUMENT_ROOT ."/includes/modules/societe/".$file.".php"); $modCodeCompta = new $file; $var = !$var; print ''; print ''; print '\n"; if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") { print ''; } else { print ''; } print ''; print "\n"; } } closedir($handle); } print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Activated").' 
'.$modCodeCompta->nom."\n"; print $modCodeCompta->info($langs); print ''.$modCodeCompta->getExample($langs)."'; print img_tick(); print ''.$langs->trans("Activate").' 
\n"; print '
'; // Autres options $html=new Form($db); $var=true; print ''; print ''; print " \n"; print " \n"; print " \n"; // Utilisation formulaire Ajax sur choix soci�t� $var=!$var; print ""; print ""; print ""; print ''; if (! $conf->use_javascript_ajax) { print '"; } else { print '"; } print ''; print ''; print '
".$langs->trans("Parameters")."".$langs->trans("Value")." 
'.$langs->trans("UseSearchToSelectCompany").''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "'; print $html->selectyesno("activate_usesearchtoselectcompany",$conf->global->COMPANY_USE_SEARCH_TO_SELECT,1); print ''; print ''; print "
'; $db->close(); llxFooter('$Date$ - $Revision$'); ?>