From 3dadf24d1069d03e84b15c0c40ac93168dd53e0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Mar 2009 19:07:12 +0000 Subject: [PATCH] Look: Uniformize pages look --- htdocs/adherents/fiche.php | 2 +- htdocs/categories/edit.php | 18 +- htdocs/commande/fiche.php | 2 +- htdocs/compta/paiement/index.php | 18 +- htdocs/fourn/facture/fiche.php | 4 +- htdocs/fourn/product/index.php | 4 +- htdocs/fourn/product/photos.php | 286 +++++++++++++++---------------- htdocs/livraison/fiche.php | 2 +- htdocs/soc.php | 2 +- htdocs/user/fiche.php | 2 +- htdocs/user/group/fiche.php | 2 +- htdocs/user/group/index.php | 10 +- htdocs/user/group/ldap.php | 2 +- htdocs/user/index.php | 2 +- htdocs/user/ldap.php | 2 +- 15 files changed, 180 insertions(+), 178 deletions(-) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 60a70777e2b..d70270b8fcb 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -710,7 +710,7 @@ if ($action == 'create') $htmls = new Form($db); $adht = new AdherentType($db); - print_titre($langs->trans("NewMember")); + print_fiche_titre($langs->trans("NewMember")); print '
'; print ''; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 2a42576a9d7..885be31dce8 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -32,9 +32,9 @@ require "./pre.inc.php"; if (!$user->rights->categorie->lire) accessforbidden(); - + $type=$_REQUEST['type']; - + // If socid provided by ajax company selector if (! empty($_POST['socid_id'])) { @@ -47,17 +47,17 @@ if ($_POST["action"] == 'update' && $user->rights->categorie->creer) { $categorie = new Categorie ($db); $result=$categorie->fetch($_REQUEST['id']); - + $categorie->label = $_POST["nom"]; $categorie->description = $_POST["description"]; $categorie->socid = ($_POST["socid"] ? $_POST["socid"] : 'null'); $categorie->visible = $_POST["visible"]; - + if($_POST['catMere'] != "-1") $categorie->id_mere = $_POST['catMere']; else $categorie->id_mere = ""; - + if (! $categorie->label) { @@ -95,8 +95,8 @@ if ($_POST["action"] == 'update' && $user->rights->categorie->creer) llxHeader("","",$langs->trans("Categories")); -print_titre($langs->trans("ModifCat")); -print "
"; +print_fiche_titre($langs->trans("ModifCat")); + if ($mesg) { @@ -156,13 +156,13 @@ else print ''.$langs->trans("AddIn").''; print $html->select_all_categories($categorie->type,$categorie->id_mere); print ''; - + print ''.$langs->trans("ContentsVisibleByAll").''; print $html->selectyesno("visible",$categorie->visible,1); print ''; print ''; } - + print ''; print ''; print '
'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index e047fde01dd..f91a5102138 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -814,7 +814,7 @@ $formorder = new FormOrder($db); *********************************************************************/ if ($_GET['action'] == 'create' && $user->rights->commande->creer) { - print_titre($langs->trans('CreateOrder')); + print_fiche_titre($langs->trans('CreateOrder')); if ($mesg) print $mesg.'
'; diff --git a/htdocs/compta/paiement/index.php b/htdocs/compta/paiement/index.php index 0ba3e0cad6a..dfc908f8a5b 100644 --- a/htdocs/compta/paiement/index.php +++ b/htdocs/compta/paiement/index.php @@ -21,24 +21,22 @@ */ require("./pre.inc.php"); -/* - * Sécurité accés - */ +// Security check if (!$user->admin && $user->societe_id > 0) accessforbidden(); +/* + * View + */ + llxHeader(); -print_titre("Paiements"); -/* - * - * - */ +print_fiche_titre("Payments"); $db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); + +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 245f4b373f5..b56a7b081b8 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -365,7 +365,7 @@ llxHeader('','',''); // Mode creation if ($_GET['action'] == 'create') { - print_titre($langs->trans('NewBill')); + print_fiche_titre($langs->trans('NewBill')); if ($mesg) { print $mesg.'
'; } @@ -471,7 +471,7 @@ else if ($_GET['action'] == 'edit') { - print_titre($langs->trans('SupplierInvoice')); + print_fiche_titre($langs->trans('SupplierInvoice')); print '
'; print ''; diff --git a/htdocs/fourn/product/index.php b/htdocs/fourn/product/index.php index a69219e3843..9d0b1368950 100644 --- a/htdocs/fourn/product/index.php +++ b/htdocs/fourn/product/index.php @@ -39,7 +39,7 @@ if (!$user->rights->produit->lire) accessforbidden(); llxHeader("","",$langs->trans("ProductsAndServices")); -print_titre($langs->trans("ProductsAndServicesArea")); +print_fiche_titre($langs->trans("ProductsAndServicesArea")); print ''; @@ -117,7 +117,7 @@ if ($resql) print '
'; print ''; - + $var=True; while ($i < $num) { diff --git a/htdocs/fourn/product/photos.php b/htdocs/fourn/product/photos.php index 408e45e7cbe..f644aa0725f 100644 --- a/htdocs/fourn/product/photos.php +++ b/htdocs/fourn/product/photos.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/fourn/product/photos.php - \ingroup product - \brief Page de la fiche produit - \version $Id$ -*/ + \file htdocs/fourn/product/photos.php + \ingroup product + \brief Page de la fiche produit + \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); @@ -37,13 +37,13 @@ if (!$user->rights->produit->lire) accessforbidden(); if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - if ($_GET["id"]) - { - $product = new Product($db); - $result = $product->fetch($_GET["id"]); + if ($_GET["id"]) + { + $product = new Product($db); + $result = $product->fetch($_GET["id"]); - $product->add_photo($conf->produit->dir_output, $_FILES['photofile']); - } + $product->add_photo($conf->produit->dir_output, $_FILES['photofile']); + } } /* * @@ -55,161 +55,161 @@ llxHeader("","",$langs->trans("CardProduct0")); */ if ($_GET["id"]) { - $product = new Product($db); - $result = $product->fetch($_GET["id"]); + $product = new Product($db); + $result = $product->fetch($_GET["id"]); - if ( $result ) - { - /* - * En mode visu - */ - - $h=0; - - $head[$h][0] = DOL_URL_ROOT."/fourn/product/fiche.php?id=".$product->id; - $head[$h][1] = $langs->trans("Card"); - $h++; - - - if ($conf->stock->enabled) + if ( $result ) { + /* + * En mode visu + */ + + $h=0; + + $head[$h][0] = DOL_URL_ROOT."/fourn/product/fiche.php?id=".$product->id; + $head[$h][1] = $langs->trans("Card"); + $h++; + + + if ($conf->stock->enabled) + { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; $head[$h][1] = $langs->trans("Stock"); $h++; - } - - $head[$h][0] = DOL_URL_ROOT."/fourn/product/photos.php?id=".$product->id; - $head[$h][1] = $langs->trans("Photos"); - $hselected = $h; - $h++; + } - //Affichage onglet Catégories - if ($conf->categorie->enabled){ - $head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id; - $head[$h][1] = $langs->trans('Categories'); - $h++; - } + $head[$h][0] = DOL_URL_ROOT."/fourn/product/photos.php?id=".$product->id; + $head[$h][1] = $langs->trans("Photos"); + $hselected = $h; + $h++; - $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; - $head[$h][1] = $langs->trans("CommercialCard"); - $h++; - - dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); + //Affichage onglet Catégories + if ($conf->categorie->enabled){ + $head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id; + $head[$h][1] = $langs->trans('Categories'); + $h++; + } - print($mesg); - print '
'.$langs->trans("LastProducts").'
'; - print ""; - print ''; - print ''; + print ''; + print ''; + print "
'.$langs->trans("Ref").''.$product->ref.''; + $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; + $head[$h][1] = $langs->trans("CommercialCard"); + $h++; + + dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); + + print($mesg); + print ''; + print ""; + print ''; + print ''; - print ''; - print ''; - print "
'.$langs->trans("Ref").''.$product->ref.''; print $product->getLibStatut(2); - print '
'.$langs->trans("Label").''.$product->libelle.''.$langs->trans("SellingPrice").''.price($product->price).'

\n"; + print '
'.$langs->trans("Label").''.$product->libelle.''.$langs->trans("SellingPrice").''.price($product->price).'

\n"; + + /* + * Ajouter une photo + * + */ + if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC)) + { + print_titre($langs->trans("AddPhoto")); + + print ''; + print ''; + + print ''; + print ''; + print ''; + + print ''; + print '
'.$langs->trans("File").'
'; + print ' '; + + + print '
'; + print '

'; + } + + + // Affiche photos + if ($_GET["action"] != 'ajout_photo') + { + $nbphoto=0; + $nbbyrow=5; + + $pdir = get_exdir($product->id,2) . $product->id ."/photos/"; + $dir = $conf->produit->dir_output . '/'. $pdir; + + print '
'; + + foreach ($product->liste_photos($dir) as $obj) + { + $nbphoto++; + + // if ($nbbyrow && $nbphoto == 1) print '
'; + + if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print ''; + if ($nbbyrow) print ''; + if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print ''; + } + + // Ferme tableau + while ($nbphoto % $nbbyrow) + { + print ''; + $nbphoto++; + } + + if ($nbphoto < 1) + { + print '
'; + + print ''; + + // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine + if ($obj['photo_vignette']) $filename=$obj['photo_vignette']; + else $filename=$obj['photo']; + print ''; + + print ''; + print '
'.$langs->trans("File").': '.dol_trunc($filename,16); + if ($user->rights->produit->creer) + { + print '
'.''.img_delete().''; + } + if ($nbbyrow) print '
 
'; + print "
".$langs->trans("NoPhotoYet")."

"; + print '
'; + } + + print ''; + } + + + print "\n"; - /* - * Ajouter une photo - * - */ - if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC)) - { - print_titre($langs->trans("AddPhoto")); - - print '
'; - print ''; - - print ''; - print ''; - print ''; - - print ''; - print '
'.$langs->trans("File").'
'; - print ' '; - - - print '
'; - print '

'; } + print "\n
\n"; - // Affiche photos - if ($_GET["action"] != 'ajout_photo') - { - $nbphoto=0; - $nbbyrow=5; - - $pdir = get_exdir($product->id,2) . $product->id ."/photos/"; - $dir = $conf->produit->dir_output . '/'. $pdir; - - print '
'; - - foreach ($product->liste_photos($dir) as $obj) - { - $nbphoto++; - -// if ($nbbyrow && $nbphoto == 1) print '
'; - - if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print ''; - if ($nbbyrow) print ''; - if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print ''; - } - - // Ferme tableau - while ($nbphoto % $nbbyrow) - { - print ''; - $nbphoto++; - } - - if ($nbphoto < 1) - { - print '
'; - - print ''; - - // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine - if ($obj['photo_vignette']) $filename=$obj['photo_vignette']; - else $filename=$obj['photo']; - print ''; - - print ''; - print '
'.$langs->trans("File").': '.dol_trunc($filename,16); - if ($user->rights->produit->creer) - { - print '
'.''.img_delete().''; - } - if ($nbbyrow) print '
 
'; - print "
".$langs->trans("NoPhotoYet")."

"; - print '
'; - } - - print ''; - } - - - print "
\n"; - - } - - print "\n
\n"; - - if ($_GET["action"] == '') - { - if ( $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC)) + if ($_GET["action"] == '') { + if ( $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC)) + { print ''; print $langs->trans("AddPhoto").''; - } -} + } + } -print "\n
\n"; + print "\n\n"; } else { - print $langs->trans("ErrorUnknown"); + print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 3fcf99ce8c6..367db064051 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -175,7 +175,7 @@ $formfile = new FormFile($db); if ($_GET["action"] == 'create') { - print_titre($langs->trans("CreateADeliveryOrder")); + print_fiche_titre($langs->trans("CreateADeliveryOrder")); if ($mesg) { diff --git a/htdocs/soc.php b/htdocs/soc.php index a6b2c4adf9f..bbd123c01b0 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -345,7 +345,7 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create') $soc->pays=$obj->libelle; } - print_titre($langs->trans("NewCompany")); + print_fiche_titre($langs->trans("NewCompany")); if ($conf->use_javascript_ajax) { diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 24cef122f03..7218c487c05 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -401,7 +401,7 @@ if (($action == 'create') || ($action == 'adduserldap')) /* */ /* ************************************************************************** */ - print_titre($langs->trans("NewUser")); + print_fiche_titre($langs->trans("NewUser")); print "
"; print $langs->trans("CreateInternalUserDesc"); diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index d395a1c06e1..741a2a13825 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -162,7 +162,7 @@ llxHeader('',$langs->trans("GroupCard")); if ($action == 'create') { - print_titre($langs->trans("NewGroup")); + print_fiche_titre($langs->trans("NewGroup")); print "
"; if ($message) { print $message."
"; } diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index 8ca5a4031ff..b6a0b10c0df 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -18,7 +18,7 @@ * * $Id$ */ - + /** \file htdocs/user/group/index.php \brief Page d'accueil de la gestion des groupes @@ -41,14 +41,18 @@ if ($page < 0) $page = 0; $limit = $conf->liste_limit; $offset = $limit * $page ; - + if (! $sortfield) $sortfield="g.nom"; if (! $sortorder) $sortorder="ASC"; +/* + * View + */ + llxHeader(); -print_titre($langs->trans("ListOfGroups")); +print_fiche_titre($langs->trans("ListOfGroups")); $sql = "SELECT g.rowid, g.nom, ".$db->pdate("g.datec")." as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index 7aa0ba77485..799853d5ad0 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -128,7 +128,7 @@ if ($result > 0) { if (! is_array($records)) { - print ''.$langs->trans("ErrorFailedToReadLDAP").''; + print ''.$langs->trans("ErrorFailedToReadLDAP").''; } else { diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 2790060c682..00fa8688b3b 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -52,7 +52,7 @@ $userstatic=new User($db); llxHeader(); -print_titre($langs->trans("ListOfUsers")); +print_fiche_titre($langs->trans("ListOfUsers")); $sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.fk_societe, u.login,"; $sql.= " ".$db->pdate("u.datec")." as datec,"; diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 133f2a9e1df..9b036c6933c 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -208,7 +208,7 @@ if ($result > 0) { if (! is_array($records)) { - print ''.$langs->trans("ErrorFailedToReadLDAP").''; + print ''.$langs->trans("ErrorFailedToReadLDAP").''; } else {