Uniformisation du look des pages de config des modules.

This commit is contained in:
Laurent Destailleur 2004-02-20 23:40:13 +00:00
parent c4466fba22
commit 6917ba2a8f
10 changed files with 214 additions and 80 deletions

View File

@ -1,6 +1,7 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -92,7 +93,7 @@ print_titre("Gestion des adh
/*
* Mailman
*/
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print "<tr $bc[$var] class=value><td>Mailman</td><td>Système de mailing listes";
print '</td><td align="center">';
@ -127,7 +128,7 @@ print "<HR><BR>\n";
/*
* Gestion banquaire
*/
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print "<tr $bc[$var] class=value><td>Gestion Banquaire</td><td>Gestion banquaire des adherents";
print '</td><td align="center">';
@ -159,7 +160,7 @@ print "<HR><BR>\n";
* Spip
*/
$var=!$var;
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print "<tr $bc[$var] class=value><td>Spip</td><td>Système de publication en ligne";
print '</td><td align="center">';
@ -193,7 +194,7 @@ print "<HR><BR>\n";
* Glasnost
*/
$var=!$var;
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print "<tr $bc[$var] class=value><td>Glasnost</td><td>Système de vote en ligne";
print '</td><td align="center">';
@ -226,7 +227,7 @@ $var=!$var;
/*
* Edition des varibales globales non rattache a un theme specifique
*/
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print "<tr $bc[$var] class=value><td>Variables globales</td><td>Variables globales non rattachées a un thème";
print '</td></tr>';
print '</table>';
@ -256,7 +257,7 @@ function form_constantes($tableau){
// Variables globales
global $db,$bc;
$form = new Form($db);
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print '<TR class="liste_titre">';
print '<TD>Description</TD>';
print '<TD>Valeur</TD>';
@ -305,8 +306,8 @@ function form_constantes($tableau){
// print '<input type="text" size="15" name="constnote" value="'.stripslashes(nl2br($obj->note)).'">';
// print '</td><td>';
print '<input type="Submit" value="Update" name="Button"><BR>';
print '<a href="'.$PHP_SELF.'?name=$const&action=unset">Delete</a>';
print '<input type="Submit" value="Update" name="Button"> &nbsp;';
print '<a href="'.$PHP_SELF.'?name='.$const.'&action=unset">'.img_delete().'</a>';
print "</td></tr>\n";
print '</form>';

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -52,11 +53,13 @@ if ($action == 'setmod')
$dir = "../includes/modules/commande/";
print_titre("Configuration des commandes");
print_titre("Configuration du module Commandes");
print_titre("Module de numérotation");
print "<br>";
print '<table class="border" cellpadding="3" cellspacing="0">';
print_titre("Module de numérotation des commandes");
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<TR class="liste_titre">';
print '<td>Nom</td><td>Info</td>';
print '<td align="center">Activé</td><td>&nbsp;</td>';
@ -80,22 +83,21 @@ if ($handle)
print '<tr class="pair"><td>'.$modCommande->nom."</td><td>\n";
print $modCommande->info();
print '</td><td align="center">';
print '</td>';
if ($commande_addon_var == "$file")
{
print '<td align="center">';
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
print '</td><td>&nbsp;</td>';
}
else
{
print "&nbsp;";
print '<td>&nbsp;</td>';
print '<td align="center"><a href="'.$PHP_SELF.'?action=setmod&amp;value='.$file.'">activer</a></td>';
}
print "</td><td>\n";
print '<a href="commande.php?action=setmod&value='.$file.'">activer</a>';
print '</td></tr>';
print '</tr>';
}
}
closedir($handle);

View File

@ -32,26 +32,137 @@ $compta_mode = defined("COMPTA_MODE")?COMPTA_MODE:"RECETTES-DEPENSES";
if ($action == 'setcomptamode')
{
$compta_mode = $HTTP_POST_VARS["compta_mode"];
dolibarr_set_const($db, "COMPTA_MODE",$compta_mode);
if (! dolibarr_set_const($db, "COMPTA_MODE",$compta_mode)) { print $db->error(); }
}
print_titre("Module de comptabilité");
$form = new Form($db);
$typeconst=array('yesno','texte','chaine');
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
{
if (! dolibarr_set_const($db, $HTTP_POST_VARS["constname"],$HTTP_POST_VARS["constvalue"],$typeconst[$HTTP_POST_VARS["consttype"]],0,isset($HTTP_POST_VARS["constnote"])?$HTTP_POST_VARS["constnote"]:''));
{
print $db->error();
}
}
if ($_GET["action"] == 'delete')
{
if (! dolibarr_del_const($db, $_GET["constname"]));
{
print $db->error();
}
}
print_titre("Configuration du module Comptabilité");
print "<br>";
print '<table class="noborder" cellpadding="3" cellspacing="0" width=\"100%\">';
print '<form action="'.$PHP_SELF.'" method="post">';
print '<input type="hidden" name="action" value="setcomptamode">';
print '<TR class="liste_titre">';
print '<tr class="liste_titre">';
print '<td>Option de tenue de comptabilité</td><td>Description</td>';
print '<td><input type="submit" value="Modifier"></td>';
print "</TR>\n";
print "</tr>\n";
print "<tr ".$bc[True]."><td width=\"200\"><input type=\"radio\" name=\"compta_mode\" value=\"RECETTES-DEPENSES\"".($compta_mode != "CREANCES-DETTES"?" checked":"")."> Option Recettes-Dépenses</td>";
print "<td colspan=\"2\">Dans ce mode, le CA est calculé sur la base des factures à l'état payé.\nLa validité des chiffres n'est donc assurée que si la tenue de la comptabilité passe rigoureusement par des entrées/sorties sur les comptes via des factures.\nDe plus, dans cette version, Dolibarr utilise la date de passage de la facture à l'état 'Validé' et non la date de passage à l'état 'Payé'.</td></tr>\n";
print "<tr ".$bc[False]."><td width=\"200\"><input type=\"radio\" name=\"compta_mode\" value=\"CREANCES-DETTES\"".($compta_mode == "CREANCES-DETTES"?" checked":"")."> Option Créances-Dettes</td>";
print "<td colspan=\"2\">Dans ce mode, le CA est calculé sur la base des factures validées. Qu'elles soient ou non payés, dès lors qu'elles sont dues, elles apparaissent dans le résultat.</td></tr>\n";
print "</form>";
print "</table>";
print "</table>\n";
print "<br>\n";
$sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE name like 'COMPTA_%' and name not in ('COMPTA_MODE')";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$i = 0;
$var=True;
if ($num) {
print '<table class="noborder" cellpadding="3" cellspacing="0" width=\"100%\">';
print '<tr class="liste_titre">';
print '<td>Autres option du module comptabilité</td><td>&nbsp;</td><td>&nbsp;</td><td>Description</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
}
while ($i < $num)
{
$obj = $db->fetch_object( $i);
$var=!$var;
print '<form action="'.$PHP_SELF.'" method="POST">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="'.$obj->name.'">';
print "<tr $bc[$var] class=value><td>$obj->name</td>\n";
print '<td>';
if ($obj->type == 'yesno')
{
$form->selectyesnonum('constvalue',$obj->value);
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),0);
}
elseif ($obj->type == 'texte')
{
print '<textarea name="constvalue" cols="35" rows="5" wrap="soft">';
print $obj->value;
print "</textarea>\n";
print '</td><td>';
$form->select_array('consttype',array('yesno','texte','chaine'),1);
}
else
{
print '<input type="text" size="30" name="constvalue" value="'.stripslashes($obj->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="'.stripslashes(nl2br($obj->note)).'">';
print '</td><td>';
print '<input type="Submit" value="Update" name="Button"> &nbsp; ';
print '<a href="'.$PHP_SELF.'?constname='.$obj->name.'&action=delete">'.img_delete().'</a>';
print "</td></tr>\n";
print '</form>';
$i++;
}
if ($num) {
print "</table>\n";
}
}
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -43,37 +43,26 @@ print "</TR>\n";
$form = new Form($db);
$typeconst=array('yesno','texte','chaine');
if ($user->admin)
{
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
{
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."'";
}else{
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
}
$result = $db->query($sql);
if (!$result)
{
print $db->error();
}
}
if ($action == 'delete')
{
$sql = "DELETE FROM llx_const WHERE rowid='$rowid'";
$result = $db->query($sql);
if (!$result)
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
{
if (! dolibarr_set_const($db, $HTTP_POST_VARS["constname"],$HTTP_POST_VARS["constvalue"],$typeconst[$HTTP_POST_VARS["consttype"]],0,isset($HTTP_POST_VARS["constnote"])?$HTTP_POST_VARS["constnote"]:''));
{
print $db->error();
print $db->error();
}
}
}
if ($_GET["action"] == 'delete')
{
if (! dolibarr_del_const($db, $HTTP_POST_VARS["constname"]));
{
print $db->error();
}
}
if ($all==1){
$sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC";
}else{

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -125,9 +126,13 @@ $dir = DOL_DOCUMENT_ROOT."/includes/modules/expedition/";
* Méthode de livraison
*/
print_titre("Configuration du module Expedition/Livraisons");
print "<br>";
print_titre("Méthode de livraison");
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print '<tr class="liste_titre">';
print '<td>Nom</td><td>Info</td>';
print '<td align="center" colspan="2">Actif</td>';
@ -190,14 +195,15 @@ closedir($handle);
print '</table>';
print '<br>';
/*
* PDF
*
*/
print_titre("Modèles bordereau de livraison");
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print '<tr class="liste_titre">';
print '<td>Nom</td><td>Info</td>';
print '<td align="center" colspan="2">Actif</td>';

View File

@ -58,6 +58,10 @@ if ($action == 'settvaoption')
$dir = "../includes/modules/facture/";
print_titre("Configuration du module Factures");
print "<br>";
print_titre("Module de numérotation des factures");
print '<table class="noborder" cellpadding="3" cellspacing="0" width=\"100%\">';

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -49,12 +50,16 @@ if ($action == 'setpdf')
$dir = "../includes/modules/fichinter/";
/*
* PDF
*
*/
print_titre("Configuration du module Fiches d'interventions");
print "<br>";
print_titre("Modèles de fiche d'intervention pdf");
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<TR class="liste_titre">';
print '<td>Nom</td>';
print '<td>Info</td>';

View File

@ -1,6 +1,7 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -169,7 +170,17 @@ foreach ($orders as $key => $value)
if ($objMod->config_page_url)
{
print '<td><a href="'.$objMod->config_page_url.'">Configurer</a></td>';
if (is_array($objMod->config_page_url)) {
print '<td>';
$i=0;
foreach ($objMod->config_page_url as $page) {
if ($i++) { print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;'; }
else { print '<a href="'.$page.'">Configurer</a>&nbsp;'; }
}
print '</td>';
} else {
print '<td><a href="'.$objMod->config_page_url.'">Configurer</a></td>';
}
}
else
{

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -105,15 +106,19 @@ if ($action == 'setmod')
*
*/
print_titre("Module de numérotation");
print_titre("Configuration du module Propositions Commerciales");
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<TR class="liste_titre">';
print "<br>";
print_titre("Module de numérotation des propositions commerciales");
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre">';
print '<td>Nom</td>';
print '<td>Info</td>';
print '<td align="center">Activé</td>';
print '<td>&nbsp;</td>';
print "</TR>\n";
print "</tr>\n";
clearstatcache();
@ -131,24 +136,23 @@ if ($handle)
$modPropale = new $file;
print '<tr class="pair"><td>'.$file."</td><td>\n";
print '<tr class="pair"><td width="140">'.$file."</td><td>\n";
print $modPropale->info();
print '</td><td align="center">';
print '</td>';
if ($propale_addon_var == "$file")
{
print '<td align="center">';
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
print '</td><td>&nbsp;</td>';
}
else
{
print "&nbsp;";
print '<td>&nbsp;</td>';
print '<td align="center"><a href="'.$PHP_SELF.'?action=setmod&amp;value='.$file.'">activer</a></td>';
}
print "</td><td>\n";
print '<a href="propale.php?action=setmod&amp;value='.$file.'">activer</a>';
print '</td></tr>';
print '</tr>';
}
}
closedir($handle);
@ -187,13 +191,13 @@ $dir = "../includes/modules/propale/";
print_titre("Modèles de propale pdf");
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<TR class="liste_titre">';
print '<td>Nom</td>';
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre">';
print '<td width="140">Nom</td>';
print '<td>Info</td>';
print '<td align="center" colspan="2">Actif</td>';
print '<td align="center" colspan="2">Défaut</td>';
print "</TR>\n";
print '<td colspan="2">Actif</td>';
print '<td colspan="2">Défaut</td>';
print "</tr>\n";
clearstatcache();
@ -257,12 +261,12 @@ print '</table>';
*/
print_titre("Formulaire de création");
print '<form method="post" action="propale.php?action=nbprod">';
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<TR class="liste_titre">';
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre">';
print '<td>Nom</td>';
print '<td>Valeur</td><td>&nbsp;</td>';
print "</TR>\n";
print '<tr><td>';
print "</tr>\n";
print '<tr class="pair"><td>';
print 'Nombre de ligne produits</td><td align="center">';
print '<input size="3" type="text" name="value" value="'.PROPALE_NEW_FORM_NB_PRODUCT.'">';
print '</td><td><input type="submit" value="changer"></td></tr></table></form>';