From ec48c6a574d28655e4f6fc8dc54eec4fd1d96874 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Mon, 9 May 2011 15:20:19 +0000 Subject: [PATCH] uniformize code --- htdocs/commande/fiche.php | 92 +++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 98199285dfc..804a5804245 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -51,12 +51,12 @@ $langs->load('propal'); $langs->load('deliveries'); $langs->load('products'); -$id=(GETPOST("id")?GETPOST("id"):GETPOST("orderid")); -$ref=GETPOST('ref'); -$socid=GETPOST('socid'); -$action=GETPOST('action'); -$confirm=GETPOST('confirm'); -$lineid=GETPOST('lineid'); +$id =(GETPOST("id")?GETPOST("id"):GETPOST("orderid")); +$ref = GETPOST('ref'); +$socid = GETPOST('socid'); +$action = GETPOST('action'); +$confirm = GETPOST('confirm'); +$lineid = GETPOST('lineid'); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -105,7 +105,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') else { $mesg=$object->error; - $_GET['action']=''; + $action=''; } } } @@ -376,8 +376,8 @@ if ($action == 'add' && $user->rights->commande->creer) else { $db->rollback(); - $_GET["action"]='create'; - $_GET['socid']=$_POST['socid']; + $action='create'; + $socid=$_POST['socid']; if (! $mesg) $mesg='
'.$object->error.'
'; } @@ -932,7 +932,7 @@ if ($_POST['addfile']) $mesg=dol_add_file_process($upload_dir,0,0); - $_GET["action"]='presend'; + $action ='presend'; $_POST["action"]='presend'; } @@ -949,7 +949,7 @@ if (! empty($_POST['removedfile'])) $mesg=dol_remove_file_process($_POST['removedfile'],0); - $_GET["action"]='presend'; + $action ='presend'; $_POST["action"]='presend'; } @@ -1088,7 +1088,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P { $langs->load("other"); $mesg='
'.$langs->trans('ErrorMailRecipientIsEmpty').' !
'; - $_GET["action"]='presend'; + $action='presend'; dol_syslog('Recipient email is empty'); } } @@ -1206,25 +1206,25 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // Reference - print ''; + print ''; // Reference client - print ''; print ''; // Client - print ''; + print ''; /* * Contact de la commande */ - print "'; // Ligne info remises tiers - print ''; // Date - print ''; // Date de livraison - print "'; } // Conditions de reglement - print ''; // Mode de reglement - print ''; // delai de livraison - print ''; // What trigger creation - print ''; @@ -1558,10 +1558,10 @@ else print '
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; + print '
'.$langs->trans('RefCustomer').''; print '
'.$langs->trans('Customer').''.$soc->getNomUrl(1).'
'.$langs->trans('Customer').''.$soc->getNomUrl(1).'
".$langs->trans("DefaultContact").''; + print "
".$langs->trans("DefaultContact").''; $html->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); print '
'.$langs->trans('Discounts').''; + print '
'.$langs->trans('Discounts').''; if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; @@ -1235,12 +1235,12 @@ if ($action == 'create' && $user->rights->commande->creer) print '
'.$langs->trans('Date').''; + print '
'.$langs->trans('Date').''; $html->select_date('','re','','','',"crea_commande",1,1); print '
".$langs->trans("DeliveryDate").""; + print "
".$langs->trans("DeliveryDate").''; if ($conf->global->DATE_LIVRAISON_WEEK_DELAY) { $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); @@ -1256,29 +1256,29 @@ if ($action == 'create' && $user->rights->commande->creer) if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS) { // Link to edit: $html->form_address($_SERVER['PHP_SELF'].'?action=create','',$soc->id,'adresse_livraison_id','commande',''); - print '
'.$langs->trans('DeliveryAddress').''; - $numaddress = $html->select_address($soc->fk_delivery_address, $_GET['socid'],'fk_address',1); + print '
'.$langs->trans('DeliveryAddress').''; + $numaddress = $html->select_address($soc->fk_delivery_address, $socid,'fk_address',1); print '   '.$langs->trans("AddAddress").''; print '
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1); print '
'.$langs->trans('PaymentMode').''; + print '
'.$langs->trans('PaymentMode').''; $html->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); print '
'.$langs->trans('AvailabilityPeriod').''; + print '
'.$langs->trans('AvailabilityPeriod').''; $html->select_availability($propal->availability,'availability_id'); print '
'.$langs->trans('Source').''; + print '
'.$langs->trans('Source').''; $html->select_demand_reason((GETPOST("origin")=='propal'?'SRC_COMM':''),'demand_reason_id','',1); print '
'; - if ($_GET['action'] != 'refcustomer' && $object->brouillon) print ''; + if ($action != 'refcustomer' && $object->brouillon) print ''; print '
'; print $langs->trans('RefCustomer').''; print ''.img_edit($langs->trans('Modify')).''.img_edit($langs->trans('Modify')).'
'; print ''; - if ($user->rights->commande->creer && $_GET['action'] == 'refcustomer') + if ($user->rights->commande->creer && $action == 'refcustomer') { print '
'; print ''; @@ -1619,10 +1619,10 @@ else print $langs->trans('Date'); print ''; - if ($_GET['action'] != 'editdate' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetDate'),1).''; + if ($action != 'editdate' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetDate'),1).''; print ''; print ''; - if ($_GET['action'] == 'editdate') + if ($action == 'editdate') { print ''; print ''; @@ -1654,10 +1654,10 @@ else print $langs->trans('DateDeliveryPlanned'); print ''; - if ($_GET['action'] != 'editdate_livraison') print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).''; + if ($action != 'editdate_livraison') print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).''; print ''; print ''; - if ($_GET['action'] == 'editdate_livraison') + if ($action == 'editdate_livraison') { print ''; print ''; @@ -1684,17 +1684,17 @@ else print $langs->trans('DeliveryAddress'); print ''; - if ($_GET['action'] != 'editdelivery_adress' && $object->brouillon) print 'socid.'&id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).''; + if ($action != 'editdelivery_adress' && $object->brouillon) print 'socid.'&id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).''; print ''; print ''; - if ($_GET['action'] == 'editdelivery_adress') + if ($action == 'editdelivery_adress') { - $html->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$_GET['socid'],'fk_address','commande',$object->id); + $html->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$socid,'fk_address','commande',$object->id); } else { - $html->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$_GET['socid'],'none','commande',$object->id); + $html->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$socid,'none','commande',$object->id); } print ''; } @@ -1705,10 +1705,10 @@ else print $langs->trans('PaymentConditionsShort'); print ''; - if ($_GET['action'] != 'editconditions' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).''; + if ($action != 'editconditions' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).''; print ''; print ''; - if ($_GET['action'] == 'editconditions') + if ($action == 'editconditions') { $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); } @@ -1725,10 +1725,10 @@ else print ''; - if ($_GET['action'] != 'editmode' && $object->brouillon) print ''; + if ($action != 'editmode' && $object->brouillon) print ''; print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'),1).'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; print ''; - if ($_GET['action'] == 'editmode') + if ($action == 'editmode') { $html->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); } @@ -1743,10 +1743,10 @@ else print ''; - if ($_GET['action'] != 'editavailability' && $object->brouillon) print ''; + if ($action != 'editavailability' && $object->brouillon) print ''; print '
'; print $langs->trans('AvailabilityPeriod'); print 'id.'">'.img_edit($langs->trans('SetAvailability'),1).'id.'">'.img_edit($langs->trans('SetAvailability'),1).'
'; print ''; - if ($_GET['action'] == 'editavailability') + if ($action == 'editavailability') { $html->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id'); } @@ -1761,10 +1761,10 @@ else print ''; - if ($_GET['action'] != 'editdemandreason' && $object->brouillon) print ''; + if ($action != 'editdemandreason' && $object->brouillon) print ''; print '
'; print $langs->trans('Source'); print 'id.'">'.img_edit($langs->trans('SetDemandReason'),1).'id.'">'.img_edit($langs->trans('SetDemandReason'),1).'
'; print ''; - if ($_GET['action'] == 'editdemandreason') + if ($action == 'editdemandreason') { $html->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); } @@ -1782,11 +1782,11 @@ else print ''; - if ($_GET['action'] != 'classer') print ''; + if ($action != 'classer') print ''; print '
'; print $langs->trans('Project'); print ''.img_edit($langs->trans('SetProject')).''.img_edit($langs->trans('SetProject')).'
'; print ''; //print "$object->id, $object->socid, $object->fk_project"; - if ($_GET['action'] == 'classer') + if ($action == 'classer') { $html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); } @@ -1859,7 +1859,7 @@ else */ if ($object->statut == 0 && $user->rights->commande->creer) { - if ($_GET['action'] != 'editline') + if ($action != 'editline') { $var=true;