Fix: Balise td en trop. Bouton action à masquer quand sur formulaire de cloture.
This commit is contained in:
parent
b8525ba82c
commit
db4d54aa9d
@ -23,9 +23,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/comm/propal.php
|
\file htdocs/comm/propal.php
|
||||||
\ingroup propale
|
\ingroup propale
|
||||||
\brief Page liste des propales (vision commercial)
|
\brief Page liste des propales (vision commercial)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -73,29 +73,29 @@ $form=new Form($db);
|
|||||||
|
|
||||||
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
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 = new Propal($db, 0, $_GET['propalid']);
|
||||||
$propal->delete($user);
|
$propal->delete($user);
|
||||||
$propalid = 0;
|
$propalid = 0;
|
||||||
$brouillon = 1;
|
$brouillon = 1;
|
||||||
}
|
}
|
||||||
Header('Location: propal.php');
|
Header('Location: propal.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes')
|
if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes')
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->valider)
|
if ($user->rights->propale->valider)
|
||||||
{
|
{
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
$propal->fetch($_GET['propalid']);
|
$propal->fetch($_GET['propalid']);
|
||||||
$result=$propal->update_price($_GET['propalid']);
|
$result=$propal->update_price($_GET['propalid']);
|
||||||
propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf);
|
propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf);
|
||||||
$result=$propal->valid($user);
|
$result=$propal->valid($user);
|
||||||
}
|
}
|
||||||
Header ('Location: propal.php?propalid='.$_GET['propalid']);
|
Header ('Location: propal.php?propalid='.$_GET['propalid']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['action'] == 'setecheance')
|
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 = new Propal($db);
|
||||||
$propal->fetch($_GET['propalid']);
|
$propal->fetch($_GET['propalid']);
|
||||||
@ -159,9 +159,12 @@ if ($_GET['action'] == 'pdf')
|
|||||||
*/
|
*/
|
||||||
if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer)
|
if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer)
|
||||||
{
|
{
|
||||||
$propal = new Propal($db);
|
if (! $_POST['cancel'])
|
||||||
$propal->fetch($_GET['propalid']);
|
{
|
||||||
$propal->cloture($user, $_POST['statut'], $_POST['note']);
|
$propal = new Propal($db);
|
||||||
|
$propal->fetch($_GET['propalid']);
|
||||||
|
$propal->cloture($user, $_POST['statut'], $_POST['note']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -588,10 +591,8 @@ if ($_GET['propalid'] > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled) $rowspan++;
|
||||||
$rowspan++;
|
|
||||||
|
|
||||||
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('Note').' :<br>'. nl2br($propal->note).'</td></tr>';
|
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('Note').' :<br>'. nl2br($propal->note).'</td></tr>';
|
||||||
|
|
||||||
@ -923,7 +924,10 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '<option value="3">'.$propal->labelstatut[3].'</option>';
|
print '<option value="3">'.$propal->labelstatut[3].'</option>';
|
||||||
print '</select>';
|
print '</select>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td align="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans('Validate').'"></td>';
|
print '<tr><td align="center" colspan="2">';
|
||||||
|
print '<input type="submit" class="button" name="validate" value="'.$langs->trans('Validate').'">';
|
||||||
|
print ' <input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
|
print '</td>';
|
||||||
print '</tr></table></form>';
|
print '</tr></table></form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -933,67 +937,72 @@ if ($_GET['propalid'] > 0)
|
|||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
// Valid
|
if ($_GET['action'] != 'statut')
|
||||||
if ($propal->statut == 0)
|
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->valider)
|
|
||||||
|
// Valid
|
||||||
|
if ($propal->statut == 0)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=validate">'.$langs->trans('Validate').'</a>';
|
if ($user->rights->propale->valider)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save
|
|
||||||
if ($propal->statut == 1)
|
|
||||||
{
|
|
||||||
if ($user->rights->propale->creer)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=modif">'.$langs->trans('Edit').'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build PDF
|
|
||||||
if ($user->rights->propale->creer)
|
|
||||||
{
|
|
||||||
if ($propal->statut < 2)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=pdf">'.$langs->trans("BuildPDF").'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=pdf">'.$langs->trans("RebuildPDF").'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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 '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=presend">'.$langs->trans('Send').'</a>';
|
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=validate">'.$langs->trans('Validate').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Save
|
||||||
// Close
|
if ($propal->statut == 1)
|
||||||
if ($propal->statut != 0)
|
|
||||||
{
|
|
||||||
if ($propal->statut == 1 && $user->rights->propale->cloturer)
|
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=statut">'.$langs->trans('Close').'</a>';
|
if ($user->rights->propale->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=modif">'.$langs->trans('Edit').'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Build PDF
|
||||||
// Delete
|
if ($user->rights->propale->creer)
|
||||||
if ($propal->statut == 0)
|
|
||||||
{
|
|
||||||
if ($user->rights->propale->supprimer)
|
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="propal.php?propalid='.$propal->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
if ($propal->statut < 2)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=builddoc">'.$langs->trans("BuildPDF").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=builddoc">'.$langs->trans("RebuildPDF").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=presend">'.$langs->trans('Send').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close
|
||||||
|
if ($propal->statut != 0)
|
||||||
|
{
|
||||||
|
if ($propal->statut == 1 && $user->rights->propale->cloturer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="propal.php?propalid='.$propal->id.'&action=statut">'.$langs->trans('Close').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete
|
||||||
|
if ($propal->statut == 0)
|
||||||
|
{
|
||||||
|
if ($user->rights->propale->supprimer)
|
||||||
|
{
|
||||||
|
print '<a class="butActionDelete" href="propal.php?propalid='.$propal->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user