From cb3f183353cddf85b6d856083ec3458c775292bb Mon Sep 17 00:00:00 2001 From: Stephen L Date: Wed, 3 Apr 2013 00:57:40 +0200 Subject: [PATCH 1/6] Add: ODTSubstitution and ODTSubstitutionLine hooks with $odfHandler for extended ODT substitution Signed-off-by: Stephen L. --- htdocs/core/lib/functions.lib.php | 2 ++ .../doc/doc_generic_order_odt.modules.php | 33 +++++++++++------ .../doc/doc_generic_invoice_odt.modules.php | 31 ++++++++++------ .../doc/doc_generic_proposal_odt.modules.php | 36 +++++++++++++------ .../societe/doc/doc_generic_odt.modules.php | 18 +++++++--- 5 files changed, 85 insertions(+), 35 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 33b694f5ed5..14386b9c77a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3597,7 +3597,9 @@ function complete_substitutions_array(&$substitutionarray,$outputlangs,$object=' $module=$reg[1]; dol_syslog("Library functions_".$substitfile['name']." found into ".$dir); + // Include the user's functions file require_once $dir.$substitfile['name']; + // Call the user's function, and only if it is defined $function_name=$module."_".$callfunc; if (function_exists($function_name)) $function_name($substitutionarray,$outputlangs,$object,$parameters); } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 85da9b96015..5ab40fd1e86 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -121,14 +121,14 @@ class doc_generic_order_odt extends ModelePDFCommandes 'object_note_private'=>$object->note, 'object_note'=>$object->note_public, ); - + // Add vat by rates foreach ($object->lines as $line) { if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0; $resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva; } - + return $resarray; } @@ -260,6 +260,15 @@ class doc_generic_order_odt extends ModelePDFCommandes return -1; } + // Add odtgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + global $action; + if (! is_object($outputlangs)) $outputlangs=$langs; $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; @@ -346,6 +355,9 @@ class doc_generic_order_odt extends ModelePDFCommandes '__TOTAL_VAT__' => $object->total_vat ); complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$substitutionarray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Line of free text $newfreetext=''; @@ -445,6 +457,9 @@ class doc_generic_order_odt extends ModelePDFCommandes // Replace tags of object + external modules $tmparray=$this->get_substitutionarray_object($object,$outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks foreach($tmparray as $key=>$value) { try { @@ -470,6 +485,9 @@ class doc_generic_order_odt extends ModelePDFCommandes { $tmparray=$this->get_substitutionarray_lines($line,$outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line); + $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks foreach($tmparray as $key => $val) { try @@ -494,15 +512,8 @@ class doc_generic_order_odt extends ModelePDFCommandes return -1; } - // Add odtgeneration hook - if (! is_object($hookmanager)) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager=new HookManager($this->db); - } - $hookmanager->initHooks(array('odtgeneration')); - $parameters=array('odfHandler'=>$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - global $action; + // Call the beforeODTSave hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Write new file diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index fbdccd73eb8..77f673f2220 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -283,6 +283,15 @@ class doc_generic_invoice_odt extends ModelePDFFactures return -1; } + // Add odtgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + global $action; + if (! is_object($outputlangs)) $outputlangs=$langs; $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; @@ -375,6 +384,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures '__TOTAL_VAT__' => $object->total_tva ); complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$substitutionarray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Line of free text $newfreetext=''; @@ -417,9 +429,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_propal=is_object($propal_object)?$this->get_substitutionarray_propal($propal_object,$outputlangs,'propal'):array(); $array_other=$this->get_substitutionarray_other($user,$outputlangs); - + $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal); complete_substitutions_array($tmparray, $outputlangs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks //var_dump($tmparray); exit; foreach($tmparray as $key=>$value) @@ -448,6 +463,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures { $tmparray=$this->get_substitutionarray_lines($line,$outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line); + $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks foreach($tmparray as $key => $val) { try @@ -472,15 +490,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures return -1; } - // Add odtgeneration hook - if (! is_object($hookmanager)) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager=new HookManager($this->db); - } - $hookmanager->initHooks(array('odtgeneration')); - $parameters=array('odfHandler'=>$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - global $action; + // Call the beforeODTSave hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Write new file diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 0878e4da181..df61cbed461 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -149,10 +149,10 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte.= ''; // Scan directories - if (count($listofdir)) + if (count($listofdir)) { $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - + if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation @@ -163,14 +163,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte.= ''; $texte.= $form->selectarray('value2',$liste,$conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT); $texte.= ""; - + $texte.= ''; $texte.= ''.$langs->trans("DefaultModelPropalToBill").''; $texte.= ''; $texte.= $form->selectarray('value3',$liste,$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL); $texte.= ""; $texte.= ''; - + $texte.= ''.$langs->trans("DefaultModelPropalClosed").''; $texte.= ''; $texte.= $form->selectarray('value4',$liste,$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED); @@ -178,9 +178,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte.= ''; } } - - + + $texte.= ''; @@ -222,6 +222,15 @@ class doc_generic_proposal_odt extends ModelePDFPropales return -1; } + // Add odtgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + global $action; + if (! is_object($outputlangs)) $outputlangs=$langs; $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; @@ -308,6 +317,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales '__TOTAL_VAT__' => $object->total_vat ); complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$substitutionarray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Line of free text $newfreetext=''; @@ -408,6 +420,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales $tmparray=$this->get_substitutionarray_propal($object,$outputlangs); //print_r($tmparray); exit; complete_substitutions_array($tmparray, $outputlangs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks foreach($tmparray as $key=>$value) { try { @@ -433,6 +448,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales { $tmparray=$this->get_substitutionarray_propal_lines($line,$outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line); + $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks foreach($tmparray as $key => $val) { try @@ -457,10 +475,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales return -1; } - // Add odtgeneration hook - $hookmanager->initHooks(array('odtgeneration')); - $parameters=array('odfHandler'=>$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - global $action; + // Call the beforeODTSave hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Write new file diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 0146ebfc253..acf14c67139 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -173,6 +173,15 @@ class doc_generic_odt extends ModeleThirdPartyDoc return -1; } + // Add odtgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + global $action; + if (! is_object($outputlangs)) $outputlangs=$langs; $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; @@ -276,6 +285,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc // Make substitutions into odt of thirdparty + external modules $tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object); + // Call the ODTSubstitution hook + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); + $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks //var_dump($object->id); exit; foreach($tmparray as $key=>$value) { @@ -296,10 +308,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc } } - // Add odtgeneration hook - $hookmanager->initHooks(array('odtgeneration')); - $parameters=array('odfHandler'=>$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - global $action; + // Call the beforeODTSave hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks // Write new file From 06485b065b2e7bc7725db7ebf0a45324d69ff438 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Apr 2013 08:56:19 +0200 Subject: [PATCH 2/6] Fix: bug #791 --- htdocs/install/mysql/data/llx_c_tva.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index b6d38949451..7cc8c36549e 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -219,13 +219,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 6 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '0','0','VAT Rate 0', 1); -- TUNISIA (id country=10) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0, null); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (102,10, '12','0','VAT 12%',1, 1, '4', 0, null); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (103,10, '18','0','VAT 18%',1, 1, '4', 0, null); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1, 1, '4', 0, null); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1, 1, '4', 0, null); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1, 1, '4', 0, null); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10, '0','0','VAT Rate 0', 1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (102,10, '12','0','VAT 12%',1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (103,10, '18','0','VAT 18%',1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10, '0','0','VAT Rate 0', 1, 1, '4', 0, 0); -- UKRAINE (id country=226) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '20','0','VAT standart rate',1); From d08eb386ab8b20a179233c3dee158629d9374000 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 09:03:13 +0200 Subject: [PATCH 3/6] Fix: cursor --- htdocs/theme/amarok/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 4b9c8438456..41f96d10d20 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -867,7 +867,7 @@ div.ficheaddleft { div.divButAction { margin-bottom: 1.4em; } .button, .butAction {background: #999; border: solid 1px #888; font-weight: normal; } -.butActionRefused {background: #eaeaea; color:rgba(0,0,0,0.6); font-weight: normal;} +.butActionRefused {background: #eaeaea; color:rgba(0,0,0,0.6); font-weight: normal; cursor: not-allowed; } .butActionDelete {background: #b33c37; border:solid 1px #8d2f2b; font-weight: normal;} .button, .butAction, .butActionRefused, .butActionDelete { From bf23efda21cca7bd24da46c4ed451c80316a97bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 09:17:03 +0200 Subject: [PATCH 4/6] Fix: Bad error management --- htdocs/societe/class/societe.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 37b81403acd..205e88c8272 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -249,7 +249,11 @@ class Societe extends CommonObject $result=$interface->run_triggers('COMPANY_CREATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers - + } + else $error++; + + if (! $error) + { dol_syslog(get_class($this)."::Create success id=".$this->id); $this->db->commit(); return $this->id; From 4996a4b2174feaa1e207a694e3a5e8657e36e726 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 12:23:12 +0200 Subject: [PATCH 5/6] Fix: regex not complete --- htdocs/core/class/menubase.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 5ebccdeb1bd..6777c37b374 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -535,7 +535,7 @@ class Menubase if ($menu['perms']) { $tmpcond=$menu['perms']; - if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z]+/','1==1',$tmpcond); // Force part of condition to true + if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/','1==1',$tmpcond); // Force part of condition to true $perms = verifCond($tmpcond); //print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$perms."
\n"; } @@ -545,7 +545,7 @@ class Menubase if ($menu['enabled']) { $tmpcond=$menu['enabled']; - if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z]+/','1==1',$tmpcond); // Force part of condition to true + if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/','1==1',$tmpcond); // Force part of condition to true $enabled = verifCond($tmpcond); if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1; //print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$enabled."
\n"; From 607ebbfe8b3ba0ff6486732001d6eded6eccf2f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 19:42:21 +0200 Subject: [PATCH 6/6] Qual: Replace tab with div --- htdocs/adherents/stats/index.php | 12 +++++++----- htdocs/comm/propal/stats/index.php | 14 +++++++++----- htdocs/commande/stats/index.php | 15 +++++++++------ htdocs/compta/deplacement/stats/index.php | 14 +++++++++----- htdocs/compta/facture/stats/index.php | 14 +++++++++----- 5 files changed, 43 insertions(+), 26 deletions(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 8e19ce15ffe..c76be008596 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -143,8 +143,7 @@ $head = member_stats_prepare_head($adh); dol_fiche_head($head, 'statssubscription', $langs->trans("Statistics"), 0, 'user'); -print ''; -print '
'; +print '
'; // Show filter box /*print '
'; @@ -210,8 +209,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -223,7 +222,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index a76b21a0371..acbccbba6f8 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -216,8 +216,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + //if (empty($socid)) //{ @@ -282,8 +283,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -297,7 +298,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 1c8a52e201a..f8ab42c8807 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -1,6 +1,6 @@ - * Copyright (c) 2004-2012 Laurent Destailleur + * Copyright (c) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * @@ -237,8 +237,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + //if (empty($socid)) //{ @@ -305,8 +306,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -320,7 +321,9 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; dol_fiche_end(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 2c8bf25fd5c..9e4fe35f3e9 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -204,8 +204,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + // Show filter box print ''; @@ -266,8 +267,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -281,7 +282,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7fc43f1edfe..e51d012ebac 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -214,8 +214,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + //if (empty($socid)) //{ @@ -280,8 +281,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -295,7 +296,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end();