From 0f9b99dced268c160ccf9963a4693dba786440ab Mon Sep 17 00:00:00 2001 From: atm-florian Date: Thu, 28 Nov 2024 16:13:32 +0100 Subject: [PATCH 1/4] Formatting: auto-replace 'else if' with 'elseif' --- class/actions_subtotal.class.php | 138 +++++++++++++++---------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/class/actions_subtotal.class.php b/class/actions_subtotal.class.php index 477c177..cd7d39d 100644 --- a/class/actions_subtotal.class.php +++ b/class/actions_subtotal.class.php @@ -254,7 +254,7 @@ function formObjectOptions($parameters, &$object, &$action, $hookmanager) if(empty($title)) $title = $langs->trans('title'); $qty = $level<1 ? 1 : $level ; } - else if($action=='add_free_text') { + elseif($action=='add_free_text') { $title = GETPOST('title', 'restricthtml'); if (empty($title)) { @@ -269,12 +269,12 @@ function formObjectOptions($parameters, &$object, &$action, $hookmanager) if(empty($title)) $title = $langs->trans('subtotalAddLineDescription'); $qty = 50; } - else if($action=='add_subtitle_line') { + elseif($action=='add_subtitle_line') { $title = GETPOST('title', 'none'); if(empty($title)) $title = $langs->trans('subtitle'); $qty = 2; } - else if($action=='add_subtotal_line') { + elseif($action=='add_subtotal_line') { $title = $langs->trans('SubSubTotal'); $qty = 98; } @@ -294,7 +294,7 @@ function formObjectOptions($parameters, &$object, &$action, $hookmanager) TSubtotal::addSubTotalLine($object, $title, $qty); } } - else if($action==='ask_deleteallline') { + elseif($action==='ask_deleteallline') { $form=new Form($db); $lineid = GETPOST('lineid','int'); @@ -778,7 +778,7 @@ function doActions($parameters, &$object, $action, $hookmanager) exit; // Surtout ne pas laisser Dolibarr faire du traitement sur le updateligne sinon ça plante les données de la ligne } } - else if($action === 'builddoc') { + elseif($action === 'builddoc') { if ( in_array('invoicecard', $contextArray) @@ -858,7 +858,7 @@ function doActions($parameters, &$object, $action, $hookmanager) } } - else if($action === 'confirm_delete_all_lines' && GETPOST('confirm', 'none')=='yes') { + elseif($action === 'confirm_delete_all_lines' && GETPOST('confirm', 'none')=='yes') { $error = 0; $Tab = TSubtotal::getLinesFromTitleId($object, GETPOST('lineid', 'int'), true); foreach($Tab as $line) { @@ -872,22 +872,22 @@ function doActions($parameters, &$object, $action, $hookmanager) /** * @var $object Facture fournisseur */ - else if($object->element=='invoice_supplier') + elseif($object->element=='invoice_supplier') { $result = $object->deleteline($idLine); } /** * @var $object Propal */ - else if($object->element=='propal') $result = $object->deleteline($idLine); + elseif($object->element=='propal') $result = $object->deleteline($idLine); /** * @var $object Propal Fournisseur */ - else if($object->element=='supplier_proposal') $result = $object->deleteline($idLine); + elseif($object->element=='supplier_proposal') $result = $object->deleteline($idLine); /** * @var $object Commande */ - else if($object->element=='commande') + elseif($object->element=='commande') { if ((float) DOL_VERSION >= 5.0) $result = $object->deleteline($user, $idLine); else $result = $object->deleteline($idLine); @@ -895,18 +895,18 @@ function doActions($parameters, &$object, $action, $hookmanager) /** * @var $object Commande fournisseur */ - else if($object->element=='order_supplier') + elseif($object->element=='order_supplier') { $result = $object->deleteline($idLine); } /** * @var $object Facturerec */ - else if($object->element=='facturerec') $result = $object->deleteline($idLine); + elseif($object->element=='facturerec') $result = $object->deleteline($idLine); /** * @var $object Expedition */ - else if($object->element=='shipping') $result = $object->deleteline($user, $idLine); + elseif($object->element=='shipping') $result = $object->deleteline($user, $idLine); if ($result < 0) $error++; } @@ -922,7 +922,7 @@ function doActions($parameters, &$object, $action, $hookmanager) exit; } - else if ($action == 'duplicate') + elseif ($action == 'duplicate') { $lineid = GETPOST('lineid', 'int'); $nbDuplicate = TSubtotal::duplicateLines($object, $lineid, true); @@ -1688,7 +1688,7 @@ function pdf_getlinetotalexcltax($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -1741,7 +1741,7 @@ function pdf_getlinetotalexcltax($parameters=array(), &$object, &$action='') { } } // Cache le prix pour les lignes standards dolibarr qui sont dans un ensemble - else if (!empty($hideprices)) + elseif (!empty($hideprices)) { // Check if a title exist for this line && if the title have subtotal $lineTitle = (!empty($object->lines[$i])) ? TSubtotal::getParentTitleOfLine($object, $object->lines[$i]->rang): ''; @@ -1800,7 +1800,7 @@ function pdf_getlinetotalwithtax($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -1829,7 +1829,7 @@ function pdf_getlineunit($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -1874,7 +1874,7 @@ function pdf_getlineupexcltax($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -1897,7 +1897,7 @@ function pdf_getlineupexcltax($parameters=array(), &$object, &$action='') { } } // Cache le prix pour les lignes standards dolibarr qui sont dans un ensemble - else if (!empty($hideprices)) + elseif (!empty($hideprices)) { // Check if a title exist for this line && if the title have subtotal @@ -1942,7 +1942,7 @@ function pdf_getlineremisepercent($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -1972,7 +1972,7 @@ function pdf_getlineupwithtax($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -2008,7 +2008,7 @@ function pdf_getlinevatrate($parameters=array(), &$object, &$action='') { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -2036,7 +2036,7 @@ function pdf_getlinevatrate($parameters=array(), &$object, &$action='') { } } // Cache le prix pour les lignes standards dolibarr qui sont dans un ensemble - else if (!empty($hideprices)) + elseif (!empty($hideprices)) { // Check if a title exist for this line && if the title have subtotal @@ -2063,7 +2063,7 @@ function pdf_getlineprogress($parameters=array(), &$object, &$action) { if((float)DOL_VERSION<=3.6) { return ''; } - else if((float)DOL_VERSION>=3.8) { + elseif((float)DOL_VERSION>=3.8) { return 1; } } @@ -2098,7 +2098,7 @@ function add_numerotation(&$object) { { $TLineTitle[] = &$line; } - else if ($line->id > 0 && TSubtotal::isSubtotal($line)) + elseif ($line->id > 0 && TSubtotal::isSubtotal($line)) { $TLineSubtotal[] = &$line; } @@ -2533,7 +2533,7 @@ function pdf_writelinedesc($parameters=array(), &$object, &$action) $posy = $pdf->GetY(); return 1; } - else if ($line->qty < 10) { + elseif ($line->qty < 10) { if(!empty(getDolGlobalString('SUBTOTAL_DISABLE_FIX_TRANSACTION'))) { /** * TCPDF::startTransaction() committe la transaction en cours s'il y en a une, @@ -2737,7 +2737,7 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) } return 0; } - else if (in_array('invoicecard',$contexts) || in_array('invoicesuppliercard',$contexts) || in_array('propalcard',$contexts) || in_array('supplier_proposalcard',$contexts) || in_array('ordercard',$contexts) || in_array('ordersuppliercard',$contexts) || in_array('invoicereccard',$contexts)) + elseif (in_array('invoicecard',$contexts) || in_array('invoicesuppliercard',$contexts) || in_array('propalcard',$contexts) || in_array('supplier_proposalcard',$contexts) || in_array('ordercard',$contexts) || in_array('ordersuppliercard',$contexts) || in_array('invoicereccard',$contexts)) { @@ -2812,11 +2812,11 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) if (!empty(getDolGlobalString('SUBTOTAL_USE_NEW_FORMAT'))) { if($line->qty==99) print 'background:#adadcf'; // Sub-total level 1 - else if($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty<=97 && $line->qty>=91) print 'background:#eeeeff;'; // Sub-total level 3 to 9 - else if($line->qty==1) print 'background:#adadcf;'; // Title level 1 - else if($line->qty==2) print 'background:#ddddff;'; // Title level 2 - else if($line->qty==50) print ''; // Free text + elseif($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty<=97 && $line->qty>=91) print 'background:#eeeeff;'; // Sub-total level 3 to 9 + elseif($line->qty==1) print 'background:#adadcf;'; // Title level 1 + elseif($line->qty==2) print 'background:#ddddff;'; // Title level 2 + elseif($line->qty==50) print ''; // Free text else print 'background:#eeeeff;'; // Title level 3 to 9 // À compléter si on veut plus de nuances de couleurs avec les niveaux 4,5,6,7,8 et 9 @@ -2824,9 +2824,9 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) else { if($line->qty==99) print 'background:#ddffdd'; // Sub-total level 1 - else if($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty==2) print 'background:#eeeeff; '; // Title level 2 - else if($line->qty==50) print ''; // Free text + elseif($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty==2) print 'background:#eeeeff; '; // Title level 2 + elseif($line->qty==50) print ''; // Free text else print 'background:#eeffee;' ; // Title level 1 and 3 to 9 } @@ -2882,7 +2882,7 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) print img_picto('', 'subsubtotal@subtotal').''.$qty_displayed.'  '; } - else if (TSubtotal::isSubtotal($line)) + elseif (TSubtotal::isSubtotal($line)) { $qty_displayed = 100 - $line->qty; print img_picto('', 'subsubtotal2@subtotal').''.$qty_displayed.'  '; @@ -2961,7 +2961,7 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) echo ''; echo ''; } - else if ($isFreeText) echo TSubtotal::getFreeTextHtml($line, (bool) $readonlyForSituation); + elseif ($isFreeText) echo TSubtotal::getFreeTextHtml($line, (bool) $readonlyForSituation); if (TSubtotal::isSubtotal($line) && $show_qty_bu_deault = TSubtotal::showQtyForObject($object)) { $line_show_qty = TSubtotal::showQtyForObjectLine($line, $show_qty_bu_deault); @@ -3092,7 +3092,7 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) else { if($line->qty<=1) print img_picto('', 'subtotal@subtotal'); - else if($line->qty==2) print img_picto('', 'subsubtotal@subtotal').'     '; + elseif($line->qty==2) print img_picto('', 'subsubtotal@subtotal').'     '; } @@ -3373,11 +3373,11 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) if (getDolGlobalString('SUBTOTAL_USE_NEW_FORMAT')) { if($line->qty==99) print 'background:#adadcf'; // Sub-total level 1 - else if($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty<=97 && $line->qty>=91) print 'background:#eeeeff;'; // Sub-total level 3 to 9 - else if($line->qty==1) print 'background:#adadcf;'; // Title level 1 - else if($line->qty==2) print 'background:#ddddff;'; // Title level 2 - else if($line->qty==50) print ''; // Free text + elseif($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty<=97 && $line->qty>=91) print 'background:#eeeeff;'; // Sub-total level 3 to 9 + elseif($line->qty==1) print 'background:#adadcf;'; // Title level 1 + elseif($line->qty==2) print 'background:#ddddff;'; // Title level 2 + elseif($line->qty==50) print ''; // Free text else print 'background:#eeeeff;'; // Title level 3 to 9 // À compléter si on veut plus de nuances de couleurs avec les niveaux 4,5,6,7,8 et 9 @@ -3385,9 +3385,9 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) else { if($line->qty==99) print 'background:#ddffdd'; // Sub-total level 1 - else if($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty==2) print 'background:#eeeeff; '; // Title level 2 - else if($line->qty==50) print ''; // Free text + elseif($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty==2) print 'background:#eeeeff; '; // Title level 2 + elseif($line->qty==50) print ''; // Free text else print 'background:#eeffee;'; // Title level 1 and 3 to 9 } @@ -3409,7 +3409,7 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) else { if($line->qty<=1) print img_picto('', 'subtotal@subtotal'); - else if($line->qty==2) print img_picto('', 'subsubtotal@subtotal').'     '; + elseif($line->qty==2) print img_picto('', 'subsubtotal@subtotal').'     '; } @@ -3498,11 +3498,11 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) if (getDolGlobalString('SUBTOTAL_USE_NEW_FORMAT')) { if($line->qty==99) print 'background:#adadcf'; // Sub-total level 1 - else if($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty<=97 && $line->qty>=91) print 'background:#eeeeff;'; // Sub-total level 3 to 9 - else if($line->qty==1) print 'background:#adadcf;'; // Title level 1 - else if($line->qty==2) print 'background:#ddddff;'; // Title level 2 - else if($line->qty==50) print ''; // Free text + elseif($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty<=97 && $line->qty>=91) print 'background:#eeeeff;'; // Sub-total level 3 to 9 + elseif($line->qty==1) print 'background:#adadcf;'; // Title level 1 + elseif($line->qty==2) print 'background:#ddddff;'; // Title level 2 + elseif($line->qty==50) print ''; // Free text else print 'background:#eeeeff;'; // Title level 3 to 9 // À compléter si on veut plus de nuances de couleurs avec les niveaux 4,5,6,7,8 et 9 @@ -3510,9 +3510,9 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) else { if($line->qty==99) print 'background:#ddffdd'; // Sub-total level 1 - else if($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty==2) print 'background:#eeeeff; '; // Title level 2 - else if($line->qty==50) print ''; // Free text + elseif($line->qty==98) print 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty==2) print 'background:#eeeeff; '; // Title level 2 + elseif($line->qty==50) print ''; // Free text else print 'background:#eeffee;'; // Title level 1, Sub-total level 1 and 3 to 9 } @@ -3542,7 +3542,7 @@ function printObjectLine ($parameters, &$object, &$action, $hookmanager) else { if($line->qty<=1) print img_picto('', 'subtotal@subtotal'); - else if($line->qty==2) print img_picto('', 'subsubtotal@subtotal').'     '; + elseif($line->qty==2) print img_picto('', 'subsubtotal@subtotal').'     '; } @@ -3649,17 +3649,17 @@ function printOriginObjectSubLine($parameters, &$object, &$action, $hookmanager) $object->tpl['subtotal'] = $line->id; if (TSubtotal::isTitle($line)) $object->tpl['sub-type'] = 'title'; - else if (TSubtotal::isSubtotal($line)) $object->tpl['sub-type'] = 'total'; + elseif (TSubtotal::isSubtotal($line)) $object->tpl['sub-type'] = 'total'; $object->tpl['sub-tr-style'] = ''; if (getDolGlobalString('SUBTOTAL_USE_NEW_FORMAT')) { if($line->qty==99) $object->tpl['sub-tr-style'].= 'background:#adadcf'; // Sub-total level 1 - else if($line->qty==98) $object->tpl['sub-tr-style'].= 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty<=97 && $line->qty>=91) $object->tpl['sub-tr-style'].= 'background:#eeeeff;'; // Sub-total level 3 to 9 - else if($line->qty==1) $object->tpl['sub-tr-style'].= 'background:#adadcf;'; // Title level 1 - else if($line->qty==2) $object->tpl['sub-tr-style'].= 'background:#ddddff;'; // Title level 2 - else if($line->qty==50) $object->tpl['sub-tr-style'].= ''; // Free text + elseif($line->qty==98) $object->tpl['sub-tr-style'].= 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty<=97 && $line->qty>=91) $object->tpl['sub-tr-style'].= 'background:#eeeeff;'; // Sub-total level 3 to 9 + elseif($line->qty==1) $object->tpl['sub-tr-style'].= 'background:#adadcf;'; // Title level 1 + elseif($line->qty==2) $object->tpl['sub-tr-style'].= 'background:#ddddff;'; // Title level 2 + elseif($line->qty==50) $object->tpl['sub-tr-style'].= ''; // Free text else $object->tpl['sub-tr-style'].= 'background:#eeeeff;'; // Sub-total level 1 and 3 to 9 // À compléter si on veut plus de nuances de couleurs avec les niveaux 4,5,6,7,8 et 9 @@ -3667,9 +3667,9 @@ function printOriginObjectSubLine($parameters, &$object, &$action, $hookmanager) else { if($line->qty==99) $object->tpl['sub-tr-style'].= 'background:#ddffdd'; // Sub-total level 1 - else if($line->qty==98) $object->tpl['sub-tr-style'].= 'background:#ddddff;'; // Sub-total level 2 - else if($line->qty==2) $object->tpl['sub-tr-style'].= 'background:#eeeeff; '; // Title level 2 - else if($line->qty==50) $object->tpl['sub-tr-style'].= ''; // Free text + elseif($line->qty==98) $object->tpl['sub-tr-style'].= 'background:#ddddff;'; // Sub-total level 2 + elseif($line->qty==2) $object->tpl['sub-tr-style'].= 'background:#eeeeff; '; // Title level 2 + elseif($line->qty==50) $object->tpl['sub-tr-style'].= ''; // Free text else $object->tpl['sub-tr-style'].= 'background:#eeffee;'; // Title level 1, Sub-total level 1 and 3 to 9 } @@ -3692,7 +3692,7 @@ function printOriginObjectSubLine($parameters, &$object, &$action, $hookmanager) { $object->tpl["sublabel"] = ''; if($line->qty<=1) $object->tpl["sublabel"] = img_picto('', 'subtotal@subtotal'); - else if($line->qty==2) $object->tpl["sublabel"] = img_picto('', 'subsubtotal@subtotal').'     '; + elseif($line->qty==2) $object->tpl["sublabel"] = img_picto('', 'subsubtotal@subtotal').'     '; } // Get display styles and apply them $titleStyleItalic = strpos(getDolGlobalString('SUBTOTAL_TITLE_STYLE'), 'I') === false ? '' : ' font-style: italic;'; @@ -4450,7 +4450,7 @@ public function printCommonFooter(&$parameters, &$objectHook, &$action, $hookman if($childLine.attr('data-folder-status') == "closed"){ doNotDisplayLines = doNotDisplayLines.concat(grandChildrenList); } - else if(o.config.closeMode == 'keepTitle' && $childLine.attr('data-folder-status') == "open"){ + elseif(o.config.closeMode == 'keepTitle' && $childLine.attr('data-folder-status') == "open"){ doNotHiddeLines = doNotDisplayLines.concat(grandChildrenList); } } @@ -4458,7 +4458,7 @@ public function printCommonFooter(&$parameters, &$objectHook, &$action, $hookman if (toggleStatus == 'closed') { if(o.config.closeMode == 'keepTitle' && ($childLine.attr('data-issubtotal') == "title" || $childLine.attr('data-issubtotal') == "subtotal" )){ $childLine.show(); - }else if(!doNotHiddeLines.includes(childLineId)){ + }elseif(!doNotHiddeLines.includes(childLineId)){ $childLine.hide(); } } else { From 56b9180fcbb3905ac19f68ae78ca6e7bd02d28f1 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Thu, 28 Nov 2024 16:36:53 +0100 Subject: [PATCH 2/4] KM2310-0104: .editorconfig reflecting newly adopted formatting rules --- .editorconfig | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..13808b9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,37 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +[*.php] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +# fine-tuning php formatting +ij_php_space_before_if_parentheses = true +ij_php_space_before_for_parentheses = true +ij_php_force_short_declaration_array_style = true + +[*.js] +indent_style = space + +[*.css] +indent_style = space + +[*.xml] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false + +[*.sql] +indent_style = space +trim_trailing_whitespace = true +indent_size = 4 From 8ebff89c7689cea993dbc35c50c2504d1a4cfec7 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Thu, 28 Nov 2024 16:39:50 +0100 Subject: [PATCH 3/4] KM2310-0104: formatting: moving property declaration to beginning of class --- class/actions_subtotal.class.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/class/actions_subtotal.class.php b/class/actions_subtotal.class.php index cd7d39d..5f08d0e 100644 --- a/class/actions_subtotal.class.php +++ b/class/actions_subtotal.class.php @@ -25,6 +25,8 @@ class ActionsSubtotal extends \subtotal\RetroCompatCommonHookActions */ public $errors = array(); + public $module_number = 104777; + /** * @var int Subtotal current level */ @@ -201,17 +203,13 @@ function createDictionaryFieldlist($parameters, &$object, &$action, $hookmanager return 0; } - - /** Overloading the formObjectOptions function : replacing the parent's function with the one below - * @param $parameters array meta datas of the hook (context, etc...) - * @param $object CommonObject the object you want to process (an invoice if you are in invoice module, a propale in propale's module, etc...) - * @param $action string current action (if set). Generally create or edit or null - * @param $hookmanager HookManager current hook manager - * @return void - */ - - var $module_number = 104777; - + /** Overloading the formObjectOptions function : replacing the parent's function with the one below + * @param $parameters array meta datas of the hook (context, etc...) + * @param $object CommonObject the object you want to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param $action string current action (if set). Generally create or edit or null + * @param $hookmanager HookManager current hook manager + * @return void + */ function formObjectOptions($parameters, &$object, &$action, $hookmanager) { global $langs,$db,$user, $conf; From fa16ff9a3ae0ea68a99d52264367befb6e4ed2fe Mon Sep 17 00:00:00 2001 From: atm-florian Date: Thu, 28 Nov 2024 16:46:54 +0100 Subject: [PATCH 4/4] KM2310-0104: formatting: only one empty line between two methods --- class/actions_subtotal.class.php | 34 +++++++++++--------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/class/actions_subtotal.class.php b/class/actions_subtotal.class.php index 5f08d0e..9d7ce5e 100644 --- a/class/actions_subtotal.class.php +++ b/class/actions_subtotal.class.php @@ -11,39 +11,31 @@ include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once __DIR__ . '/../backport/v19/core/class/commonhookactions.class.php'; - class ActionsSubtotal extends \subtotal\RetroCompatCommonHookActions { - - /** - * @var string $error - */ - public $error; - - /** - * @var array $errors - */ - public $errors = array(); - + /** + * @var string $error + */ + public $error; + /** + * @var array $errors + */ + public $errors = []; public $module_number = 104777; - /** * @var int Subtotal current level */ protected $subtotal_level_cur = 0; - /** * @var bool Show subtotal qty by default */ protected $subtotal_show_qty_by_default = false; - /** * @var bool Determine if sum on subtotal qty is enabled */ protected $subtotal_sum_qty_enabled = false; - - function __construct($db) + function __construct($db) { global $langs; @@ -74,7 +66,6 @@ function printFieldListSelect($parameters, &$object, &$action, $hookmanager) { return 0; } - function editDictionaryFieldlist($parameters, &$object, &$action, $hookmanager) { global $conf; @@ -139,6 +130,7 @@ function editDictionaryFieldlist($parameters, &$object, &$action, $hookmanager) return 0; } + function createDictionaryFieldlist($parameters, &$object, &$action, $hookmanager) { global $conf; @@ -539,7 +531,6 @@ function showSelectTitleToAdd(&$object)