diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index ad26c7f0bdc..e726df6db7c 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -272,12 +272,7 @@ - - - - - - + 0 @@ -310,20 +305,21 @@ - - + 0 - + 0 + - 0 + 0 - + + 0 @@ -332,27 +328,25 @@ - + 0 - + + 0 - - 0 - + + + - 0 + 0 - - 0 - - - 0 - + + + @@ -361,26 +355,26 @@ 0 + - 0 + 0 - + 0 + - - 0 - + 0 0 - + 0 @@ -391,16 +385,16 @@ + + 0 + - - - - + 0 @@ -411,7 +405,6 @@ 0 - 0 @@ -421,15 +414,17 @@ - - - - - + + + + + + + diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 86981e5b5de..cf00519e9d7 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -161,7 +161,7 @@ if (empty($reshook)) if ($action == 'disable') { if ($accounting->fetch($id)) { $mode = GETPOST('mode', 'int'); - $result = $accounting->account_desactivate($id, $mode); + $result = $accounting->accountDeactivate($id, $mode); } $action = 'update'; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index a32918cc5bf..bcd17793db1 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -553,24 +553,19 @@ class AccountingAccount extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Account deactivated + * Deactivate an account (for status active or status reconcilable) * * @param int $id Id - * @param int $mode 0=field active, 1=field active_customer_list, 2=field_active_supplier_list + * @param int $mode 0=field active, 1=field reconcilable * @return int <0 if KO, >0 if OK */ - public function account_desactivate($id, $mode = 0) + public function accountDeactivate($id, $mode = 0) { - // phpcs:enable $result = $this->checkUsage(); - if ($mode == 0) - { - $fieldtouse = 'active'; - } - elseif ($mode == 1) + $fieldtouse = 'active'; + if ($mode == 1) { $fieldtouse = 'reconcilable'; } @@ -582,7 +577,7 @@ class AccountingAccount extends CommonObject $sql .= "SET ".$fieldtouse." = '0'"; $sql .= " WHERE rowid = ".$this->db->escape($id); - dol_syslog(get_class($this)."::account_desactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 58115537b1f..3fcbffba3b2 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1672,8 +1672,7 @@ class Account extends CommonObject //Replace the old AccountNumber key with the new BankAccountNumber key $fieldlists = explode( ' ', - preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', - $conf->global->BANK_SHOW_ORDER_OPTION) + preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', $conf->global->BANK_SHOW_ORDER_OPTION) ); } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 25857767e80..9f825cdf009 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1452,7 +1452,7 @@ else print ''; - // Ligne info remises tiers + // Line info of thirdparty discounts print ''; } print ''; print ''; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index e6cbad245d9..198a3910747 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -52,8 +52,12 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $lastseparatorkeyfound = ''; $extrafields_collapse_num = ''; + $extrafields_collapse_num_old = ''; + $i = 0; foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { + $i++; + // Discard if extrafield is a hidden field on form $enabled = 1; @@ -65,6 +69,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); } + $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) { @@ -87,6 +92,8 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $value = $object->array_options["options_".$key]; //var_dump($key.' - '.$value); } + + // Print line tr of extra field if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') { $extrafields_collapse_num = ''; @@ -109,13 +116,20 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] } else { - print ''; + print ''; + $extrafields_collapse_num_old = $extrafields_collapse_num; print '
'.$langs->trans('Discount').''; if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); @@ -1502,8 +1502,6 @@ else } - $colorb = '666666'; - $arrayothercontracts = $object->getListOfContracts('others'); /* @@ -1775,8 +1773,8 @@ else print ''; - print ''; - print '
'; + print ''; + print '
'; print '
'; print ''; print ''; - print '
attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; print '">'; if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); @@ -161,6 +175,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; } + //TODO Improve element and rights detection if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) { diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index b815cf997cc..135ac1ae9ec 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -83,7 +83,7 @@ ListOfDictionariesEntries=List of dictionaries entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update). Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
4 = display in description column after the description only if not empty DisplayOnPdf=Display on PDF IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 61024cdd7ff..c111e075972 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -44,9 +44,7 @@ if (!empty($user->socid)) $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array( - 'productstatssupplyorder' -)); +$hookmanager->initHooks(array('productstatssupplyorder')); $mesg = ''; diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index c73e874a465..c4d60a52c1b 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -29,5 +29,5 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; $key = GETPOST('key'); -$module = new modTcpdfbarcode($db); +$module = new modTcpdfbarcode(); $result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 68e16afecd0..2f5e10c1459 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1611,7 +1611,7 @@ div.nopadding { } td.nobordernopadding.widthpictotitle.col-picto { - color: var(--colortexttitlenotab); + color: #bbb; opacity: 0.85; } .table-list-of-attached-files .col-picto, .table-list-of-links .col-picto { @@ -1707,6 +1707,7 @@ div.statusref { margin-top: 8px; margin-bottom: 10px; clear: both; + text-align: right; } div.statusref img { padding-left: 8px; @@ -1750,7 +1751,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); /* border-bottom: 2px solid var(--colorbackhmenu1); */ } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { /* border-bottom: 2px solid var(--colorbackhmenu1) !important; */ border-bottom: 2px solid rgb() !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c7ce5709efd..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1799,7 +1799,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { border-bottom: 1px solid rgb() !important; } .tdhrthin { diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index bc3d4a78c6a..39ed3b3cdf5 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -153,8 +153,8 @@ $server->wsdl->addComplexType( 'sequence', '', array( - 'code' => array('name'=>'code', 'type'=>'xsd:string'), - 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') + 'code' => array('name'=>'code', 'type'=>'xsd:string'), + 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') ) ); @@ -164,7 +164,7 @@ $server->wsdl->addComplexType( 'array', 'sequence', '', - array( + array( 'actioncommtype' => array( 'name' => 'actioncommtype', 'type' => 'tns:actioncommtype',