From 88fcfa95338451c57deb1b92f54424289d142025 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 29 Nov 2012 10:23:47 +0100 Subject: [PATCH 1/6] Fix: uniformize code --- htdocs/fourn/commande/fiche.php | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 81503d29dd3..972cb12bbd6 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -174,36 +174,36 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver) else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) { $langs->load('errors'); - $error = false; + $error = 0; - if ($_POST['pu'] < 0 && $_POST['qty'] < 0) + if (GETPOST('pu') < 0 && GETPOST('qty') < 0) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error = true; + $error++; } - if (empty($_POST['idprodfournprice']) && $_POST['type'] < 0) + if (! GETPOST('idprodfournprice') && GETPOST('type') < 0) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); - $error = true; + $error++; } - if (empty($_POST['idprodfournprice']) && (! isset($_POST['pu']) || $_POST['pu']=='')) // Unit price can be 0 but not '' + if (! GETPOST('idprodfournprice') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not '' { setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); - $error = true; + $error++; } - if (empty($_POST['idprodfournprice']) && empty($_POST['np_desc']) && empty($_POST['dp_desc'])) + if (! GETPOST('idprodfournprice') && ! GETPOST('np_desc') && ! GETPOST('dp_desc')) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); - $error = true; + $error++; } - if (empty($_POST['idprodfournprice']) && (! isset($_POST['qty']) || $_POST['qty'] == '') - || ! empty($_POST['idprodfournprice']) && (! isset($_POST['pqty']) || $_POST['pqty'] == '')) + if (! GETPOST('idprodfournprice') && (! GETPOST('qty') || GETPOST('qty') == '') + || GETPOST('idprodfournprice') && (! GETPOST('pqty') || GETPOST('pqty') == '')) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error = true; + $error++; } - if (! $error && (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice']))) + if (! $error && ((GETPOST('qty') || GETPOST('pqty')) && ((GETPOST('pu') && (GETPOST('np_desc') || GETPOST('dp_desc'))) || GETPOST('idprodfournprice')))) { if ($object->fetch($id) < 0) dol_print_error($db,$object->error); if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error); @@ -211,9 +211,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit - if ($_POST["idprodfournprice"]) // >0 or -1 + if (GETPOST('idprodfournprice')) // >0 or -1 { - $qty = $_POST['qty'] ? $_POST['qty'] : $_POST['pqty']; + $qty = GETPOST('qty') ? GETPOST('qty') : GETPOST('pqty'); $productsupplier = new ProductFournisseur($db); $idprod=$productsupplier->get_buyprice($_POST['idprodfournprice'], $qty); // Just to see if a price exists for the quantity. Not used to found vat @@ -230,9 +230,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $desc.= $productsupplier->description && $_POST['np_desc'] ? "\n" : ""; $desc.= $_POST['np_desc']; - $remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"]; + $remise_percent = GETPOST('remise_percent') ? GETPOST('remise_percent') : GETPOST('p_remise_percent'); - $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); + $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); $type = $productsupplier->type; // Local Taxes @@ -241,13 +241,13 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $result=$object->addline( $desc, - $pu, + $pu, // FIXME $pu is not defined $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $productsupplier->id, - $_POST['idprodfournprice'], + GETPOST('idprodfournprice'), $productsupplier->fourn_ref, $remise_percent, 'HT', @@ -257,7 +257,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) if ($idprod == -1) { // Quantity too low - $mesg='
'.$langs->trans("ErrorQtyTooLowForThisSupplier").'
'; + setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors'); } } else @@ -272,7 +272,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) if (! $_POST['dp_desc']) { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); } else { @@ -1000,7 +1000,7 @@ if ($id > 0 || ! empty($ref)) $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); if ($ret == 'html') print '
'; } - + // Clone confirmation if ($action == 'clone') { @@ -1065,7 +1065,7 @@ if ($id > 0 || ! empty($ref)) $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); if ($ret == 'html') print '
'; } - + /* * Confirmation de l'annulation */ @@ -1491,7 +1491,7 @@ if ($id > 0 || ! empty($ref)) print ''; // TODO Use the predefinedproductline_create.tpl.php file - + // Add free products/services form print '
'; print ''; @@ -1505,7 +1505,7 @@ if ($id > 0 || ! empty($ref)) }); }); '; - + $var=true; print ''; print ''; @@ -1684,7 +1684,7 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("CancelOrder").''; } } - + // Clone if ($user->rights->fournisseur->commande->creer) { From d97f1937f8f8348338a5e6c65967822060d73402 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 29 Nov 2012 10:25:33 +0100 Subject: [PATCH 2/6] Fix: UPGRADE ECLIPSE AND EGIT WITH THE LAST VERSION PLEASE !!!! --- htdocs/adherents/stats/byproperties.php | 12 ++++++------ htdocs/admin/dict.php | 12 ++++++------ htdocs/comm/action/class/actioncomm.class.php | 6 +++--- htdocs/comm/action/fiche.php | 2 +- .../prelevement/class/bonprelevement.class.php | 16 ++++++++-------- htdocs/compta/prelevement/fiche.php | 16 ++++++++-------- htdocs/compta/prelevement/index.php | 4 ++-- htdocs/core/class/hookmanager.class.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formactions.class.php | 8 ++++---- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/exports/class/export.class.php | 2 +- htdocs/exports/export.php | 2 +- htdocs/fourn/commande/fiche.php | 12 ++++++------ htdocs/fourn/facture/fiche.php | 12 ++++++------ htdocs/holiday/fiche.php | 16 ++++++++-------- htdocs/holiday/index.php | 2 +- htdocs/install/etape1.php | 4 ++-- htdocs/install/fileconf.php | 2 +- 19 files changed, 67 insertions(+), 67 deletions(-) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 302992a707b..dcc25501d84 100755 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -22,8 +22,8 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $graphwidth = 700; $mapratio = 0.5; @@ -83,8 +83,8 @@ if ($resql) { $obj=$db->fetch_object($resql); - if ($obj->code == 'phy') $foundphy++; - if ($obj->code == 'mor') $foundmor++; + if ($obj->code == 'phy') $foundphy++; + if ($obj->code == 'mor') $foundmor++; $data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate)); @@ -122,8 +122,8 @@ print ''.$langs->trans("NbOfMembers").''; print ''.$langs->trans("LastMemberDate").''; print ''; -if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>''); -if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>''); +if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>''); +if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>''); $oldyear=0; $var=true; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ea9c5ca8183..e18420285c0 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1066,12 +1066,12 @@ if ($id) } } - // Est-ce une entree du dictionnaire qui peut etre desactivee ? - $iserasable=1; // Oui par defaut - if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0; - if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0; - if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0; - if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; + // Est-ce une entree du dictionnaire qui peut etre desactivee ? + $iserasable=1; // Oui par defaut + if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0; + if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0; + if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0; + if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; // Active print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fd1a1e657a6..a79650fa893 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -723,7 +723,7 @@ class ActionComm extends CommonObject { $libelle=$label; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code); - $libelleshort=dol_trunc($label, $maxlength); + $libelleshort=dol_trunc($label, $maxlength); } else { @@ -733,8 +733,8 @@ class ActionComm extends CommonObject if ($withpicto) { - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - { + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { $libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':''); } $result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index ee9ad394f05..5b5ebee90ee 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -111,7 +111,7 @@ if ($action == 'add_action') { $error++; $action = 'create'; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'
'; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'
'; } // Initialisation objet cactioncomm diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 630a8926b84..25153612f56 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1042,12 +1042,12 @@ class BonPrelevement extends CommonObject } - /** - * Get object and lines from database - * - * @return int >0 if OK, <0 if KO - */ - function delete() + /** + * Get object and lines from database + * + * @return int >0 if OK, <0 if KO + */ + function delete() { $this->db->begin(); @@ -1057,7 +1057,7 @@ class BonPrelevement extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."'"; $resql2=$this->db->query($sql); - if (! $resql2) dol_print_error($this->db); + if (! $resql2) dol_print_error($this->db); $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = '".$this->id."'"; $resql3=$this->db->query($sql); @@ -1078,7 +1078,7 @@ class BonPrelevement extends CommonObject return -1; } } - + /** * Returns clickable name (with picto) diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index af2b1bbf495..73450228480 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -54,8 +54,8 @@ if ( $action == 'confirm_delete' ) $res=$bon->delete(); if ($res > 0) { - header("Location: index.php"); - exit; + header("Location: index.php"); + exit; } } @@ -100,11 +100,11 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send) $error = $bon->set_infotrans($user, $dt, GETPOST('methode','alpha')); - if ($error) - { - header("Location: fiche.php?id=".$id."&error=$error"); + if ($error) + { + header("Location: fiche.php?id=".$id."&error=$error"); exit; - } + } } if ($action == 'infocredit' && $user->rights->prelevement->bons->credit) @@ -244,7 +244,7 @@ if ($id > 0) if (empty($bon->date_trans) && $user->rights->prelevement->bons->send) { - print "id."\">".$langs->trans("SetToStatusSent").""; + print "id."\">".$langs->trans("SetToStatusSent").""; } if (! empty($bon->date_trans) && $bon->date_credit == 0) @@ -252,7 +252,7 @@ if ($id > 0) print "id."\">".$langs->trans("ClassCredited").""; } - print "id."\">".$langs->trans("Delete").""; + print "id."\">".$langs->trans("Delete").""; print ""; } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 62664038b7e..2f2dd82fcb7 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -127,8 +127,8 @@ if ($result) print $bprev->getNomUrl(1); print "\n"; print ''.dol_print_date($db->jdate($obj->datec),"dayhour")."\n"; - print ''.price($obj->amount)."\n"; - print ''.$bprev->getLibStatut(3)."\n"; + print ''.price($obj->amount)."\n"; + print ''.$bprev->getLibStatut(3)."\n"; print "\n"; $i++; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index cf3c7b8ba96..671334982e9 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -170,7 +170,7 @@ class HookManager if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; // TODO. remove this. array result must be set into $actionclassinstance->results - if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); + if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 945a65fb820..f031750cb5b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2238,7 +2238,7 @@ class Form $inputko=array(); // Clean parameters - $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; + $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; if (is_array($formquestion) && ! empty($formquestion)) { diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 07780c1c068..5916159bd6e 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -172,7 +172,7 @@ class FormActions print ''; print "\n"; - $userstatic = new User($this->db); + $userstatic = new User($this->db); foreach($listofactions as $action) { @@ -219,9 +219,9 @@ class FormActions $form=new Form($this->db); // Suggest a list with manual event or all auto events - $arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot); - array_unshift($arraylist,' '); // Add empty line at start - //asort($arraylist); + $arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot); + array_unshift($arraylist,' '); // Add empty line at start + //asort($arraylist); print $form->selectarray($htmlname, $arraylist, $selected); if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index d8b1fb11f9e..13ec3392364 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -184,7 +184,7 @@ class pdf_crabe extends ModelePDFFactures $nblignes = count($object->lines); $pdf=pdf_getInstance($this->format); - $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance + $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 2bd5b27537c..721a0c94e52 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -294,7 +294,7 @@ class Export } break; case 'Boolean': - $szFilterQuery=" ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField =='yes' ? 1: 0) ); + $szFilterQuery=" ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField =='yes' ? 1: 0) ); break; case 'Status': case 'List': diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 8f4ceefcba6..6ffcc39e1c8 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -1122,7 +1122,7 @@ print '
'; llxFooter(); -$db->close(); +$db->close(); /** diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 972cb12bbd6..2e627fadc7b 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1498,12 +1498,12 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - print ''; $var=true; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 7ecc09268e6..6986b743dfd 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -469,7 +469,7 @@ elseif ($action == 'addline') if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or '' { $idprod=0; - $product=new Product($db); + $product=new Product($db); if (GETPOST('idprodfournprice') == '') { @@ -1820,12 +1820,12 @@ else print ''; print ''; - print ''; $var=! $var; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 859069957a6..147d57bda7f 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -830,14 +830,14 @@ else } - $h=0; - $head = array(); - $head[$h][0] = DOL_URL_ROOT . '/holiday/fiche.php?id='.$id; - $head[$h][1] = $langs->trans("Card"); - $head[$h][2] = 'card'; - $h++; - - complete_head_from_modules($conf,$langs,$cp,$head,$h,'holiday'); + $h=0; + $head = array(); + $head[$h][0] = DOL_URL_ROOT . '/holiday/fiche.php?id='.$id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + complete_head_from_modules($conf,$langs,$cp,$head,$h,'holiday'); dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday'); diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index dd706ed9be2..8e063237b83 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -57,7 +57,7 @@ $search_employe = GETPOST('search_employe'); $search_valideur = GETPOST('search_valideur'); $search_statut = GETPOST('select_statut'); -$holiday = new Holiday($db); +$holiday = new Holiday($db); /* * Actions diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 56fe19f37eb..b482987af0b 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -55,8 +55,8 @@ $db_prefix=GETPOST('db_prefix','alpha'); session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) // Save a flag to tell to restore input value if we do back -$_SESSION['dol_save_pass']=$db_pass; -//$_SESSION['dol_save_passroot']=$passroot; +$_SESSION['dol_save_pass']=$db_pass; +//$_SESSION['dol_save_passroot']=$passroot; // Now we load forced value from install.forced.php file. $useforcedwizard=false; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 4cb44467761..349de13771a 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -69,7 +69,7 @@ if (@file_exists($forcedfile)) { * View */ -session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) +session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) pHeader($langs->trans("ConfigurationFile"),"etape1","set","",(empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/')); From 36ca33482117928053df53dac8aa5eabb4b5be22 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 29 Nov 2012 10:43:05 +0100 Subject: [PATCH 3/6] FIXME: this return create an error in jenkins --- htdocs/fourn/class/fournisseur.commande.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d2e93906bf4..6bb21519a26 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -953,7 +953,7 @@ class CommandeFournisseur extends CommonOrder if ($this->db->query($sql)) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur"); - + if ($this->id) { $num=count($this->lines); @@ -994,7 +994,7 @@ class CommandeFournisseur extends CommonOrder { // On logue creation pour historique $this->log($user, 0, time()); - + if (! $notrigger) { // Appel des triggers @@ -1004,7 +1004,7 @@ class CommandeFournisseur extends CommonOrder if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers } - + $this->db->commit(); return $this->id; } @@ -1170,7 +1170,7 @@ class CommandeFournisseur extends CommonOrder $this->error="No price found for this quantity. Quantity may be too low ?"; $this->db->rollback(); dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG); - return -1; + return -1; // FIXME this return create an error in jenkins } if ($result < -1) { From a62f2a7c8d9253e3be67422ffdbc63cf3ecb0e8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Nov 2012 12:53:12 +0100 Subject: [PATCH 4/6] New: Add vat rate for south africa. --- htdocs/install/mysql/data/llx_c_tva.sql | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index db277680875..3f48667c690 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -255,9 +255,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (15 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1); -- BARBADOS (id country=46) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (461,46, '0','0','No VAT',1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (462,46, '15','0','VAT 15%',1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (463,46, '7.5','0','VAT 7.5%',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 461, 46, '0','0','No VAT',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1); + +-- SOUTH AFRICA (id country=205) +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051,205, '0','0','No VAT',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1); -- VENEZUELA (id country=232) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1); From 583dfb225cfac3b8a5b1ee4f172af5f1cfaf228c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 29 Nov 2012 18:21:18 +0100 Subject: [PATCH 5/6] New: add possibility to force label of buttons and hide the second button for dialog info only --- htdocs/core/js/lib_head.js | 6 ++++++ htdocs/core/lib/ajax.lib.php | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index d9088ba83ba..b2fd89ac5d9 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -729,6 +729,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, modal: true, buttons: [ { + id : yesButton, text : yesButton, click : function() { if (action == "set") { @@ -748,6 +749,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } }, { + id : noButton, text : noButton, click : function() { $(this).dialog("close"); @@ -755,6 +757,10 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } ] }); + // For information dialog box only, hide the noButton + if (boxConfirm.info) { + $("#" + noButton).button().hide(); + } } /* diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4b5b4f986ce..ba9511d8d66 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -375,6 +375,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false) // Set constant $("#set_" + code).click(function() { if (input.alert && input.alert.set) { + // Posibility to force label of buttons + if (input.alert.set.yesButton) + yesButton = input.alert.set.yesButton; + if (input.alert.set.noButton) + noButton = input.alert.set.noButton; confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton); } else { setConstant(url, code, input, entity); @@ -384,6 +389,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false) // Del constant $("#del_" + code).click(function() { if (input.alert && input.alert.del) { + // Posibility to force label of buttons + if (input.alert.del.yesButton) + yesButton = input.alert.del.yesButton; + if (input.alert.del.noButton) + noButton = input.alert.del.noButton; confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton); } else { delConstant(url, code, input, entity); From 3005a4f7cf0caa0973996e275184c74c85986767 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 29 Nov 2012 18:37:37 +0100 Subject: [PATCH 6/6] Fix: use specific code for avoid conflict --- htdocs/core/js/lib_head.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index b2fd89ac5d9..d03baa648c4 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -729,7 +729,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, modal: true, buttons: [ { - id : yesButton, + id : 'yesButton_' + code, text : yesButton, click : function() { if (action == "set") { @@ -749,7 +749,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } }, { - id : noButton, + id : 'noButton_' + code, text : noButton, click : function() { $(this).dialog("close"); @@ -759,7 +759,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, }); // For information dialog box only, hide the noButton if (boxConfirm.info) { - $("#" + noButton).button().hide(); + $("#noButton_" + code).button().hide(); } }