From e74f258d186f2820473e2d0b36a82c0f11e0ee33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Mar 2009 19:10:23 +0000 Subject: [PATCH] New: Some pages can link to wiki help pages --- htdocs/fourn/facture/index.php | 28 ++-- htdocs/fourn/facture/pre.inc.php | 256 +++++++++++++++---------------- 2 files changed, 139 insertions(+), 145 deletions(-) diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index af950ae2f5a..49a3f477da8 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/fourn/facture/index.php - \ingroup fournisseur,facture - \brief Lsite des factures fournisseurs - \version $Id$ -*/ + * \file htdocs/fourn/facture/index.php + * \ingroup fournisseur,facture + * \brief List of suppliers invoices + * \version $Id$ + */ require("./pre.inc.php"); @@ -34,7 +34,7 @@ $langs->load("companies"); $socid = $_GET["socid"]; // Security check -if ($user->societe_id > 0) +if ($user->societe_id > 0) { $_GET["action"] = ''; $socid = $user->societe_id; @@ -43,7 +43,7 @@ if ($user->societe_id > 0) $page=$_GET["page"]; $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; - + if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -64,7 +64,7 @@ if ($_POST["mode"] == 'search') $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; $sql.= " WHERE s.nom like '%".addslashes(strtolower($socname))."%'"; } - + if ( $db->query($sql) ) { if ( $db->num_rows() == 1) @@ -75,17 +75,17 @@ if ($_POST["mode"] == 'search') $db->free(); } } - + /* * View */ - + $now=gmmktime(); -llxHeader(); +llxHeader($langs->trans("SuppliersInovices"),'','EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); $sql = "SELECT s.rowid as socid, s.nom, "; $sql.= " fac.rowid as ref, fac.rowid as facid, fac.facnumber, ".$db->pdate("fac.datef")." as datef, ".$db->pdate("fac.date_lim_reglement")." as date_echeance,"; @@ -229,10 +229,10 @@ if ($resql) // \todo le montant deja pay� obj->am n'est pas d�finie print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am); print ''; - + print "\n"; $i++; - + if ($i == min($num,$limit)) { // Print total @@ -244,7 +244,7 @@ if ($resql) print "\n"; } } - + print "\n"; print "\n"; $db->free($resql); diff --git a/htdocs/fourn/facture/pre.inc.php b/htdocs/fourn/facture/pre.inc.php index e469c5acc8b..e53d115fb67 100644 --- a/htdocs/fourn/facture/pre.inc.php +++ b/htdocs/fourn/facture/pre.inc.php @@ -21,143 +21,137 @@ */ /** - \file htdocs/fourn/facture/pre.inc.php - \ingroup fournisseur,facture - \brief Fichier gestionnaire du menu factures fournisseurs -*/ + \file htdocs/fourn/facture/pre.inc.php + \ingroup fournisseur,facture + \brief Fichier gestionnaire du menu factures fournisseurs + */ require("../../main.inc.php"); require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"; require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"; -function llxHeader($head = "", $title = "", $addons='') +function llxHeader($head = '', $title = '', $help_url='') { - global $user, $conf, $langs; - - $langs->load("suppliers"); - $langs->load("propal"); - - top_menu($head, $title); - - $menu = new Menu(); - - - if (is_array($addons)) - { - $menu->add($addons[0][0], $addons[0][1]); - } - - - if ($conf->fournisseur->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - // Sécurité accés client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - } - - if ($conf->societe->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - } - - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/impayees.php",$langs->trans("Unpayed")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - - - $langs->load("orders"); - if ($user->rights->fournisseur->commande->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } - - $langs->load("products"); - if ($conf->produit->enabled || $conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); - } - - - $menu = new Menu(); - - - if (is_array($addons)) - { - $menu->add($addons[0][0], $addons[0][1]); - } - - - if ($conf->fournisseur->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - // Sécurité accés client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - } - - if ($conf->societe->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - } - - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - } - + global $user, $conf, $langs; - if ($user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - - - if ($user->rights->fournisseur->commande->lire) - { - $langs->load("orders"); - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } - - - if ($conf->produit->enabled || $conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); - } - - left_menu($menu->liste); + $langs->load("suppliers"); + $langs->load("propal"); + + top_menu($head, $title); + + $menu = new Menu(); + + + if ($conf->fournisseur->enabled) + { + if ($user->rights->societe->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); + } + + // Sécurité accés client + if ($user->societe_id == 0 && $user->rights->societe->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); + } + } + + if ($conf->societe->enabled) + { + if ($user->rights->societe->lire) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); + } + } + + + $langs->load("bills"); + if ($user->rights->fournisseur->facture->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); + } + if ($user->rights->fournisseur->facture->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/impayees.php",$langs->trans("Unpayed")); + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); + } + + + $langs->load("orders"); + if ($user->rights->fournisseur->commande->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); + } + + $langs->load("products"); + if ($conf->produit->enabled || $conf->service->enabled) + { + $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); + } + + + $menu = new Menu(); + + + if (is_array($addons)) + { + $menu->add($addons[0][0], $addons[0][1]); + } + + + if ($conf->fournisseur->enabled) + { + if ($user->rights->societe->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); + } + + // Sécurité accés client + if ($user->societe_id == 0 && $user->rights->societe->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); + } + } + + if ($conf->societe->enabled) + { + if ($user->rights->societe->lire) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); + } + } + + + $langs->load("bills"); + if ($user->rights->fournisseur->facture->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); + } + + + if ($user->rights->fournisseur->facture->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); + } + if ($user->rights->fournisseur->facture->lire) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); + } + + + if ($user->rights->fournisseur->commande->lire) + { + $langs->load("orders"); + $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); + } + + + if ($conf->produit->enabled || $conf->service->enabled) + { + $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); + } + + left_menu($menu->liste, $help_url); } ?>