diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 9c564c24b0c..e4bdefaecd4 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -167,7 +167,6 @@ - 0 diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index ee67aaad392..59bfd561c6c 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -936,7 +936,7 @@ if (empty($action) || $action == 'view') { $accountoshow = length_accountg($k); if (($accountoshow == "") || $accountoshow == 'NotDefined') { - print ''.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')'.''; + print ''.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')'; } else print $accountoshow; print ""; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 1710a61ccdd..c3c9f45ed5a 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -874,7 +874,7 @@ if (empty($action) || $action == 'view') { $accountoshow = length_accountg($k); if (($accountoshow == "") || $accountoshow == 'NotDefined') { - print ''.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')'.''; + print ''.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')'; } else print $accountoshow; print ""; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 251322ea798..d250203b3d8 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -213,19 +213,17 @@ class Dolistore { $cat = $this->categories[$i]; if ($cat->is_root_category == 1 && $parent == 0) { - $html .= '
  • '.$cat->name->language[$this->lang - 1].' '.$cat->nb_products_recursive.'

    '; - $html .= self::get_categories($cat->id); - $html .= "
  • \n"; + $html .= '
  • description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' '.$cat->nb_products_recursive.'

    '; + $html .= self::get_categories($cat->id); + $html .= "
  • \n"; } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau $select = ($cat->id == $this->categorie) ? ' selected' : ''; - $html .= '
  • '.$cat->name->language[$this->lang - 1].' '.$cat->nb_products_recursive.''; - $html .= self::get_categories($cat->id); - $html .= "
  • \n"; - } else { + $html .= '
  • description->language[$this->lang - 1])).'" '; + $html .= '>'.$cat->name->language[$this->lang - 1].' '.$cat->nb_products_recursive.''; + $html .= self::get_categories($cat->id); + $html .= "
  • \n"; } } diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index b3a66fa112e..8aa1a425778 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -327,7 +327,7 @@ if ($resql) print ''."\n"; - print ""."\n"; + print "\n"; $i++; } diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index fcfe25ce3d3..dd77c41a673 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -66,7 +66,7 @@ if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug")); - print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; + print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; } print '
    '; @@ -123,7 +123,7 @@ if (!$foundcache && $test) { $foundcache++; print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache"); - print ' '.$langs->trans("MoreInformation").' Xcache admin page'; + print ' '.$langs->trans("MoreInformation").' Xcache admin page'; } $test = function_exists('eaccelerator_info'); if (!$foundcache && $test) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index d753b3a66ea..66cc3b44848 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -223,20 +223,20 @@ if ($action === 'downloadblockchain') { { $statusofrecordnote = $langs->trans("PreviousFingerprint").': '.$previoushash.($statusofrecordnote ? ' - '.$statusofrecordnote : ''); } - print $obj->rowid - .';'.$obj->date_creation - .';"'.$obj->user_fullname.'"' - .';'.$obj->action - .';'.$obj->element - .';'.$obj->amounts - .';'.$obj->fk_object - .';'.$obj->date_object - .';"'.$obj->ref_object.'"' - .';'.$obj->signature - .';'.$statusofrecord - .';'.$statusofrecordnote - .';"'.str_replace('"', '""', $obj->object_data).'"' - ."\n"; + print $obj->rowid; + print ';'.$obj->date_creation; + print ';"'.str_replace('"', '""', $obj->user_fullname).'"'; + print ';'.$obj->action; + print ';'.$obj->element; + print ';'.$obj->amounts; + print ';'.$obj->fk_object; + print ';'.$obj->date_object; + print ';"'.str_replace('"', '""', $obj->ref_object).'"'; + print ';'.$obj->signature; + print ';'.$statusofrecord; + print ';'.$statusofrecordnote; + print ';"'.str_replace('"', '""', $obj->object_data).'"'; + print "\n"; // Set new previous hash for next fetch $previoushash = $obj->signature; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 2103a4081d3..b36101750f2 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -184,9 +184,7 @@ foreach ($fulltree as $key => $val) 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_parent'], 'entry'=>''.$counter. - //''. - ''. - '
    color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.''.dolGetFirstLineOfText($desc).''.img_view().'
    ' + ''.img_view().'' ); } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 0bce99df2ff..bcedba7a074 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -191,15 +191,15 @@ if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description .= '
    '.$langs $description .= ($description ? '
    ' : '').$fsearch; if (!empty($conf->global->TAX_REPORT_EXTRA_REPORT)) { - $description .= '
    ' - . ' ' - . $langs->trans('SimpleReport') - . '' - . '
    ' - . ' ' - . $langs->trans('AddExtraReport') - . '' - . '
    '; + $description .= '
    '; + $description .= ' '; + $description .= $langs->trans('SimpleReport'); + $description .= ''; + $description .= '
    '; + $description .= ' '; + $description .= $langs->trans('AddExtraReport'); + $description .= ''; + $description .= '
    '; } $elementcust = $langs->trans("CustomersInvoices"); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 63500b156a8..954a996b0a8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6642,8 +6642,7 @@ class Form $out .= 'function formatResult(record) {'."\n"; if ($elemtype == 'category') { - $out .= ' //return \' \'+record.text+\'\'; - return \' \'+record.text+\'\';'; + $out .= 'return \' \'+record.text+\'\';'; } else { diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index 3ea4baf8c87..1349ed00dad 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -56,16 +56,10 @@ function RemoveFromEnd($sourceString, $charToRemove) */ function FindBadUtf8($string) { - $regex = '([\x00-\x7F]'. - '|[\xC2-\xDF][\x80-\xBF]'. - '|\xE0[\xA0-\xBF][\x80-\xBF]'. - '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. - '|\xED[\x80-\x9F][\x80-\xBF]'. - '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. - '|[\xF1-\xF3][\x80-\xBF]{3}'. - '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. - '|(.{1}))'; + $regex = '([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]'; + $regex .= '|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2}|(.{1}))'; + $matches =array(); while (preg_match('/'.$regex.'/S', $string, $matches)) { if (isset($matches[2])) { return true; diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index 3e4f838fe33..769e0a36157 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -75,7 +75,7 @@ if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP var audio = null; global->AGENDA_REMINDER_BROWSER_SOUND)) { - print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');'; + print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav\');'; } ?> diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 8128a449cfd..33ad0a85229 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -107,7 +107,7 @@ function dol_print_cron_urls() print ''.$langs->trans("FileToLaunchCronJobs").':
    '; - $file = '/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->CRON_KEY) ? 'securitykey' : ''.$conf->global->CRON_KEY.'').' '.$logintouse.' [cronjobid]'; + $file = '/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY) ? 'securitykey' : ''.$conf->global->CRON_KEY.'').' '.$logintouse.' [cronjobid]'; print '
    \n"; print '
    '; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 581a7ebab74..be23fc65cfc 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -642,7 +642,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($source == 'internal') $c = new User($db); else $c = new Contact($db); $c->fetch($contacttask['id']); - print $c->getNomUrl(1).' ('.$contacttask['libelle'].')'.'
    '; + print $c->getNomUrl(1).' ('.$contacttask['libelle'].')
    '; } } } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index b2b5ef06abf..6ef17220283 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -133,7 +133,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) $tplcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n"; $tplcontent .= ' $pathdepth = count(explode(\'/\', $_SERVER[\'SCRIPT_NAME\'])) - 2;'."\n"; $tplcontent .= ' require_once ($pathdepth ? str_repeat(\'../\', $pathdepth) : \'./\').\'master.inc.php\';'."\n"; - $tplcontent .= "} // Not already loaded"."\n"; + $tplcontent .= "} // Not already loaded\n"; $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $tplcontent .= "ob_start();\n"; @@ -212,7 +212,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) $tplcontent .= 'id.');'."\n"; - $tplcontent .= "// END PHP ?>"."\n"; + $tplcontent .= "// END PHP ?>\n"; //var_dump($filetpl);exit; $result = file_put_contents($filetpl, $tplcontent); diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 4a85c595223..440f1147cbf 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -251,7 +251,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) } fwrite($calfileh, "DTEND".$prefix.":".$enddatef."\n"); - fwrite($calfileh, "STATUS:CONFIRMED"."\n"); + fwrite($calfileh, "STATUS:CONFIRMED\n"); if (!empty($transparency)) { @@ -295,7 +295,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) fwrite($calfileh, "SUMMARY:".$encoding.$summary."\n"); fwrite($calfileh, "DESCRIPTION:".$encoding.$description."\n"); - fwrite($calfileh, "STATUS:CONFIRMED"."\n"); + fwrite($calfileh, "STATUS:CONFIRMED\n"); fwrite($calfileh, "CATEGORIES:".$category."\n"); fwrite($calfileh, "LOCATION:".$location."\n"); fwrite($calfileh, "TRANSP:OPAQUE\n"); @@ -381,7 +381,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $url = $urlwithroot."/public/agenda/agendaexport.php?format=rss&exportkey=".urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY); } - fwrite($fichier, ""."\n"); + fwrite($fichier, "\n"); foreach ($events_array as $key => $event) { @@ -480,9 +480,9 @@ function format_cal($format, $string) if ($format === "ical") { // Replace new lines chars by "\n" - $newstring = preg_replace("/"."\r\n"."/i", "\\n", $newstring); - $newstring = preg_replace("/"."\n\r"."/i", "\\n", $newstring); - $newstring = preg_replace("/"."\n"."/i", "\\n", $newstring); + $newstring = preg_replace("/\r\n/i", "\\n", $newstring); + $newstring = preg_replace("/\n\r/i", "\\n", $newstring); + $newstring = preg_replace("/\n/i", "\\n", $newstring); // Must not exceed 75 char. Cut with "\r\n"+Space $newstring = calEncode($newstring); @@ -586,7 +586,7 @@ function quotedPrintEncode($str, $forcal = 0) if ((strlen($newpara) + strlen($char)) >= 76) { // New line with carray-return (CR) and line-feed (LF) - $out .= $newpara."="."\r\n"; + $out .= $newpara."=\r\n"; // extra space for cal if ($forcal) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 0ce2f2bbbb2..23868eef643 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -227,14 +227,14 @@ class pdf_sepamandate extends ModeleBankAccountDoc $posY += 2; $pdf->SetXY($this->marge_gauche, $posY); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("RUMLong").' ('.$outputlangs->transnoentitiesnoconv("RUM").')'.' : '.$object->rum, 0, 'L'); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("RUMLong").' ('.$outputlangs->transnoentitiesnoconv("RUM").') : '.$object->rum, 0, 'L'); $posY = $pdf->GetY(); $posY += 2; $pdf->SetXY($this->marge_gauche, $posY); $ics = ''; if (!empty($conf->global->PRELEVEMENT_ICS)) $ics = $conf->global->PRELEVEMENT_ICS; - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("CreditorIdentifier").' ('.$outputlangs->transnoentitiesnoconv("ICS").')'.' : '.$ics, 0, 'L'); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("CreditorIdentifier").' ('.$outputlangs->transnoentitiesnoconv("ICS").') : '.$ics, 0, 'L'); $posY = $pdf->GetY(); $posY += 1; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index d129fbeb1e4..2c99c28e7e5 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1440,9 +1440,9 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { exit; } while ($obj_dispatch = $db->fetch_object($resql_dispatch)) { - $sql_line = 'SELECT line.rowid, line.qty FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet AS line' - . ' WHERE line.fk_commande = '.$obj_dispatch->fk_commande - . ' AND line.fk_product = '.$obj_dispatch->fk_product; + $sql_line = 'SELECT line.rowid, line.qty FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet AS line'; + $sql_line .= ' WHERE line.fk_commande = '.$obj_dispatch->fk_commande; + $sql_line .= ' AND line.fk_product = '.$obj_dispatch->fk_product; $resql_line = $db->query($sql_line); // s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur, diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 09a9c10e789..30529b49f56 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -84,7 +84,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''."\n"; print '
    '."\n"; - print '
    '."\n"; + print ''."\n"; print ''; print ''."\n"; print "\n"; diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 9ed74d112eb..25f3e38a81b 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -172,22 +172,22 @@ if ($resql) print ''; print ''; - print ''. - ''. - ''. - ''. - ''. - ''; + print ''; + print ''; + print ''; + print ''; + print ''; diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 195a7560631..04fe1f75fca 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -66,7 +66,7 @@ $extrafields = new ExtraFields($db); $morehead = ''; if (!empty($conf->global->MEMBER_PUBLIC_CSS)) $morehead = ''; -else $morehead = ''; +else $morehead = ''; llxHeaderVierge($langs->trans("MemberCard"), $morehead); diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index ef5458456c5..d0ce716bb7d 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -690,7 +690,7 @@ if ($object->allow_spy) { if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); - $meilleursujet .= dol_print_date($toutsujetdate[0], 'daytext').' ('.dol_print_date($toutsujetdate[0], '%A').')'.' - '.$toutsujetdate[1]; + $meilleursujet .= dol_print_date($toutsujetdate[0], 'daytext').' ('.dol_print_date($toutsujetdate[0], '%A').') - '.$toutsujetdate[1]; } else { $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').' ('.dol_print_date($toutsujet[$i], '%A').')'; } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index c3e6553cf92..8b1e8a42574 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1924,7 +1924,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print '
    '; print ''; - print ''; + print ''; print ''; print '
    '. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - $form->selectDate($search_date, 'search_date', 0, 0, 1, '', 1, 0, 0, ''). - ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->selectDate($search_date, 'search_date', 0, 0, 1, '', 1, 0, 0, ''); + print ''; $searchpicto = $form->showFilterAndCheckAddButtons(0); print $searchpicto; print '
    '; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 9c6e8df76f1..3d8547f9322 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1858,7 +1858,7 @@ elseif ($id || $ref) print ''; print ''; // Qty to receive or received - print ''.''.''; + print ''; // Warehouse source print ''.$formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -1878,11 +1878,11 @@ elseif ($id || $ref) print ''; print ''; // Qty to receive or received - print ''.''.''; + print ''; // Warehouse source - print ''.''; + print ''; // Batch number managment - print ''.''; + print ''; print ''; } } diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 10a679615a9..46d168ddd24 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -264,7 +264,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { print ''.$langs->trans('CashDeskReaderKeyCodeForEnter').''; print ''; -print ''; +print ''; print ''; // Numbering module