diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 41c20740d78..50eb6c84def 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -105,8 +105,8 @@ if (empty($includecustom)) { } } -print "Release : ".$release."\n"; print "Working on files into : ".DOL_DOCUMENT_ROOT."\n"; +print "Release : ".$release."\n"; print "Include custom in signature : ".$includecustom."\n"; print "Include constants in signature : "; foreach ($includeconstants as $countrycode => $tmp) { diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 6ff8a988899..84fbb8dae30 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -400,7 +400,7 @@ if ($conf->product->enabled) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 5e5655f918f..c971cf42091 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -668,7 +668,7 @@ Whet is definition of "shippable" according to all different STOCK_CALCULATE_... print ''; print ''.$langs->trans("ShippableOrderIconInList").''; -print ' '; +print ' '; print ''; if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { print ''; @@ -687,7 +687,7 @@ if ($conf->banque->enabled) { print ''; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); @@ -717,7 +717,7 @@ if ($conf->stock->enabled) { print ''; - print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 9d715f92301..81e6bda40a0 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -215,8 +215,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if ($_POST["optionlocaltax1"] == "localtax1on") { - if (!isset($_REQUEST['lt1'])) - { + if (!GETPOSTISSET('lt1')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity); } else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -225,8 +224,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) } if ($_POST["optionlocaltax2"] == "localtax2on") { - if (!isset($_REQUEST['lt2'])) - { + if (!GETPOSTISSET('lt2')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity); } else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -236,7 +234,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + if (GETPOST('save')) { // To avoid to show message when we juste switch the country that resubmit the form. + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } $db->commit(); } else { $db->rollback(); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 2502a257ae7..90ea5f290b6 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -33,7 +33,9 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'aZ09'); +if (empty($action)) $action = 'edit'; +// Define list of managed delays $modules = array( 'agenda' => array( array( @@ -190,6 +192,10 @@ if ($action == 'update') for ($i = 0; $i < 4; $i++) { if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity); } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + + $action = 'edit'; } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 80398531515..af4c2aa348e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -799,11 +799,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $keycode = $listfieldvalue[$i]; if (empty($keycode)) $keycode = $value; - if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { - $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); - } elseif ($value == 'entity') { - $_POST[$keycode] = getEntity($tabname[$id]); - } + if ($value == 'price' || preg_match('/^amount/i', $value)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } + elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); + } + elseif ($value == 'entity') { + $_POST[$keycode] = getEntity($tabname[$id]); + } if ($i) $sql .= ","; @@ -823,11 +827,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } $sql .= ",1)"; - dol_syslog("actionadd", LOG_DEBUG); - $result = $db->query($sql); - if ($result) // Add is ok - { - setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs'); + dol_syslog("actionadd", LOG_DEBUG); + $result = $db->query($sql); + if ($result) // Add is ok + { + setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs'); // Clean $_POST array, we keep only id of dictionary if ($id == 10 && GETPOST('country', 'int') > 0) { @@ -862,11 +866,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $keycode = $listfieldvalue[$i]; if (empty($keycode)) $keycode = $field; - if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { - $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); - } elseif ($field == 'entity') { - $_POST[$keycode] = getEntity($tabname[$id]); - } + if ($field == 'price' || preg_match('/^amount/i', $field)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } + elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); + } + elseif ($field == 'entity') { + $_POST[$keycode] = getEntity($tabname[$id]); + } if ($i) $sql .= ","; $sql .= $field."="; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index e7149ece88d..9d3dfaaf09b 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -416,7 +416,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (function_exists('imap_open')) { - $connectstringserver = $object->getConnectStringIMAP(); + // Note: $object->host has been loaded by the fetch + $usessl = 1; + + $connectstringserver = $object->getConnectStringIMAP($usessl); try { if ($sourcedir) { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 78f06b0ee2e..e6a85894fc4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -472,22 +472,22 @@ if ($nbofactivatedmodules <= 1) { print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); // Start to show page +$deschelp = ''; if ($mode == 'common' || $mode == 'commonkanban') { $desc = $langs->trans("ModulesDesc", '{picto}'); $desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc); - print ''.$desc."

\n"; + $deschelp = ''.$desc."

\n"; } if ($mode == 'marketplace') { - print ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; } if ($mode == 'deploy') { - print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; + $deschelp = ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; } if ($mode == 'develop') { - print ''.$langs->trans("ModulesDevelopDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesDevelopDesc")."

\n"; } - $head = modules_prepare_head(); @@ -512,6 +512,8 @@ if ($mode == 'common' || $mode == 'commonkanban') { print dol_get_fiche_head($head, 'modules', '', -1); + print $deschelp; + $moreforfilter = '
'; $moreforfilter .= '
'; } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 1a643323dce..8672fa1c2bf 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1855,7 +1855,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { $noidempotency_key = (GETPOSTISSET('noidempotency') ? GETPOST('noidempotency', 'int') : 0); // By default noidempotency is unset, so we must use a different tag/ref for each payment. If set, we can pay several times the same tag/ref. $paymentintent = $stripe->getPaymentIntent($amount, $currency, $tag, 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $stripecu, $stripeacc, $servicestatus, 0, 'automatic', false, null, 0, $noidempotency_key); - // The paymentintnent has status 'requires_payment_method' (even if paymentintent was already payed) + // The paymentintnent has status 'requires_payment_method' (even if paymentintent was already paid) //var_dump($paymentintent); if ($stripe->error) setEventMessages($stripe->error, null, 'errors'); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 346e4003e4c..f4b9f0feb5b 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -614,7 +614,7 @@ if ($ispaymentok) $ispostactionok = -1; } } else { - $postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found'; + $postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription paid was not found'; $ispostactionok = -1; } } elseif (array_key_exists('INV', $tmptag) && $tmptag['INV'] > 0) @@ -718,7 +718,7 @@ if ($ispaymentok) $ispostactionok = -1; } } else { - $postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found'; + $postactionmessages[] = 'Invoice paid '.$tmptag['INV'].' was not found'; $ispostactionok = -1; } } else { diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 30d31291a74..cb9bc100f79 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -447,7 +447,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town); if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; +if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_ref_rcp) $sql .= natural_search('e.ref', $search_ref_rcp); if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv); if ($search_company) $sql .= natural_search('s.nom', $search_company); @@ -656,7 +656,7 @@ if ($resql) if (!empty($arrayfields['typent.code']['checked'])) { print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT)); + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); print ''; } // Date delivery planned diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 59ea51466b6..0a8fb1bab0f 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 5f257f594cf..918fc9f727d 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -70,9 +70,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * Dolibarr version of the loaded document @@ -128,7 +128,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 7fb8427a517..2fc71bec099 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -256,7 +256,7 @@ if ($action == 'create') print ''; print ''; - print load_fiche_titre($langs->trans("NewSalaryPayment"), '', 'object_payment'); + print load_fiche_titre($langs->trans("NewSalaryPayment"), '', 'salary'); print dol_get_fiche_head('', ''); @@ -375,7 +375,7 @@ if ($id) { $head = salaries_prepare_head($object); - print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'salary'); $linkback = ''.$langs->trans("BackToList").''; @@ -425,7 +425,7 @@ if ($id) print '
'; print '
'; - print ''; + print '
'; // Label print ''; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 8b5bcc13920..59cf90e72e7 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -44,7 +44,7 @@ class PaymentSalary extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'payment'; + public $picto = 'salary'; public $tms; diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 6cc482f1304..dc86a274837 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -90,7 +90,7 @@ if ($object->id) $head = salaries_prepare_head($object); - print dol_get_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'salary'); // Build file list $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 9461bae867e..c7a5090072e 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -52,7 +52,7 @@ $object->info($id); $head = salaries_prepare_head($object); -print dol_get_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'payment'); +print dol_get_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'salary'); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 2b700108d10..119b224e76b 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -342,13 +342,15 @@ if (!empty($socid)) { } $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'salary', 0, $newcardbutton, '', $limit, 0, 0, 1); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; //$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields = ''; $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); +$moreforfilter = ''; + print '
'; print '
'.$langs->trans("Label").''.$object->label.'
'."\n"; @@ -453,9 +455,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Store properties in $object $object->setVarsFromFetchObj($obj); - // Show here line of result - print ''; - $userstatic->id = $obj->uid; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; @@ -468,6 +467,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $salstatic->id = $obj->rowid; $salstatic->ref = $obj->rowid; + // Show here line of result + print ''; + // Ref print "\n"; if (!$i) { diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 1f0598f4245..99b2fd9042f 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -60,7 +60,7 @@ llxHeader(); $title = $langs->trans("SalariesStatistics"); $dir = $conf->salaries->dir_temp; -print load_fiche_titre($title, '', 'object_payment'); +print load_fiche_titre($title, '', 'salary'); dol_mkdir($dir); diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index aa738f0845b..daaf9fbd623 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -784,7 +784,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; -print ''; +print ''; print ''; if ($conf->browser->layout == 'phone') print ''; @@ -2020,7 +2020,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Country print ''; @@ -2047,9 +2047,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // EMail / Web print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -2173,7 +2173,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Type - Workforce/Staff print ''; if ($conf->browser->layout == 'phone') print ''; @@ -2398,19 +2398,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; print '
".$salstatic->getNomUrl(1)."
'.$langs->trans("AddRefInList").'  '; if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { @@ -799,7 +799,7 @@ print '
'.$langs->trans("AddAdressInList").'  '; if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { @@ -814,7 +814,7 @@ print '
'.$langs->trans("AddEmailPhoneTownInContactList").'  '; if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { print ''; @@ -830,7 +830,7 @@ if (!empty($conf->expedition->enabled)) { if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print '
'.$langs->trans("AskForPreferredShippingMethod").'  '; if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { @@ -848,7 +848,7 @@ if (!empty($conf->expedition->enabled)) { // Disable Prospect/Customer thirdparty type print '
'.$langs->trans("DisableProspectCustomerType").'  '; if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index cd60d200a42..b471ca23ead 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1497,7 +1497,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Type - Workforce/Staff print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'browser->layout == 'phone' ? ' colspan="3"' : '').'>'."\n"; $sortparam = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. - print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam, '', 1); + print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); + print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''.img_picto('', 'object_email').'
'.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''.img_picto('', 'globe').'
'.img_picto('', 'globe').'
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''; - print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); + print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; - // Prospect/Customer - print ''; - // Supplier - if (!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) - { - print ''; - } - // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 81a1c167a02..3e8a6c91f92 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1068,7 +1068,7 @@ class Thirdparties extends DolibarrApi /** * Return list of invoices qualified to be corrected by a credit note. * Invoices matching the following rules are returned - * (validated + payment on process) or classified (payed completely or payed partialy) + not already replaced + not already a credit note + * (validated + payment on process) or classified (paid completely or paid partialy) + not already replaced + not already a credit note * * @param int $id Id of thirdparty * diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9c8e93b6567..c4d355ab62c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -126,6 +126,33 @@ class Societe extends CommonObject */ public $restrictiononfksoc = 1; + + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not 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 and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ @@ -152,17 +179,8 @@ class Societe extends CommonObject 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110), 'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115), 'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - /*'skype' =>array('type'=>'varchar(255)', 'label'=>'Skype', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'whatsapp' =>array('type'=>'varchar(255)', 'label'=>'Whatsapp', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'linkedin' =>array('type'=>'varchar(255)', 'label'=>'Linkedin', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'youtube' =>array('type'=>'varchar(255)', 'label'=>'Youtube', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'googleplus' =>array('type'=>'varchar(255)', 'label'=>'Googleplus', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'snapchat' =>array('type'=>'varchar(255)', 'label'=>'Snapchat', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'instagram' =>array('type'=>'varchar(255)', 'label'=>'Instagram', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'facebook' =>array('type'=>'varchar(255)', 'label'=>'Facebook', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'twitter' =>array('type'=>'varchar(255)', 'label'=>'Twitter', 'enabled'=>1, 'visible'=>-1, 'position'=>165),*/ 'fk_effectif' =>array('type'=>'integer', 'label'=>'Workforce', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175), + 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175, 'csslist'=>'minwidth200'), 'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'JuridicalStatus', 'enabled'=>1, 'visible'=>-1, 'position'=>180), 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185), 'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190), @@ -2589,6 +2607,41 @@ class Societe extends CommonObject return $result; } + /** + * Return link(s) on type of thirdparty (with picto) + * + * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) + * @param string $option ''=All + * @param int $notooltip 1=Disable tooltip + * @return string String with URL + */ + public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0) + { + global $conf, $langs; + + $s = ''; + if (empty($option) || preg_match('/prospect/', $option)) { + if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; + } + } + if (empty($option) || preg_match('/customer/', $option)) { + if (($this->client == 1 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; + } + } + if (empty($option) || preg_match('/supplier/', $option)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) + { + $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; + } + } + return $s; + } + + /** * Return label of status (activity, closed) * @@ -4348,6 +4401,7 @@ class Societe extends CommonObject * Return label of status customer is prospect/customer * * @return string Label + * @see getTypeUrl() */ public function getLibCustProspStatut() { diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 62301015418..fe8c2adb7bc 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -433,15 +433,15 @@ if ($sql_select) // Status print ''; - print '\n"; // Type print ''; // Last modified date print ''; } // Multiprice level @@ -924,7 +925,7 @@ if (!empty($arrayfields['s.tva_intra']['checked'])) print ''; } -// Type (customer/prospect/supplier) +// Nature (customer/prospect/supplier) if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; print "\n"; - print ''; if (!empty($arrayfields['s.rowid']['checked'])) print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); @@ -1012,7 +1012,7 @@ if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'], $_SERVER["PHP_SELF"], "region.nom", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, "", $sortfield, $sortorder, 'center '); if (!empty($arrayfields['staff.code']['checked'])) print_liste_field_titre($arrayfields['staff.code']['label'], $_SERVER["PHP_SELF"], "staff.code", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['s.price_level']['checked'])) print_liste_field_titre($arrayfields['s.price_level']['label'], $_SERVER["PHP_SELF"], "s.price_level", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder); @@ -1266,20 +1266,7 @@ while ($i < min($num, $limit)) if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; if (!$i) $totalarray['nbfield']++; } @@ -1371,6 +1358,14 @@ while ($i < min($num, $limit)) $i++; } +// If no record found +if ($num == 0) +{ + $colspan = 1; + foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + print ''; +} + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 5730d8f1ff4..b911bfb034e 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; -$langs->loadLangs(array("companies", "mails", "admin", "other")); +$langs->loadLangs(array("companies", "mails", "admin", "other", "errors")); $socid = GETPOST("socid", 'int'); $action = GETPOST('action', 'aZ09'); @@ -139,6 +139,7 @@ $result = $object->fetch($socid); $title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.' - '.$langs->trans("Notification"); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + llxHeader('', $title, $help_url); @@ -157,7 +158,7 @@ if ($result > 0) print '
'; print '
'; - print '
'.$langs->trans('ProspectCustomer').''; - print $object->getLibCustProspStatut(); + // Type Prospect/Customer/Supplier + print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); print '
'.$langs->trans('Supplier').''; - print yn($object->fournisseur); - print '
'; - if ($type_element == 'contract') - { - print $documentstaticline->getLibStatut(2); + if ($type_element == 'contract') { + print $documentstaticline->getLibStatut(5); } else { - print $documentstatic->getLibStatut(2); + print $documentstatic->getLibStatut(5); } print ''; + // Label + print ''; // Define text, description and type $text = ''; $description = ''; $type = 0; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index ddd865521d7..9ce38458c7f 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -289,21 +289,7 @@ if ($result) print "'; - $obj = $thirdparty_static; - $s = ''; - if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; - } - if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; - } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) - { - $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; - } - print $s; + print $thirdparty_static->getTypeUrl(); print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2553179acb8..e62b17559ee 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -78,7 +78,7 @@ $search_zip = trim(GETPOST("search_zip", 'alpha')); $search_state = trim(GETPOST("search_state", 'alpha')); $search_region = trim(GETPOST("search_region", 'alpha')); $search_email = trim(GETPOST('search_email', 'alpha')); -$search_phone = trim(GETPOST('search_phone', 'alpha')); +$search_phone = trim(GETPOST('search_phone', 'ahttps://wiki.dolibarr.org/index.php?title=Migrer_mon_Dolibarr_vers_une_offre_Cloudlpha')); $search_fax = trim(GETPOST('search_fax', 'alpha')); $search_url = trim(GETPOST('search_url', 'alpha')); $search_idprof1 = trim(GETPOST('search_idprof1', 'alpha')); @@ -444,7 +444,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) $sql .= " AND s.rowi if ($search_sale && $search_sale != -2) $sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale if (!$user->rights->fournisseur->lire) $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible if ($search_sale == -2) $sql .= " AND sc.fk_user IS NULL"; -elseif ($search_sale) $sql .= " AND sc.fk_user = ".$db->escape($search_sale); +elseif ($search_sale > 0) $sql .= " AND sc.fk_user = ".$db->escape($search_sale); if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); if ($search_categ_sup > 0) $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ_sup); if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL"; @@ -485,7 +485,7 @@ if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0"; if ($search_status != '' && $search_status >= 0) $sql .= natural_search("s.status", $search_status, 2); if (!empty($conf->barcode->enabled) && $search_barcode) $sql .= natural_search("s.barcode", $search_barcode); if ($search_prive_level && $search_prive_level != '-1') $sql .= natural_search("s.price_level", $search_prive_level, 2); -if ($search_type_thirdparty && $search_type_thirdparty != '-1') $sql .= natural_search("s.fk_typent", $search_type_thirdparty, 2); +if ($search_type_thirdparty && $search_type_thirdparty > 0) $sql .= natural_search("s.fk_typent", $search_type_thirdparty, 2); if (!empty($search_staff) && $search_staff != '-1') $sql .= natural_search("s.fk_effectif", $search_staff, 2); if ($search_level) $sql .= natural_search("s.fk_prospectlevel", join(',', $search_level), 3); if ($search_parent_name) $sql .= natural_search("s2.nom", $search_parent_name); @@ -582,7 +582,7 @@ if ($search_idprof5 != '') $param .= '&search_idprof5='.urlencode($search_idprof if ($search_idprof6 != '') $param .= '&search_idprof6='.urlencode($search_idprof6); if ($search_vat != '') $param .= '&search_vat='.urlencode($search_vat); if ($search_prive_level != '') $param .= '&search_prive_level='.urlencode($search_prive_level); -if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); +if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($search_type != '') $param .= '&search_type='.urlencode($search_type); if (is_array($search_level) && count($search_level)) foreach ($search_level as $slevel) $param .= '&search_level[]='.urlencode($slevel); if ($search_status != '') $param .= '&search_status='.urlencode($search_status); @@ -682,7 +682,7 @@ if (empty($type) || $type == 'c' || $type == 'p') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': '; + $moreforfilter .= img_picto('', 'category', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $langs->trans('CustomersProspectsCategoriesShort')); $moreforfilter .= '
'; } @@ -693,8 +693,8 @@ if (empty($type) || $type == 'f') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('SuppliersCategoriesShort').': '; - $moreforfilter .= $formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1); + $moreforfilter .= img_picto('', 'category', 'class="pictofixedwidth"'); + $moreforfilter .= $formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $langs->trans('SuppliersCategoriesShort')); $moreforfilter .= '
'; } } @@ -703,8 +703,8 @@ if (empty($type) || $type == 'f') if ($user->rights->societe->client->voir || $socid) { $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('SalesRepresentatives').': '; - $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300', 1); + $moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"'); + $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), 'maxwidth300', 1); $moreforfilter .= '
'; } if ($moreforfilter) @@ -829,7 +829,8 @@ if (!empty($arrayfields['country.code_iso']['checked'])) if (!empty($arrayfields['typent.code']['checked'])) { print '
'; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1); + // We use showempty=0 here because there is already an unknown value into dictionary. + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'minwidth50 maxwidth100', 1); print ''; @@ -996,7 +997,6 @@ print $searchpicto; print '
'; - $s = ''; - if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; - } - if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; - } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) - { - $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; - } - print $s; + print $companystatic->getTypeUrl(1); print '
'.$langs->trans("NoRecordFound").'
'; + print '
'; // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field @@ -208,72 +209,15 @@ if ($result > 0) print "\n"; // Help - print '
'; + print '
'; print $langs->trans("NotificationsDesc"); print '
'.$langs->trans("NotificationsDescUser"); print '
'.$langs->trans("NotificationsDescContact"); print '
'.$langs->trans("NotificationsDescGlobal"); + print '
'; print '
'; - print '

'."\n"; - - - // Add notification form - print load_fiche_titre($langs->trans("AddNewNotification"), '', ''); - - print '
'; - print ''; - print ''; - - $param = "&socid=".$socid; - - // Line with titles - print '
'; - print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); - print_liste_field_titre(''); - print "\n"; - - $var = false; - $listofemails = $object->thirdparty_and_contact_email_array(); - if (count($listofemails) > 0) - { - $actions = array(); - - // Load array of available notifications - $notificationtrigger = new InterfaceNotification($db); - $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents(); - - foreach ($listofmanagedeventfornotification as $managedeventfornotification) - { - $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); - $actions[$managedeventfornotification['rowid']] = $label; - } - print ''; - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - } - - print '
'; - print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 0, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); - print ''; - print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); - print ''; - $type = array('email'=>$langs->trans("EMail")); - print $form->selectarray("typeid", $type); - print '
'; - print $langs->trans("YouMustCreateContactFirst"); - print '
'; - - - print ''; - print '
'; + print '
'."\n"; // List of notifications enabled for contacts @@ -295,20 +239,60 @@ if ($result > 0) dol_print_error($db); } - // List of active notifications - print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + + // Add notification form + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + + print '
'; + print ''; + print ''; + + $param = "&socid=".$socid; // Line with titles - print ''; + print '
'; + print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); - print_liste_field_titre('', '', ''); - print ''; + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); + print_liste_field_titre(''); + print "\n"; + + // Line to add a new subscription + $listofemails = $object->thirdparty_and_contact_email_array(); + if (count($listofemails) > 0) + { + $actions = array(); + + // Load array of available notifications + $notificationtrigger = new InterfaceNotification($db); + $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents(); + + foreach ($listofmanagedeventfornotification as $managedeventfornotification) + { + $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); + $actions[$managedeventfornotification['rowid']] = $label; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + } - $langs->load("errors"); - $langs->load("other"); if ($num) { @@ -323,7 +307,9 @@ if ($result > 0) $contactstatic->id = $obj->contact_id; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; - print ''; + print ''; - print ''; @@ -355,7 +341,6 @@ if ($result > 0) foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; - $var = ! $var; print ''; @@ -395,14 +381,14 @@ if ($result > 0) /*if ($user->admin) { - $var = ! $var; print ''; }*/ print '
'; + print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); + print ''; + print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); + print ''; + $type = array('email'=>$langs->trans("EMail")); + print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); + print '
'; + print $langs->trans("YouMustCreateContactFirst"); + print '
'.$contactstatic->getNomUrl(1); + + print '
'.$contactstatic->getNomUrl(1); if ($obj->type == 'email') { if (isValidEmail($obj->email)) @@ -331,11 +317,11 @@ if ($result > 0) print ' <'.$obj->email.'>'; } else { $langs->load("errors"); - print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email).''; } } print ''; + print ''; $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label); print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label; print '
'; $listtmp=explode(',',$val); $first=1; @@ -372,7 +357,8 @@ if ($result > 0) } else { - print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail); + $langs->load("errors"); + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail).'; } } print '
'; print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).''; print '
'; - + print '
'; + print ''; print '

'."\n"; @@ -458,7 +444,8 @@ if ($result > 0) print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); // Line with titles - print ''; + print '
'; + print '
'; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder); @@ -517,6 +504,7 @@ if ($result > 0) } print '
'; + print ''; print ''; } else dol_print_error('', 'RecordNotFound'); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index dc532457965..259e1cea935 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 */ @@ -325,7 +325,7 @@ class Stripe extends CommonObject { global $conf, $user; - dol_syslog("getPaymentIntent", LOG_INFO, 1); + dol_syslog(get_class($this)."::getPaymentIntent", LOG_INFO, 1); $error = 0; @@ -534,10 +534,9 @@ class Stripe extends CommonObject } } - dol_syslog("getPaymentIntent return error=".$error." this->error=".$this->error, LOG_INFO, -1); + dol_syslog(get_class($this)."::getPaymentIntent return error=".$error." this->error=".$this->error, LOG_INFO, -1); - if (!$error) - { + if (!$error) { return $paymentintent; } else { return null; @@ -937,7 +936,7 @@ class Stripe extends CommonObject dol_syslog("* createPaymentStripe get stripeacc", LOG_DEBUG); $stripeacc = $stripe->getStripeAccount($service); // Get Stripe OAuth connect account if it exists (no network access here) - dol_syslog("* createPaymentStripe Create payment on card ".$stripecard->id.", amounttopay=".$amounttopay.", amountstripe=".$amountstripe.", FULLTAG=".$FULLTAG, LOG_DEBUG); + dol_syslog("* createPaymentStripe Create payment for customer ".$customer->id." on source card ".$stripecard->id.", amounttopay=".$amounttopay.", amountstripe=".$amountstripe.", FULLTAG=".$FULLTAG, LOG_DEBUG); // Create payment intent and charge payment (confirmnow = true) $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 421ac40b447..9826c2a409d 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -294,7 +294,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town); if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; +if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_ref) $sql .= natural_search('sp.ref', $search_ref); if ($search_societe) $sql .= natural_search('s.nom', $search_societe); if ($search_login) $sql .= natural_search('u.login', $search_login); @@ -395,6 +395,7 @@ if ($resql) if ($socid > 0) $param .= '&socid='.urlencode($socid); if ($search_status != '') $param .= '&search_status='.urlencode($search_status); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); + if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -518,7 +519,7 @@ if ($resql) if (!empty($arrayfields['typent.code']['checked'])) { print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT)); + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); print ''; } // Date diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 6fedcd0292a..a08df6d2b43 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant or multiple sales $action = GETPOST('action', 'aZ09'); @@ -776,11 +777,10 @@ $( document ).ready(function() { { print "ModalBox('ModalTerminal');"; } - if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) - { - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE "; - $sql .= "date(date_creation) = CURDATE() "; - $sql .= ""; + if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) { + $sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE"; + $sql .= " entity = ".$conf->entity." AND "; + $sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -1026,8 +1026,9 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { ); } -$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE "; -$sql .= "date(date_creation) = CURDATE() "; +$sql = "SELECT rowid, status, entity FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE"; +$sql .= " entity = ".$conf->entity." AND "; +$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 364723e2152..d6a2251b390 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -58,7 +58,9 @@ div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefuse span.butAction, span.butActionDelete { cursor: pointer; } - +.paginationafterarrows .butAction { + font-size: 0.9em; +} .butAction { background: var(--butactionbg); color: #FFF !important; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 05b0f1308ec..d39e7a3e1b5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -807,12 +807,24 @@ span.fa.fa-plus-circle.paddingleft { { border-right: 1px solid #DDD; } +.borderleftlight +{ + border-left: 1px solid #DDD; +} #formuserfile { margin-top: 4px; } #formuserfile input[type='file'] { font-size: 1em; + /* opacity: 0.5em; */ } +/*#formuserfile input[type='file']:valid { + color: #a00; +} +#formuserfile input[type='file']:empty { + color: #0a0; +}*/ + #formuserfile_link { margin-left: 1px; } @@ -1935,6 +1947,12 @@ span.widthpictotitle.pictotitle { .tagtdnote span.pictoedit { opacity: 0.4; } +.pictofixedwidth { + text-align: left; + width: 18px; + padding-right: 0; +} + .colorthumb { padding-left: 1px !important; padding-right: 1px; @@ -3295,6 +3313,12 @@ td.borderright { border-right-color: #BBB !important; border-right-style: solid !important; } +td.borderleft { + border: none; /* to erase value for table.nobordernopadding td */ + border-left-width: 1px !important; + border-left-color: #BBB !important; + border-left-style: solid !important; +} /* For table with no filter before */ @@ -3414,13 +3438,13 @@ div.pagination li:first-child span { border-bottom-left-radius: 4px;*/ } -div.pagination li a:hover, -div.pagination li:not(.paginationafterarrows,.title-button) span:hover, +/*div.pagination li a:hover, +div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:hover, div.pagination li a:focus, -div.pagination li:not(.paginationafterarrows,.title-button) span:focus { +div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:focus { -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); -} +}*/ div.pagination li .active a, div.pagination li .active span, div.pagination li .active a:hover, diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ae60254ea13..623ecb2a779 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -875,6 +875,11 @@ body[class*="colorblind-"] .text-success{ { border-right: 1px solid #f4f4f4; } +.borderleftlight +{ + border-left: 1px solid #f4f4f4; +} + #formuserfile { margin-top: 4px; } @@ -1866,6 +1871,11 @@ div.nopadding { img.hideonsmartphone.pictoactionview { vertical-align: bottom; } +.pictofixedwidth { + text-align: left; + width: 16px; +} + .colorthumb { padding-left: 1px !important; padding-right: 1px; @@ -3249,6 +3259,12 @@ td.borderright { border-right-color: #BBB !important; border-right-style: solid !important; } +td.borderleft { + border: none; /* to erase value for table.nobordernopadding td */ + border-left-width: 1px !important; + border-left-color: #BBB !important; + border-left-style: solid !important; +} /* For table with no filter before */ table.listwithfilterbefore { diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index fff39a3d45f..cb113166cad 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -185,7 +185,7 @@ if ($id > 0) { print '
'; print '
'; - print '     '; + print '     '; print ''; print '
'; } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index badf3840582..ee60b90b994 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -340,7 +340,7 @@ if ($object->id > 0) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ' '; + print ' '; } } else { // Do not own permission @@ -351,7 +351,7 @@ if ($object->id > 0) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ' '; + print ' '; } $permlabel = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index e294be6a219..b10bd9267f8 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -277,7 +277,6 @@ if ($canreadperms) } } -//print ''; print ''; // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 3c7395fe1e8..d09ee52077f 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -195,9 +195,9 @@ if ($result > 0) // Line with titles print ''; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -271,9 +271,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; @@ -322,10 +322,8 @@ if ($result > 0) // List of notifications enabled for fixed email /* - foreach($conf->global as $key => $val) - { + foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; - $var = ! $var; print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -435,7 +435,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } // Label of permission 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 '
'; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index e993428adf0..cf58c298206 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -376,7 +376,18 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase break; } $this->assertTrue($ok, 'Found a declaration @var array() instead of @var array in file '.$file['relativename'].'.'); - } + + + // Test we don't have CURDATE() + $ok=true; + $matches=array(); + preg_match_all('/CURDATE\(\)/', $filecontent, $matches, PREG_SET_ORDER); + foreach ($matches as $key => $val) { + $ok=false; + break; + } + $this->assertTrue($ok, 'Found a CURDATE\(\) into code. Do not use this SQL method in file '.$file['relativename'].'. You must use the PHP function dol_now() instead.'); + } return; } diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index a3386c7aef5..4051deb125b 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -279,15 +279,14 @@ class ExportTest extends PHPUnit\Framework\TestCase $expectedresult=1; $this->assertEquals($expectedresult, $result, 'Error in TSV export'); - $model='excel2007new'; + $model='excel2007'; // Build export file /* ko on php 7.4 on travis (zip not available) */ print "Process build_file for model = ".$model."\n"; $result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql); $expectedresult=1; - $this->assertEquals($expectedresult, $result, 'Error in Excel2007new export'); - + $this->assertEquals($expectedresult, $result, 'Error in Excel2007 export'); return true; } diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 506013599bc..700507a4edf 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -242,7 +242,7 @@ class FactureTest extends PHPUnit\Framework\TestCase true, array( 'newref','oldref','id','lines','client','thirdparty','brouillon','user_author','date_creation','date_validation','datem','date_modification', - 'ref','statut','paye','specimen','ref','actiontypecode','actionmsg2','actionmsg','mode_reglement','cond_reglement', + 'ref','statut','status','paye','specimen','ref','actiontypecode','actionmsg2','actionmsg','mode_reglement','cond_reglement', 'cond_reglement_doc', 'modelpdf', 'multicurrency_total_ht','multicurrency_total_tva', 'multicurrency_total_ttc','fk_multicurrency','multicurrency_code','multicurrency_tx', 'retained_warranty' ,'retained_warranty_date_limit', 'retained_warranty_fk_cond_reglement', 'specimen', 'situation_cycle_ref', 'situation_counter', 'situation_final', diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index fb9dbe5100e..6b157d2dcab 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -310,6 +310,8 @@ class SecurityTest extends PHPUnit\Framework\TestCase $_POST["param8a"]="Hackerobjnotdefined\''; $_POST["param11"]=' Name '; @@ -386,9 +388,17 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($_POST['param8c'], $result, 'Test a string with non closing html tag with alphanohtml'); - $result=GETPOST("param9", 'alphanohtml'); - print __METHOD__." result=".$result."\n"; - $this->assertEquals($_POST["param9"], $result); + $result=GETPOST("param8d", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('abc123 is html to clean', $result, 'Test a string with non closing html tag with alphanohtml'); + + $result=GETPOST("param8e", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals($_POST['param8e'], $result, 'Test a string with non closing html tag with alphanohtml'); + + $result=GETPOST("param9", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals($_POST["param9"], $result); $result=GETPOST("param10", 'alphanohtml'); print __METHOD__." result=".$result."\n";
'; $listtmp=explode(',',$val); $first=1; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 68238b63c29..a05fd76df7b 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -424,7 +424,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print '