diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 8261c8cb69b..b7f4a49599c 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin * @@ -93,14 +93,18 @@ llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); $html = new Form($db); +$now=gmmktime(); $id = $_GET['id']; -if ($id > 0) +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { //if ($mesg) print $mesg.'
'; $commande = new CommandeFournisseur($db); - if ( $commande->fetch($_GET['id']) >= 0) + + $result=$commande->fetch($_GET['id'],$_GET['ref']); + if ($result >= 0) { $soc = new Societe($db); $soc->fetch($commande->socid); @@ -110,55 +114,55 @@ if ($id > 0) $author->fetch(); $head = ordersupplier_prepare_head($commande); - + $title=$langs->trans("SupplierOrder"); dolibarr_fiche_head($head, 'dispatch', $title); - + /* * Commande */ print ''; + // Ref print ''; - print ''; + print ''; print ''; // Fournisseur - print '"; - print ''; + print '"; + print ''; print ''; // Statut print ''; print ''; - print '"; + // Date if ($commande->methode_commande_id > 0) { print '"; - print ''; } - print ""; } // Auteur print ''; print ''; - print '"; + print ''; + print "
'.$langs->trans("Ref").''.$commande->ref.''; + print $html->showrefnav($commande,'ref','',1,'ref','ref'); + print '
'.$langs->trans("Supplier")."'; - print ''; - print img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.'
'.$langs->trans("Supplier")."'.$soc->getNomUrl(1,'supplier').'
'.$langs->trans("Status").''; + print ''; print $commande->getLibStatut(4); print "
'.$langs->trans("Date").''; - if ($commande->date_commande) { print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n"; } + print "
'; if ($commande->methode_commande) { - print $langs->trans("Method")." : " .$commande->methode_commande; + print '
'.$langs->trans("Method").''.$commande->methode_commande.'
'.$langs->trans("AuthorRequest").''.$author->getNomUrl(1).''; - print " 
"; if ($mesg) print $mesg; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 6aaea92afaa..2ac31a4a1e4 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005 Regis Houssin * @@ -71,12 +71,14 @@ $pagenext = $page + 1; $commande = new CommandeFournisseur($db); -if ($commande->fetch($id) < 0) +if ($commande->fetch($_GET['id'],$_GET['ref']) < 0) { dolibarr_print_error($db); exit; } + + /* * Actions */ @@ -114,16 +116,25 @@ if ($action=='delete') /* - * Affichage + * View */ -if ($id > 0) + +$html = new Form($db); + +$id = $_GET['id']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { llxHeader(); $upload_dir = $conf->fournisseur->commande->dir_output.'/'.sanitizeFileName($commande->ref); - $societe = new Societe($db); - $societe->fetch($commande->socid); + $soc = new Societe($db); + $soc->fetch($commande->socid); + + $author = new User($db); + $author->id = $commande->user_author_id; + $author->fetch(); $head = ordersupplier_prepare_head($commande); @@ -142,20 +153,49 @@ if ($id > 0) print ''; // Ref - print ''; + print ''; + print ''; + print ''; - print ''; + // Fournisseur + print '"; + print ''; + print ''; // Statut print ''; print ''; - print '"; + // Date + if ($commande->methode_commande_id > 0) + { + print '"; + + if ($commande->methode_commande) + { + print ''; + } + } + + // Auteur + print ''; + print ''; + print ''; + print ''; print ''; print "
'.$langs->trans('Ref').''.$commande->ref.'
'.$langs->trans("Ref").''; + print $html->showrefnav($commande,'ref','',1,'ref','ref'); + print '
'.$langs->trans('Supplier').''.$societe->getNomUrl(1).'
'.$langs->trans("Supplier")."'.$soc->getNomUrl(1,'supplier').'
'.$langs->trans("Status").''; + print ''; print $commande->getLibStatut(4); print "
'.$langs->trans("Date").''; + if ($commande->date_commande) + { + print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n"; + } + print "
'.$langs->trans("Method").''.$commande->methode_commande.'
'.$langs->trans("AuthorRequest").''.$author->getNomUrl(1).'
'.$langs->trans("NbOfAttachedFiles").''.sizeof($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
\n"; + print "\n"; if ($mesg) { print $mesg."
"; } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 373fec262dc..116f02f8d6a 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -595,14 +595,14 @@ if ($id > 0 || ! empty($ref)) print ''; // Fournisseur - print ''.$langs->trans("Supplier").""; + print ''.$langs->trans("Supplier").""; print ''.$soc->getNomUrl(1,'supplier').''; print ''; // Statut print ''; print ''.$langs->trans("Status").''; - print ''; + print ''; print $commande->getLibStatut(4); print ""; diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php index 39d57ce6a50..972195d45cd 100644 --- a/htdocs/fourn/commande/history.php +++ b/htdocs/fourn/commande/history.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -36,18 +36,23 @@ $langs->load('stocks'); if (!$user->rights->fournisseur->commande->lire) accessforbidden(); -/* *************************************************************************** */ -/* */ -/* Mode vue */ -/* */ -/* *************************************************************************** */ +/* + * View + */ -if ($_GET["id"] > 0) +$html = new Form($db); + +$now=gmmktime(); + +$id = $_GET['id']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { $soc = new Societe($db); $commande = new CommandeFournisseur($db); - if ( $commande->fetch($_GET["id"]) >= 0) + $result=$commande->fetch($_GET["id"],$_GET['ref']); + if ($result >= 0) { $soc->fetch($commande->socid); @@ -55,10 +60,7 @@ if ($_GET["id"] > 0) $author->id = $commande->user_author_id; $author->fetch(); - $addons[0][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id; - $addons[0][1] = $soc->nom; - - llxHeader('',$langs->trans("History"),"CommandeFournisseur",$addons); + llxHeader('',$langs->trans("History"),"CommandeFournisseur"); $head = ordersupplier_prepare_head($commande); @@ -74,27 +76,44 @@ if ($_GET["id"] > 0) // Ref print ''.$langs->trans("Ref").''; - print ''.$commande->ref.''; + print ''; + print $html->showrefnav($commande,'ref','',1,'ref','ref'); + print ''; print ''; // Fournisseur - print ''.$langs->trans("Supplier").""; - print ''; - print ''.img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.''; + print ''.$langs->trans("Supplier").""; + print ''.$soc->getNomUrl(1,'supplier').''; print ''; - print ''.$langs->trans("Status").''; + // Statut + print ''; + print ''.$langs->trans("Status").''; + print ''; print $commande->getLibStatut(4); print ""; + // Date if ($commande->methode_commande_id > 0) { - print ''.$langs->trans("Date").''; - print ''.dolibarr_print_date($commande->date_commande,"dayhourtext")."\n"; - print ' '; + print ''.$langs->trans("Date").''; + if ($commande->date_commande) + { + print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n"; + } print ""; + + if ($commande->methode_commande) + { + print ''.$langs->trans("Method").''.$commande->methode_commande.''; + } } + // Auteur + print ''.$langs->trans("AuthorRequest").''; + print ''.$author->getNomUrl(1).''; + print ''; + print "\n"; print "
"; @@ -157,7 +176,7 @@ if ($_GET["id"] > 0) /* Commande non trouvée */ print "Commande inexistante ou accés refusé"; } -} +} $db->close(); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 26c1549f865..809e5e23030 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -37,13 +37,13 @@ if (!$user->rights->fournisseur->commande->lire) accessforbidden(); /* * Actions - */ + */ if ($_POST["action"] == 'updatenote' && $user->rights->fournisseur->commande->creer) { $commande = new CommandeFournisseur($db); $commande->fetch($_GET["id"]); - + $result = $commande->UpdateNote($user, $_POST["note"], $_POST["note_public"]); if ($result >= 0) { @@ -53,6 +53,9 @@ if ($_POST["action"] == 'updatenote' && $user->rights->fournisseur->commande->cr } +/* + * View + */ llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); @@ -63,11 +66,16 @@ $html = new Form($db); /* Mode vue et edition */ /* */ /* *************************************************************************** */ - -if ($_GET["id"] > 0) + +$now=gmmktime(); + +$id = $_GET['id']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { $commande = new CommandeFournisseur($db); - if ( $commande->fetch($_GET["id"]) >= 0) + $result=$commande->fetch($_GET["id"],$_GET['ref']); + if ($result >= 0) { $soc = new Societe($db); $soc->fetch($commande->socid); @@ -77,7 +85,7 @@ if ($_GET["id"] > 0) $author->fetch(); $head = ordersupplier_prepare_head($commande); - + $title=$langs->trans("SupplierOrder"); dolibarr_fiche_head($head, 'note', $title); @@ -92,41 +100,46 @@ if ($_GET["id"] > 0) // Ref print ''.$langs->trans("Ref").''; - print ''.$commande->ref.''; + print ''; + print $html->showrefnav($commande,'ref','',1,'ref','ref'); + print ''; print ''; // Fournisseur - print ''.$langs->trans("Supplier").''; - print ''; - print ''.img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.''; + print ''.$langs->trans("Supplier").""; + print ''.$soc->getNomUrl(1,'supplier').''; print ''; + // Statut print ''; print ''.$langs->trans("Status").''; - print ''; + print ''; print $commande->getLibStatut(4); print ""; + // Date if ($commande->methode_commande_id > 0) { - print ''.$langs->trans("Date").''; - print ''; - + print ''.$langs->trans("Date").''; if ($commande->date_commande) { - print dolibarr_print_date($commande->date_commande,'dayhourtext')."\n"; - } - - print ' '; - if ($commande->methode_commande) - { - print "Méthode : " .$commande->methode_commande; + print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n"; } print ""; + + if ($commande->methode_commande) + { + print ''.$langs->trans("Method").''.$commande->methode_commande.''; + } } + // Auteur + print ''.$langs->trans("AuthorRequest").''; + print ''.$author->getNomUrl(1).''; + print ''; + print ''.$langs->trans("NotePublic").''; - print ''; + print ''; if ($user->rights->fournisseur->commande->creer) print ''; @@ -135,26 +148,28 @@ if ($_GET["id"] > 0) if (! $user->societe_id) { print ''.$langs->trans("NotePrivate").''; - print ''; + print ''; if ($user->rights->fournisseur->commande->creer) print ''; print ''; } - + if ($user->rights->fournisseur->commande->creer) { - print ''; + print ''; } print ""; + + print "\n"; } else { /* Commande non trouvée */ print "Commande inexistante"; } -} +} $db->close(); diff --git a/htdocs/fourn/commande/pre.inc.php b/htdocs/fourn/commande/pre.inc.php index 1e2971db0ef..5b73e807928 100644 --- a/htdocs/fourn/commande/pre.inc.php +++ b/htdocs/fourn/commande/pre.inc.php @@ -21,11 +21,11 @@ * */ -/** - \file htdocs/fourn/commande/pre.inc.php - \ingroup compta - \brief Fichier gestionnaire du menu commandes fournisseurs -*/ +/** + \file htdocs/fourn/commande/pre.inc.php + \ingroup compta + \brief Fichier gestionnaire du menu commandes fournisseurs + */ require("../../main.inc.php"); $langs->load("orders"); @@ -37,38 +37,36 @@ require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php"); function llxHeader($head = "", $title = "", $help_url='', $addons='') { - global $user, $langs; - $langs->load("orders"); - /* - * - * - */ - top_menu($head, $title); + global $user, $langs; + $langs->load("orders"); - $menu = new Menu(); - if (is_array($addons)) - { - $menu->add($addons[0][0], $addons[0][1]); - } -if ($user->societe_id == 0 && $user->rights->societe->lire) -{ - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); -} + top_menu($head, $title); - $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->commande->lire) -{ - $menu->add(DOL_URL_ROOT."/fourn/commande/", $langs->trans("Orders")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/commande/liste.php", $langs->trans("List")); -} + $menu = new Menu(); - left_menu($menu->liste,$help_url); + if (is_array($addons)) + { + $menu->add($addons[0][0], $addons[0][1]); + } + if ($user->societe_id == 0 && $user->rights->societe->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); + $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->commande->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/commande/", $langs->trans("Orders")); + $menu->add_submenu(DOL_URL_ROOT."/fourn/commande/liste.php", $langs->trans("List")); + } + + left_menu($menu->liste,$help_url); } ?>