From db4d54aa9d883713b3f152df5b50fa0592b4fc81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Jan 2006 21:08:32 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Balise=20td=20en=20trop.=20Bouton=20acti?= =?UTF-8?q?on=20=E0=20masquer=20quand=20sur=20formulaire=20de=20cloture.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php | 165 ++++++++++++++++++++++------------------- 1 file changed, 87 insertions(+), 78 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 70a7fe2ad3a..d1b4046f5b8 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -23,9 +23,9 @@ */ /** - \file htdocs/comm/propal.php - \ingroup propale - \brief Page liste des propales (vision commercial) + \file htdocs/comm/propal.php + \ingroup propale + \brief Page liste des propales (vision commercial) */ require("./pre.inc.php"); @@ -73,29 +73,29 @@ $form=new Form($db); if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes') { - if ($user->rights->propale->supprimer) + if ($user->rights->propale->supprimer) { - $propal = new Propal($db, 0, $_GET['propalid']); - $propal->delete($user); - $propalid = 0; - $brouillon = 1; + $propal = new Propal($db, 0, $_GET['propalid']); + $propal->delete($user); + $propalid = 0; + $brouillon = 1; } - Header('Location: propal.php'); - exit; + Header('Location: propal.php'); + exit; } if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes') { - if ($user->rights->propale->valider) + if ($user->rights->propale->valider) { - $propal = new Propal($db); - $propal->fetch($_GET['propalid']); - $result=$propal->update_price($_GET['propalid']); - propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf); - $result=$propal->valid($user); + $propal = new Propal($db); + $propal->fetch($_GET['propalid']); + $result=$propal->update_price($_GET['propalid']); + propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf); + $result=$propal->valid($user); } - Header ('Location: propal.php?propalid='.$_GET['propalid']); - exit; + Header ('Location: propal.php?propalid='.$_GET['propalid']); + exit; } if ($_POST['action'] == 'setecheance') @@ -147,7 +147,7 @@ if ($_POST['action'] == 'add') } } -if ($_GET['action'] == 'pdf') +if ($_GET['action'] == 'builddoc') { $propal = new Propal($db); $propal->fetch($_GET['propalid']); @@ -159,9 +159,12 @@ if ($_GET['action'] == 'pdf') */ if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer) { - $propal = new Propal($db); - $propal->fetch($_GET['propalid']); - $propal->cloture($user, $_POST['statut'], $_POST['note']); + if (! $_POST['cancel']) + { + $propal = new Propal($db); + $propal->fetch($_GET['propalid']); + $propal->cloture($user, $_POST['statut'], $_POST['note']); + } } /* @@ -588,10 +591,8 @@ if ($_GET['propalid'] > 0) } } } - print ''; - if ($conf->projet->enabled) - $rowspan++; + if ($conf->projet->enabled) $rowspan++; print ''.$langs->trans('Note').' :
'. nl2br($propal->note).''; @@ -923,7 +924,10 @@ if ($_GET['propalid'] > 0) print ''; print ''; print ''; - print ''; + print ''; + print ''; + print '   '; + print ''; print ''; } @@ -933,67 +937,72 @@ if ($_GET['propalid'] > 0) */ print '
'; - // Valid - if ($propal->statut == 0) + if ($_GET['action'] != 'statut') { - if ($user->rights->propale->valider) + + // Valid + if ($propal->statut == 0) { - print ''.$langs->trans('Validate').''; - } - } - - // Save - if ($propal->statut == 1) - { - if ($user->rights->propale->creer) - { - print ''.$langs->trans('Edit').''; - } - } - - // Build PDF - if ($user->rights->propale->creer) - { - if ($propal->statut < 2) - { - print ''.$langs->trans("BuildPDF").''; - } - else - { - print ''.$langs->trans("RebuildPDF").''; - } - } - - // Send - if ($propal->statut == 1) - { - if ($user->rights->propale->envoyer) - { - $propref = sanitize_string($propal->ref); - $file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf'; - if (file_exists($file)) + if ($user->rights->propale->valider) { - print ''.$langs->trans('Send').''; + print ''.$langs->trans('Validate').''; } } - } - - // Close - if ($propal->statut != 0) - { - if ($propal->statut == 1 && $user->rights->propale->cloturer) + + // Save + if ($propal->statut == 1) { - print ''.$langs->trans('Close').''; + if ($user->rights->propale->creer) + { + print ''.$langs->trans('Edit').''; + } } - } - - // Delete - if ($propal->statut == 0) - { - if ($user->rights->propale->supprimer) + + // Build PDF + if ($user->rights->propale->creer) { - print ''.$langs->trans('Delete').''; + if ($propal->statut < 2) + { + print ''.$langs->trans("BuildPDF").''; + } + else + { + print ''.$langs->trans("RebuildPDF").''; + } } + + // Send + if ($propal->statut == 1) + { + if ($user->rights->propale->envoyer) + { + $propref = sanitize_string($propal->ref); + $file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf'; + if (file_exists($file)) + { + print ''.$langs->trans('Send').''; + } + } + } + + // Close + if ($propal->statut != 0) + { + if ($propal->statut == 1 && $user->rights->propale->cloturer) + { + print ''.$langs->trans('Close').''; + } + } + + // Delete + if ($propal->statut == 0) + { + if ($user->rights->propale->supprimer) + { + print ''.$langs->trans('Delete').''; + } + } + } print '
';