Merge remote-tracking branch 'upstream/develop' into Squiz.Scope.MethodScope.Missing

This commit is contained in:
Frédéric FRANCE 2019-03-02 18:27:29 +01:00
commit 1125c7b475
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
15 changed files with 183 additions and 118 deletions

View File

@ -309,7 +309,7 @@ script:
set -e set -e
# Exclusions are defined in the ruleset.xml file # Exclusions are defined in the ruleset.xml file
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
set +e set +e
echo echo

View File

@ -11,8 +11,6 @@
<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern> <exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
<exclude-pattern type="relative">*/nltechno*</exclude-pattern> <exclude-pattern type="relative">*/nltechno*</exclude-pattern>
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern> <exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
<exclude-pattern type="relative">*.min.css</exclude-pattern>
<exclude-pattern type="relative">*.js</exclude-pattern>
<!-- List of all tests --> <!-- List of all tests -->

View File

@ -323,6 +323,8 @@ class FactureRec extends CommonInvoice
{ {
global $conf; global $conf;
$error = 0;
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET";
$sql.= " fk_soc = ".$this->fk_soc; $sql.= " fk_soc = ".$this->fk_soc;
// TODO Add missing fields // TODO Add missing fields

View File

@ -352,31 +352,15 @@ class CMailFile
elseif ($this->sendmode == 'swiftmailer') elseif ($this->sendmode == 'swiftmailer')
{ {
// Use Swift Mailer library // Use Swift Mailer library
// ------------------------------------------
$host = dol_getprefix('email'); $host = dol_getprefix('email');
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php'; require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Exception/InvalidEmail.php'; // egulias autoloader lib
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Exception/NoDomainPart.php'; require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/autoload.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/EmailParser.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/EmailLexer.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/EmailValidator.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Warning/Warning.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Parser/Parser.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Parser/DomainPart.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Parser/LocalPart.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Validation/EmailValidation.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/egulias/email-validator/EmailValidator/Validation/RFCValidation.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/classes/Swift/InputByteStream.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/classes/Swift/Signer.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php';
//require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/classes/Swift/SignedMessage.php';
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
// Create the message // Create the message
//$this->message = Swift_Message::newInstance(); //$this->message = Swift_Message::newInstance();
$this->message = new Swift_Message(); $this->message = new Swift_Message();
@ -430,10 +414,8 @@ class CMailFile
$this->errors[] = $e->getMessage(); $this->errors[] = $e->getMessage();
} }
if (! empty($this->html)) if (! empty($this->html)) {
{ if (!empty($css)) {
if (!empty($css))
{
$this->css = $css; $this->css = $css;
$this->buildCSS(); $this->buildCSS();
} }

View File

@ -21,13 +21,13 @@
* \brief File that include javascript functions for timepicker * \brief File that include javascript functions for timepicker
*/ */
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); if (! defined('NOLOGIN')) define('NOLOGIN', 1);
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
session_cache_limiter('public'); session_cache_limiter('public');

View File

@ -1065,7 +1065,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
* @param array $links Array of tabs. Currently initialized by calling a function xxx_admin_prepare_head * @param array $links Array of tabs. Currently initialized by calling a function xxx_admin_prepare_head
* @param string $active Active tab name (document', 'info', 'ldap', ....) * @param string $active Active tab name (document', 'info', 'ldap', ....)
* @param string $title Title * @param string $title Title
* @param int $notab -1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required. * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using dol_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after)
* @param string $picto Add a picto on tab title * @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @param string $morehtmlright Add more html content on right of tabs title * @param string $morehtmlright Add more html content on right of tabs title
@ -1083,7 +1083,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
* @param array $links Array of tabs * @param array $links Array of tabs
* @param string $active Active tab name * @param string $active Active tab name
* @param string $title Title * @param string $title Title
* @param int $notab -1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required. * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using dol_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after)
* @param string $picto Add a picto on tab title * @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @param string $morehtmlright Add more html content on right of tabs title * @param string $morehtmlright Add more html content on right of tabs title
@ -1232,7 +1232,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out.="</div>\n"; $out.="</div>\n";
if (! $notab || $notab == -1) $out.="\n".'<div class="tabBar'.($notab == -1 ? '' : ' tabBarWithBottom').'">'."\n"; if (! $notab || $notab == -1 || $notab == -2) $out.="\n".'<div class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ' tabBarWithBottom')).'">'."\n";
$parameters=array('tabname' => $active, 'out' => $out); $parameters=array('tabname' => $active, 'out' => $out);
$reshook=$hookmanager->executeHooks('printTabsHead', $parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead" $reshook=$hookmanager->executeHooks('printTabsHead', $parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead"

View File

@ -287,8 +287,7 @@ function dol_json_decode($json, $assoc = false)
*/ */
function _unval($val) function _unval($val)
{ {
while (preg_match('/\\\u([0-9A-F]{2})([0-9A-F]{2})/i', $val, $reg)) while (preg_match('/\\\u([0-9A-F]{2})([0-9A-F]{2})/i', $val, $reg)) {
{
// single, escaped unicode character // single, escaped unicode character
$utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2])); $utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2]));
$utf8 = utf162utf8($utf16); $utf8 = utf162utf8($utf16);
@ -310,7 +309,7 @@ function _unval($val)
function utf162utf8($utf16) function utf162utf8($utf16)
{ {
// oh please oh please oh please oh please oh please // oh please oh please oh please oh please oh please
if(function_exists('mb_convert_encoding')) { if (function_exists('mb_convert_encoding')) {
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
} }

View File

@ -428,9 +428,6 @@ if ($step == 1 || ! $datatoexport)
{ {
llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones'); llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
/*
* Affichage onglets
*/
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1'; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
@ -438,12 +435,6 @@ if ($step == 1 || ! $datatoexport)
$hselected=$h; $hselected=$h;
$h++; $h++;
/*
$head[$h][0] = '';
$head[$h][1] = $langs->trans("Step")." 2";
$h++;
*/
dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1); dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1);
@ -500,10 +491,6 @@ if ($step == 2 && $datatoexport)
{ {
llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones'); llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
/*
* Affichage onglets
*/
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1'; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
@ -515,7 +502,7 @@ if ($step == 2 && $datatoexport)
$hselected=$h; $hselected=$h;
$h++; $h++;
dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1); dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -2);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
@ -697,9 +684,6 @@ if ($step == 3 && $datatoexport)
llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones'); llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
/*
* Affichage onglets
*/
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1'; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
@ -715,7 +699,7 @@ if ($step == 3 && $datatoexport)
$hselected=$h; $hselected=$h;
$h++; $h++;
dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1); dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -2);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
@ -873,9 +857,6 @@ if ($step == 4 && $datatoexport)
llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones'); llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
/*
* Affichage onglets
*/
$stepoffset=0; $stepoffset=0;
$h = 0; $h = 0;
@ -901,7 +882,7 @@ if ($step == 4 && $datatoexport)
$hselected=$h; $hselected=$h;
$h++; $h++;
dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1); dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -2);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
@ -1121,9 +1102,6 @@ if ($step == 5 && $datatoexport)
llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones'); llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
/*
* Affichage onglets
*/
$h = 0; $h = 0;
$stepoffset=0; $stepoffset=0;
@ -1153,7 +1131,7 @@ if ($step == 5 && $datatoexport)
$hselected=$h; $hselected=$h;
$h++; $h++;
dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1); dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -2);
/* /*
* Confirmation suppression fichier * Confirmation suppression fichier

View File

@ -0,0 +1,13 @@
<?php
/*
* Bootstrap the library.
*/
namespace Egulias;
require_once __DIR__ . '/egulias/email-validator/AutoLoader.php';
$autoloader = new EguliasAutoLoader(__NAMESPACE__, dirname(__DIR__));
$autoloader->register();

View File

@ -0,0 +1,82 @@
<?php
namespace Egulias;
/**
* PSR-0 Autoloader
*
* @author ieter Hordijk <info@pieterhordijk.com>
*/
class EguliasAutoLoader
{
/**
* @var string The namespace prefix for this instance.
*/
protected $namespace = '';
/**
* @var string The filesystem prefix to use for this instance
*/
protected $path = '';
/**
* Build the instance of the autoloader
*
* @param string $namespace The prefixed namespace this instance will load
* @param string $path The filesystem path to the root of the namespace
*/
public function __construct($namespace, $path)
{
$this->namespace = ltrim($namespace, '\\');
$this->path = rtrim($path, '/\\') . DIRECTORY_SEPARATOR;
}
/**
* Try to load a class
*
* @param string $class The class name to load
*
* @return boolean If the loading was successful
*/
public function load($class)
{
$class = ltrim($class, '\\');
if (strpos($class, $this->namespace) === 0) {
$nsparts = explode('\\', $class);
$class = array_pop($nsparts);
$path = $this->path . 'swiftmailer/egulias/email-validator/EmailValidator/';
$max=count($nsparts);
for ($i=2; $i<$max;$i++) {
$path .= $nsparts[$i].'/';
}
$nsparts = array();
$path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
if (file_exists($path)) {
require $path;
return true;
}
}
return false;
}
/**
* Register the autoloader to PHP
*
* @return boolean The status of the registration
*/
public function register()
{
return spl_autoload_register(array($this, 'load'));
}
/**
* Unregister the autoloader to PHP
*
* @return boolean The status of the unregistration
*/
public function unregister()
{
return spl_autoload_unregister(array($this, 'load'));
}
}

View File

@ -18,15 +18,15 @@
*/ */
if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
if (!defined('NOREQUIREDB')) define('NOREQUIREDB','1'); if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
if (!defined('NOLOGIN')) define('NOLOGIN', 1); if (!defined('NOLOGIN')) define('NOLOGIN', 1);
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1);
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
/** /**

View File

@ -20,13 +20,13 @@
* \brief Fichier de javascript de traduction pour JSGantt * \brief Fichier de javascript de traduction pour JSGantt
*/ */
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); if (! defined('NOLOGIN')) define('NOLOGIN', 1);
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
require_once __DIR__.'/../main.inc.php'; require_once __DIR__.'/../main.inc.php';

View File

@ -2369,6 +2369,11 @@ div.tabBar div.titre {
padding-top: 20px; padding-top: 20px;
} }
div.tabBar.tabBarNoTop {
padding-top: 0;
border-top: 0;
}
/* tabBar used for creation/update/send forms */ /* tabBar used for creation/update/send forms */
div.tabBarWithBottom { div.tabBarWithBottom {
padding-bottom: 18px; padding-bottom: 18px;

View File

@ -2304,6 +2304,12 @@ div.tabBar {
div.tabBar div.titre { div.tabBar div.titre {
padding-top: 10px; padding-top: 10px;
} }
div.tabBar.tabBarNoTop {
padding-top: 0;
border-top: 0;
}
div.tabBarWithBottom { div.tabBarWithBottom {
padding-bottom: 18px; padding-bottom: 18px;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;