* Copyright (C) 2004-2005 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. * * $Id$ * $Source$ */ /** \file htdocs/admin/index.php \brief Page d'accueil de l'espace administration/configuration \version $Revision$ */ require("./pre.inc.php"); $langs->load("admin"); $langs->load("companies"); if (!$user->admin) accessforbidden(); if ($_POST["action"] == 'update') { dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"]); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS",$_POST["pays_id"]); dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"]); dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"]); dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"]); dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"]); dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"]); dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"]); Header("Location: index.php"); } llxHeader(); $form = new Form($db); print_titre($langs->trans("GlobalSetup")); print "
\n"; if ($_GET["action"] == 'edit') { /* * Edition des paramètres */ print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("CompanyInfo").'
'.$langs->trans("CompanyName").''; print '
'.$langs->trans("Country").''; $form->select_pays(MAIN_INFO_SOCIETE_PAYS); print '
'.$langs->trans("CompanyCurrency").''; print '
'.$langs->trans("Capital").''; print '
'; print '
'; print ''; print ''; $langs->load("companies"); // Recupere code pays $code_pays=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation $sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays"; $sql .= " WHERE rowid = ".MAIN_INFO_SOCIETE_PAYS; $result=$db->query($sql); if ($result) { $obj = $db->fetch_object(); if ($obj->code) $code_pays=$obj->code; } else { dolibarr_print_error($db); } if ($langs->transcountry("ProfId1",$code_pays) != '-') { print ''; } if ($langs->transcountry("ProfId2",$code_pays) != '-') { print ''; } if ($langs->transcountry("ProfId3",$code_pays) != '-') { print ''; } print ''; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->transcountry("ProfId1",$code_pays).''; print '
'.$langs->transcountry("ProfId2",$code_pays).''; print '
'.$langs->transcountry("ProfId3",$code_pays).''; print '
'.$langs->trans("TVAIntra").''; print '
'; print '
'; print '
'; } else { /* * Affichage des paramètres */ print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").'' . MAIN_INFO_SOCIETE_NOM . '
'.$langs->trans("Country").''; print $form->pays_name(MAIN_INFO_SOCIETE_PAYS); print '
'.$langs->trans("CompanyCurrency").'' . MAIN_MONNAIE . '
'.$langs->trans("Capital").''; print MAIN_INFO_CAPITAL . '
'; print '
'; print ''; print ''; // Recupere code pays $code_pays=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation $sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays"; $sql .= " WHERE rowid = ".MAIN_INFO_SOCIETE_PAYS; $result=$db->query($sql); if ($result) { $obj = $db->fetch_object(); if ($obj->code) $code_pays=$obj->code; } else { dolibarr_print_error($db); } if ($langs->transcountry("ProfId1",$code_pays) != '-') { print ''; } if ($langs->transcountry("ProfId2",$code_pays) != '-') { print ''; } if ($langs->transcountry("ProfId3",$code_pays) != '-') { print ''; } print ''; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->transcountry("ProfId1",$code_pays).''; print MAIN_INFO_SIRET . '
'.$langs->transcountry("ProfId2",$code_pays).''; print MAIN_INFO_SIREN . '
'.$langs->transcountry("ProfId3",$code_pays).''; print MAIN_INFO_APE . '
'.$langs->trans("TVAIntra").'' . MAIN_INFO_TVAINTRA . '

'; // Boutons d'action print '
'; print ''.$langs->trans("Edit").''; print '
'; } llxFooter("Dernière modification $Date$ révision $Revision$"); ?>