Qual: Removed deprecated code

This commit is contained in:
Laurent Destailleur 2009-02-18 15:00:34 +00:00
parent 8126b0cd6f
commit 19e1bd0083
6 changed files with 445 additions and 456 deletions

View File

@ -297,7 +297,7 @@ if ($socid > 0)
} }
// Adresse de livraison // Adresse de livraison
if ($conf->expedition->enabled) if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{ {
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';

View File

@ -786,6 +786,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
} }
} }
// Set project
if ($_POST['action'] == 'classin') if ($_POST['action'] == 'classin')
{ {
$propal = new Propal($db); $propal = new Propal($db);
@ -1050,7 +1051,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Delivery date
$langs->load('deliveries'); $langs->load('deliveries');
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1097,7 +1098,7 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>'; print '</td></tr>';
} }
// Conditions et modes de reglement // Payment term
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -1116,7 +1117,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Mode paiement // Payment mode
print '<tr>'; print '<tr>';
print '<td width="25%">'; print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1142,9 +1143,9 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project').'</td>'; print $langs->trans('Project').'</td>';
if ($propal->statut == 0 && $user->rights->propale->creer) if ($user->rights->propale->creer)
{ {
if ($_GET['action'] != 'classer' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>'; if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET['action'] == 'classer') if ($_GET['action'] == 'classer')
@ -1166,7 +1167,7 @@ if ($id > 0 || ! empty($ref))
$proj = new Project($db); $proj = new Project($db);
$proj->fetch($propal->projetidp); $proj->fetch($propal->projetidp);
print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">'; print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">';
print $proj->title; print $proj->ref;
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }

View File

@ -1184,7 +1184,7 @@ else
/* /*
* Commande * Commande
*/ */
$nbrow=8; $nbrow=7;
if ($conf->projet->enabled) $nbrow++; if ($conf->projet->enabled) $nbrow++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1268,8 +1268,6 @@ else
print '</tr>'; print '</tr>';
// Date de livraison // Date de livraison
if ($conf->expedition->enabled)
{
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryDate'); print $langs->trans('DeliveryDate');
@ -1296,7 +1294,8 @@ else
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
// Adresse de livraison // Adresse de livraison
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1337,23 +1336,14 @@ else
} }
print '</td>'; print '</td>';
//Note public lorsque le module expedition n'est pas active
if (!$conf->projet->enabled) $nbrow--;
if (!$conf->expedition->enabled)
{
$nbrow--;
if ($conf->projet->enabled) $nbrow--;
print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
print nl2br($commande->note_public);
print '</td>';
}
print '</tr>'; print '</tr>';
// Payment mode
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
print '</td>'; print '</td>';
if ($_GET['action'] != 'editmode' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>'; if ($_GET['action'] != 'editmode') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td colspan="2">';
if ($_GET['action'] == 'editmode') if ($_GET['action'] == 'editmode')
@ -1374,7 +1364,7 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project'); print $langs->trans('Project');
print '</td>'; print '</td>';
if ($_GET['action'] != 'classer' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>'; if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td colspan="2">';
if ($_GET['action'] == 'classer') if ($_GET['action'] == 'classer')

View File

@ -76,9 +76,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
if ($_GET["action"] == 'setstatut') if ($_GET["action"] == 'setstatut')
{ {
/* // Close proposal
* Class<EFBFBD>e la facture comme factur<EFBFBD>e
*/
$propal = new Propal($db); $propal = new Propal($db);
$propal->id = $_GET["propalid"]; $propal->id = $_GET["propalid"];
$propal->cloture($user, $_GET["statut"], $note); $propal->cloture($user, $_GET["statut"], $note);
@ -109,6 +107,15 @@ if ( $action == 'delete' )
$brouillon = 1; $brouillon = 1;
} }
// Set project
if ($_POST['action'] == 'classin')
{
$propal = new Propal($db);
$propal->fetch($_GET['propalid']);
$propal->setProject($_POST['projetidp']);
}
/* /*
* View * View
@ -209,7 +216,7 @@ if ($_GET["propalid"] > 0)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Conditions et modes de r<>glement // Payment term
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -227,7 +234,7 @@ if ($_GET["propalid"] > 0)
} }
print '</td>'; print '</td>';
// Mode de paiement // Payment mode
print '<tr>'; print '<tr>';
print '<td width="25%">'; print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -246,27 +253,16 @@ if ($_GET["propalid"] > 0)
} }
print '</td></tr>'; print '</td></tr>';
// Projet // Project
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
$langs->load("projects"); $langs->load("projects");
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project').'</td>'; print $langs->trans('Project').'</td>';
$numprojet = $societe->has_projects(); if (1 == 2 && $user->rights->propale->creer)
if (! $numprojet)
{ {
print '</td></tr></table>'; if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '<td colspan="2">';
print $langs->trans("NoProject").'</td><td>';
print '<a href=../projet/fiche.php?socid='.$societe->id.'&action=create>'.$langs->trans('AddProject').'</a>';
print '</td>';
}
else
{
if ($propal->statut == 0 && $user->rights->propale->creer)
{
if ($_GET['action'] != 'classer' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET['action'] == 'classer') if ($_GET['action'] == 'classer')
@ -288,7 +284,7 @@ if ($_GET["propalid"] > 0)
$proj = new Project($db); $proj = new Project($db);
$proj->fetch($propal->projetidp); $proj->fetch($propal->projetidp);
print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">'; print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">';
print $proj->title; print $proj->ref;
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
@ -296,7 +292,6 @@ if ($_GET["propalid"] > 0)
print '<td colspan="3">&nbsp;</td>'; print '<td colspan="3">&nbsp;</td>';
} }
} }
}
print '</tr>'; print '</tr>';
} }

View File

@ -45,7 +45,7 @@ $langs->load('stocks');
if (!$user->rights->commande->lire) if (!$user->rights->commande->lire)
accessforbidden(); accessforbidden();
// Sécurité accés client // S<EFBFBD>curit<EFBFBD> acc<63>s client
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $action = '';
@ -148,12 +148,12 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET["action"] == 'cloture') if ($_GET["action"] == 'cloture')
{ {
$html->form_confirm("commande.php?id=".$_GET["id"],"Clôturer la commande","Etes-vous sûr de vouloir clôturer cette commande ?","confirm_cloture"); $html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture");
print "<br />"; print "<br />";
} }
// Onglet commande // Onglet commande
$nbrow=8; $nbrow=7;
if ($conf->projet->enabled) $nbrow++; if ($conf->projet->enabled) $nbrow++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -262,6 +262,8 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
// Adresse de livraison // Adresse de livraison
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -281,8 +283,9 @@ if ($id > 0 || ! empty($ref))
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id); $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
} }
print '</td></tr>'; print '</td></tr>';
}
// Conditions et modes de réglement // Conditions et modes de r<EFBFBD>glement
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -363,8 +366,8 @@ if ($id > 0 || ! empty($ref))
/** /**
* Lignes de commandes avec quantité livrées et reste à livrer * Lignes de commandes avec quantit<EFBFBD> livr<EFBFBD>es et reste <EFBFBD> livrer
* Les quantités livrées sont stockées dans $commande->expeditions[fk_product] * Les quantit<EFBFBD>s livr<EFBFBD>es sont stock<EFBFBD>es dans $commande->expeditions[fk_product]
*/ */
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
@ -595,7 +598,7 @@ if ($id > 0 || ! empty($ref))
} }
else else
{ {
/* Commande non trouvée */ /* Commande non trouv<EFBFBD>e */
print "Commande inexistante"; print "Commande inexistante";
} }
} }

View File

@ -1614,7 +1614,7 @@ class Form
$projet = new Project($this->db); $projet = new Project($this->db);
$projet->fetch($selected); $projet->fetch($selected);
//print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$selected.'">'.$projet->title.'</a>'; //print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$selected.'">'.$projet->title.'</a>';
print $projet->getNomUrl(1); print $projet->getNomUrl(0);
} else { } else {
print "&nbsp;"; print "&nbsp;";
} }