From f4f9a7c461789881fed4c3d023090bf26ec73ce8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 09:44:51 +0100 Subject: [PATCH 1/8] Clean page of info tools --- htdocs/admin/system/dolibarr.php | 10 +-- htdocs/admin/system/phpinfo.php | 118 ++++++++----------------------- htdocs/admin/system/security.php | 29 +++++--- htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 55 insertions(+), 103 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 2efb2a14a7d..5e89d8ae683 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -73,7 +73,7 @@ print load_fiche_titre($title, '', 'title_setup'); // Version print '
'; print ''; -print ''."\n"; +print ''."\n"; print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')'.DOL_VERSION; // If current version differs from last upgrade if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) @@ -139,7 +139,7 @@ print '
'; // Session print '
'; print ''; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; @@ -180,7 +180,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S print '
'; print '
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("SessionSavePath").''.session_save_path().'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'; print ''; - print ''; + print ''; print ''; print ''; print ''."\n"; @@ -202,7 +202,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S // Localisation print '
'; print '
'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").''.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").''.$langs->trans("NbOfEntries").''.$langs->trans("Address").'
'; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; // Thousands @@ -342,7 +342,7 @@ $configfileparameters = array( print '
'; print '
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").''.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'
'.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().'
'; print ''; -print ''; print ''; diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index cf38687f66f..a7bce7a3025 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -69,13 +69,13 @@ if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2) print '
'.$langs->trans("Parameters").' '; +print ''.$langs->trans("Parameters").' '; print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')'; print ''.$langs->trans("Parameter").'
'; -print ''; +print ''; $ErrorPicturePath = "../../theme/eldy/img/error.png"; $WarningPicturePath = "../../theme/eldy/img/warning.png"; $OkayPicturePath = "../../theme/eldy/img/tick.png"; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Version").''; +print '
'.$langs->trans("Version").''; $arrayphpminversionerror = array(5, 5, 0); $arrayphpminversionwarning = array(5, 6, 0); @@ -129,11 +129,8 @@ $loadedExtensions = array_map('strtolower', get_loaded_extensions(false)); print ''; print ''; -print ''; -//print ''; -print ''; -print ''; -print ''; +print ''; +print ''; print ''; $functions = ["mb_check_encoding"]; @@ -141,9 +138,6 @@ $name = "MBString"; print ""; print ""; -//print getTableColumn($name, $activatedExtensions); -print getTableColumn($name, $loadedExtensions); -print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; @@ -152,9 +146,6 @@ $name = "JSON"; print ""; print ""; -//print getTableColumn($name, $activatedExtensions); -print getTableColumn($name, $loadedExtensions); -print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; @@ -163,8 +154,6 @@ $name = "GD"; print ""; print ""; -print getTableColumn($name, $loadedExtensions); -print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; @@ -173,8 +162,6 @@ $name = "Curl"; print ""; print ""; -print getTableColumn($name, $loadedExtensions); -print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; @@ -185,8 +172,6 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc print ""; print ""; - print getTableColumn($name, $loadedExtensions); - print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; } @@ -196,8 +181,6 @@ $name = "IMAP"; print ""; print ""; -print getTableColumn($name, $loadedExtensions); -print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; @@ -206,8 +189,6 @@ $name = "xDebug"; print ""; print ""; -print getTableColumn($name, $loadedExtensions); -print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; @@ -222,7 +203,7 @@ foreach ($phparray as $key => $value) print '
'; print '
'.$langs->trans("Extension").''.$langs->trans("EnabledInSetup").''.$langs->trans("Loaded").''.$langs->trans("FunctionTest").''.$langs->trans("Result").''.$langs->trans("Extension").''.$langs->trans("Test").'
".$name."
".$name."
".$name."
".$name."
".$name."
".$name."
".$name."
'; print ''; - print ''; + print ''; print ''; print "\n"; @@ -269,69 +250,6 @@ llxFooter(); $db->close(); -/** - * Return a table column with a indicator (okay or warning), based on the given name and list - * - * @param string $name The name to check inside the given list - * @param array $list A list that should contains the given name - * - * @return string - */ -function getTableColumn($name, array $list) -{ - global $langs; - - $name = strtolower($name); - $html = ""; - - return $html; -} - -/** - * Return a table column with a indicator (okay or warning), based on the given functions to check - * - * @param array $functions A list with functions to check - * - * @return string - */ -function getTableColumnFunction(array $functions) -{ - if (count($functions) < 1) - { - return ""; - } - - $result = true; - $html = ""; - - return $html; -} - /** * Return a result column with a translated result text * @@ -339,7 +257,6 @@ function getTableColumnFunction(array $functions) * @param array $activated A list with all activated PHP extensions. Deprecated. * @param array $loaded A list with all loaded PHP extensions * @param array $functions A list with all PHP functions to check - * * @return string */ function getResultColumn($name, array $activated, array $loaded, array $functions) @@ -347,6 +264,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function global $langs; $result = true; + //$result = $result && in_array(strtolower($name), $activated); $result = $result && in_array(strtolower($name), $loaded); @@ -356,7 +274,29 @@ function getResultColumn($name, array $activated, array $loaded, array $function } $html = ""; return $html; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index f978c0dcd81..f0ada86a393 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -43,9 +43,6 @@ if (GETPOST('action', 'aZ09') == 'donothing') * View */ -$form = new Form($db); -$nowstring = dol_print_date(dol_now(), 'dayhourlog'); - llxHeader(); print load_fiche_titre($langs->trans("Security"), '', 'title_setup'); @@ -78,7 +75,7 @@ else { print '
'; print '
'; -print load_fiche_titre($langs->trans("ConfigFile"), '', 'folder'); +print load_fiche_titre($langs->trans("ConfigurationFile"), '', 'folder'); print ''.$langs->trans("dolibarr_main_prod").': '.$dolibarr_main_prod; if (empty($dolibarr_main_prod)) { @@ -90,7 +87,12 @@ print ''.$langs->trans("dolibarr_nocsrfcheck").': '.$dolibarr_n if (!empty($dolibarr_nocsrfcheck)) { print img_picto('', 'warning').'   '.$langs->trans("IfYouAreOnAProductionSetThis", 0); } +print '
'; +print ''.$langs->trans("dolibarr_main_restrict_ip").': '.$dolibarr_main_restrict_ip; +/*if (empty($dolibarr_main_restrict_ip)) { + print '   '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1); +}*/ print '
'; print '
'; @@ -102,9 +104,17 @@ print ''.$langs->trans("PermissionsOnFilesInWebRoot").': '; print 'TODO'; print '
'; -print ''.$langs->trans("PermissionsOnFile", 'conf.php').': '; -// TODO Check permission on file conf.php (read only for the web user) -print 'TODO'; +print ''.$langs->trans("PermissionsOnFile", $conffile).': '; // $conffile is defined into filefunc.inc.php +$perms = fileperms($dolibarr_main_document_root.'/'.$conffile); +if ($perms) { + if (($perms & 0x0004) || ($perms & 0x0002)) { + print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers"); + } else { + print img_picto('', 'tick'); + } +} else { + print img_warning().' '.$langs->trans("FailedToReadFile", $conffile); +} print '
'; print '
'; @@ -137,14 +147,15 @@ print '
'; print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder'); //print ''.$langs->trans("PasswordEncryption").': '; -print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? 'unset' : '')."   "; +print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')."   "; print '   If unset: \'md5\' '; print ' - Recommanded value: \'password_hash\'
'; -print 'MAIN_SECURITY_SALT = '.$conf->global->MAIN_SECURITY_SALT.'
'; +print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : '').'
'; print '
'; // TODO print ''.$langs->trans("AntivirusEnabledOnUpload").': '; +print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0); if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bba6966fa45..cc10b054606 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2095,3 +2095,4 @@ SeeLinkToOnlineDocumentation=See link to online documention on top menu for exam SHOW_SUBPRODUCT_REF_IN_PDF=If the feature "%s" of module %s is used, show details of subproducts of a kit on PDF. AskThisIDToYourBank=Contact your bank to get this ID AdvancedModeOnly=Permision available in Advanced permission mode only +ConfFileIsReadableOrWritableByAnyUsers=The conf file is reabable or writable by any users. Give permission to web server user and group only. From 2f6a8c85c21b3a13976080140f0b6adcf9a1d53d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 10:25:57 +0100 Subject: [PATCH 2/8] Doc --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index e1ee0138287..9722de167f9 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -317,7 +317,7 @@ class Stripe extends CommonObject * @param int $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) * @param string $payment_method 'pm_....' (if known) - * @param string $off_session If we use an already known payment method to pay off line. + * @param string $off_session If we use an already known payment method to pay when customer is not available during the checkout flow. * @param string $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ From 95e255747fa0b79e54f1ee96105c96d4fcce4427 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 10:53:59 +0100 Subject: [PATCH 3/8] Fix accent on graph of expense report --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 8d5cbd3c2cc..babe69206ce 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2319,7 +2319,7 @@ class ExpenseReport extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($result); - $ret[$obj->code] = (($langs->trans($obj->code) != $obj->code) ? $langs->trans($obj->code) : $obj->label); + $ret[$obj->code] = (($langs->transnoentitiesnoconv($obj->code) != $obj->code) ? $langs->transnoentitiesnoconv($obj->code) : $obj->label); $i++; } } else { From 218a76ee637f011a519cbb6f4c057e7000e0e618 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 11:06:58 +0100 Subject: [PATCH 4/8] FIX SQL Error with postgres or mysql strict mode --- htdocs/core/boxes/box_factures_imp.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 08233ff754c..b47f948f4ca 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -110,7 +110,8 @@ class box_factures_imp extends ModeleBoxes $sql .= " AND fk_statut = 1"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($user->socid) $sql .= " AND s.rowid = ".$user->socid; - $sql .= " GROUP BY s.nom, s.rowid, s.email, s.code_client, s.logo, f.ref, f.date_lim_reglement,"; + $sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,"; + $sql .= " f.ref, f.date_lim_reglement,"; $sql .= " f.type, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid"; //$sql.= " ORDER BY f.datef DESC, f.ref DESC "; $sql .= " ORDER BY datelimite ASC, f.ref ASC "; From 1fd2f126731960b96fd50aed0da5a3de1115575b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 11:15:16 +0100 Subject: [PATCH 5/8] Fix responsive --- htdocs/core/boxes/box_last_ticket.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 268a6861524..dbc453eced6 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -134,7 +134,7 @@ class box_last_ticket extends ModeleBoxes $thirdparty->name = $objp->company_name; $link = $thirdparty->getNomUrl(1); } else { - $link = dol_print_email($objp->origin_email); + $link = ''.dol_print_email($objp->origin_email).''; } $r = 0; @@ -149,15 +149,15 @@ class box_last_ticket extends ModeleBoxes // Subject $this->info_box_contents[$i][$r] = array( - 'td' => '', - 'text' => $objp->subject, // Some event have no ref + 'td' => 'class="tdoverflowmax200"', + 'text' => ''.$objp->subject.'', // Some event have no ref 'url' => DOL_URL_ROOT."/ticket/card.php?track_id=".$objp->track_id, ); $r++; // Customer $this->info_box_contents[$i][$r] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax100"', 'text' => $link, 'asis' => 1, ); From 7ff5cd50c322f41557a2d76a0275959f6dbd1e16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 11:41:32 +0100 Subject: [PATCH 6/8] Fix responsive --- htdocs/compta/bank/various_payment/list.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 9c936c1d943..0d91eb38e7d 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -424,6 +424,10 @@ if ($result) { $obj = $db->fetch_object($result); + $variousstatic->id = $obj->rowid; + $variousstatic->ref = $obj->rowid; + $variousstatic->label = $obj->label; + print ''; // No @@ -433,15 +437,13 @@ if ($result) // Ref if ($arrayfields['ref']['checked']) { - $variousstatic->id = $obj->rowid; - $variousstatic->ref = $obj->rowid; - print ""; + print '"; if (!$i) $totalarray['nbfield']++; } // Label payment if ($arrayfields['label']['checked']) { - print ""; + print '"; if (!$i) $totalarray['nbfield']++; } @@ -460,7 +462,13 @@ if ($result) // Type if ($arrayfields['type']['checked']) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } From b80de4aeaf2f28c17769611951e05a4d659bb164 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 13:04:41 +0100 Subject: [PATCH 7/8] FIX CSRF errors on margin forms --- htdocs/core/class/html.form.class.php | 13 ++++++---- htdocs/core/lib/ajax.lib.php | 9 ++++--- htdocs/core/tpl/objectline_create.tpl.php | 3 +-- htdocs/margin/agentMargins.php | 11 ++------- htdocs/margin/customerMargins.php | 16 +++++-------- htdocs/margin/productMargins.php | 29 +++++++---------------- htdocs/variants/combinations.php | 8 ++++--- 7 files changed, 37 insertions(+), 52 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 448bdad3cd9..bc33692e2fc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1927,7 +1927,7 @@ class Form * Return list of products for customer in Ajax if Ajax activated or go to select_produits_list * * @param int $selected Preselected products - * @param string $htmlname Name of HTML select field (must be unique in page) + * @param string $htmlname Name of HTML select field (must be unique in page). * @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service) * @param int $limit Limit on number of returned lines * @param int $price_level Level of price to show @@ -1949,7 +1949,7 @@ class Form * @param string $nooutput No print, return the output into a string * @return void|string */ - public function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = array(), $nooutput = 0) + public function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = null, $nooutput = 0) { // phpcs:enable global $langs, $conf; @@ -1997,10 +1997,13 @@ class Form } $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); - if (!empty($conf->variants->enabled)) { + if (!empty($conf->variants->enabled) && is_array($selected_combinations)) { + // Code to automatically insert with javascript the select of attributes under the select of product + // when a parent of variant has been selected. $out .= ' + '."\n"; - // End of page llxFooter(); $db->close(); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 0a015f0f73d..468d633875d 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -87,6 +87,7 @@ $picto = 'margin'; print '
'; +print ''; print dol_get_fiche_head($head, 'customerMargins', $titre, 0, $picto); @@ -101,7 +102,7 @@ if ($socid > 0) { { print '
'; print ''; $client = true; @@ -111,7 +112,7 @@ if ($socid > 0) { } else { print ''; print ''; } @@ -138,16 +139,16 @@ foreach ($TRes as $prod) { $TProducts[$prod['key']] = $prod['label']; } -print ''; +print ''; print ''; // Categories $TCats = $form->select_all_categories(0, array(), '', 64, 0, 1); print ''; -print ''; +print ''; print ''; @@ -365,11 +366,6 @@ $db->free($result); print ' '; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 24da596f3c2..933d379e48a 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -107,7 +107,9 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( $features = $_SESSION['addvariant_'.$object->id]; if (!$features) { - setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); + if ($action == 'create') { + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); + } } else { $reference = trim($reference); if (empty($reference)) { @@ -763,11 +765,11 @@ if (!empty($id) || !empty($ref)) print '
'; - print ''.$langs->trans('NewProductCombination').''; // NewVariant + print ''.$langs->trans('NewProductCombination').''; // NewVariant if ($productCombinations) { - print ''.$langs->trans('PropagateVariant').''; + print ''.$langs->trans('PropagateVariant').''; } print '
'; From 85357a34c8b58d91b2997f2612a6b4ad832a34b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Feb 2021 13:12:12 +0100 Subject: [PATCH 8/8] Fix style of injected combo to select variant --- htdocs/core/class/html.form.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bc33692e2fc..2482795147a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2022,7 +2022,7 @@ class Form return; } - console.log("After change we get variants"); + console.log("A change has started. We get variants fields to inject html select"); jQuery.getJSON("'.DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { id: jQuery(this).val() @@ -2040,8 +2040,7 @@ class Form span.append( jQuery(document.createElement(\'div\')).text(val.label).css({ \'font-weight\': \'bold\', - \'display\': \'table-cell\', - \'text-align\': \'right\' + \'display\': \'table-cell\' }) );
'.$key.''.$key.''.$langs->trans("Value").'
"; - - if (in_array($name, $list)) - { - if ($name == 'xdebug') $html .= ''; - else $html .= ''; - } else { - if ($name == 'xdebug') $html .= yn(0); - else $html .= ''; - } - - $html .= "-"; - - foreach ($functions as $function) - { - $result = $result && function_exists($function); - } - - if ($result) - { - $html .= 'Ok'; - } else { - $html .= 'Warning'; - } - - $html .= ""; - $html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport", $name); + if ($result) { + if (strtolower($name) == 'xdebug') $html .= img_warning($langs->trans("ModuleActivated", "xdebug")); + else $html .= img_picto($langs->trans("Ok"), 'tick'); + if (in_array(strtolower($name), $loaded)) { + $html .= ' '.$langs->trans("Loaded").' - '; + } else { + //$html .= ' '.$langs->trans("NotLoaded").' - '; + } + if (strtolower($name) == 'xdebug') { + $html .= ' '.$langs->trans("ModuleActivated", "xdebug"); + } else { + $html .= ' '.$langs->trans("PHPSupport", $name); + } + } else { + if (strtolower($name) == 'xdebug') $html .= yn(0); + else $html .= img_warning($langs->trans("ModuleActivated", "xdebug")); + if (in_array(strtolower($name), $loaded)) { + $html .= ' '.$langs->trans("Loaded").' - '; + } else { + //$html .= ' '.$langs->trans("NotLoaded").' - '; + } + $html .= ' '.$langs->trans("ErrorPHPDoesNotSupport", $name); + } $html .= "
".$variousstatic->getNomUrl(1)."'.$variousstatic->getNomUrl(1)."".dol_trunc($obj->label, 40)."'.$variousstatic->label."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; + if ($obj->payment_code) { + print $langs->trans("PaymentTypeShort".$obj->payment_code); + print ' '; + } + print $obj->num_payment; + print '
'.$langs->trans('ThirdPartyName').''; - print $form->select_company($socid, 'socid', '(client=1 OR client=3)', 1, 0, 0); + print img_picto('', 'company').$form->select_company($socid, 'socid', '(client=1 OR client=3)', 1, 0, 0); print '
'.$langs->trans('ThirdPartyName').''; - print $form->select_company(null, 'socid', '(client=1 OR client=3)', 1, 0, 0); + print img_picto('', 'company').$form->select_company(null, 'socid', '(client=1 OR client=3)', 1, 0, 0); print '
'.$langs->trans('ChooseProduct/Service').'
'.$langs->trans('ProductOrService').''; -print $form->multiselectarray('products', $TProducts, $TSelectedProducts, 0, 0, 'minwidth500'); +print img_picto('', 'product').$form->multiselectarray('products', $TProducts, $TSelectedProducts, 0, 0, 'minwidth500'); print '
'.$langs->trans('ChooseCategory').''.$langs->trans('Category').''; print img_picto('', 'category').$form->multiselectarray('categories', $TCats, $TSelectedCats, 0, 0, 'quatrevingtpercent widthcentpercentminusx'); print '