mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
New: Gestion multi-langue sur plus de page de l'espace "Configuration"
New: Amlioration de l'IHM sur l'cran d'activation des box. Il sera possible d'activer les box sur d'autres pages que la Homepage.
This commit is contained in:
parent
791ea970b7
commit
6a53682f80
|
|
@ -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 "<br>";
|
||||
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 <a href=\"modules.php\">module</a> actif sont présentées.<br>\n";
|
||||
print "<br>".$langs->trans("BoxesDesc")."<br>\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 '<br>';
|
||||
print_titre("Boites disponibles");
|
||||
print "<br>\n";
|
||||
print_titre($langs->trans("BoxesAvailable"));
|
||||
|
||||
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
|
||||
print '<table class="noborder" cellpadding="1" cellspacing="0" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Boites</td>';
|
||||
print '<td>Fichier source</td>';
|
||||
foreach ($pos_array as $position) {
|
||||
print '<td align="center">Activation '.$pos_name[$position].'</td>';
|
||||
}
|
||||
print '<td>'.$langs->trans("Boxe").'</td>';
|
||||
print '<td>'.$langs->trans("SourceFile").'</td>';
|
||||
print '<td align="center" width="180">'.$langs->trans("ActivateOn").'</td>';
|
||||
print '<td align="center" width="80"> </td>';
|
||||
print "</tr>\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 '<tr '.$bc[$var].'><td width="200">'.$obj->name.'</td><td width="200">' . $obj->file . '</td>';
|
||||
print '<form action="boxes.php" method="POST">';
|
||||
print '<tr '.$bc[$var].'><td>'.$obj->name.'</td><td>' . $obj->file . '</td>';
|
||||
|
||||
// Pour chaque position possible, on affiche un lien
|
||||
// d'activation si boite non deja active pour cette position
|
||||
foreach ($pos_array as $position) {
|
||||
print '<td width="50" align="center">';
|
||||
if (! $boxes[$position][$obj->rowid])
|
||||
{
|
||||
print '<a href="boxes.php?rowid='.$obj->rowid.'&action=add&pos='.$position.'">'.$langs->trans("Add").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="center">';
|
||||
$html=new Form($db);
|
||||
print $html->select_array("pos",$pos_name);
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="boxid" value="'.$obj->rowid.'">';
|
||||
print ' <input type="submit" name="button" value="'.$langs->trans("Activate").'">';
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
|
@ -149,14 +144,15 @@ $db->free();
|
|||
print '</table>';
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print_titre("Boites activées");
|
||||
print "<br>\n\n";
|
||||
print_titre($langs->trans("BoxesActivated"));
|
||||
|
||||
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Boites</td>';
|
||||
print '<td>Active pour</td>';
|
||||
print '<td align="center">Désactiver</td>';
|
||||
print '<td>'.$langs->trans("Boxe").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center" width="180">'.$langs->trans("ActiveOn").'</td>';
|
||||
print '<td align="center" width="80">'.$langs->trans("Disable").'</td>';
|
||||
print "</tr>\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 '<tr '.$bc[$var].'><td width="200">'.$obj->name.'</td><td width="200">' . $pos_name[$obj->position] . '</td><td width="50" align="center">';
|
||||
print '<tr '.$bc[$var].'><td>'.$obj->name.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center">' . $pos_name[$obj->position] . '</td>';
|
||||
print '<td align="center">';
|
||||
print '<a href="boxes.php?rowid='.$obj->rowid.'&action=delete">'.img_delete().'</a>';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,9 +64,34 @@ print '<td>'.$langs->trans("Action").'</td>';
|
|||
print "</tr>\n";
|
||||
|
||||
|
||||
# Affiche lignes des constantes
|
||||
$form = new Form($db);
|
||||
|
||||
|
||||
# Affiche ligne d'ajout
|
||||
$var=!$var;
|
||||
print '<form action="const.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print "<tr $bc[$var] class=value><td><input type=\"text\" size=\"15\" name=\"constname\" value=\"\"></td>\n";
|
||||
|
||||
print '<td>';
|
||||
print '<input type="text" size="30" name="constvalue" value="">';
|
||||
print '</td><td>';
|
||||
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),2);
|
||||
print '</td><td>';
|
||||
|
||||
print '<input type="text" size="15" name="constnote" value="">';
|
||||
print '</td><td>';
|
||||
|
||||
print '<input type="Submit" value="'.$langs->trans("Add").'" name="Button"><BR>';
|
||||
print "</td>\n";
|
||||
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
# 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 '<form action="const.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print "<tr $bc[$var] class=value><td><input type=\"text\" size=\"15\" name=\"constname\" value=\"\"></td>\n";
|
||||
|
||||
print '<td>';
|
||||
print '<input type="text" size="30" name="constvalue" value="">';
|
||||
print '</td><td>';
|
||||
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),1);
|
||||
print '</td><td>';
|
||||
|
||||
print '<input type="text" size="15" name="constnote" value="">';
|
||||
print '</td><td>';
|
||||
|
||||
print '<input type="Submit" value="'.$langs->trans("Add").'" name="Button"><BR>';
|
||||
print "</td>\n";
|
||||
print '</form>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
$db->close();
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ llxHeader();
|
|||
|
||||
if ($_GET["id"])
|
||||
{
|
||||
print_titre("Configuration des dictionnaires de données");
|
||||
print_titre($langs->trans("DictionnarySetup"));
|
||||
print '<br>';
|
||||
|
||||
// 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 '<br>';
|
||||
|
||||
foreach ($tabid as $i => $value) {
|
||||
|
|
|
|||
|
|
@ -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 "<br>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 "<br>\n";
|
||||
|
||||
|
|
@ -71,7 +72,7 @@ if ($_GET["action"] == 'edit')
|
|||
print '<input name="siren" size="20" value="' . MAIN_INFO_SIREN . '"></td></tr>';
|
||||
|
||||
print '<tr class="pair"><td width="50%">Code de l\'activité économique</td><td>';
|
||||
print '<input name="rcs" size="20" value="' . MAIN_INFO_APE . '"></td></tr>';
|
||||
print '<input name="ape" size="20" value="' . MAIN_INFO_APE . '"></td></tr>';
|
||||
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" value="Enregistrer"></td></tr>';
|
||||
|
|
@ -81,7 +82,7 @@ else
|
|||
{
|
||||
|
||||
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
|
||||
print '<tr class="liste_titre"><td>Informations sur la société/association</td><td>Valeur</td></tr>';
|
||||
print '<tr class="liste_titre"><td>Informations sur la société/association</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="impair"><td width="50%">Nom de la société/association</td><td>' . MAIN_INFO_SOCIETE_NOM . '</td></tr>';
|
||||
|
||||
print '<tr class="pair"><td>Pays de la société</td><td>';
|
||||
|
|
@ -96,8 +97,8 @@ else
|
|||
print '<tr class="impair"><td width="50%">Identifiant professionnel (SIREN,...)</td><td>';
|
||||
print MAIN_INFO_SIREN . '</td></tr>';
|
||||
|
||||
print '<tr class="pair"><td width="50%">RCS</td><td>';
|
||||
print MAIN_INFO_RCS . '</td></tr>';
|
||||
print '<tr class="pair"><td width="50%">Code de l\'activité économique</td><td>';
|
||||
print MAIN_INFO_APE . '</td></tr>';
|
||||
|
||||
|
||||
print '</table><br>';
|
||||
|
|
|
|||
|
|
@ -103,20 +103,18 @@ if (!$user->admin)
|
|||
exit;
|
||||
}
|
||||
|
||||
print_titre("Modules");
|
||||
print_titre($langs->trans("Modules"));
|
||||
|
||||
print '<br>';
|
||||
print 'Les modules Dolibarr définissent les fonctionnalités disponibles dans l\'application.<br>';
|
||||
print 'Certains modules nécessitent des droits qu\'il vous faudra affecter aux utilisateurs pour qu\'ils puissent accéder à ces fonctionnalités.<br>';
|
||||
print "<br>".$langs->trans("ModulesDesc")."<br>\n";
|
||||
|
||||
print '<br>';
|
||||
print '<table class="noborder" cellpadding="3" cellspacing="0">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Famille</td>';
|
||||
print '<td>Module</td>';
|
||||
print '<td>Info</td>';
|
||||
print '<td align="center">Actif</td>';
|
||||
print '<td align="center">Action</td>';
|
||||
print '<td>'.$langs->trans("Family").'</td>';
|
||||
print '<td>'.$langs->trans("Module").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Action").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\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 '<a href="modules.php?action=reset&value='.$modName.'">Désactiver</a></td>';
|
||||
print '<a href="modules.php?action=reset&value='.$modName.'">'.$langs->trans("Disable").'</a></td>';
|
||||
|
||||
|
||||
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 '<a href="'.$page.'">'.ucfirst($page).'</a> '; }
|
||||
else { print '<a href="'.$page.'">Configurer</a> '; }
|
||||
else { print '<a href="'.$page.'">'.$langs->trans("Setup").'</a> '; }
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td><a href="'.$objMod->config_page_url.'">Configurer</a></td>';
|
||||
print '<td><a href="'.$objMod->config_page_url.'">'.$langs->trans("Setup").'</a></td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -236,7 +234,7 @@ foreach ($orders as $key => $value)
|
|||
}
|
||||
else
|
||||
{
|
||||
print '<a href="modules.php?action=set&value='.$modName.'">Activer</a></td><td> </td>';
|
||||
print '<a href="modules.php?action=set&value='.$modName.'">'.$langs->trans("Activate").'</a></td><td> </td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -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 "<br>".$langs->trans("DefaultRightsDesc")."<br><br>\n";
|
||||
|
||||
|
||||
print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%">';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user