From c0821a8ed680f3e4df6a6cbff1d1c5bec2e88157 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Apr 2020 00:02:31 +0200 Subject: [PATCH] Fix phpcs --- .../accountancy/class/bookkeeping.class.php | 2 +- htdocs/admin/menus/index.php | 32 +++++++++++-------- htdocs/admin/notification.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 4 +-- htdocs/expedition/card.php | 14 ++++---- htdocs/website/index.php | 8 ++--- 6 files changed, 33 insertions(+), 29 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 43762c2d36a..0162a98394e 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -704,7 +704,7 @@ class BookKeeping extends CommonObject $sql .= ' WHERE 1 = 1'; $sql .= " AND entity IN (".getEntity('accountancy').")"; if (null !== $ref) { - $sql .= ' AND t.ref = '.'\''.$ref.'\''; + $sql .= " AND t.ref = '".$this->db->escape($ref)."'"; } else { $sql .= ' AND t.rowid = '.$id; } diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index cc83e019833..56251e48f7b 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -325,6 +325,22 @@ if ($conf->use_javascript_ajax) if (!empty($menu['langs'])) $langs->load($menu['langs']); $titre = $langs->trans($menu['titre']); + $entry = '
'; + $entry .= '   '.$titre.''; + $entry .= ''; + $entry .= ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; + $entry .= ''.img_edit_add('default').' '; + $entry .= ''.img_delete('default').' '; + $entry .= '     '; + $entry .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; + $entry .= '
'; + + $buttons = ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; + $buttons .= ''.img_edit_add('default').' '; + $buttons .= ''.img_delete('default').' '; + $buttons .= '     '; + $buttons .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; + $data[] = array( 'rowid'=>$menu['rowid'], 'module'=>$menu['module'], @@ -335,20 +351,8 @@ if ($conf->use_javascript_ajax) 'fk_mainmenu'=>$menu['fk_mainmenu'], 'fk_leftmenu'=>$menu['fk_leftmenu'], 'position'=>$menu['position'], - 'entry'=>'
'. - '   '.$titre.''. - ''. - ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. - ''.img_edit_add('default').' '. - ''.img_delete('default').' '. - '     '. - ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''. - '
', - 'buttons'=>''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. - ''.img_edit_add('default').' '. - ''.img_delete('default').' '. - '     '. - ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").'' + 'entry'=>$entry, + 'buttons'=>$buttons ); $i++; } diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 0455fb961ae..97b09861a42 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -265,7 +265,7 @@ print ''.$langs->trans("Code").''; print ''.$langs->trans("Label").''; print ''.$langs->trans("FixedEmailTarget").''; print ''.$langs->trans("Threshold").''; -print ''.''; +print ''; print "\n"; foreach ($listofnotifiedevents as $notifiedevent) diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index f433366f112..23727e4ad97 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -486,9 +486,9 @@ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) { print ''; print '
'.$langs->trans("AdvTgtStartDt").''; - print $form->selectDate('', 'options_'.$key.'_st_dt'.'_cnct'); + print $form->selectDate('', 'options_'.$key.'_st_dt_cnct'); print ''.$langs->trans("AdvTgtEndDt").''; - print $form->selectDate('', 'options_'.$key.'_end_dt'.'_cnct'); + print $form->selectDate('', 'options_'.$key.'_end_dt_cnct'); print '
'; print ''."\n"; print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 655ba8f060f..7fd2948480e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2278,7 +2278,7 @@ elseif ($id || $ref) { print ''; // Qty to ship or shipped - print ''.''.''; + print ''; // Batch number managment if ($lines[$i]->entrepot_id == 0) { @@ -2291,7 +2291,7 @@ elseif ($id || $ref) // add a 0 qty lot row to be able to add a lot print ''; // Qty to ship or shipped - print ''.''.''; + print ''; // Batch number managment print ''.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).''; print ''; @@ -2305,7 +2305,7 @@ elseif ($id || $ref) print ''; print ''; // Qty to ship or shipped - print ''.''.''; + print ''; // Warehouse source print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2319,7 +2319,7 @@ elseif ($id || $ref) { print ''; // Qty to ship or shipped - print ''.''.''; + print ''; // Warehouse source print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2338,11 +2338,11 @@ elseif ($id || $ref) print ''; print ''; // Qty to ship or shipped - print ''.''.''; + print ''; // Warehouse source - print ''.''; + print ''; // Batch number managment - print ''.''; + print ''; print ''; } } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 32fa5d4eefb..403473071f4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1263,7 +1263,7 @@ if ($action == 'updatecss') $jscontent .= ""."\n"; + $jscontent .= "// END PHP ?>\n"; $result = dolSaveJsFile($filejs, $jscontent); if (!$result) @@ -1329,7 +1329,7 @@ if ($action == 'updatecss') $manifestjsoncontent .= ""."\n"; + $manifestjsoncontent .= "// END PHP ?>\n"; $result = dolSaveManifestJson($filemanifestjson, $manifestjsoncontent); if (!$result)