From 2bcbd7dc2ad18e6463a2c61e17a62baba623ce57 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Tue, 18 Sep 2012 18:00:05 +0200 Subject: [PATCH 1/7] fix: Warning : Invalid argument supplied for foreach() --- htdocs/core/class/html.formfile.class.php | 71 ++++++++++++----------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 07f51ebd72c..ebcdd51fc88 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -450,46 +450,49 @@ class FormFile } // Loop on each file found - foreach($file_list as $file) - { - $var=!$var; + if (is_array($file_list)) + { + foreach($file_list as $file) + { + $var=!$var; - // Define relative path for download link (depends on module) - $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... - // Autre cas - if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; } - if ($modulepart == 'export') { $relativepath = $file["name"]; } + // Define relative path for download link (depends on module) + $relativepath=$file["name"]; // Cas general + if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... + // Autre cas + if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; } + if ($modulepart == 'export') { $relativepath = $file["name"]; } - $out.= ""; + $out.= ""; - // Show file name with link to download - $out.= ''; - $out.= 'trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); - $out.= ''."\n"; - $out.= ''; + // Show file name with link to download + $out.= ''; + $out.= 'trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); + $out.= ''."\n"; + $out.= ''; - // Show file size - $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); - $out.= ''.dol_print_size($size).''; + // Show file size + $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); + $out.= ''.dol_print_size($size).''; - // Show file date - $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); - $out.= ''.dol_print_date($date, 'dayhour').''; + // Show file date + $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); + $out.= ''.dol_print_date($date, 'dayhour').''; - if ($delallowed) - { - $out.= ''; - $out.= ''.img_delete().''; - } + if ($delallowed) + { + $out.= ''; + $out.= ''.img_delete().''; + } + } $out.= ''; From d18488966b4e90993ebf6e612e03db61a70a55a8 Mon Sep 17 00:00:00 2001 From: simnandez Date: Wed, 19 Sep 2012 15:51:00 +0200 Subject: [PATCH 2/7] Fix: Update spanish VAT data for first instalations --- htdocs/install/mysql/data/llx_c_tva.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index a24c419f2f7..579700212a8 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -190,10 +190,10 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (20 INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '0', '0', 'VAT Rate 0', 1); -- SPAIN (id country=4) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values ( 41, 4, '21','0','5.2','1','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values ( 42, 4, '10','0','1.4','1','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values ( 43, 4, '4','0','0.5','1','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 44, 4, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type, note,active) values ( 41, 4, '21','0','5.2','3','-15','1','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4, '10','0','1.4','3','-15','1','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-15','1','VAT super-reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'0','0','0','3','-15','1','VAT Rate 0',1); -- SWEDEN (id country=20) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (201,20, '25','0','VAT standard rate',1); From 31b91e68c11cf1638dbb4229c358864cea22505b Mon Sep 17 00:00:00 2001 From: simnandez Date: Wed, 19 Sep 2012 16:09:41 +0200 Subject: [PATCH 3/7] Fix: Update spanish VAT data for first instalations --- htdocs/install/mysql/data/llx_c_tva.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 579700212a8..1c4980afc7c 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -190,10 +190,10 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (20 INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '0', '0', 'VAT Rate 0', 1); -- SPAIN (id country=4) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type, note,active) values ( 41, 4, '21','0','5.2','3','-15','1','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4, '10','0','1.4','3','-15','1','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-15','1','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'0','0','0','3','-15','1','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4,'21','0','5.2','3','-15','1','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-15','1','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-15','1','VAT super-reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4, '0','0','0', '3','-15','1','VAT Rate 0',1); -- SWEDEN (id country=20) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (201,20, '25','0','VAT standard rate',1); From 5344d0c33028559c804d188862d259f499b3fb93 Mon Sep 17 00:00:00 2001 From: simnandez Date: Wed, 19 Sep 2012 16:15:35 +0200 Subject: [PATCH 4/7] Fix: Update spanish VAT data for first instalations --- htdocs/install/mysql/data/llx_c_tva.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 1c4980afc7c..2a9746c7080 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -193,7 +193,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (20 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4,'21','0','5.2','3','-15','1','VAT standard rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-15','1','VAT reduced rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-15','1','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4, '0','0','0', '3','-15','1','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4, '0','0', '0','3','-15','1','VAT Rate 0',1); -- SWEDEN (id country=20) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (201,20, '25','0','VAT standard rate',1); From 40f54275201892002697350193e709fdfcbd91e5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 19 Sep 2012 17:18:52 +0200 Subject: [PATCH 5/7] Fix: broken features, ready for doliforge --- htdocs/admin/ihm.php | 28 +++++++++++++++++++++++++--- htdocs/main.inc.php | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 30b33e70db8..2b71b92d330 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,6 +76,7 @@ if ($action == 'update') // This one is not always defined if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity); + if (isset($_POST["MAIN_BUGTRACK_ENABLELINK"])) dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer @@ -235,6 +236,17 @@ if ($action == 'edit') // Edit print ' '; print ''; + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + // Show bugtrack link + $var=!$var; + print ''.$langs->trans("ShowBugTrackLink").''; + print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); + print ''; + print ' '; + print ''; + } + // Message on login page $var=!$var; print ''.$langs->trans("MessageLogin").''; @@ -378,6 +390,16 @@ else // Show print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); print ''; + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + // Show bugtrack link + $var=!$var; + print ''.$langs->trans("ShowBugTrackLink").''; + print yn($conf->global->MAIN_BUGTRACK_ENABLELINK).""; + print ' '; + print ""; + } + // Message login $var=!$var; print ''.$langs->trans("MessageLogin").''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9b95f6ab149..4fa01b4f116 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1512,7 +1512,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me } // Link to bugtrack - if (! empty($conf->global->MAIN_SHOW_BUGTRACK_LINK)) + if (! empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; From 98b38628c57a583e2288ec6a8ea6c1dd88936dec Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 19 Sep 2012 17:24:40 +0200 Subject: [PATCH 6/7] Fix: optimizing --- htdocs/core/tpl/predefinedproductline_create.tpl.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index e10dc184ccb..3fadf385543 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -142,8 +142,7 @@ if (! empty($conf->margin->enabled)) { $("#idprod").change(function() { $("#fournprice options").remove(); $("#fournprice").hide(); - $("#buying_price").val(""); - $("#buying_price").show(); + $("#buying_price").val("").show(); $.post('/fourn/ajax/getSupplierPrices.php', {'idprod': $(this).val()}, function(data) { if (data && data.length > 0) { var options = ''; @@ -158,9 +157,8 @@ $("#idprod").change(function() { options += '>'+this.label+''; }); options += ''; - $("#fournprice").html(options); $("#buying_price").hide(); - $("#fournprice").show(); + $("#fournprice").html(options).show(); $("#fournprice").change(function() { var selval = $(this).find('option:selected').attr("price"); if (selval) From d58c106f66a6067975ad48ce6b9f1feee40d1206 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 19 Sep 2012 17:53:09 +0200 Subject: [PATCH 7/7] Fix: convert line delimiters !!! --- htdocs/admin/dict.php | 4 +- htdocs/admin/ihm.php | 26 ++--- htdocs/contact/class/contact.class.php | 28 ++--- htdocs/contact/fiche.php | 110 +++++++++--------- htdocs/core/lib/files.lib.php | 12 +- .../commande/doc/pdf_einstein.modules.php | 2 +- .../doc/pdf_expedition_merou.modules.php | 2 +- .../doc/pdf_expedition_rouget.modules.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 2 +- .../livraison/pdf/pdf_sirocco.modules.php | 2 +- .../livraison/pdf/pdf_typhon.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 2 +- .../pdf/pdf_canelle.modules.php | 2 +- .../pdf/pdf_muscadet.modules.php | 2 +- .../class/fournisseur.commande.class.php | 2 +- htdocs/holiday/admin/holiday.php | 6 +- htdocs/product/admin/product_extrafields.php | 2 +- htdocs/projet/note.php | 2 +- htdocs/projet/tasks.php | 6 +- 20 files changed, 109 insertions(+), 109 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index f991758250f..c739a261575 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -440,7 +440,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } // Clean some parameters if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0 - if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0 + if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0 // Si verif ok et action add, on ajoute la ligne if ($ok && GETPOST('actionadd')) @@ -814,7 +814,7 @@ if ($id) /* $tmparray=getLabelOfField($fieldlist[$field]); $showfield=$tmp['showfield']; - $valuetoshow=$tmp['valuetoshow']; + $valuetoshow=$tmp['valuetoshow']; $align=$tmp['align']; $sortable=$tmp['sortable']; */ diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 2b71b92d330..18a38ca3d8f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -237,13 +237,13 @@ if ($action == 'edit') // Edit print ''; if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { - // Show bugtrack link - $var=!$var; - print ''.$langs->trans("ShowBugTrackLink").''; - print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); - print ''; - print ' '; + { + // Show bugtrack link + $var=!$var; + print ''.$langs->trans("ShowBugTrackLink").''; + print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); + print ''; + print ' '; print ''; } @@ -390,13 +390,13 @@ else // Show print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - // Show bugtrack link - $var=!$var; - print ''.$langs->trans("ShowBugTrackLink").''; - print yn($conf->global->MAIN_BUGTRACK_ENABLELINK).""; - print ' '; + // Show bugtrack link + $var=!$var; + print ''.$langs->trans("ShowBugTrackLink").''; + print yn($conf->global->MAIN_BUGTRACK_ENABLELINK).""; + print ' '; print ""; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e5cd3bed15f..bf0f5057179 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -263,21 +263,21 @@ class Contact extends CommonObject unset($this->state_code); unset($this->state); - // Actions on extra fields (by external module or standard code) - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager=new HookManager($this->db); - $hookmanager->initHooks(array('contactdao')); - $parameters=array('socid'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) + // Actions on extra fields (by external module or standard code) + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + $hookmanager->initHooks(array('contactdao')); + $parameters=array('socid'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - else if ($reshook < 0) $error++; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + else if ($reshook < 0) $error++; if (! $error && ! $notrigger) { diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 78c9e7e01e7..30e6952db44 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); $langs->load("users"); @@ -48,7 +48,7 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $object = new Contact($db); -$extrafields = new ExtraFields($db); +$extrafields = new ExtraFields($db); // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($id); @@ -76,7 +76,7 @@ $hookmanager->initHooks(array('contactcard')); $parameters=array('id'=>$id, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); if (empty($reshook)) { @@ -254,14 +254,14 @@ if (empty($reshook)) $object->priv = $_POST["priv"]; $object->note = $_POST["note"]; - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=GETPOST($key); - } - } + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=GETPOST($key); + } + } $result = $object->update($_POST["contactid"], $user); @@ -285,8 +285,8 @@ if (empty($reshook)) * View */ -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('contact'); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('contact'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ContactsAddresses"),$help_url); @@ -492,20 +492,20 @@ else // Note print ''.$langs->trans("Note").''; - // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - print ''.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } - } - + // Other attributes + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); + print ''.$label.''; + print $extrafields->showInputField($key,$value); + print ''."\n"; + } + } + print "
"; @@ -688,20 +688,20 @@ else print isset($_POST["note"])?$_POST["note"]:$object->note; print ''; - // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print ''.$label.''; - print $extrafields->showInputField($key,$value); - print "\n"; - } - } - + // Other attributes + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print ''.$label.''; + print $extrafields->showInputField($key,$value); + print "\n"; + } + } + $object->load_ref_elements(); if (! empty($conf->commande->enabled)) @@ -898,20 +898,20 @@ else print nl2br($object->note); print ''; - // Other attributes - $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - print ''.$label.''; - print $extrafields->showOutputField($key,$value); - print "\n"; - } - } - + // Other attributes + $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); + print ''.$label.''; + print $extrafields->showOutputField($key,$value); + print "\n"; + } + } + $object->load_ref_elements(); if (! empty($conf->commande->enabled)) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 92399378f53..90a2f8970c8 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -906,12 +906,12 @@ function dol_meta_create($object) // Define parent dir of elements $element=$object->element; - if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande'; - elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture'; - elseif ($object->element == 'project') $dir = $conf->projet->dir_output; - elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending'; - elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt'; - elseif ($object->element == 'fichinter') $dir = $conf->ficheinter->dir_output; + if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande'; + elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture'; + elseif ($object->element == 'project') $dir = $conf->projet->dir_output; + elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending'; + elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt'; + elseif ($object->element == 'fichinter') $dir = $conf->ficheinter->dir_output; else $dir=empty($conf->$element->dir_output)?'':$conf->$element->dir_output; if ($dir) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b0561ed7310..495e292d3f6 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -262,7 +262,7 @@ class pdf_einstein extends ModelePDFCommandes { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 29b8eea38f0..0e41524f4a7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -206,7 +206,7 @@ class pdf_expedition_merou extends ModelePdfExpedition { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 3); - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 9ef088bb9a3..31fb518df1b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -233,7 +233,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8f2198928a8..90f6030e11d 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -265,7 +265,7 @@ class pdf_crabe extends ModelePDFFactures { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index dde7c8dfd78..9a5509de183 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -246,7 +246,7 @@ class pdf_soleil extends ModelePDFFicheinter { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php index 719a0d98bee..1e49e8f6c6d 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php @@ -184,7 +184,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index da54ea642bd..b2653beb7cc 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -239,7 +239,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot-50); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 704171866e6..9f199310dc4 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -263,7 +263,7 @@ class pdf_azur extends ModelePDFPropales { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index d1ef4e3bb27..e6948d6ef7c 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -260,7 +260,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index dd6109b818b..d638c940988 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -272,7 +272,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 84a21b97a1c..6b598b1a8b5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1905,7 +1905,7 @@ class CommandeFournisseurLigne var $total_localtax2; var $total_ttc; var $info_bits; - var $special_code; + var $special_code; // From llx_product var $libelle; // Label produit diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index e14b1a2bba9..dbb8dc67d74 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -266,7 +266,7 @@ print '
'; print_fiche_titre($langs->trans('TitleOptionMainCP'),'',''); -dol_fiche_head(array(),'',''); +dol_fiche_head(array(),'',''); print '
'."\n"; print ''."\n"; @@ -334,13 +334,13 @@ print ''."\n"; print '
'."\n"; print '
'."\n\n"; -dol_fiche_end(); +dol_fiche_end(); print '
'; print_fiche_titre($langs->trans('TitleOptionEventCP'),'',''); -dol_fiche_head(array(),'',''); +dol_fiche_head(array(),'',''); $cp_events = $cp->fetchEventsCP(); diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 9c9276669af..6ad785a35c6 100755 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -146,7 +146,7 @@ if ($action == 'create') print "
"; print_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields.tpl.php'; print '
'; print ''; diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 7abdcfe0303..f3f57994860 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -134,7 +134,7 @@ if ($id > 0 || ! empty($ref)) print '
'; $colwidth=30; - include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; dol_fiche_end();; } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index ec6257e7854..521b6708858 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -354,10 +354,10 @@ else //var_dump($tasksarray); //var_dump($tasksrole); - if (! empty($conf->use_javascript_ajax)) + if (! empty($conf->use_javascript_ajax)) { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + } print ''; print '';