* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/fourn/commande/note.php * \ingroup commande * \brief Fiche note commande */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"); require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php"); $langs->load("orders"); $langs->load("suppliers"); $langs->load("companies"); $langs->load('stocks'); // Security check $id = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'commande_fournisseur', $id,''); /* * 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) { Header("Location: note.php?id=".$_GET["id"]); exit; } } /* * View */ llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); $html = new Form($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ $now=dol_now(); $id = $_GET['id']; $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) { $commande = new CommandeFournisseur($db); $result=$commande->fetch($_GET["id"],$_GET['ref']); if ($result >= 0) { $soc = new Societe($db); $soc->fetch($commande->socid); $author = new User($db); $author->fetch($commande->user_author_id); $head = ordersupplier_prepare_head($commande); $title=$langs->trans("SupplierOrder"); dol_fiche_head($head, 'note', $title, 0, 'order'); /* * Commande */ print '
'; print ''; print ''; print ''; // Ref 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 ''; if (! $user->societe_id) { print ''; print ''; } if ($user->rights->fournisseur->commande->creer) { print ''; } print "
'.$langs->trans("Ref").''; print $html->showrefnav($commande,'ref','',1,'ref','ref'); print '
'.$langs->trans("Supplier")."'.$soc->getNomUrl(1,'supplier').'
'.$langs->trans("Status").''; print $commande->getLibStatut(4); print "
'.$langs->trans("Date").''; if ($commande->date_commande) { print dol_print_date($commande->date_commande,"dayhourtext")."\n"; } print "
'.$langs->trans("Method").''.$commande->methode_commande.'
'.$langs->trans("AuthorRequest").''.$author->getNomUrl(1).'
'.$langs->trans("NotePublic").''; if ($user->rights->fournisseur->commande->creer) print ''; print '
'.$langs->trans("NotePrivate").''; if ($user->rights->fournisseur->commande->creer) print ''; print '
"; print "\n"; } else { /* Order not found */ $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } } $db->close(); llxFooter(); ?>