Files
dolibarr/htdocs/comm/propal/note.php
Rodolphe Quiedeville 0caf374e9a Nouveau fichier
2004-03-05 16:10:16 +00:00

143 lines
3.9 KiB
PHP

<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
/**
* Gestion d'une proposition commerciale
* @package propale
*/
require("./pre.inc.php");
$user->getrights('propale');
if (!$user->rights->propale->lire)
accessforbidden();
/*
* Modules optionnels
*/
require("../../propal.class.php");
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
}
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($_GET["valid"] == 1 && $user->rights->propale->valider)
{
$propal = new Propal($db);
$propal->fetch($_GET["propalid"]);
$propal->update_price($_GET["propalid"]);
propale_pdf_create($db, $_GET["propalid"], $propal->modelpdf);
$propal->valid($user);
}
llxHeader();
$html = new Form($db);
/******************************************************************************/
/* Fin des Actions */
/******************************************************************************/
if ($_GET["propalid"])
{
$propal = new Propal($db);
if ( $propal->fetch($_GET["propalid"]) )
{
$societe = new Societe($db);
if ( $societe->fetch($propal->soc_id) )
{
$head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id;
$head[0][1] = "Proposition commerciale : $propal->ref";
$h = 1;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = "Note";
$a = 1;
dolibarr_fiche_head($head, $a);
print '<table class="border" cellspacing="0" cellpadding="2" width="100%">';
print '<tr><td>Société</td><td>';
if ($societe->client == 1)
{
$url ='fiche.php?socid='.$societe->id;
}
else
{
$url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id;
}
print '<a href="'.$url.'">'.$societe->nom.'</a></td>';
print '<td>Statut</td><td align="center"><b>'.$propal->statut_libelle.'</b></td></tr>';
print '<tr><td>Date</td><td>'.strftime("%A %d %B %Y",$propal->date);
if ($propal->fin_validite)
{
print " (".strftime("%d %B %Y",$propal->fin_validite).")";
}
print '</td>';
print '<td>Auteur</td><td>';
$author = new User($db, $propal->user_author_id);
$author->fetch('');
print $author->fullname.'</td></tr>';
print '<tr><td valign="top" colspan="4">Note :<br>'. nl2br($propal->note)."</td></tr>";
if ($_GET["action"] == 'edit')
{
print '<tr><td valign="top" colspan="4"><textarea name="note" cols="80" rows="8">'.$propal->note."</textarea></td></tr>";
}
print "</table>";
/*
* Actions
*/
print '</div>';
print '<p><div class="tabsAction">';
if ($user->rights->propale->creer && $_GET["action"] <> 'edit')
{
print "<a class=\"tabAction\" href=\"$PHP_SELF?propalid=$propal->id&amp;action=edit\">Editer</a>";
}
print "</div>";
}
}
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>