Fix: uniformize code

This commit is contained in:
Regis Houssin 2011-08-23 18:40:45 +00:00
parent 68a9994b62
commit 5085638f5e
10 changed files with 65 additions and 62 deletions

View File

@ -26,7 +26,7 @@
* \file htdocs/comm/propal.php
* \ingroup propale
* \brief Page of commercial proposals card and list
* \version $Id: propal.php,v 1.622 2011/08/23 15:23:19 hregis Exp $
* \version $Id: propal.php,v 1.623 2011/08/23 18:40:45 hregis Exp $
*/
require("../main.inc.php");
@ -1367,10 +1367,10 @@ if ($id > 0 || ! empty($ref))
print $langs->trans('Project').'</td>';
if ($user->rights->propale->creer)
{
if ($action != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
if ($action != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'classer')
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid');
}
@ -1401,7 +1401,7 @@ if ($id > 0 || ! empty($ref))
}
// Insert hooks
$parameters=array('colspan'=>'colspan="3"');
$parameters=array('colspan'=>' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Amount HT
@ -1936,6 +1936,6 @@ else
}
$db->close();
llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.622 $');
llxFooter('$Date: 2011/08/23 18:40:45 $ - $Revision: 1.623 $');
?>

View File

@ -25,7 +25,7 @@
* \file htdocs/commande/fiche.php
* \ingroup commande
* \brief Page to show customer order
* \version $Id: fiche.php,v 1.536 2011/08/23 15:23:19 hregis Exp $
* \version $Id: fiche.php,v 1.537 2011/08/23 18:40:45 hregis Exp $
*/
require("../main.inc.php");
@ -1757,11 +1757,11 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
if ($action != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
//print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classer')
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid');
}
@ -1773,7 +1773,7 @@ else
}
// Insert hooks
$parameters=array('colspan'=>'colspan="2"');
$parameters=array('colspan'=>' colspan="2"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Lignes de 3 colonnes
@ -2077,5 +2077,5 @@ else
$db->close();
llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.536 $');
llxFooter('$Date: 2011/08/23 18:40:45 $ - $Revision: 1.537 $');
?>

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/compta/deplacement/fiche.php
* \brief Page to show a trip card
* \version $Id: fiche.php,v 1.56 2011/08/03 00:46:35 eldy Exp $
* \version $Id: fiche.php,v 1.57 2011/08/23 18:40:45 hregis Exp $
*/
require("../../main.inc.php");
@ -364,15 +364,15 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($_GET['action'] != 'classin')
if ($_GET['action'] != 'classify')
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&amp;id='.$deplacement->id.'">';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$deplacement->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classin')
if ($_GET['action'] == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$deplacement->id, $deplacement->socid, $deplacement->fk_project,'projectid');
}
@ -432,5 +432,5 @@ print '</div>';
$db->close();
llxFooter('$Date: 2011/08/03 00:46:35 $ - $Revision: 1.56 $');
llxFooter('$Date: 2011/08/23 18:40:45 $ - $Revision: 1.57 $');
?>

View File

@ -25,7 +25,7 @@
* \file htdocs/compta/facture.php
* \ingroup facture
* \brief Page to create/see an invoice
* \version $Id: facture.php,v 1.856 2011/08/23 15:23:19 hregis Exp $
* \version $Id: facture.php,v 1.857 2011/08/23 18:40:47 hregis Exp $
*/
require('../main.inc.php');
@ -2524,16 +2524,16 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classin')
if ($action != 'classify')
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&amp;facid='.$object->id.'">';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;facid='.$object->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'classin')
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,$object->fk_project,'projectid');
}
@ -2546,7 +2546,7 @@ else
}
// Insert hooks
$parameters=array('colspan'=>'colspan="3"');
$parameters=array('colspan'=>' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print '</table><br>';
@ -3193,5 +3193,5 @@ else
$db->close();
llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.856 $');
llxFooter('$Date: 2011/08/23 18:40:47 $ - $Revision: 1.857 $');
?>

View File

@ -24,7 +24,7 @@
* \file htdocs/compta/propal.php
* \ingroup propale
* \brief Page liste des propales (vision compta)
* \version $Id: propal.php,v 1.194 2011/08/03 00:46:24 eldy Exp $
* \version $Id: propal.php,v 1.195 2011/08/23 18:40:48 hregis Exp $
*/
require('../main.inc.php');
@ -40,6 +40,11 @@ $langs->load('compta');
$langs->load('orders');
$langs->load('bills');
$id=GETPOST('id');
$ref=GETPOST('ref');
$socid=GETPOST('socid');
$action=GETPOST('action');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
@ -63,9 +68,9 @@ if (! empty($_GET["socid"]))
$module='societe';
$dbtable='';
}
else if (! empty($_GET["id"]))
else if (! empty($id))
{
$objectid=$_GET["id"];
$objectid=$id;
$module='propale';
$dbtable='propal';
}
@ -81,18 +86,18 @@ $object = new Propal($db);
/* Actions */
/******************************************************************************/
if ($_GET["action"] == 'setstatut')
if ($action == 'setstatut')
{
// Close proposal
$object->id = $_GET["id"];
$object->id = $id;
$object->cloture($user, $_GET["statut"], $note);
}
// Set project
if ($_POST['action'] == 'classin')
if ($action == 'classin')
{
$object->fetch($_GET["id"]);
$object->fetch($id);
$object->setProject($_POST['projectid']);
}
@ -114,15 +119,13 @@ $propalstatic=new Propal($db);
$now=gmmktime();
$id = $_GET["id"];
$ref= $_GET["ref"];
if ($id > 0 || ! empty($ref))
{
if ($mesg) print "$mesg<br>";
$product_static=new Product($db);
$object->fetch($_GET["id"],$_GET["ref"]);
$object->fetch($id,$ref);
$societe = new Societe($db);
$societe->fetch($object->socid);
@ -148,7 +151,7 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>';
if ($_GET['action'] != 'refclient' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
if ($action != 'refclient' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print $object->ref_client;
@ -209,10 +212,10 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort');
print '</td>';
if ($_GET['action'] != 'editconditions' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
if ($action != 'editconditions' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editconditions')
if ($action == 'editconditions')
{
$html->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id');
}
@ -228,10 +231,10 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentMode');
print '</td>';
if ($_GET['action'] != 'editmode' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
if ($action != 'editmode' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editmode')
if ($action == 'editmode')
{
$html->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
}
@ -250,10 +253,10 @@ if ($id > 0 || ! empty($ref))
print $langs->trans('Project').'</td>';
if (1 == 2 && $user->rights->propale->creer)
{
if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
if ($action != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classer')
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid');
}
@ -367,7 +370,7 @@ if ($id > 0 || ! empty($ref))
if (! empty($objp->date_start)) $type=1;
if (! empty($objp->date_end)) $type=1;
if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid)
if ($action != 'editline' || $_GET['rowid'] != $objp->rowid)
{
print '<tr '.$bc[$var].'>';
if ($objp->fk_product > 0)
@ -701,6 +704,6 @@ else
$db->close();
llxFooter('$Date: 2011/08/03 00:46:24 $ - $Revision: 1.194 $');
llxFooter('$Date: 2011/08/23 18:40:48 $ - $Revision: 1.195 $');
?>

View File

@ -23,7 +23,7 @@
* \file htdocs/contrat/fiche.php
* \ingroup contrat
* \brief Page of a contract
* \version $Id: fiche.php,v 1.200 2011/08/13 13:03:20 eldy Exp $
* \version $Id: fiche.php,v 1.201 2011/08/23 18:40:48 hregis Exp $
*/
require ("../main.inc.php");
@ -681,10 +681,10 @@ else
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans("Project");
print '</td>';
if ($action != "classer" && $user->rights->projet->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classer&amp;id='.$id.'">'.img_edit($langs->trans("SetProject")).'</a></td>';
if ($action != "classify" && $user->rights->projet->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$id.'">'.img_edit($langs->trans("SetProject")).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == "classer")
if ($action == "classify")
{
$form->form_project("fiche.php?id=$id",$object->socid,$object->fk_project,"projectid");
}
@ -1287,5 +1287,5 @@ else
$db->close();
llxFooter('$Date: 2011/08/13 13:03:20 $ - $Revision: 1.200 $');
llxFooter('$Date: 2011/08/23 18:40:48 $ - $Revision: 1.201 $');
?>

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/expedition/shipment.php
* \ingroup expedition
* \version $Id: shipment.php,v 1.30 2011/07/31 23:50:53 eldy Exp $
* \version $Id: shipment.php,v 1.31 2011/08/23 18:40:48 hregis Exp $
*/
require("../main.inc.php");
@ -342,10 +342,10 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</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>';
if ($_GET['action'] != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($_GET['action'] == 'classer')
if ($_GET['action'] == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid');
}
@ -667,5 +667,5 @@ if ($id > 0 || ! empty($ref))
$db->close();
llxFooter('$Date: 2011/07/31 23:50:53 $ - $Revision: 1.30 $');
llxFooter('$Date: 2011/08/23 18:40:48 $ - $Revision: 1.31 $');
?>

View File

@ -22,7 +22,7 @@
* \file htdocs/fichinter/fiche.php
* \brief Fichier fiche intervention
* \ingroup ficheinter
* \version $Id: fiche.php,v 1.173 2011/07/31 23:50:53 eldy Exp $
* \version $Id: fiche.php,v 1.174 2011/08/23 18:40:49 hregis Exp $
*/
require("../main.inc.php");
@ -843,15 +843,15 @@ elseif ($fichinterid)
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classin')
if ($action != 'classify')
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&amp;id='.$object->id.'">';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$object->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'classin')
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid');
}
@ -1218,5 +1218,5 @@ elseif ($fichinterid)
$db->close();
llxFooter('$Date: 2011/07/31 23:50:53 $ - $Revision: 1.173 $');
llxFooter('$Date: 2011/08/23 18:40:49 $ - $Revision: 1.174 $');
?>

View File

@ -25,7 +25,7 @@
* \file htdocs/fourn/commande/fiche.php
* \ingroup supplier, order
* \brief Card supplier order
* \version $Id: fiche.php,v 1.234 2011/08/20 23:56:04 eldy Exp $
* \version $Id: fiche.php,v 1.235 2011/08/23 18:40:49 hregis Exp $
*/
require("../../main.inc.php");
@ -981,11 +981,11 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
if ($action != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
//print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classer')
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid');
}
@ -1542,5 +1542,5 @@ if ($id > 0 || ! empty($ref))
$db->close();
llxFooter('$Date: 2011/08/20 23:56:04 $ - $Revision: 1.234 $');
llxFooter('$Date: 2011/08/23 18:40:49 $ - $Revision: 1.235 $');
?>

View File

@ -24,7 +24,7 @@
* \file htdocs/fourn/facture/fiche.php
* \ingroup facture, fournisseur
* \brief Page for supplier invoice card (view, edit, validate)
* \version $Id: fiche.php,v 1.263 2011/08/04 21:46:50 eldy Exp $
* \version $Id: fiche.php,v 1.264 2011/08/23 18:40:49 hregis Exp $
*/
require("../../main.inc.php");
@ -1458,16 +1458,16 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($_GET['action'] != 'classer')
if ($_GET['action'] != 'classify')
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classer&amp;facid='.$fac->id.'">';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;facid='.$fac->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classer')
if ($_GET['action'] == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->socid,$fac->fk_project,'projectid');
}
@ -1915,5 +1915,5 @@ else
$db->close();
llxFooter('$Date: 2011/08/04 21:46:50 $ - $Revision: 1.263 $');
llxFooter('$Date: 2011/08/23 18:40:49 $ - $Revision: 1.264 $');
?>