Correction bug #18853
This commit is contained in:
parent
2f4137934f
commit
c09d353a7a
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
@ -25,9 +25,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");
|
||||||
@ -62,8 +62,8 @@ $socid='';
|
|||||||
if ($_GET["socid"]) { $socid=$_GET["socid"]; }
|
if ($_GET["socid"]) { $socid=$_GET["socid"]; }
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nombre de ligne pour choix de produit/service prédéfinis
|
// Nombre de ligne pour choix de produit/service prédéfinis
|
||||||
@ -71,42 +71,40 @@ $NBLINES=4;
|
|||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* Actions */
|
/* Actions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
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->fetch($_GET['propalid']);
|
$propal->fetch($_GET['propalid']);
|
||||||
$propal->delete($user);
|
$propal->delete($user);
|
||||||
$propalid = 0;
|
$propalid = 0;
|
||||||
$brouillon = 1;
|
$brouillon = 1;
|
||||||
}
|
}
|
||||||
Header('Location: '.$_SERVER["PHP_SELF"]);
|
Header('Location: '.$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if ($user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
$propal->fetch($_GET['propalid']);
|
$propal->fetch($_GET['propalid']);
|
||||||
$result=$propal->delete_product($_GET['ligne']);
|
$result=$propal->delete_product($_GET['ligne']);
|
||||||
if ($_REQUEST['lang_id'])
|
if ($_REQUEST['lang_id'])
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
|
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||||
}
|
}
|
||||||
propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs);
|
propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs);
|
||||||
}
|
}
|
||||||
Header('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET['propalid']);
|
Header('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET['propalid']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes')
|
if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes')
|
||||||
@ -703,11 +701,6 @@ if ($_GET['action'] == 'down' && $user->rights->propale->creer)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader('',$langs->trans('Proposal'),'Proposition');
|
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -716,92 +709,97 @@ $html = new Form($db);
|
|||||||
*/
|
*/
|
||||||
if ($_GET['propalid'] > 0)
|
if ($_GET['propalid'] > 0)
|
||||||
{
|
{
|
||||||
if ($mesg) print "$mesg<br>";
|
if ($mesg) print "$mesg<br>";
|
||||||
|
|
||||||
|
$propal = new Propal($db);
|
||||||
|
|
||||||
|
$result=$propal->fetch($_GET['propalid']);
|
||||||
|
if (! $result > 0)
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db,$propal->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$propal = new Propal($db);
|
if ($user->societe_id > 0 && $propal->socid <> $user->societe_id)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
$result=$propal->fetch($_GET['propalid']);
|
llxHeader('',$langs->trans('Proposal'),'Proposition');
|
||||||
if (! $result > 0)
|
|
||||||
{
|
$societe = new Societe($db);
|
||||||
dolibarr_print_error($db,$propal->error);
|
$societe->fetch($propal->socid);
|
||||||
exit;
|
|
||||||
}
|
$head = propal_prepare_head($propal);
|
||||||
|
dolibarr_fiche_head($head, 'comm', $langs->trans('Proposal'));
|
||||||
$societe = new Societe($db);
|
|
||||||
$societe->fetch($propal->socid);
|
|
||||||
|
/*
|
||||||
$head = propal_prepare_head($propal);
|
* Confirmation de la suppression de la propale
|
||||||
dolibarr_fiche_head($head, 'comm', $langs->trans('Proposal'));
|
*/
|
||||||
|
if ($_GET['action'] == 'delete')
|
||||||
|
{
|
||||||
/*
|
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete');
|
||||||
* Confirmation de la suppression de la propale
|
print '<br>';
|
||||||
*/
|
}
|
||||||
if ($_GET['action'] == 'delete')
|
|
||||||
{
|
/*
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete');
|
* Confirmation de la suppression d'une ligne produit
|
||||||
print '<br>';
|
*/
|
||||||
}
|
if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
|
{
|
||||||
/*
|
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
||||||
* Confirmation de la suppression d'une ligne produit
|
print '<br>';
|
||||||
*/
|
}
|
||||||
if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
|
||||||
{
|
/*
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
* Confirmation de la validation de la propale
|
||||||
print '<br>';
|
*/
|
||||||
}
|
if ($_GET['action'] == 'validate')
|
||||||
|
{
|
||||||
/*
|
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('ValidateProp'), $langs->trans('ConfirmValidateProp'), 'confirm_validate');
|
||||||
* Confirmation de la validation de la propale
|
print '<br>';
|
||||||
*/
|
}
|
||||||
if ($_GET['action'] == 'validate')
|
|
||||||
{
|
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('ValidateProp'), $langs->trans('ConfirmValidateProp'), 'confirm_validate');
|
/*
|
||||||
print '<br>';
|
* Fiche propal
|
||||||
}
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
print '<table class="border" width="100%">';
|
||||||
* Fiche propal
|
|
||||||
*
|
// Ref
|
||||||
*/
|
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref_url.'</td></tr>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
// Ref client
|
||||||
|
print '<tr><td>';
|
||||||
// Ref
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
|
||||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref_url.'</td></tr>';
|
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||||
|
print '</td>';
|
||||||
// Ref client
|
if ($_GET['action'] != 'refclient' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&propalid='.$propal->id.'">'.img_edit($langs->trans('Edit')).'</a></td>';
|
||||||
print '<tr><td>';
|
print '</tr></table>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
|
print '</td><td colspan="5">';
|
||||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
if ($user->rights->propale->creer && $_GET['action'] == 'refclient')
|
||||||
print '</td>';
|
{
|
||||||
if ($_GET['action'] != 'refclient' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&propalid='.$propal->id.'">'.img_edit($langs->trans('Edit')).'</a></td>';
|
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
||||||
print '</tr></table>';
|
print '<input type="hidden" name="action" value="set_ref_client">';
|
||||||
print '</td><td colspan="5">';
|
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$propal->ref_client.'">';
|
||||||
if ($user->rights->propale->creer && $_GET['action'] == 'refclient')
|
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
{
|
print '</form>';
|
||||||
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
}
|
||||||
print '<input type="hidden" name="action" value="set_ref_client">';
|
else
|
||||||
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$propal->ref_client.'">';
|
{
|
||||||
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print $propal->ref_client;
|
||||||
print '</form>';
|
}
|
||||||
}
|
print '</td>';
|
||||||
else
|
print '</tr>';
|
||||||
{
|
|
||||||
print $propal->ref_client;
|
$rowspan=8;
|
||||||
}
|
|
||||||
print '</td>';
|
// Société
|
||||||
print '</tr>';
|
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td>';
|
||||||
|
print '</tr>';
|
||||||
$rowspan=8;
|
|
||||||
|
// Ligne info remises tiers
|
||||||
// Société
|
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Ligne info remises tiers
|
|
||||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
||||||
if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client);
|
if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client);
|
||||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||||
@ -828,12 +826,12 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($conf->projet->enabled) $rowspan++;
|
if ($conf->projet->enabled) $rowspan++;
|
||||||
if ($conf->expedition->enabled)
|
if ($conf->expedition->enabled)
|
||||||
{
|
{
|
||||||
if ($conf->global->PROPALE_ADD_SHIPPING_DATE) $rowspan++;
|
if ($conf->global->PROPALE_ADD_SHIPPING_DATE) $rowspan++;
|
||||||
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) $rowspan++;
|
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) $rowspan++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notes
|
// Notes
|
||||||
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('NotePublic').' :<br>'. nl2br($propal->note_public).'</td>';
|
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('NotePublic').' :<br>'. nl2br($propal->note_public).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -1720,12 +1718,14 @@ if ($conf->expedition->enabled)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
llxHeader('',$langs->trans('Proposal'),'Proposition');
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* *
|
* *
|
||||||
* Mode Liste des propales *
|
* Mode Liste des propales *
|
||||||
* *
|
* *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
$sortorder=$_GET['sortorder'];
|
$sortorder=$_GET['sortorder'];
|
||||||
$sortfield=$_GET['sortfield'];
|
$sortfield=$_GET['sortfield'];
|
||||||
$page=$_GET['page'];
|
$page=$_GET['page'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user