From ff39491f15fa9a9a3f23aed66880cb9dac8f611d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 27 Jan 2019 23:31:37 +0100 Subject: [PATCH] wip --- htdocs/accountancy/admin/accountmodel.php | 2 +- htdocs/admin/modules.php | 4 +-- htdocs/admin/system/constall.php | 2 +- htdocs/comm/mailing/card.php | 4 +-- htdocs/core/class/extrafields.class.php | 12 ++------- htdocs/core/lib/functions.lib.php | 7 ++--- htdocs/core/lib/functions2.lib.php | 4 +-- .../expensereport/mod_expensereport_jade.php | 2 +- .../doc/pdf_standardlabel.class.php | 4 +-- htdocs/takepos/takepos.php | 27 ++++++++++--------- 10 files changed, 31 insertions(+), 37 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index b3017d93b42..fc4406714c0 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -534,7 +534,7 @@ if ($id) if ($valuetoshow != '') { print ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { - print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; + print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; } elseif (! empty($tabhelp[$id][$value])) { print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); } else { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 56590d0c187..630e04d2f89 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -768,7 +768,7 @@ if ($mode == 'common') } print "\n"; } - elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url,$regs)) + elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) { print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; } @@ -1061,7 +1061,7 @@ if ($mode == 'deploy') { $langs->load('other'); print ' '; - print info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphp), 1); } } else diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index d1bf993bc43..9148d44e53c 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -182,7 +182,7 @@ foreach($configfileparameters as $key) print ''.$newkey.''; // Value print ""; - if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*', ${$newkey}); + if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i', '*', ${$newkey}); elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); else print ${$newkey}; if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 3b892c47a79..9e8fb3a9964 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -530,9 +530,9 @@ if (empty($reshook)) elseif ($action == 'setemail_errorsto') { $object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha')); } elseif ($action == 'settitre' && empty($object->titre)) { - $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle")); + $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle")); } elseif ($action == 'setfrom' && empty($object->email_from)) { - $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")); + $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")); } if (! $mesg) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a805ff78706..adf774778d0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2020,22 +2020,14 @@ class ExtraFields // Clean parameters $value_key=dol_mktime($_POST[$keysuffix."options_".$key.$keyprefix."hour"], $_POST[$keysuffix."options_".$key.$keyprefix."min"], 0, $_POST[$keysuffix."options_".$key.$keyprefix."month"], $_POST[$keysuffix."options_".$key.$keyprefix."day"], $_POST[$keysuffix."options_".$key.$keyprefix."year"]); } -<<<<<<< HEAD - else if (in_array($key_type, array('checkbox', 'chkbxlst'))) -======= - elseif (in_array($key_type,array('checkbox', 'chkbxlst'))) ->>>>>>> upstream/develop + elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); // Make sure we get an array even if there's only one checkbox $value_arr=(array) $value_arr; $value_key=implode(',', $value_arr); } -<<<<<<< HEAD - else if (in_array($key_type, array('price','double'))) -======= - elseif (in_array($key_type,array('price','double'))) ->>>>>>> upstream/develop + elseif (in_array($key_type, array('price','double'))) { $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); $value_key=price2num($value_arr); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8dc49f453d5..ebca2aee9cf 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -535,8 +535,8 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti $out=trim($out); // '"' is dangerous because param in url can close the href= or src= and add javascript functions. // '../' is dangerous because it allows dir transversals - if (preg_match('/"/',$out)) $out=''; - elseif (preg_match('/\.\.\//',$out)) $out=''; + if (preg_match('/"/', $out)) $out=''; + elseif (preg_match('/\.\.\//', $out)) $out=''; $out=dol_string_nohtmltag($out); } break; @@ -3089,7 +3089,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fa='fa'; if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas'; - $enabledisablehtml = ''; + $enabledisablehtml = ''; if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $enabledisablehtml.= $titlealt; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 00bdae573ff..b58e3061af3 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1355,12 +1355,12 @@ function numero_semaine($time) */ // Definition du Jeudi de la semaine - if (date("w",mktime(12, 0, 0, $mois, $jour, $annee))==0) // Dimanche + if (date("w", mktime(12, 0, 0, $mois, $jour, $annee))==0) // Dimanche $jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee)-3*24*60*60; elseif (date("w", mktime(12, 0, 0, $mois, $jour, $annee))<4) // du Lundi au Mercredi $jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee)+(4-date("w", mktime(12, 0, 0, $mois, $jour, $annee)))*24*60*60; elseif (date("w", mktime(12, 0, 0, $mois, $jour, $annee))>4) // du Vendredi au Samedi - $jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee)-(date("w",mktime(12,0,0,$mois,$jour,$annee))-4)*24*60*60; + $jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee)-(date("w", mktime(12, 0, 0, $mois, $jour, $annee))-4)*24*60*60; else // Jeudi $jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee); diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index a6c68f32364..fb571a65c8b 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -78,7 +78,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport /** - * Test whether the numbers already in force in the base do not cause conflicts + * Test whether the numbers already in force in the base do not cause conflicts * that would prevent this numbering from working. * * @return boolean false si conflit, true si ok diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 62d7c962ab9..fab88a91bfd 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -171,7 +171,7 @@ class pdf_standardlabel extends CommonStickerGenerator elseif ($textright == '%LOGO%' || $textright == '%PHOTO%') { if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse); - elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop, $widthtouse, $heighttouse); + elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse); $pdf->SetXY($_PosX+$xleft, $_PosY+$ytop); $pdf->MultiCell($this->_Width-$widthtouse-$xleft-$xleft-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -187,7 +187,7 @@ class pdf_standardlabel extends CommonStickerGenerator { // Output right area if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse); - elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop, $widthtouse, $heighttouse); + elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse); else { $pdf->SetXY($_PosX+$xleft, $_PosY+$ytop); diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 2a4a485d684..e2d50cfcab0 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -120,8 +120,8 @@ function LoadProducts(position){ ishow=0; //product to show counter while (idata < 30) { if (typeof (data[idata]) == "undefined") { - $("#prodesc"+ishow).text(""); - $("#proimg"+ishow).attr("src",""); + $("#prodesc"+ishow).text(""); + $("#proimg"+ishow).attr("src",""); $("#prodiv"+ishow).data("rowid",""); ishow++; //Next product to show after print data product } @@ -158,8 +158,8 @@ function MoreProducts(moreorless){ ishow=0; //product to show counter while (idata < 30) { if (typeof (data[idata]) == "undefined") { - $("#prodesc"+ishow).text(""); - $("#proimg"+ishow).attr("src",""); + $("#prodesc"+ishow).text(""); + $("#proimg"+ishow).attr("src",""); $("#prodiv"+ishow).data("rowid",""); ishow++; //Next product to show after print data product } @@ -337,11 +337,11 @@ function MoreActions(totalactions){ } else if (pageactions==1){ pageactions=0; - for (i = 0; i <= totalactions; i++){ + for (i = 0; i <= totalactions; i++){ if (i<9) $("#action"+i).show(); else $("#action"+i).hide(); } - } + } } $( document ).ready(function() { @@ -411,16 +411,17 @@ if($conf->global->TAKEPOS_BAR_RESTAURANT){ } if ($conf->global->TAKEPOSCONNECTOR){ - $menus[$r++]=array('title'=>$langs->trans("DOL_OPEN_DRAWER"), - 'action'=>'OpenDrawer();'); + $menus[$r++]=array( + 'title'=>$langs->trans("DOL_OPEN_DRAWER"), + 'action'=>'OpenDrawer();' + ); } $hookmanager->initHooks(array('takeposfrontend')); $reshook=$hookmanager->executeHooks('ActionButtons'); -if (!empty($reshook)) - { - $menus[$r++]=$reshook; - } +if (!empty($reshook)) { + $menus[$r++]=$reshook; +} ?>
@@ -446,7 +447,7 @@ foreach($menus as $menu) { while ($count<16) { ?> -
id='catdiv'> +
id='catdiv'> width="98%" id='catimg'/>