* Copyright (C) 2004-2007 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/commande/note.php \ingroup commande \brief Fiche de notes sur une commande \version $Id: note.php,v 1.24 2011/07/31 22:23:15 eldy Exp $ */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/order.lib.php'); require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php"); $socid=isset($_GET["socid"])?$_GET["socid"]:isset($_POST["socid"])?$_POST["socid"]:""; if (!$user->rights->commande->lire) accessforbidden(); $langs->load("companies"); $langs->load("bills"); $langs->load("orders"); // Security check $socid=0; $comid = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'commande',$comid,''); $id = $_GET['id']; $ref= $_GET['ref']; $commande = new Commande($db); if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0) { dol_print_error($db); } /* * Actions */ if ($_POST["action"] == 'update' && $user->rights->commande->creer) { $db->begin(); $resPrivateNote=$commande->update_note($_POST["note"]); $resPublicNote=$commande->update_note_public($_POST["note_public"]); if ($resPrivateNote < 0 || $resPublicNote < 0) { $mesg='
'.$commande->error.'
'; $db->rollback(); } else { $db->commit(); } } /* * View */ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); $html = new Form($db); if ($id > 0 || ! empty($ref)) { $soc = new Societe($db, $commande->socid); $soc->fetch($commande->socid); $head = commande_prepare_head($commande); dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order'); print ''; // Ref print '"; // Ref commande client print ''; print ''; // Customer print ""; print ''; // Note publique print ''; print '"; // Note private if (! $user->societe_id) { print ''; print '"; } print "
'.$langs->trans("Ref").''; print $html->showrefnav($commande,'ref','',1,'ref','ref'); print "
'; print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; print '
'; print $commande->ref_client; print '
".$langs->trans("Company")."'.$soc->getNomUrl(1).'
'.$langs->trans("NotePublic").' :'; if ($_GET["action"] == 'edit') { print '
'; print ''; print ''; print '
"; } else { print ($commande->note_public?nl2br($commande->note_public):" "); } print "
'.$langs->trans("NotePrivate").' :'; if ($_GET["action"] == 'edit') { print '
"; } else { print ($commande->note?nl2br($commande->note):" "); } print "
"; if ($_GET["action"] == 'edit') { print '
'; print ' '; print '
'; print ''; } print ''; /* * Actions */ print '
'; if ($user->rights->commande->creer && $_GET["action"] <> 'edit') { print "id."&action=edit\">".$langs->trans('Modify').""; } print "
"; } $db->close(); llxFooter('$Date: 2011/07/31 22:23:15 $ - $Revision: 1.24 $'); ?>