From 6a53682f804fa26d4e3951095513520ac6d5de2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Aug 2004 01:44:51 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Gestion=20multi-langue=20sur=20plus=20de?= =?UTF-8?q?=20page=20de=20l'espace=20"Configuration"=20New:=20Am=E9liorati?= =?UTF-8?q?on=20de=20l'IHM=20sur=20l'=E9cran=20d'activation=20des=20box.?= =?UTF-8?q?=20Il=20sera=20possible=20d'activer=20les=20box=20sur=20d'autre?= =?UTF-8?q?s=20pages=20que=20la=20Homepage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/boxes.php | 91 ++++++++++++++++++++-------------------- htdocs/admin/const.php | 52 +++++++++++------------ htdocs/admin/dict.php | 4 +- htdocs/admin/ihm.php | 2 +- htdocs/admin/index.php | 13 +++--- htdocs/admin/modules.php | 38 ++++++++--------- htdocs/admin/perms.php | 9 +++- 7 files changed, 108 insertions(+), 101 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6c309e63fcb..e8181b628f6 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -21,40 +21,36 @@ */ require("./pre.inc.php"); +$langs->trans("admin"); + + if (!$user->admin) accessforbidden(); llxHeader(); -print_titre("Boites"); +print_titre($langs->trans("Boxes")); -print "
"; -print "Les boites sont des cartouches d'informations réduites qui s'affichent sur certaines pages. Vous pouvez choisir ou non d'activer ces cartouches en cliquant sur 'Ajouter' ou la poubelle pour les désactiver. "; -print "Seules les boites en rapport avec un module actif sont présentées.
\n"; +print "
".$langs->trans("BoxesDesc")."
\n"; if ($_POST["action"] == 'add') { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$_POST["rowid"].",".$_POST["constvalue"].");"; - + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes WHERE box_id=".$_POST["boxid"]." AND position=".$_POST["pos"]; $result = $db->query($sql); + + $num = $db->num_rows(); + if ($num == 0) { + // Si la boite n'est pas deja active + $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$_POST["boxid"].",".$_POST["pos"].");"; + $result = $db->query($sql); + } } -if ($_GET["action"] == 'add') -{ - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$_GET["rowid"].",0);"; - - $result = $db->query($sql); -} - - if ($_GET["action"] == 'delete') { $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=".$_GET["rowid"]; - $result = $db->query($sql); } @@ -96,16 +92,15 @@ $db->free(); * Boites disponibles * */ -print '
'; -print_titre("Boites disponibles"); +print "
\n"; +print_titre($langs->trans("BoxesAvailable")); -print ''; +print '
'; print ''; -print ''; -print ''; -foreach ($pos_array as $position) { - print ''; -} +print ''; +print ''; +print ''; +print ''; print "\n"; $sql = "SELECT rowid, name, file FROM ".MAIN_DB_PREFIX."boxes_def"; @@ -117,29 +112,29 @@ if ($result) $num = $db->num_rows(); $i = 0; + // Boucle sur toutes les boites while ($i < $num) { $var = ! $var; $obj = $db->fetch_object( $i); - print ''; + print ''; + print ''; // Pour chaque position possible, on affiche un lien // d'activation si boite non deja active pour cette position - foreach ($pos_array as $position) { - print ''; - } + print ''; + + print ''; print ''; + print ''; $i++; } @@ -149,14 +144,15 @@ $db->free(); print '
BoitesFichier sourceActivation '.$pos_name[$position].''.$langs->trans("Boxe").''.$langs->trans("SourceFile").''.$langs->trans("ActivateOn").' 
'.$obj->name.'' . $obj->file . '
'.$obj->name.'' . $obj->file . ''; - if (! $boxes[$position][$obj->rowid]) - { - print ''.$langs->trans("Add").''; - } - else - { - print " "; - } - print ''; + $html=new Form($db); + print $html->select_array("pos",$pos_name); + print ''; + print ''; + print ' '; + print ' 
'; -print "
\n"; -print_titre("Boites activées"); +print "
\n\n"; +print_titre($langs->trans("BoxesActivated")); print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; $sql = "SELECT b.rowid, b.box_id, b.position, d.name FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d where b.box_id = d.rowid"; @@ -172,9 +168,14 @@ if ($result) $var = ! $var; $obj = $db->fetch_object( $i); - print ''; + print ''; + print ''; + print ''; + print ''; + + print "\n"; $i++; } } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 14d80bb04c4..22b44b43e08 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -64,9 +64,34 @@ print ''; print "\n"; -# Affiche lignes des constantes $form = new Form($db); + +# Affiche ligne d'ajout +$var=!$var; +print ''; +print ''; + +print "\n"; + +print '\n"; + +print ''; +print ''; + + +# Affiche lignes des constantes if ($all==1){ $sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC"; }else{ @@ -128,31 +153,6 @@ if ($result) } -# Affiche ligne d'ajout -$var=!$var; -print ''; -print ''; - -print "\n"; - -print '\n"; -print ''; - -print ''; - - - print '
BoitesActive pourDésactiver'.$langs->trans("Boxe").' '.$langs->trans("ActiveOn").''.$langs->trans("Disable").'
'.$obj->name.'' . $pos_name[$obj->position] . ''; + print '
'.$obj->name.' ' . $pos_name[$obj->position] . ''; print ''.img_delete().''; - print '
'.$langs->trans("Action").'
'; +print ''; +print ''; + +$form->select_array('consttype',array('yesno','texte','chaine'),2); +print ''; + +print ''; +print ''; + +print '
'; +print "
'; -print ''; -print ''; - -$form->select_array('consttype',array('yesno','texte','chaine'),1); -print ''; - -print ''; -print ''; - -print '
'; -print "
'; $db->close(); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index a345f8349a2..7cd6e608459 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -104,7 +104,7 @@ llxHeader(); if ($_GET["id"]) { - print_titre("Configuration des dictionnaires de données"); + print_titre($langs->trans("DictionnarySetup")); print '
'; // Complète requete recherche valeurs avec critere de tri @@ -208,7 +208,7 @@ if ($_GET["id"]) } else { - print_titre("Configuration des dictionnaires de données"); + print_titre($langs->trans("DictionnarySetup")); print '
'; foreach ($tabid as $i => $value) { diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index f08d2c07d75..d002c31e657 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -46,7 +46,7 @@ if (!defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD))) define("MAIN_MOTD",""); } -print_titre("Configuration IHM (Dolibarr version ".DOL_VERSION.")"); +print_titre($langs->trans("GUISetup")); print "
\n"; diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 91fbc46b1cf..ee8470acdcd 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -33,7 +33,7 @@ if ($_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"]); dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"]); dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"]); - dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"]); + dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"]); Header("Location: index.php"); } @@ -42,7 +42,8 @@ if ($_POST["action"] == 'update') llxHeader(); $form = new Form($db); -print_titre("Configuration générale (Dolibarr version ".DOL_VERSION.")"); +print_titre($langs->trans("GlobalSetup")); + print "
\n"; @@ -71,7 +72,7 @@ if ($_GET["action"] == 'edit') print ''; print 'Code de l\'activité économique'; - print ''; + print ''; print ''; print ''; @@ -81,7 +82,7 @@ else { print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print '
Informations sur la société/associationValeur
Informations sur la société/association'.$langs->trans("Value").'
Nom de la société/association' . MAIN_INFO_SOCIETE_NOM . '
Pays de la société'; @@ -96,8 +97,8 @@ else print '
Identifiant professionnel (SIREN,...)'; print MAIN_INFO_SIREN . '
RCS'; - print MAIN_INFO_RCS . '
Code de l\'activité économique'; + print MAIN_INFO_APE . '

'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 4837cbc9ba6..31d3966ed00 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -103,20 +103,18 @@ if (!$user->admin) exit; } -print_titre("Modules"); +print_titre($langs->trans("Modules")); -print '
'; -print 'Les modules Dolibarr définissent les fonctionnalités disponibles dans l\'application.
'; -print 'Certains modules nécessitent des droits qu\'il vous faudra affecter aux utilisateurs pour qu\'ils puissent accéder à ces fonctionnalités.
'; +print "
".$langs->trans("ModulesDesc")."
\n"; print '
'; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print ''; print "\n"; @@ -160,13 +158,13 @@ asort($orders); $var=True; $familylib=array( -'crm'=>'Gestion client (CRM)', -'products'=>'Gestion produits', -'hr'=>'Ressources humaines', -'projects'=>'Projets/Travail collaboratif', -'other'=>'Autre', -'technic'=>'Modules techniques, interfaces', -'financial'=>'Modules financiers (Compta/trésorerie)' +'crm'=>$langs->trans("ModuleFamilyCrm"), +'products'=>$langs->trans("ModuleFamilyProducts"), +'hr'=>$langs->trans("ModuleFamilyHr"), +'projects'=>$langs->trans("ModuleFamilyProjects"), +'other'=>$langs->trans("ModuleFamilyOther"), +'technic'=>$langs->trans("ModuleFamilyTechnic"), +'financial'=>$langs->trans("ModuleFamilyFinancial") ); foreach ($orders as $key => $value) { @@ -211,7 +209,7 @@ foreach ($orders as $key => $value) if ($const_value == 1) { - print 'Désactiver'; + print ''.$langs->trans("Disable").''; if ($objMod->config_page_url) @@ -221,11 +219,11 @@ foreach ($orders as $key => $value) $i=0; foreach ($objMod->config_page_url as $page) { if ($i++) { print ''.ucfirst($page).' '; } - else { print 'Configurer '; } + else { print ''.$langs->trans("Setup").' '; } } print ''; } else { - print ''; + print ''; } } else @@ -236,7 +234,7 @@ foreach ($orders as $key => $value) } else { - print 'Activer'; + print ''.$langs->trans("Activate").''; } print ''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 4368d955457..3373c6711c6 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -21,9 +21,13 @@ */ require("./pre.inc.php"); +$langs->load("users"); + + if (!$user->admin) accessforbidden(); + if ($_GET["action"] == 'add') { $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1 WHERE id =".$_GET["pid"]; @@ -38,7 +42,10 @@ if ($_GET["action"] == 'remove') llxHeader(); -print_titre("Permissions par défaut"); +print_titre($langs->trans("DefaultRights")); + +print "
".$langs->trans("DefaultRightsDesc")."

\n"; + print '
FamilleModuleInfoActifAction'.$langs->trans("Family").''.$langs->trans("Module").''.$langs->trans("Description").''.$langs->trans("Activated").''.$langs->trans("Action").' 
Configurer'.$langs->trans("Setup").'  
';