diff --git a/.editorconfig b/.editorconfig index 2df455f0d4f..a40a586406f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,8 @@ charset = utf-8 end_of_line = lf insert_final_newline = true [*.php] -indent_style = tab +indent_style = space +trim_trailing_whitespace = true [*.js] indent_style = tab [*.css] diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index ec9ded557ff..88b194f362b 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -22,7 +22,7 @@ * \brief This script create a xml checksum file */ -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db +if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); @@ -45,8 +45,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; $includecustom=0; $includeconstants=array(); -if (empty($argv[1])) -{ +if (empty($argv[1])) { print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit -1; @@ -54,14 +53,11 @@ if (empty($argv[1])) parse_str($argv[1]); $i=0; -while ($i < $argc) -{ +while ($i < $argc) { if (! empty($argv[$i])) parse_str($argv[$i]); - if (preg_match('/includeconstant=/',$argv[$i])) - { + if (preg_match('/includeconstant=/', $argv[$i])) { $tmp=explode(':', $includeconstant, 3); - if (count($tmp) != 3) - { + if (count($tmp) != 3) { print "Error: Bad parameter includeconstant ".$includeconstant."\n"; exit -1; } @@ -70,50 +66,39 @@ while ($i < $argc) $i++; } -if (empty($release)) -{ - print "Error: Missing release paramater\n"; - print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; +if (empty($release)) { + print "Error: Missing release paramater\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + exit -1; } $savrelease = $release; // If release is auto, we take current version $tmpver=explode('-', $release, 2); -if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') -{ - $release=DOL_VERSION; - if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1]; +if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') { + $release=DOL_VERSION; + if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1]; } -if (empty($includecustom)) -{ - $tmpverbis=explode('-', $release, 2); - if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable') - { - if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') - { - print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; - print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; - } - } - else - { - $tmpverter=explode('-', DOL_VERSION, 2); - if ($tmpverter[0] != $tmpverbis[0]) - { - print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; - print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; - } - } -} -else -{ - if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release)) - { +if (empty($includecustom)) { + $tmpverbis=explode('-', $release, 2); + if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable') { + if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') { + print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + exit -1; + } + } else { + $tmpverter=explode('-', DOL_VERSION, 2); + if ($tmpverter[0] != $tmpverbis[0]) { + print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + exit -1; + } + } +} else { + if (! preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) { print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; exit -1; @@ -123,10 +108,8 @@ else print "Release : ".$release."\n"; print "Include custom in signature : ".$includecustom."\n"; print "Include constants in signature : "; -foreach ($includeconstants as $countrycode => $tmp) -{ - foreach($tmp as $constname => $constvalue) - { +foreach ($includeconstants as $countrycode => $tmp) { + foreach($tmp as $constname => $constvalue) { print $constname.'='.$constvalue." "; } } @@ -135,20 +118,18 @@ print "\n"; //$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml'; $outputdir=dirname(dirname(__FILE__)).'/htdocs/install'; print 'Delete current files '.$outputdir.'/filelist*.xml'."\n"; -dol_delete_file($outputdir.'/filelist*.xml',0,1,1); +dol_delete_file($outputdir.'/filelist*.xml', 0, 1, 1); $checksumconcat=array(); $outputfile=$outputdir.'/filelist-'.$release.'.xml'; -$fp = fopen($outputfile,'w'); +$fp = fopen($outputfile, 'w'); fputs($fp, ''."\n"); fputs($fp, ''."\n"); -foreach ($includeconstants as $countrycode => $tmp) -{ +foreach ($includeconstants as $countrycode => $tmp) { fputs($fp, ''."\n"); - foreach($tmp as $constname => $constvalue) - { + foreach($tmp as $constname => $constvalue) { $valueforchecksum=(empty($constvalue)?'0':$constvalue); $checksumconcat[]=$valueforchecksum; fputs($fp, ' '.$valueforchecksum.''."\n"); @@ -169,10 +150,10 @@ $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoex $dir=''; $needtoclose=0; foreach ($files as $filetmp) { - $file = $filetmp['fullname']; - //$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file)); - $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); - if ($newdir!=$dir) { + $file = $filetmp['fullname']; + //$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file)); + $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); + if ($newdir!=$dir) { if ($needtoclose) fputs($fp, ' '."\n"); fputs($fp, ' '."\n"); @@ -191,7 +172,7 @@ fputs($fp, ''."\n"); asort($checksumconcat); // Sort list of checksum //var_dump($checksumconcat); fputs($fp, ''."\n"); -fputs($fp, md5(join(',',$checksumconcat))."\n"); +fputs($fp, md5(join(',', $checksumconcat))."\n"); fputs($fp, ''."\n"); @@ -211,10 +192,10 @@ $files = dol_dir_list(dirname(__FILE__).'/../scripts/', 'files', 1, $regextoincl $dir=''; $needtoclose=0; foreach ($files as $filetmp) { - $file = $filetmp['fullname']; - //$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); - $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); - $newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); + $file = $filetmp['fullname']; + //$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); + $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); + $newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); if ($newdir!=$dir) { if ($needtoclose) fputs($fp, ' '."\n"); @@ -233,7 +214,7 @@ fputs($fp, ''."\n"); asort($checksumconcat); // Sort list of checksum fputs($fp, ''."\n"); -fputs($fp, md5(join(',',$checksumconcat))."\n"); +fputs($fp, md5(join(',', $checksumconcat))."\n"); fputs($fp, ''."\n"); fputs($fp, ''."\n"); diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index e519c62a436..792341f5c79 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -89,13 +89,13 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } } else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index 95b047705fa..fa3fa573223 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -87,13 +87,13 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$com->error); + dol_print_error($db, $com->error); } } else { $error++; - dol_print_error($db,$com->error); + dol_print_error($db, $com->error); } diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 8cbc07a1b63..7ca09246980 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -86,7 +86,7 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$myproduct->error); + dol_print_error($db, $myproduct->error); } // -------------------- END OF YOUR CODE -------------------- diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index 4e6669de03c..2fed1a51972 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -77,7 +77,7 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } } elseif ($obj->error == 'ErrorLoginAlreadyExists') @@ -87,7 +87,7 @@ elseif ($obj->error == 'ErrorLoginAlreadyExists') else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php index daff0e43e6f..eafc0dfeed5 100755 --- a/dev/examples/code/get_contracts.php +++ b/dev/examples/code/get_contracts.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index 280518bd4e3..0f04a4d236f 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -43,59 +43,59 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; define(GEN_NUMBER_FACTURE, 1); $year = 2016; -$dates = array (mktime(12,0,0,1,3,$year), - mktime(12,0,0,1,9,$year), - mktime(12,0,0,2,13,$year), - mktime(12,0,0,2,23,$year), - mktime(12,0,0,3,30,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,5,9,$year), - mktime(12,0,0,5,1,$year), - mktime(12,0,0,5,13,$year), - mktime(12,0,0,5,19,$year), - mktime(12,0,0,5,23,$year), - mktime(12,0,0,6,3,$year), - mktime(12,0,0,6,19,$year), - mktime(12,0,0,6,24,$year), - mktime(12,0,0,7,3,$year), - mktime(12,0,0,7,9,$year), - mktime(12,0,0,7,23,$year), - mktime(12,0,0,7,30,$year), - mktime(12,0,0,8,9,$year), - mktime(12,0,0,9,23,$year), - mktime(12,0,0,10,3,$year), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,1,3,($year - 1)), - mktime(12,0,0,1,9,($year - 1)), - mktime(12,0,0,2,13,($year - 1)), - mktime(12,0,0,2,23,($year - 1)), - mktime(12,0,0,3,30,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,5,9,($year - 1)), - mktime(12,0,0,5,1,($year - 1)), - mktime(12,0,0,5,13,($year - 1)), - mktime(12,0,0,5,19,($year - 1)), - mktime(12,0,0,5,23,($year - 1)), - mktime(12,0,0,6,3,($year - 1)), - mktime(12,0,0,6,19,($year - 1)), - mktime(12,0,0,6,24,($year - 1)), - mktime(12,0,0,7,3,($year - 1)), - mktime(12,0,0,7,9,($year - 1)), - mktime(12,0,0,7,23,($year - 1)), - mktime(12,0,0,7,30,($year - 1)), - mktime(12,0,0,8,9,($year - 1)), - mktime(12,0,0,9,23,($year - 1)), - mktime(12,0,0,10,3,($year - 1)), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,12,12,$year), - mktime(12,0,0,12,13,$year), +$dates = array (mktime(12, 0, 0, 1, 3, $year), + mktime(12, 0, 0, 1, 9, $year), + mktime(12, 0, 0, 2, 13, $year), + mktime(12, 0, 0, 2, 23, $year), + mktime(12, 0, 0, 3, 30, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 5, 9, $year), + mktime(12, 0, 0, 5, 1, $year), + mktime(12, 0, 0, 5, 13, $year), + mktime(12, 0, 0, 5, 19, $year), + mktime(12, 0, 0, 5, 23, $year), + mktime(12, 0, 0, 6, 3, $year), + mktime(12, 0, 0, 6, 19, $year), + mktime(12, 0, 0, 6, 24, $year), + mktime(12, 0, 0, 7, 3, $year), + mktime(12, 0, 0, 7, 9, $year), + mktime(12, 0, 0, 7, 23, $year), + mktime(12, 0, 0, 7, 30, $year), + mktime(12, 0, 0, 8, 9, $year), + mktime(12, 0, 0, 9, 23, $year), + mktime(12, 0, 0, 10, 3, $year), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 1, 3, ($year - 1)), + mktime(12, 0, 0, 1, 9, ($year - 1)), + mktime(12, 0, 0, 2, 13, ($year - 1)), + mktime(12, 0, 0, 2, 23, ($year - 1)), + mktime(12, 0, 0, 3, 30, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 5, 9, ($year - 1)), + mktime(12, 0, 0, 5, 1, ($year - 1)), + mktime(12, 0, 0, 5, 13, ($year - 1)), + mktime(12, 0, 0, 5, 19, ($year - 1)), + mktime(12, 0, 0, 5, 23, ($year - 1)), + mktime(12, 0, 0, 6, 3, ($year - 1)), + mktime(12, 0, 0, 6, 19, ($year - 1)), + mktime(12, 0, 0, 6, 24, ($year - 1)), + mktime(12, 0, 0, 7, 3, ($year - 1)), + mktime(12, 0, 0, 7, 9, ($year - 1)), + mktime(12, 0, 0, 7, 23, ($year - 1)), + mktime(12, 0, 0, 7, 30, ($year - 1)), + mktime(12, 0, 0, 8, 9, ($year - 1)), + mktime(12, 0, 0, 9, 23, ($year - 1)), + mktime(12, 0, 0, 10, 3, ($year - 1)), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 12, 12, $year), + mktime(12, 0, 0, 12, 13, $year), ); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -150,7 +150,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) $object->mode_reglement_id = 3; $fuser = new User($db); - $fuser->fetch(mt_rand(1,2)); + $fuser->fetch(mt_rand(1, 2)); $fuser->getRights(); $result=$object->create($fuser); @@ -163,10 +163,10 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) $prodid = mt_rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); if ($result < 0) { - dol_print_error($db,$propal->error); + dol_print_error($db, $propal->error); } $xnbp++; } @@ -178,11 +178,11 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) } else { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } else { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index 8f8b4e2a2d9..1c9a4e259ca 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -49,59 +49,59 @@ require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; define(GEN_NUMBER_COMMANDE, 10); $year = 2016; -$dates = array (mktime(12,0,0,1,3,$year), - mktime(12,0,0,1,9,$year), - mktime(12,0,0,2,13,$year), - mktime(12,0,0,2,23,$year), - mktime(12,0,0,3,30,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,5,9,$year), - mktime(12,0,0,5,1,$year), - mktime(12,0,0,5,13,$year), - mktime(12,0,0,5,19,$year), - mktime(12,0,0,5,23,$year), - mktime(12,0,0,6,3,$year), - mktime(12,0,0,6,19,$year), - mktime(12,0,0,6,24,$year), - mktime(12,0,0,7,3,$year), - mktime(12,0,0,7,9,$year), - mktime(12,0,0,7,23,$year), - mktime(12,0,0,7,30,$year), - mktime(12,0,0,8,9,$year), - mktime(12,0,0,9,23,$year), - mktime(12,0,0,10,3,$year), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,1,3,($year - 1)), - mktime(12,0,0,1,9,($year - 1)), - mktime(12,0,0,2,13,($year - 1)), - mktime(12,0,0,2,23,($year - 1)), - mktime(12,0,0,3,30,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,5,9,($year - 1)), - mktime(12,0,0,5,1,($year - 1)), - mktime(12,0,0,5,13,($year - 1)), - mktime(12,0,0,5,19,($year - 1)), - mktime(12,0,0,5,23,($year - 1)), - mktime(12,0,0,6,3,($year - 1)), - mktime(12,0,0,6,19,($year - 1)), - mktime(12,0,0,6,24,($year - 1)), - mktime(12,0,0,7,3,($year - 1)), - mktime(12,0,0,7,9,($year - 1)), - mktime(12,0,0,7,23,($year - 1)), - mktime(12,0,0,7,30,($year - 1)), - mktime(12,0,0,8,9,($year - 1)), - mktime(12,0,0,9,23,($year - 1)), - mktime(12,0,0,10,3,($year - 1)), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,12,12,$year), - mktime(12,0,0,12,13,$year), +$dates = array (mktime(12, 0, 0, 1, 3, $year), + mktime(12, 0, 0, 1, 9, $year), + mktime(12, 0, 0, 2, 13, $year), + mktime(12, 0, 0, 2, 23, $year), + mktime(12, 0, 0, 3, 30, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 5, 9, $year), + mktime(12, 0, 0, 5, 1, $year), + mktime(12, 0, 0, 5, 13, $year), + mktime(12, 0, 0, 5, 19, $year), + mktime(12, 0, 0, 5, 23, $year), + mktime(12, 0, 0, 6, 3, $year), + mktime(12, 0, 0, 6, 19, $year), + mktime(12, 0, 0, 6, 24, $year), + mktime(12, 0, 0, 7, 3, $year), + mktime(12, 0, 0, 7, 9, $year), + mktime(12, 0, 0, 7, 23, $year), + mktime(12, 0, 0, 7, 30, $year), + mktime(12, 0, 0, 8, 9, $year), + mktime(12, 0, 0, 9, 23, $year), + mktime(12, 0, 0, 10, 3, $year), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 1, 3, ($year - 1)), + mktime(12, 0, 0, 1, 9, ($year - 1)), + mktime(12, 0, 0, 2, 13, ($year - 1)), + mktime(12, 0, 0, 2, 23, ($year - 1)), + mktime(12, 0, 0, 3, 30, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 5, 9, ($year - 1)), + mktime(12, 0, 0, 5, 1, ($year - 1)), + mktime(12, 0, 0, 5, 13, ($year - 1)), + mktime(12, 0, 0, 5, 19, ($year - 1)), + mktime(12, 0, 0, 5, 23, ($year - 1)), + mktime(12, 0, 0, 6, 3, ($year - 1)), + mktime(12, 0, 0, 6, 19, ($year - 1)), + mktime(12, 0, 0, 6, 24, ($year - 1)), + mktime(12, 0, 0, 7, 3, ($year - 1)), + mktime(12, 0, 0, 7, 9, ($year - 1)), + mktime(12, 0, 0, 7, 23, ($year - 1)), + mktime(12, 0, 0, 7, 30, ($year - 1)), + mktime(12, 0, 0, 8, 9, ($year - 1)), + mktime(12, 0, 0, 9, 23, ($year - 1)), + mktime(12, 0, 0, 10, 3, ($year - 1)), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 12, 12, $year), + mktime(12, 0, 0, 12, 13, $year), ); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if ($ret <= 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -174,7 +174,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $listofuserid=array(12,13,16); $fuser = new User($db); - $fuser->fetch($listofuserid[mt_rand(0,2)]); + $fuser->fetch($listofuserid[mt_rand(0, 2)]); $fuser->getRights(); $db->begin(); @@ -189,10 +189,10 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $prodid = mt_rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); + $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); if ($result <= 0) { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } $xnbp++; } @@ -207,13 +207,13 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) { print " KO\n"; $db->rollback(); - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } else { print " KO\n"; $db->rollback(); - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index f1b6c25e92a..9e1b15331d4 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -49,7 +49,7 @@ include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; define(GEN_NUMBER_PRODUIT, 100000); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -85,12 +85,12 @@ for ($s = 0 ; $s < GEN_NUMBER_PRODUIT ; $s++) { print "Product ".$s; $produit = new Product($db); - $produit->type = mt_rand(0,1); + $produit->type = mt_rand(0, 1); $produit->status = 1; $produit->ref = ($produit->type?'S':'P').time().$s; $produit->label = 'Label '.time().$s; $produit->description = 'Description '.time().$s; - $produit->price = mt_rand(1,1000); + $produit->price = mt_rand(1, 1000); $produit->tva_tx = "19.6"; $ret=$produit->create($user); if ($ret < 0) print "Error $ret - ".$produit->error."\n"; diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index eb2bfe15a00..4bd9c2c654b 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -45,59 +45,59 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; define(GEN_NUMBER_PROPAL, 10); $year = 2016; -$dates = array (mktime(12,0,0,1,3,$year), - mktime(12,0,0,1,9,$year), - mktime(12,0,0,2,13,$year), - mktime(12,0,0,2,23,$year), - mktime(12,0,0,3,30,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,5,9,$year), - mktime(12,0,0,5,1,$year), - mktime(12,0,0,5,13,$year), - mktime(12,0,0,5,19,$year), - mktime(12,0,0,5,23,$year), - mktime(12,0,0,6,3,$year), - mktime(12,0,0,6,19,$year), - mktime(12,0,0,6,24,$year), - mktime(12,0,0,7,3,$year), - mktime(12,0,0,7,9,$year), - mktime(12,0,0,7,23,$year), - mktime(12,0,0,7,30,$year), - mktime(12,0,0,8,9,$year), - mktime(12,0,0,9,23,$year), - mktime(12,0,0,10,3,$year), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,1,3,($year - 1)), - mktime(12,0,0,1,9,($year - 1)), - mktime(12,0,0,2,13,($year - 1)), - mktime(12,0,0,2,23,($year - 1)), - mktime(12,0,0,3,30,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,5,9,($year - 1)), - mktime(12,0,0,5,1,($year - 1)), - mktime(12,0,0,5,13,($year - 1)), - mktime(12,0,0,5,19,($year - 1)), - mktime(12,0,0,5,23,($year - 1)), - mktime(12,0,0,6,3,($year - 1)), - mktime(12,0,0,6,19,($year - 1)), - mktime(12,0,0,6,24,($year - 1)), - mktime(12,0,0,7,3,($year - 1)), - mktime(12,0,0,7,9,($year - 1)), - mktime(12,0,0,7,23,($year - 1)), - mktime(12,0,0,7,30,($year - 1)), - mktime(12,0,0,8,9,($year - 1)), - mktime(12,0,0,9,23,($year - 1)), - mktime(12,0,0,10,3,($year - 1)), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,12,12,$year), - mktime(12,0,0,12,13,$year), +$dates = array (mktime(12, 0, 0, 1, 3, $year), + mktime(12, 0, 0, 1, 9, $year), + mktime(12, 0, 0, 2, 13, $year), + mktime(12, 0, 0, 2, 23, $year), + mktime(12, 0, 0, 3, 30, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 5, 9, $year), + mktime(12, 0, 0, 5, 1, $year), + mktime(12, 0, 0, 5, 13, $year), + mktime(12, 0, 0, 5, 19, $year), + mktime(12, 0, 0, 5, 23, $year), + mktime(12, 0, 0, 6, 3, $year), + mktime(12, 0, 0, 6, 19, $year), + mktime(12, 0, 0, 6, 24, $year), + mktime(12, 0, 0, 7, 3, $year), + mktime(12, 0, 0, 7, 9, $year), + mktime(12, 0, 0, 7, 23, $year), + mktime(12, 0, 0, 7, 30, $year), + mktime(12, 0, 0, 8, 9, $year), + mktime(12, 0, 0, 9, 23, $year), + mktime(12, 0, 0, 10, 3, $year), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 1, 3, ($year - 1)), + mktime(12, 0, 0, 1, 9, ($year - 1)), + mktime(12, 0, 0, 2, 13, ($year - 1)), + mktime(12, 0, 0, 2, 23, ($year - 1)), + mktime(12, 0, 0, 3, 30, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 5, 9, ($year - 1)), + mktime(12, 0, 0, 5, 1, ($year - 1)), + mktime(12, 0, 0, 5, 13, ($year - 1)), + mktime(12, 0, 0, 5, 19, ($year - 1)), + mktime(12, 0, 0, 5, 23, ($year - 1)), + mktime(12, 0, 0, 6, 3, ($year - 1)), + mktime(12, 0, 0, 6, 19, ($year - 1)), + mktime(12, 0, 0, 6, 24, ($year - 1)), + mktime(12, 0, 0, 7, 3, ($year - 1)), + mktime(12, 0, 0, 7, 9, ($year - 1)), + mktime(12, 0, 0, 7, 23, ($year - 1)), + mktime(12, 0, 0, 7, 30, ($year - 1)), + mktime(12, 0, 0, 8, 9, ($year - 1)), + mktime(12, 0, 0, 9, 23, ($year - 1)), + mktime(12, 0, 0, 10, 3, ($year - 1)), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 12, 12, $year), + mktime(12, 0, 0, 12, 13, $year), ); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -174,7 +174,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $object = new Propal($db); $fuser = new User($db); - $fuser->fetch(mt_rand(1,2)); + $fuser->fetch(mt_rand(1, 2)); $fuser->getRights(); $object->contactid = $contids[$socids[$socid]][0]; @@ -193,10 +193,10 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $prodid = mt_rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0); + $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0); if ($result < 0) { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } $xnbp++; } @@ -211,11 +211,11 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) { print " KO\n"; $db->rollback(); - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } else { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 3744abeae7c..cc2e85e544a 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -52,7 +52,7 @@ $listoflastname = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Doroth define(GEN_NUMBER_SOCIETE, 10); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -91,22 +91,22 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) $soc = new Societe($db); $soc->name = "Company num ".time()."$s"; $soc->town = $listoftown[mt_rand(0, count($listoftown)-1)]; - $soc->client = mt_rand(1,2); // Une societe sur 2 est prospect, l'autre client - $soc->fournisseur = mt_rand(0,1); // Une societe sur 2 est fournisseur + $soc->client = mt_rand(1, 2); // Une societe sur 2 est prospect, l'autre client + $soc->fournisseur = mt_rand(0, 1); // Une societe sur 2 est fournisseur $soc->code_client='CU'.time()."$s"; $soc->code_fournisseur='SU'.time()."$s"; $soc->tva_assuj=1; $soc->country_id=1; $soc->country_code='FR'; // Un client sur 3 a une remise de 5% - $user_remise=mt_rand(1,3); if ($user_remise==3) $soc->remise_percent=5; + $user_remise=mt_rand(1, 3); if ($user_remise==3) $soc->remise_percent=5; print "> client=".$soc->client.", fournisseur=".$soc->fournisseur.", remise=".$soc->remise_percent."\n"; $soc->note_private = 'Company created by the script generate-societe.php'; $socid = $soc->create(); if ($socid >= 0) { - $rand = mt_rand(1,4); + $rand = mt_rand(1, 4); print "> Generates $rand contact(s)\n"; for ($c = 0 ; $c < $rand ; $c++) { diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 0f4856aefb2..4494e65c280 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/import-products.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -57,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $filepath = $argv[2]; @@ -66,7 +66,7 @@ $defaultlang = empty($argv[3])?'en_US':$argv[3]; $startlinenb = empty($argv[4])?1:$argv[4]; $endlinenb = empty($argv[5])?0:$argv[5]; -if (empty($mode) || ! in_array($mode,array('test','confirm','confirmforced')) || empty($filepath)) { +if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) || empty($filepath)) { print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [defaultlang] [startlinenb] [endlinenb]\n"; print "Usage: $script_file test myfilepath.csv fr_FR 2 1002\n"; print "\n"; @@ -78,7 +78,7 @@ if (! file_exists($filepath)) { exit(-1); } -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index 63c6856e5ec..69b9bb8bdc6 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/import-thirdparties.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -57,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $filepath = $argv[2]; @@ -66,7 +66,7 @@ $filepatherr = $filepath.'.err'; $startlinenb = empty($argv[3])?1:$argv[3]; $endlinenb = empty($argv[4])?0:$argv[4]; -if (empty($mode) || ! in_array($mode,array('test','confirm','confirmforced')) || empty($filepath)) { +if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) || empty($filepath)) { print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n"; print "Usage: $script_file test myfilepath.csv 2 1002\n"; print "\n"; @@ -78,7 +78,7 @@ if (! file_exists($filepath)) { exit(-1); } -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -199,13 +199,13 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { $salesrep=new User($db); - $tmp=explode(' ',$fields[3],2); + $tmp=explode(' ', $fields[3], 2); $salesrep->firstname = trim($tmp[0]); $salesrep->lastname = trim($tmp[1]); if ($salesrep->lastname) $salesrep->login = strtolower(substr($salesrep->firstname, 0, 1)) . strtolower(substr($salesrep->lastname, 0)); else $salesrep->login=strtolower($salesrep->firstname); - $salesrep->login=preg_replace('/ /','',$salesrep->login); - $salesrep->fetch(0,$salesrep->login); + $salesrep->login=preg_replace('/ /', '', $salesrep->login); + $salesrep->fetch(0, $salesrep->login); $result = $object->add_commercial($user, $salesrep->id); if ($result < 0) diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index c94f74341f6..2a1dcc3d826 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/import-users.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -57,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $filepath = $argv[2]; @@ -66,7 +66,7 @@ $filepatherr = $filepath.'.err'; $startlinenb = empty($argv[3])?1:$argv[3]; $endlinenb = empty($argv[4])?0:$argv[4]; -if (empty($mode) || ! in_array($mode,array('test','confirm','confirmforced')) || empty($filepath)) { +if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) || empty($filepath)) { print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n"; print "Usage: $script_file test myfilepath.csv 2 1002\n"; print "\n"; @@ -78,7 +78,7 @@ if (! file_exists($filepath)) { exit(-1); } -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -127,12 +127,12 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $object = new User($db); $object->statut = 1; - $tmp=explode(' ',$fields[3],2); + $tmp=explode(' ', $fields[3], 2); $object->firstname = trim($tmp[0]); $object->lastname = trim($tmp[1]); if ($object->lastname) $object->login = strtolower(substr($object->firstname, 0, 1)) . strtolower(substr($object->lastname, 0)); else $object->login=strtolower($object->firstname); - $object->login=preg_replace('/ /','',$object->login); + $object->login=preg_replace('/ /', '', $object->login); $object->password = 'init'; print "Process line nb ".$i.", login ".$object->login; diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 63a10d84bc5..5964d0d3e62 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/purge-data.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -150,22 +150,22 @@ $sqls=array( @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $option = $argv[2]; -if (empty($mode) || ! in_array($mode,array('test','confirm'))) { +if (empty($mode) || ! in_array($mode, array('test','confirm'))) { print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; print "\n"; - print "option can be ".implode(',',array_keys($sqls))."\n"; + print "option can be ".implode(',', array_keys($sqls))."\n"; exit(-1); } -if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) { +if (empty($option) || ! in_array($option, array_merge(array('all'), array_keys($sqls))) ) { print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; print "\n"; - print "option can be ".implode(',',array_keys($sqls))."\n"; + print "option can be ".implode(',', array_keys($sqls))."\n"; exit(-1); } @@ -179,7 +179,7 @@ if (! empty($argv[3])) } //var_dump($user->db->database_name); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'An admin user with login "admin" must exists to use this script.'."\n"; @@ -215,9 +215,9 @@ function processfamily($family) $error=0; foreach($sqls[$family] as $sql) { - if (preg_match('/^@/',$sql)) + if (preg_match('/^@/', $sql)) { - $newfamily=preg_replace('/@/','',$sql); + $newfamily=preg_replace('/@/', '', $sql); processfamily($newfamily); continue; } diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php index 98cb6189935..e9641ac6816 100755 --- a/dev/initdemo/sftpget_and_loaddump.php +++ b/dev/initdemo/sftpget_and_loaddump.php @@ -46,8 +46,8 @@ if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $p if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res) die ("Failed to include master.inc.php file\n"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -58,7 +58,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $login=''; $server=''; -if (preg_match('/^(.*)@(.*):(.*)$/',$sourceserver,$reg)) +if (preg_match('/^(.*)@(.*):(.*)$/', $sourceserver, $reg)) { $login=$reg[1]; $server=$reg[2]; @@ -84,7 +84,7 @@ print 'SFTP connect string : '.$sftpconnectstring."\n"; // SFTP connect if (! function_exists("ssh2_connect")) { - dol_print_error('','ssh2_connect function does not exists'); exit(1); + dol_print_error('', 'ssh2_connect function does not exists'); exit(1); } $connection = ssh2_connect($server, 22); @@ -92,7 +92,7 @@ if ($connection) { if (! @ssh2_auth_password($connection, $login, $password)) { - dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password),LOG_ERR); + dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR); exit(-5); } else @@ -112,11 +112,11 @@ if ($connection) ssh2_scp_recv($connection, $sourcefile, $targetdir.$targetfile); $fullcommand="cat ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database; - if (preg_match('/\.bz2$/',$targetfile)) + if (preg_match('/\.bz2$/', $targetfile)) { $fullcommand="bzip2 -c -d ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database; } - if (preg_match('/\.gz$/',$targetfile)) + if (preg_match('/\.gz$/', $targetfile)) { $fullcommand="gzip -d ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database; } diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index 53717314d5f..606bdbe6f56 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -41,8 +41,8 @@ if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $p if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res) die ("Failed to include master.inc.php file\n"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 989e9535297..a82086fe313 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -112,9 +112,6 @@ - - 0 - 0 @@ -192,6 +189,9 @@ + + + @@ -434,5 +434,5 @@ - + diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 569bcc9dfd4..4da15890045 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -63,7 +63,7 @@ class autoTranslator // Translate //ini_set('default_charset','UTF-8'); - ini_set('default_charset',$this->_outputpagecode); + ini_set('default_charset', $this->_outputpagecode); $this->parseRefLangTranslationFiles(); } @@ -83,7 +83,7 @@ class autoTranslator $counter++; $fileContent = null; $refPath = $this->_langDir.$this->_refLang.self::DIR_SEPARATOR.$file; - $fileContent = file($refPath,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); + $fileContent = file($refPath, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); print "Processing file " . $file . ", with ".count($fileContent)." lines
\n"; // Define target dirs @@ -93,19 +93,19 @@ class autoTranslator $targetlangs=array(); // If we must process all languages - $arraytmp=dol_dir_list($this->_langDir,'directories',0); + $arraytmp=dol_dir_list($this->_langDir, 'directories', 0); foreach($arraytmp as $dirtmp) { if ($dirtmp['name'] === $this->_refLang) continue; // We discard source language - $tmppart=explode('_',$dirtmp['name']); - if (preg_match('/^en/i',$dirtmp['name'])) continue; // We discard en_* languages - if (preg_match('/^fr/i',$dirtmp['name'])) continue; // We discard fr_* languages - if (preg_match('/^es/i',$dirtmp['name'])) continue; // We discard es_* languages - if (preg_match('/ca_ES/i',$dirtmp['name'])) continue; // We discard es_CA language - if (preg_match('/pt_BR/i',$dirtmp['name'])) continue; // We discard pt_BR language - if (preg_match('/nl_BE/i',$dirtmp['name'])) continue; // We discard nl_BE language - if (preg_match('/^\./i',$dirtmp['name'])) continue; // We discard files .* - if (preg_match('/^CVS/i',$dirtmp['name'])) continue; // We discard CVS + $tmppart=explode('_', $dirtmp['name']); + if (preg_match('/^en/i', $dirtmp['name'])) continue; // We discard en_* languages + if (preg_match('/^fr/i', $dirtmp['name'])) continue; // We discard fr_* languages + if (preg_match('/^es/i', $dirtmp['name'])) continue; // We discard es_* languages + if (preg_match('/ca_ES/i', $dirtmp['name'])) continue; // We discard es_CA language + if (preg_match('/pt_BR/i', $dirtmp['name'])) continue; // We discard pt_BR language + if (preg_match('/nl_BE/i', $dirtmp['name'])) continue; // We discard nl_BE language + if (preg_match('/^\./i', $dirtmp['name'])) continue; // We discard files .* + if (preg_match('/^CVS/i', $dirtmp['name'])) continue; // We discard CVS $targetlangs[]=$dirtmp['name']; } //var_dump($targetlangs); @@ -122,7 +122,7 @@ class autoTranslator { // No file present, we generate file echo "File not found: " . $destPath . ". We generate it.
\n"; - $this->createTranslationFile($destPath,$my_destlang); + $this->createTranslationFile($destPath, $my_destlang); } else { @@ -130,18 +130,18 @@ class autoTranslator } // Translate lines - $fileContentDest = file($destPath,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); + $fileContentDest = file($destPath, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); $newlines=0; foreach($fileContent as $line){ $key = $this->getLineKey($line); $value = $this->getLineValue($line); if ($key && $value) { - $newlines+=$this->translateFileLine($fileContentDest,$file,$key,$value,$my_destlang); + $newlines+=$this->translateFileLine($fileContentDest, $file, $key, $value, $my_destlang); } } - $this->updateTranslationFile($destPath,$file,$my_destlang); + $this->updateTranslationFile($destPath, $file, $my_destlang); echo "New translated lines: " . $newlines . "
\n"; //if ($counter ==3) die('fim'); } @@ -167,7 +167,7 @@ class autoTranslator fwrite($fp, "\n"); fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\n"); fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\n"); - foreach( $this->_translatedFiles[$file] as $line) { + foreach($this->_translatedFiles[$file] as $line) { fwrite($fp, $line . "\n"); } fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\n"); @@ -209,7 +209,7 @@ class autoTranslator { //print "key =".$key."\n"; - foreach( $content as $line ) { + foreach($content as $line) { $destKey = $this->getLineKey($line); $destValue = $this->getLineValue($line); // If translated return @@ -220,14 +220,16 @@ class autoTranslator } } - if ($key == 'CHARSET') $val=$this->_outputpagecode; - elseif (preg_match('/^Format/',$key)) $val=$value; - elseif ($value=='-') $val=$value; - else - { + if ($key == 'CHARSET') { + $val=$this->_outputpagecode; + } elseif (preg_match('/^Format/', $key)) { + $val=$value; + } elseif ($value=='-') { + $val=$value; + } else { // If not translated then translate - if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value),substr($this->_refLang,0,2),substr($my_destlang,0,2)); - else $val=utf8_decode($this->translateTexts(array($value),substr($this->_refLang,0,2),substr($my_destlang,0,2))); + if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)); + else $val=utf8_decode($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2))); } $val=trim($val); @@ -246,7 +248,7 @@ class autoTranslator */ private function getLineKey($line) { - $arraykey = explode('=',$line,2); + $arraykey = explode('=', $line, 2); return trim($arraykey[0]); } @@ -258,7 +260,7 @@ class autoTranslator */ private function getLineValue($line) { - $arraykey = explode('=',$line,2); + $arraykey = explode('=', $line, 2); return trim(isset($arraykey[1])?$arraykey[1]:''); } @@ -272,7 +274,7 @@ class autoTranslator { $dir = new DirectoryIterator($this->_langDir.$lang); while($dir->valid()) { - if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) { + if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { $files[] = $dir->getFilename(); } $dir->next(); @@ -291,16 +293,16 @@ class autoTranslator private function translateTexts($src_texts, $src_lang, $dest_lang) { // We want to be sure that src_lang and dest_lang are using 2 chars only - $tmp=explode('_',$src_lang); + $tmp=explode('_', $src_lang); if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) $src_lang=$tmp[0]; - $tmp=explode('_',$dest_lang); + $tmp=explode('_', $dest_lang); if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) $dest_lang=$tmp[0]; //setting language pair $lang_pair = $src_lang.'|'.$dest_lang; - $src_text_to_translate=preg_replace('/%s/','SSSSS',implode('',$src_texts)); - $src_text_to_translate=preg_replace('/'.preg_quote('\n\n').'/',' NNNNN ',$src_text_to_translate); + $src_text_to_translate=preg_replace('/%s/', 'SSSSS', implode('', $src_texts)); + $src_text_to_translate=preg_replace('/'.preg_quote('\n\n').'/', ' NNNNN ', $src_text_to_translate); // Define GET URL v1 //$url = "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=".urlencode($src_text_to_translate)."&langpair=".urlencode($lang_pair); @@ -337,9 +339,9 @@ class autoTranslator } $rep=$json['data']['translations'][0]['translatedText']; - $rep=preg_replace('/SSSSS/i','%s',$rep); - $rep=preg_replace('/NNNNN/i','\n\n',$rep); - $rep=preg_replace('/'/i','\'',$rep); + $rep=preg_replace('/SSSSS/i', '%s', $rep); + $rep=preg_replace('/NNNNN/i', '\n\n', $rep); + $rep=preg_replace('/'/i', '\'', $rep); //print "OK ".join('',$src_texts).' => '.$rep."\n"; diff --git a/dev/translation/autotranslator.php b/dev/translation/autotranslator.php index c7897810a72..eb0f53ead65 100755 --- a/dev/translation/autotranslator.php +++ b/dev/translation/autotranslator.php @@ -90,7 +90,7 @@ if ($argv[2] != 'all') require_once DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php"; -$langParser = new autoTranslator($argv[2],$argv[1],$dir,$file,$argv[3]); +$langParser = new autoTranslator($argv[2], $argv[1], $dir, $file, $argv[3]); print "***** Finished *****\n"; diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 556a0fce254..4db931f7dae 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -113,7 +113,7 @@ if (empty($files)) $dups=array(); $exludefiles = array('.','..','README'); -$files = array_diff($files,$exludefiles); +$files = array_diff($files, $exludefiles); // To force a file: $files=array('myfile.lang'); if (isset($argv[2])) { @@ -128,10 +128,10 @@ foreach ($files AS $file) { $content = file($workdir.$file); foreach ($content AS $line => $row) { // don't want comment lines - if (substr($row,0,1) !== '#') { + if (substr($row, 0, 1) !== '#') { // don't want lines without the separator (why should those even be here, anyway...) - if (strpos($row,'=')!==false) { - $row_array = explode('=',$row); // $row_array[0] = key + if (strpos($row, '=')!==false) { + $row_array = explode('=', $row); // $row_array[0] = key $langstrings_3d[$path_file['basename']][$line+1]=$row_array[0]; $langstrings_3dtrans[$path_file['basename']][$line+1]=$row_array[1]; $langstrings_full[]=$row_array[0]; @@ -355,7 +355,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a $search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')" -e "('.$value.',"'; $string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*'; //print $string."
\n"; - exec($string,$output); + exec($string, $output); if (empty($output)) { $unused[$value] = $line; echo $line; // $trad contains the \n @@ -372,7 +372,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a { $filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang'; print "Strings in en_US that are never used are saved into file ".$filetosave.":\n"; - file_put_contents($filetosave, implode("",$unused)); + file_put_contents($filetosave, implode("", $unused)); print "To remove from original file, run command :\n"; if (($argv[2]?$argv[2]:"")) print 'cd htdocs/langs/en_US; mv '.($argv[2]?$argv[2]:"")." ".($argv[2]?$argv[2]:"").".tmp; "; print "diff ".($argv[2]?$argv[2]:"").".tmp ".$filetosave." | grep \< | cut -b 3- > ".($argv[2]?$argv[2]:""); diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index 685626d6c11..d439397a512 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -81,14 +81,14 @@ if ($filesToProcess == 'all') { $dir = new DirectoryIterator('htdocs/langs/'.$lPrimary); while($dir->valid()) { - if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) { + if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { $files[] = $dir->getFilename(); } $dir->next(); } $filesToProcess=$files; } -else $filesToProcess=explode(',',$filesToProcess); +else $filesToProcess=explode(',', $filesToProcess); // Arguments should be OK here. @@ -256,7 +256,7 @@ foreach($filesToProcess as $fileToProcess) print "Read Primary File $lPrimaryFile and write ".$output.":\n"; - fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/','',$fileToProcess))."\n"); + fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n"); $cnt = 0; while (($line = fgets($handle)) !== false) @@ -306,7 +306,7 @@ foreach($filesToProcess as $fileToProcess) //print "Found primary key = ".$key."\n"; // Key not in other file - if (in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)) + if (in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)) { //print "Key $key is a key we always want to see into secondary file (line: $cnt).\n"; } @@ -320,7 +320,7 @@ foreach($filesToProcess as $fileToProcess) if ( (! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] && ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) - || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key) + || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key) ) { //print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n"; diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 6a6e1f44a6a..f551cf3e716 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -32,27 +32,27 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php $langs->loadLangs(array("compta","bills","admin","accountancy","salaries")); $mesg = ''; -$action = GETPOST('action','aZ09'); -$cancel = GETPOST('cancel','alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'alpha'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist'; // To manage different context of search +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'accountingaccountlist'; // To manage different context of search -$search_account = GETPOST('search_account','alpha'); -$search_label = GETPOST('search_label','alpha'); -$search_accountparent = GETPOST('search_accountparent','alpha'); -$search_pcgtype = GETPOST('search_pcgtype','alpha'); -$search_pcgsubtype = GETPOST('search_pcgsubtype','alpha'); +$search_account = GETPOST('search_account', 'alpha'); +$search_label = GETPOST('search_label', 'alpha'); +$search_accountparent = GETPOST('search_accountparent', 'alpha'); +$search_pcgtype = GETPOST('search_pcgtype', 'alpha'); +$search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha'); // Security check if ($user->societe_id > 0) accessforbidden(); if (! $user->rights->accounting->chartofaccount) accessforbidden(); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -77,11 +77,11 @@ $accounting = new AccountingAccount($db); * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha')) { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha')) { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -90,7 +90,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $search_account = ""; $search_label = ""; @@ -100,7 +100,7 @@ if (empty($reshook)) $search_array_options=array(); } - if (GETPOST('change_chart','alpha')) + if (GETPOST('change_chart', 'alpha')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); @@ -305,13 +305,13 @@ if ($resql) print ''; print ''; - if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_type']['help']); - if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_subtype']['help']); - if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"], "aa.label", "", $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, 'align="left"', $sortfield, $sortorder); + if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help']); + if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_subtype', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_subtype']['help']); + if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; $accountstatic = new AccountingAccount($db); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 6a3a8c16812..9f31fa663ed 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -44,30 +44,30 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core // Load translation files required by the page $langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm")); -$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; +$confirm=GETPOST('confirm', 'alpha'); $id=31; -$rowid=GETPOST('rowid','alpha'); -$code=GETPOST('code','alpha'); +$rowid=GETPOST('rowid', 'alpha'); +$code=GETPOST('code', 'alpha'); $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); -$listoffset=GETPOST('listoffset','alpha'); -$listlimit=GETPOST('listlimit','int')>0?GETPOST('listlimit','int'):1000; +$listoffset=GETPOST('listoffset', 'alpha'); +$listlimit=GETPOST('listlimit', 'int')>0?GETPOST('listlimit', 'int'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'aZ09comma'); -$sortorder = GETPOST("sortorder",'aZ09comma'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'aZ09comma'); +$sortorder = GETPOST("sortorder", 'aZ09comma'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$search_country_id = GETPOST('search_country_id','int'); +$search_country_id = GETPOST('search_country_id', 'int'); // Security check @@ -139,25 +139,25 @@ $sourceList=array(); * Actions */ -if (GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter_x','alpha')) +if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) { $search_country_id = ''; } // Actions add or modify an entry into a dictionary -if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) +if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancyCategory','Pcg_version'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancyCategory','Pcg_version'))) continue; // For some pages, country is not mandatory + if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; @@ -192,7 +192,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) } } // Other checks - if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { + if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system','systemauto'))) { $ok=0; setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } @@ -211,14 +211,14 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) } if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2)) { - if (in_array($tablib[$id],array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries + if (in_array($tablib[$id], array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries { $_POST["country"]=''; } else { $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } } if (! is_numeric($_POST["code"])) @@ -235,7 +235,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null // Si verif ok et action add, on ajoute la ligne - if ($ok && GETPOST('actionadd','alpha')) + if ($ok && GETPOST('actionadd', 'alpha')) { if ($tabrowid[$id]) { @@ -255,20 +255,20 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; $sql.=",active)"; $sql.= " VALUES("; // List of values - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $newid.","; $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } elseif ($value == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; @@ -299,7 +299,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) } // Si verif ok et action modify, on modifie la ligne - if ($ok && GETPOST('actionmodify','alpha')) + if ($ok && GETPOST('actionmodify', 'alpha')) { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -307,7 +307,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldmodify)) { $sql.= $tabrowid[$id]."="; $sql.= "'".$db->escape($rowid)."', "; @@ -315,8 +315,8 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } elseif ($field == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; @@ -340,7 +340,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -if (GETPOST('actioncancel','alpha')) +if (GETPOST('actioncancel', 'alpha')) { //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } @@ -460,7 +460,7 @@ llxHeader(); $titre=$langs->trans($tablib[$id]); $linkback=''; -print load_fiche_titre($titre,$linkback,'title_accountancy'); +print load_fiche_titre($titre, $linkback, 'title_accountancy'); print "
\n"; @@ -468,7 +468,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.urlencode($page).'&':'').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.urlencode($page).'&':'').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -482,18 +482,18 @@ if ($id) if ($search_country_id > 0) { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; + if (preg_match('/ WHERE /', $sql)) $sql.= " AND "; else $sql.=" WHERE "; $sql.= " c.rowid = ".$search_country_id; } // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; - $sql.=$db->order($sortfield,$sortorder); - $sql.=$db->plimit($listlimit+1,$offset); + $sql.=$db->order($sortfield, $sortorder); + $sql.=$db->plimit($listlimit+1, $offset); //print $sql; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print '
'; print ''; @@ -507,7 +507,7 @@ if ($id) $alabelisused=0; $var=false; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); // Line for title print ''; @@ -525,18 +525,21 @@ if ($id) if ($id != 25) $valuetoshow.="*"; } if ($fieldlist[$field]=='country') { - if (in_array('region_id',$fieldlist)) { print ' '; continue; } // For region page, we do not show the country input + if (in_array('region_id', $fieldlist)) { print ' '; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='country_id') { $valuetoshow=''; } if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } - if ($valuetoshow != '') - { + if ($valuetoshow != '') { print ''; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; - elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); - else print $valuetoshow; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { + print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + } elseif (! empty($tabhelp[$id][$value])) { + print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); + } else { + print $valuetoshow; + } print ''; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; @@ -554,7 +557,7 @@ if ($id) $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd','alpha')) + if (GETPOST('actionadd', 'alpha')) { foreach ($fieldlist as $key=>$val) { @@ -565,12 +568,12 @@ if ($id) $tmpaction = 'create'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; if (empty($reshook)) { - fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); + fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'add'); } print ''; @@ -697,10 +700,10 @@ if ($id) $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit'); print ' '; print ' '; @@ -709,7 +712,7 @@ if ($id) { $tmpaction = 'view'; $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -826,7 +829,7 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = { if ($fieldlist[$field] == 'country') { - if (in_array('region_id',$fieldlist)) + if (in_array('region_id', $fieldlist)) { print ''; //print join(',',$fieldlist); @@ -840,7 +843,7 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = } elseif ($fieldlist[$field] == 'country_id') { - if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) + if (! in_array('country', $fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0); print ''; @@ -854,7 +857,7 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = if ($fieldlist[$field] == 'type_cdr') { print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); } else { - print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); + print $form->selectyesno($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1); } print ''; } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 449d425b846..6d43f01b03f 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -35,13 +35,13 @@ $error = 0; $langs->loadLangs(array("bills","accountancy")); $mesg = ''; -$action = GETPOST('action','aZ09'); -$backtopage = GETPOST('backtopage','alpha'); +$action = GETPOST('action', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $rowid = GETPOST('rowid', 'int'); -$cancel = GETPOST('cancel','alpha'); -$accountingaccount = GETPOST('accountingaccount','alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$accountingaccount = GETPOST('accountingaccount', 'alpha'); // Security check @@ -53,9 +53,9 @@ $object = new AccountingAccount($db); * Action */ -if (GETPOST('cancel','alpha')) +if (GETPOST('cancel', 'alpha')) { - $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php',1); + $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php', 1); header("Location: ".$urltogo); exit; } @@ -74,28 +74,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) // To manage zero or not at the end of the accounting account if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { - $account_number = GETPOST('account_number','string'); + $account_number = GETPOST('account_number', 'string'); } else { - $account_number = clean_account(GETPOST('account_number','string')); + $account_number = clean_account(GETPOST('account_number', 'string')); } - if (GETPOST('account_parent','int') <= 0) + if (GETPOST('account_parent', 'int') <= 0) { $account_parent = 0; } else { - $account_parent = GETPOST('account_parent','int'); + $account_parent = GETPOST('account_parent', 'int'); } $object->fk_pcg_version = $obj->pcg_version; - $object->pcg_type = GETPOST('pcg_type','alpha'); - $object->pcg_subtype = GETPOST('pcg_subtype','alpha'); + $object->pcg_type = GETPOST('pcg_type', 'alpha'); + $object->pcg_subtype = GETPOST('pcg_subtype', 'alpha'); $object->account_number = $account_number; $object->account_parent = $account_parent; - $object->account_category = GETPOST('account_category','alpha'); + $object->account_category = GETPOST('account_category', 'alpha'); $object->label = GETPOST('label', 'alpha'); $object->active = 1; @@ -118,8 +118,8 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) } if (! $error) { - setEventMessages("RecordCreatedSuccessfully",null,'mesgs'); - $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php',1); + setEventMessages("RecordCreatedSuccessfully", null, 'mesgs'); + $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php', 1); header("Location: ".$urltogo); exit; } @@ -139,28 +139,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) // To manage zero or not at the end of the accounting account if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { - $account_number = GETPOST('account_number','string'); + $account_number = GETPOST('account_number', 'string'); } else { - $account_number = clean_account(GETPOST('account_number','string')); + $account_number = clean_account(GETPOST('account_number', 'string')); } - if (GETPOST('account_parent','int') <= 0) + if (GETPOST('account_parent', 'int') <= 0) { $account_parent = 0; } else { - $account_parent = GETPOST('account_parent','int'); + $account_parent = GETPOST('account_parent', 'int'); } $object->fk_pcg_version = $obj->pcg_version; - $object->pcg_type = GETPOST('pcg_type','alpha'); - $object->pcg_subtype = GETPOST('pcg_subtype','alpha'); + $object->pcg_type = GETPOST('pcg_type', 'alpha'); + $object->pcg_subtype = GETPOST('pcg_subtype', 'alpha'); $object->account_number = $account_number; $object->account_parent = $account_parent; - $object->account_category = GETPOST('account_category','alpha'); + $object->account_category = GETPOST('account_category', 'alpha'); $object->label = GETPOST('label', 'alpha'); $result = $object->update($user); @@ -251,13 +251,13 @@ if ($action == 'create') { // Chart of accounts type print '' . $langs->trans("Pcgtype") . ''; print ''; - print ''; + print ''; print ''; // Chart of acounts subtype print '' . $langs->trans("Pcgsubtype") . ''; print ''; - print ''; + print ''; print ''; print ''; @@ -317,13 +317,13 @@ elseif ($id > 0 || $ref) { // Chart of accounts type print '' . $langs->trans("Pcgtype") . ''; print ''; - print ''; + print ''; print ''; // Chart of accounts subtype print '' . $langs->trans("Pcgsubtype") . ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 14eec9fa58a..decae324ac5 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -35,11 +35,11 @@ $langs->loadLangs(array("bills","accountancy")); $mesg = ''; $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); -$cancel = GETPOST('cancel','alpha'); -$action = GETPOST('action','aZ09'); -$cat_id = GETPOST('account_category','int'); +$cancel = GETPOST('cancel', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cat_id = GETPOST('account_category', 'int'); $selectcpt = GETPOST('cpt_bk', 'array'); -$cpt_id = GETPOST('cptid','int'); +$cpt_id = GETPOST('cptid', 'int'); if ($cat_id == 0) { $cat_id = null; @@ -61,7 +61,7 @@ $accountingcategory = new AccountancyCategory($db); // si ajout de comptes if (! empty($selectcpt)) { $cpts = array (); - foreach ( $selectcpt as $selectedoption ) { + foreach ($selectcpt as $selectedoption) { if (! array_key_exists($selectedoption, $cpts)) $cpts[$selectedoption] = "'" . $selectedoption . "'"; } @@ -167,7 +167,7 @@ if ($action == 'display' || $action == 'delete') { } if (is_array($accountingcategory->lines_display) && count($accountingcategory->lines_display) > 0) { - foreach ( $accountingcategory->lines_display as $cpt ) { + foreach ($accountingcategory->lines_display as $cpt) { print ''; print '' . length_accountg($cpt->account_number) . ''; print '' . $cpt->label . ''; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index bb3db6fd0bf..7cb7d7d27f2 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -34,11 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","companies","resource","holiday","accountancy","hrm")); -$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; +$confirm=GETPOST('confirm', 'alpha'); $id=32; -$rowid=GETPOST('rowid','alpha'); -$code=GETPOST('code','alpha'); +$rowid=GETPOST('rowid', 'alpha'); +$code=GETPOST('code', 'alpha'); // Security access if (empty($user->rights->accounting->chartofaccount)) @@ -48,22 +48,22 @@ if (empty($user->rights->accounting->chartofaccount)) $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); -$listoffset=GETPOST('listoffset','alpha'); -$listlimit=GETPOST('listlimit','int')>0?GETPOST('listlimit','int'):1000; +$listoffset=GETPOST('listoffset', 'alpha'); +$listlimit=GETPOST('listlimit', 'int')>0?GETPOST('listlimit', 'int'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'aZ09comma'); -$sortorder = GETPOST("sortorder",'aZ09comma'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'aZ09comma'); +$sortorder = GETPOST("sortorder", 'aZ09comma'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$search_country_id = GETPOST('search_country_id','int'); +$search_country_id = GETPOST('search_country_id', 'int'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); @@ -121,7 +121,7 @@ $tabfieldcheck=array(); $tabfieldcheck[32] = array(); // Complete all arrays with entries found into modules -complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); +complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") @@ -134,18 +134,18 @@ $sourceList=array(); * Actions */ -if (GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter_x','alpha')) +if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) { $search_country_id = ''; } // Actions add or modify an entry into a dictionary -if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) +if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; @@ -177,7 +177,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); } } - if (! is_numeric(GETPOST('position','alpha'))) + if (! is_numeric(GETPOST('position', 'alpha'))) { $langs->loadLangs(array("errors")); $ok=0; @@ -190,7 +190,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null // Si verif ok et action add, on ajoute la ligne - if ($ok && GETPOST('actionadd','alpha')) + if ($ok && GETPOST('actionadd', 'alpha')) { if ($tabrowid[$id]) { @@ -210,13 +210,13 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) $sql.= $tabrowid[$id].","; + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; $sql.=",active)"; $sql.= " VALUES("; // List of values - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) $sql.= $newid.","; + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $newid.","; $i=0; foreach ($listfieldinsert as $f => $value) { @@ -249,7 +249,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) } // Si verif ok et action modify, on modifie la ligne - if ($ok && GETPOST('actionmodify','alpha')) + if ($ok && GETPOST('actionmodify', 'alpha')) { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -257,7 +257,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldmodify)) { $sql.= $tabrowid[$id]."="; $sql.= "'".$db->escape($rowid)."', "; @@ -290,7 +290,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -if (GETPOST('actioncancel','alpha')) +if (GETPOST('actioncancel', 'alpha')) { //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } @@ -418,7 +418,7 @@ print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id>0?'&search_country_id='.$search_country_id:''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id>0?'&search_country_id='.$search_country_id:''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -432,22 +432,22 @@ if ($id) if ($search_country_id > 0) { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; + if (preg_match('/ WHERE /', $sql)) $sql.= " AND "; else $sql.=" WHERE "; $sql.= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)"; } // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; - $sql.=$db->order($sortfield,$sortorder); - $sql.=$db->plimit($listlimit+1,$offset); + $sql.=$db->order($sortfield, $sortorder); + $sql.=$db->plimit($listlimit+1, $offset); //print $sql; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print ''; print ''; - print ''; + print ''; print '
'; print ''; @@ -457,7 +457,7 @@ if ($id) { $alabelisused=0; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); // Line for title print ''; @@ -469,7 +469,7 @@ if ($id) $valuetoshow=$langs->trans($valuetoshow); // try to translate $class="left"; if ($fieldlist[$field]=='type') { - if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); + if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); else $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } @@ -491,8 +491,8 @@ if ($id) if ($valuetoshow != '') { print ''; } @@ -512,7 +512,7 @@ if ($id) $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd','alpha')) + if (GETPOST('actionadd', 'alpha')) { foreach ($fieldlist as $key=>$val) { @@ -523,12 +523,12 @@ if ($id) $tmpaction = 'create'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; if (empty($reshook)) { - fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'add'); + fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'add'); } print ''; print ''; @@ -683,7 +683,7 @@ if ($id) { $tmpaction = 'view'; $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -740,7 +740,7 @@ if ($id) $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default if (isset($obj->code)) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; } } $canbemodified=$iserasable; @@ -834,7 +834,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co if ($context == 'add') { $fieldname='country_id'; - print $form->select_country(GETPOST('country_id','int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); + print $form->select_country(GETPOST('country_id', 'int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); } else { @@ -844,7 +844,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co } elseif ($fieldlist[$field] == 'country_id') { - if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) + if (! in_array('country', $fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0); print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 1cd00627aa3..5b39a38657f 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -96,7 +96,7 @@ if (GETPOST('change_chart', 'alpha')) if ($action == 'update') { $error = 0; - foreach ( $list_account_main as $constname ) { + foreach ($list_account_main as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -104,7 +104,7 @@ if ($action == 'update') { } } - foreach ( $list_account as $constname ) { + foreach ($list_account as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 21fef9a1930..15e455cf84c 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -96,7 +96,7 @@ if ($action == 'update') { $error ++; } - foreach ( $main_option as $constname ) { + foreach ($main_option as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -104,7 +104,7 @@ if ($action == 'update') { } } - foreach ($listparam[$modelcsv] as $key => $value ) { + foreach ($listparam[$modelcsv] as $key => $value) { $constante = $key; if (strpos($constante, 'ACCOUNTING')!==false) { @@ -198,7 +198,7 @@ print "\n"; $num = count($main_option); if ($num) { - foreach ( $main_option as $key ) { + foreach ($main_option as $key) { print ''; @@ -256,7 +256,7 @@ if ($num2) { print ''; print "\n"; - foreach ( $model_option as $key) { + foreach ($model_option as $key) { print ''; // Param diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 06641d7d0a9..78fe73322f2 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -25,13 +25,13 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -58,7 +58,7 @@ static $tmpstatut2label = array ( $statut2label = array ( '' ); -foreach ( $tmpstatut2label as $key => $val ) +foreach ($tmpstatut2label as $key => $val) $statut2label[$key] = $langs->trans($val); $errors = array (); @@ -87,7 +87,7 @@ llxHeader('', $title, $helpurl); $sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_fiscalyear as f"; $sql .= " WHERE f.entity = " . $conf->entity; -$sql.=$db->order($sortfield,$sortorder); +$sql.=$db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 19f6da0c922..4063e28f369 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -50,7 +50,7 @@ static $tmpstatut2label = array ( $statut2label = array ( '' ); -foreach ( $tmpstatut2label as $key => $val ) +foreach ($tmpstatut2label as $key => $val) $statut2label[$key] = $langs->trans($val); $object = new Fiscalyear($db); @@ -151,7 +151,7 @@ $form = new Form($db); $title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card"); $helpurl = ""; -llxHeader("",$title,$helpurl); +llxHeader("", $title, $helpurl); if ($action == 'create') { diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 9dfa7a681e2..86b01fa7397 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -40,7 +40,7 @@ $id = GETPOST('id', 'int'); // View $title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Info"); $helpurl = ""; -llxHeader("",$title,$helpurl); +llxHeader("", $title, $helpurl); if ($id) { $object = new Fiscalyear($db); diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 236ca09cfee..1efebf5c234 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -36,10 +36,10 @@ $langs->loadLangs(array("compta","bills","accountancy")); if (! $user->admin) accessforbidden(); -$limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -68,7 +68,7 @@ if ($_POST["action"] == 'import') { $obj = $db->fetch_object($result); $cpt = 0; - foreach ( $to_import as $maLigneCochee ) { + foreach ($to_import as $maLigneCochee) { $accounting = new AccountingAccount($db); @@ -156,11 +156,11 @@ if ($result) { print ''; print ''; print ''; // Colonne choix ligne a ventiler diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 8d29d10708d..1e623c23860 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -34,11 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; // Load translation files required by the page $langs->loadLangs(array("admin","compta","accountancy")); -$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; +$confirm=GETPOST('confirm', 'alpha'); $id=35; -$rowid=GETPOST('rowid','alpha'); -$code=GETPOST('code','alpha'); +$rowid=GETPOST('rowid', 'alpha'); +$code=GETPOST('code', 'alpha'); // Security access if (empty($user->rights->accounting->chartofaccount)) @@ -48,16 +48,16 @@ if (empty($user->rights->accounting->chartofaccount)) $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); $listoffset=GETPOST('listoffset', 'alpha'); $listlimit=GETPOST('listlimit', 'int')>0?GETPOST('listlimit', 'int'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; @@ -123,7 +123,7 @@ $tabfieldcheck=array(); $tabfieldcheck[35] = array(); // Complete all arrays with entries found into modules -complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); +complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") @@ -151,10 +151,10 @@ if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', // Actions add or modify an entry into a dictionary if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; @@ -178,7 +178,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; }*/ } - if (! GETPOST('label','alpha')) + if (! GETPOST('label', 'alpha')) { setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); $ok=0; @@ -210,14 +210,14 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; $sql.=",active,entity)"; $sql.= " VALUES("; // List of values - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $newid.","; $i=0; foreach ($listfieldinsert as $f => $value) @@ -259,7 +259,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldmodify)) { $sql.= $tabrowid[$id]."="; $sql.= "'".$db->escape($rowid)."', "; @@ -267,8 +267,8 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } elseif ($field == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; @@ -381,13 +381,13 @@ if ($id) $titlepicto='title_accountancy'; } -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -402,14 +402,14 @@ if ($id) // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; - $sql.=$db->order($sortfield,$sortorder); - $sql.=$db->plimit($listlimit+1,$offset); + $sql.=$db->order($sortfield, $sortorder); + $sql.=$db->plimit($listlimit+1, $offset); - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print ''; print ''; - print ''; + print ''; print '
'; print '
'; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; - elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); else print $valuetoshow; print ''; @@ -555,7 +555,7 @@ if ($id) $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; - if (GETPOST('from','alpha')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); + if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.GETPOST('from', 'alpha'); // There is several pages if ($num > $listlimit) { @@ -662,11 +662,11 @@ if ($id) { $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields - if (empty($reshook)) fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'edit'); print ''; @@ -854,7 +854,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co } elseif ($fieldlist[$field] == 'category_type') { print ''; - print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); + print $form->selectyesno($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1); print '
' . $langs->trans('OtherOptions') . '
'; - print ''; + print ''; print ''; - print ''; + print ''; print '
'; @@ -419,7 +419,7 @@ if ($id) { $alabelisused=0; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); // Line for title print ''; @@ -440,8 +440,8 @@ if ($id) if ($valuetoshow != '') { print ''; } @@ -472,12 +472,12 @@ if ($id) $tmpaction = 'create'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; if (empty($reshook)) { - fieldListJournal($fieldlist,$obj,$tabname[$id],'add'); + fieldListJournal($fieldlist, $obj, $tabname[$id], 'add'); } print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 78d2ac08e14..f2676620c30 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -65,10 +65,10 @@ $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); $btn_changeaccount = GETPOST('changeaccount', 'alpha'); $btn_changetype = GETPOST('changetype', 'alpha'); -$limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -85,15 +85,15 @@ $arrayfields=array(); * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $search_ref = ''; $search_label = ''; @@ -134,7 +134,7 @@ if ($action == 'update') { $arrayofdifferentselectedvalues = array(); $cpt = 0; $ok = 0; $ko = 0; - foreach ( $chk_prod as $productid ) + foreach ($chk_prod as $productid) { $accounting_account_id = GETPOST('codeventil_' . $productid); @@ -223,11 +223,11 @@ else $sql.= ' WHERE p.entity IN ('.getEntity('product').')'; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { if (strlen(trim($search_current_account))) { - $sql .= natural_search("p.accountancy_code_buy",$search_current_account); + $sql .= natural_search("p.accountancy_code_buy", $search_current_account); } } else { if (strlen(trim($search_current_account))) { - $sql .= natural_search("p.accountancy_code_sell",$search_current_account); + $sql .= natural_search("p.accountancy_code_sell", $search_current_account); } } if ($search_current_account_valid == 'withoutvalidaccount') @@ -240,13 +240,13 @@ if ($search_current_account_valid == 'withvalidaccount') } // Add search filter like if (strlen(trim($search_ref))) { - $sql .= natural_search("p.ref",$search_ref); + $sql .= natural_search("p.ref", $search_ref); } if (strlen(trim($search_label))) { - $sql .= natural_search("p.label",$search_label); + $sql .= natural_search("p.label", $search_label); } if (strlen(trim($search_desc))) { - $sql .= natural_search("p.description",$search_desc); + $sql .= natural_search("p.description", $search_desc); } $sql .= $db->order($sortfield, $sortorder); @@ -361,7 +361,7 @@ if ($result) $product_static = new Product($db); $i=0; - while ($i < min($num,$limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 86d513d059a..4da7865624e 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -42,14 +42,14 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha'); $action = GETPOST('action', 'aZ09'); -if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; +if (GETPOST("exportcsv", 'alpha')) $action = 'export_csv'; // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); -if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -131,7 +131,7 @@ if (! empty($search_accountancy_code_end)) { * Action */ -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_accountancy_code_start = ''; $search_accountancy_code_end = ''; diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index c2e34270438..7b9bf25c589 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; $langs->loadLangs(array("bills","compta","accountancy","other")); // Filter -$year = GETPOST("year",'int'); +$year = GETPOST("year", 'int'); if ($year == 0) { $year_current = strftime("%Y", time()); $year_start = $year_current; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 105c87409c1..7e3d3a6e68d 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -37,11 +37,11 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php // Load translation files required by the page $langs->loadLangs(array("accountancy", "bills", "compta")); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); // id of record -$mode = GETPOST('mode','aZ09'); // '' or 'tmp' -$piece_num = GETPOST("piece_num",'int'); // id of transaction (several lines share the same transaction id) +$mode = GETPOST('mode', 'aZ09'); // '' or 'tmp' +$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id) // Security check if ($user->societe_id > 0) { @@ -53,25 +53,25 @@ $mesg = ''; $accountingaccount = new AccountingAccount($db); $accountingjournal = new AccountingJournal($db); -$accountingaccount_number = GETPOST('accountingaccount_number','alphanohtml'); +$accountingaccount_number = GETPOST('accountingaccount_number', 'alphanohtml'); $accountingaccount->fetch(null, $accountingaccount_number, true); $accountingaccount_label = $accountingaccount->label; -$journal_code = GETPOST('code_journal','alpha'); +$journal_code = GETPOST('code_journal', 'alpha'); $accountingjournal->fetch(null, $journal_code); $journal_label = $accountingjournal->label; -$subledger_account = GETPOST('subledger_account','alphanohtml'); +$subledger_account = GETPOST('subledger_account', 'alphanohtml'); if ($subledger_account == - 1) { $subledger_account = null; } -$label_operation= GETPOST('label_operation','alphanohtml'); -$debit = price2num(GETPOST('debit','alpha')); -$credit = price2num(GETPOST('credit','alpha')); +$label_operation= GETPOST('label_operation', 'alphanohtml'); +$debit = price2num(GETPOST('debit', 'alpha')); +$credit = price2num(GETPOST('credit', 'alpha')); -$save = GETPOST('save','alpha'); +$save = GETPOST('save', 'alpha'); if (! empty($save)) $action = 'add'; -$update = GETPOST('update','alpha'); +$update = GETPOST('update', 'alpha'); if (! empty($update)) $action = 'confirm_update'; $object = new BookKeeping($db); @@ -165,14 +165,14 @@ elseif ($action == "add") { $object->label_operation= $label_operation; $object->debit = $debit; $object->credit = $credit; - $object->doc_date = GETPOST('doc_date','alpha'); - $object->doc_type = GETPOST('doc_type','alpha'); + $object->doc_date = GETPOST('doc_date', 'alpha'); + $object->doc_type = GETPOST('doc_type', 'alpha'); $object->piece_num = $piece_num; - $object->doc_ref = GETPOST('doc_ref','alpha'); + $object->doc_ref = GETPOST('doc_ref', 'alpha'); $object->code_journal = $journal_code; $object->journal_label = $journal_label; - $object->fk_doc = GETPOST('fk_doc','int'); - $object->fk_docdet = GETPOST('fk_docdet','int'); + $object->fk_doc = GETPOST('fk_doc', 'int'); + $object->fk_docdet = GETPOST('fk_docdet', 'int'); if (floatval($debit) != 0.0) { $object->montant = $debit; @@ -239,17 +239,17 @@ elseif ($action == "confirm_create") { $object->label_compte = ''; $object->debit = 0; $object->credit = 0; - $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth','int'), GETPOST('doc_dateday','int'), GETPOST('doc_dateyear','int')); - $object->doc_type = GETPOST('doc_type','alpha'); - $object->piece_num = GETPOST('next_num_mvt','alpha'); - $object->doc_ref = GETPOST('doc_ref','alpha'); + $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); + $object->doc_type = GETPOST('doc_type', 'alpha'); + $object->piece_num = GETPOST('next_num_mvt', 'alpha'); + $object->doc_ref = GETPOST('doc_ref', 'alpha'); $object->code_journal = $journal_code; $object->journal_label = $journal_label; $object->fk_doc = 0; $object->fk_docdet = 0; $object->montant = 0; - $result = $object->createStd($user,0, $mode); + $result = $object->createStd($user, 0, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -266,7 +266,7 @@ elseif ($action == "confirm_create") { if ($action == 'setdate') { $datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); - $result = $object->updateByMvt($piece_num,'doc_date',$db->idate($datedoc),$mode); + $result = $object->updateByMvt($piece_num, 'doc_date', $db->idate($datedoc), $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -293,8 +293,8 @@ if ($action == 'setjournal') { } if ($action == 'setdocref') { - $refdoc = trim(GETPOST('doc_ref','alpha')); - $result = $object->updateByMvt($piece_num,'doc_ref',$refdoc,$mode); + $refdoc = trim(GETPOST('doc_ref', 'alpha')); + $result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -308,7 +308,7 @@ if ($action == 'setdocref') { // Validate transaction if ($action == 'valid') { - $result = $object->transformTransaction(0,$piece_num); + $result = $object->transformTransaction(0, $piece_num); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -368,7 +368,7 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -436,7 +436,7 @@ if ($action == 'create') print $langs->trans('Docdate'); print ''; if ($action != 'editdate') - print ''; + print ''; print '
'; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; - elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); else print $valuetoshow; print ''; @@ -503,7 +503,7 @@ if ($id) $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; - if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); + if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.GETPOST('from', 'alpha'); // There is several pages if ($num > $listlimit) @@ -577,11 +577,11 @@ if ($id) { $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields - if (empty($reshook)) fieldListJournal($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldListJournal($fieldlist, $obj, $tabname[$id], 'edit'); print ''; print ''; @@ -595,7 +595,7 @@ if ($id) { $tmpaction = 'view'; $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -627,11 +627,17 @@ if ($id) // Can an entry be erased or disabled ? $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default - if (isset($obj->code) && $id != 10) - { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } - elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } - elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } + if (isset($obj->code) && $id != 10) { + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { + $iserasable = 0; + $canbedisabled = 0; + } elseif ($obj->code == 'RECEP') { + $iserasable = 0; + $canbedisabled = 0; + } elseif ($obj->code == 'EF0') { + $iserasable = 0; + $canbedisabled = 0; + } } $canbemodified=$iserasable; @@ -712,7 +718,7 @@ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '') if ($fieldlist[$field] == 'nature') { print ''; - print $form->selectarray('nature', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectarray('nature', $sourceList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print '
' . $langs->trans("Codejournal") . '' . $formaccounting->select_journal($journal_code,'code_journal',0,0,1,1) . '' . $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1) . '
piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'),1).'piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'
'; print ''; if ($action == 'editdate') { @@ -459,7 +459,7 @@ if ($action == 'create') print $langs->trans('Codejournal'); print ''; if ($action != 'editjournal') - print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; print ''; print ''; if ($action == 'editjournal') { @@ -467,7 +467,7 @@ if ($action == 'create') print ''; print ''; print ''; - print $formaccounting->select_journal($object->code_journal,'code_journal',0,0,array(),1,1); + print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1); print ''; print ''; } else { @@ -482,7 +482,7 @@ if ($action == 'create') print $langs->trans('Piece'); print ''; if ($action != 'editdocref') - print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; print ''; print ''; if ($action == 'editdocref') { @@ -638,7 +638,7 @@ if ($action == 'create') print ''; } else { $accountingaccount->fetch(null, $line->numero_compte, true); - print '' . $accountingaccount->getNomUrl(0,1,1,'',0) . ''; + print '' . $accountingaccount->getNomUrl(0, 1, 1, '', 0) . ''; print '' . length_accounta($line->subledger_account) . ''; print '' . $line->label_operation. ''; print '' . price($line->debit) . ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a5a2a691e8f..bc4b815100b 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -82,10 +82,10 @@ $search_ledger_code = GETPOST('search_ledger_code', 'alpha'); $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); -$page = GETPOST('page','int'); +$page = GETPOST('page', 'int'); if (empty($page) || $page < 0) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; @@ -100,7 +100,7 @@ $formaccounting = new FormAccounting($db); $formother = new FormOther($db); $form = new Form($db); -if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int')) +if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int')) { if (empty($search_date_start) && empty($search_date_end) && ! GETPOSTISSET('restore_lastsearch_values')) { @@ -152,12 +152,12 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_mvt_num = ''; $search_doc_type = ''; @@ -302,14 +302,14 @@ if ($action == 'delbookkeepingyearconfirm') { if ($delyear==-1) { $delyear=0; } - $deljournal = GETPOST('deljournal','alpha'); + $deljournal = GETPOST('deljournal', 'alpha'); if ($deljournal==-1) { $deljournal=0; } if (! empty($delyear) || ! empty($deljournal)) { - $result = $object->deleteByYearAndJournal($delyear,$deljournal); + $result = $object->deleteByYearAndJournal($delyear, $deljournal); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -617,7 +617,7 @@ if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_tit if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -640,7 +640,7 @@ if ($num > 0) print ''; $object->id = $line->id; $object->piece_num = $line->piece_num; - print $object->getNomUrl(1,'',0,'',1); + print $object->getNomUrl(1, '', 0, '', 1); print ''; if (! $i) $totalarray['nbfield']++; } @@ -709,8 +709,8 @@ if ($num > 0) if (! empty($arrayfields['t.code_journal']['checked'])) { $accountingjournal = new AccountingJournal($db); - $result = $accountingjournal->fetch('',$line->code_journal); - $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0,0,0,'',0) : $line->code_journal); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); print '' . $journaltoshow . ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 30019885281..33c7deb0cfd 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -62,10 +62,10 @@ $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); -$page = GETPOST('page','int'); +$page = GETPOST('page', 'int'); if (empty($page) || $page < 0) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; @@ -104,7 +104,7 @@ $object = new BookKeeping($db); /* * Action */ -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_doc_date = ''; $search_accountancy_code = ''; @@ -382,8 +382,8 @@ while ($i < min($num, $limit)) print '' . ($line->credit ? price($line->credit) : '') . ''; $accountingjournal = new AccountingJournal($db); - $result = $accountingjournal->fetch('',$line->code_journal); - $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0,0,0,'',0) : $line->code_journal); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); print '' . $journaltoshow . ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 843ab21e901..9bef7a1c4fc 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -122,7 +122,7 @@ $formaccounting = new FormAccounting($db); $title=$object->name." - ".$langs->trans('TabLetteringCustomer'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$title,$help_url); +llxHeader('', $title, $help_url); $head = societe_prepare_head($object); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index f9489040c36..11da2236703 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -57,9 +57,9 @@ if ($sortorder == "") if ($sortfield == "") $sortfield = "bk.doc_date"; -$search_year = GETPOST("search_year",'int'); -$search_doc_type = GETPOST("search_doc_type",'alpha'); -$search_doc_ref = GETPOST("search_doc_ref",'alpha'); +$search_year = GETPOST("search_year", 'int'); +$search_doc_type = GETPOST("search_doc_type", 'alpha'); +$search_doc_ref = GETPOST("search_doc_ref", 'alpha'); $lettering = GETPOST('lettering', 'alpha'); if (!empty($lettering)) { @@ -68,7 +68,7 @@ if (!empty($lettering)) { // Did we click on purge search criteria ? // All tests are required to be compatible with all browsers -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $search_year=''; $search_doc_type=''; @@ -123,7 +123,7 @@ $formaccounting = new FormAccounting($db); $title=$object->name." - ".$langs->trans('TabLetteringSupplier'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$title,$help_url); +llxHeader('', $title, $help_url); $head = societe_prepare_head($object); @@ -149,7 +149,7 @@ if (dol_strlen($search_year)) { $sql .= " AND ( bk.doc_date BETWEEN '".$db->idate($date_start)."' AND '".$db->idate($date_end)."' )"; } -$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->order($sortfield, $sortorder); $debit = 0; $credit = 0; @@ -196,14 +196,14 @@ if ($resql) { print ""; print ''; - print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder); print "\n"; diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 6885df63b61..bf425ffb992 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -605,7 +605,7 @@ class AccountancyCategory // extends CommonObject // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__ . " " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -644,7 +644,7 @@ class AccountancyCategory // extends CommonObject // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__ . " " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index d61932884dc..1a82d2758e4 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -272,7 +272,7 @@ class AccountancyExport */ public function exportCegid($objectLines) { - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); $separator = ";"; $end_line = "\n"; @@ -298,7 +298,7 @@ class AccountancyExport */ public function exportCogilog($objectLines) { - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); $separator = ";"; $end_line = "\n"; @@ -336,7 +336,7 @@ class AccountancyExport $separator = ";"; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d/%m/%Y'); print $date . $separator; print $line->code_journal . $separator; @@ -365,7 +365,7 @@ class AccountancyExport $separator = ";"; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { print $line->piece_num . $separator; $date = dol_print_date($line->doc_date, '%d/%m/%Y'); print $date . $separator; @@ -405,7 +405,7 @@ class AccountancyExport $i = 1; $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd - foreach ( $TData as $data ) { + foreach ($TData as $data) { $code_compta = $data->numero_compte; if (! empty($data->subledger_account)) $code_compta = $data->subledger_account; @@ -447,7 +447,7 @@ class AccountancyExport //We should use dol_now function not time however this is wrong date to transfert in accounting //$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy //$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy - foreach ( $TData as $data ) { + foreach ($TData as $data) { $code_compta = $data->numero_compte; if (! empty($data->subledger_account)) $code_compta = $data->subledger_account; @@ -528,7 +528,7 @@ class AccountancyExport $separator = ','; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); @@ -536,9 +536,9 @@ class AccountancyExport print $date . $separator; print $line->code_journal . $separator; print length_accountg($line->numero_compte) . $separator; - print substr(length_accountg($line->numero_compte),0,2) . $separator; - print '"'.dol_trunc($line->label_operation,40,'right','UTF-8',1).'"' . $separator; - print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$separator; + print substr(length_accountg($line->numero_compte), 0, 2) . $separator; + print '"'.dol_trunc($line->label_operation, 40, 'right', 'UTF-8', 1).'"' . $separator; + print '"'.dol_trunc($line->piece_num, 15, 'right', 'UTF-8', 1).'"'.$separator; print price2num($line->montant).$separator; print $line->sens.$separator; print $date . $separator; @@ -561,7 +561,7 @@ class AccountancyExport $separator = ';'; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); @@ -652,7 +652,7 @@ class AccountancyExport print "Idevise"; print $end_line; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date_creation = dol_print_date($line->date_creation, '%d%m%Y'); $date_doc = dol_print_date($line->doc_date, '%d%m%Y'); $date_valid = dol_print_date($line->date_validated, '%d%m%Y'); diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 681073332d7..d889ef37195 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -440,7 +440,7 @@ class AccountingAccount extends CommonObject // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -479,7 +479,7 @@ class AccountingAccount extends CommonObject // Add param to save lastsearch_values or not $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; $picto = 'billr'; @@ -634,7 +634,7 @@ class AccountingAccount extends CommonObject */ function getLibStatut($mode = 0) { - return $this->LibStatut($this->status,$mode); + return $this->LibStatut($this->status, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps @@ -664,23 +664,23 @@ class AccountingAccount extends CommonObject } elseif ($mode == 2) { - if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); - if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); + if ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); } elseif ($mode == 3) { - if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4'); - if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5'); + if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4'); + if ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5'); } elseif ($mode == 4) { - if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); - if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); + if ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); } elseif ($mode == 5) { - if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); - if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); + if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); } } } diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 2a2d050af7b..1b82fc88bd2 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -153,7 +153,7 @@ class AccountingJournal extends CommonObject // Manage filter $sqlwhere = array(); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.code' || $key == 't.label' || $key == 't.nature') { $sqlwhere[] = $key . '\'' . $this->db->escape($value) . '\''; } elseif ($key == 't.rowid' || $key == 't.active') { @@ -272,7 +272,7 @@ class AccountingJournal extends CommonObject */ function getLibType($mode = 0) { - return $this->LibType($this->nature,$mode); + return $this->LibType($this->nature, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2aaf918b197..6e8824c5a23 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -432,7 +432,7 @@ class BookKeeping extends CommonObject { // Add param to save lastsearch_values or not $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; } @@ -777,7 +777,7 @@ class BookKeeping extends CommonObject // Manage filter $sqlwhere = array (); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { @@ -909,7 +909,7 @@ class BookKeeping extends CommonObject // Manage filter $sqlwhere = array (); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { @@ -1021,7 +1021,7 @@ class BookKeeping extends CommonObject // Manage filter $sqlwhere = array (); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { @@ -1360,7 +1360,7 @@ class BookKeeping extends CommonObject if (! $resql) { $this->errors[] = "Error " . $this->db->lasterror(); - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -1394,7 +1394,7 @@ class BookKeeping extends CommonObject if (! $resql) { $this->errors[] = "Error " . $this->db->lasterror(); - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 83a018a24cc..5050327298b 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -157,7 +157,7 @@ class Lettering extends BookKeeping $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk ON (bk.fk_doc = pay.fk_bank AND bk.code_journal='" . $obj->code_journal . "')"; $sql .= " WHERE payfac.fk_paiement = '" . $obj->url_id . "' "; $sql .= " AND bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4 AND entity=".$conf->entity.") "; - $sql .= " AND fac.entity IN (".getEntity('invoice',0).")";// We don't share object for accountancy + $sql .= " AND fac.entity IN (".getEntity('invoice', 0).")";// We don't share object for accountancy $sql .= " AND ( "; if (! empty($object->code_compta)) { $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; @@ -185,7 +185,7 @@ class Lettering extends BookKeeping $sql .= " FROM " . MAIN_DB_PREFIX . "facture fac "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk ON( bk.fk_doc = fac.rowid AND fac.rowid IN (" . implode(',', $ids_fact) . "))"; $sql .= " WHERE code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=2 AND entity=".$conf->entity.") "; - $sql .= " AND fac.entity IN (".getEntity('invoice',0).")";// We don't share object for accountancy + $sql .= " AND fac.entity IN (".getEntity('invoice', 0).")";// We don't share object for accountancy $sql .= " AND ( "; if (! empty($object->code_compta)) { $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; @@ -216,7 +216,7 @@ class Lettering extends BookKeeping } } if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::" . __METHOD__ . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -302,7 +302,7 @@ class Lettering extends BookKeeping } // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::update " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 9c9d0db38a4..aa8161b9c52 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write) $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); -if (GETPOST("year",'int')) $year_start = GETPOST("year",'int'); +if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int'); else { $year_start = dol_print_date(dol_now(), '%Y'); @@ -63,7 +63,7 @@ $search_date_end = dol_get_last_day($year_end, $month_end); $year_current = $year_start; // Validate History -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 076c1d7b3c8..dbd0f680db7 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -48,14 +48,14 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_day=GETPOST("search_day","int"); -$search_month=GETPOST("search_month","int"); -$search_year=GETPOST("search_year","int"); +$search_day=GETPOST("search_day", "int"); +$search_month=GETPOST("search_month", "int"); +$search_year=GETPOST("search_year", "int"); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); @@ -85,7 +85,7 @@ $formaccounting = new FormAccounting($db); */ // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_lineid = ''; $search_ref = ''; @@ -105,7 +105,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', if (is_array($changeaccount) && count($changeaccount) > 0) { $error = 0; - if (! (GETPOST('account_parent','int') >= 0)) + if (! (GETPOST('account_parent', 'int') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); @@ -116,7 +116,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $db->begin(); $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l"; - $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0'); + $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1); @@ -175,7 +175,7 @@ $sql.= " fd.situation_percent,"; $sql.= " co.code as country_code, co.label as country,"; $sql.= " s.tva_intra"; $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product"; @@ -218,7 +218,7 @@ if (strlen(trim($search_vat))) { if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'"; elseif ($search_year > 0 && ! empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else @@ -226,7 +226,7 @@ if ($search_month > 0) } elseif ($search_year > 0) { - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } if (strlen(trim($search_country))) { $arrayofcode = getCountriesInEEC(); @@ -311,7 +311,7 @@ if ($result) { print ''; print ''; //print ''; @@ -380,7 +380,7 @@ if ($result) { print ''; print ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 6768e94ce02..873018cf6c9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bills","compta","accountancy","other","productbatch")); -$action=GETPOST('action','alpha'); -$massaction=GETPOST('massaction','alpha'); -$show_files=GETPOST('show_files','int'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'alpha'); +$massaction=GETPOST('massaction', 'alpha'); +$show_files=GETPOST('show_files', 'int'); +$confirm=GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); // Select Box @@ -57,19 +57,19 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_day=GETPOST("search_day","int"); -$search_month=GETPOST("search_month","int"); -$search_year=GETPOST("search_year","int"); +$search_day=GETPOST("search_day", "int"); +$search_month=GETPOST("search_month", "int"); +$search_year=GETPOST("search_year", "int"); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); $btn_ventil = GETPOST('ventil', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); -$page = GETPOST('page','int'); +$page = GETPOST('page', 'int'); if (empty($page) || $page < 0) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; @@ -103,17 +103,17 @@ $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'acco * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $search_lineid = ''; $search_ref = ''; @@ -217,7 +217,7 @@ $sql.= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_e $sql.= " co.code as country_code, co.label as country,"; $sql.= " s.tva_intra"; $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; @@ -257,7 +257,7 @@ if (strlen(trim($search_vat))) { if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'"; elseif ($search_year > 0 && ! empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else @@ -265,7 +265,7 @@ if ($search_month > 0) } elseif ($search_year > 0) { - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } if (strlen(trim($search_country))) { $arrayofcode = getCountriesInEEC(); @@ -293,7 +293,7 @@ $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't sha // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -378,7 +378,7 @@ if ($result) { print ''; print ''; //print ''; @@ -494,7 +494,7 @@ if ($result) { print ''; print ''; print ''; print ''; @@ -316,7 +316,7 @@ if ($result) { print ''; print ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index bf6f597924d..9d28206a91e 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bills","compta","accountancy","other","trips","productbatch")); -$action=GETPOST('action','alpha'); -$massaction=GETPOST('massaction','alpha'); -$show_files=GETPOST('show_files','int'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'alpha'); +$massaction=GETPOST('massaction', 'alpha'); +$show_files=GETPOST('show_files', 'int'); +$confirm=GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); // Select Box @@ -53,17 +53,17 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_day=GETPOST("search_day","int"); -$search_month=GETPOST("search_month","int"); -$search_year=GETPOST("search_year","int"); +$search_day=GETPOST("search_day", "int"); +$search_month=GETPOST("search_month", "int"); +$search_year=GETPOST("search_year", "int"); $btn_ventil = GETPOST('ventil', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); -$page = GETPOST('page','int'); +$page = GETPOST('page', 'int'); if (empty($page) || $page < 0) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; @@ -92,11 +92,11 @@ $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'acco * Action */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $search_expensereport = ''; $search_label = ''; @@ -128,7 +128,7 @@ if ($massaction == 'ventil') { $ok=0; $ko=0; - foreach ( $mesCasesCochees as $maLigneCochee ) { + foreach ($mesCasesCochees as $maLigneCochee) { $maLigneCourante = explode("_", $maLigneCochee); $monId = $maLigneCourante[0]; $monCompte = GETPOST('codeventil'.$monId); @@ -198,27 +198,27 @@ $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountan $sql.= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0"; // Add search filter like if (strlen(trim($search_expensereport))) { - $sql .= natural_search("er.ref",$search_expensereport); + $sql .= natural_search("er.ref", $search_expensereport); } if (strlen(trim($search_label))) { - $sql .= natural_search("f.label",$search_label); + $sql .= natural_search("f.label", $search_label); } if (strlen(trim($search_desc))) { - $sql .= natural_search("erd.comments",$search_desc); + $sql .= natural_search("erd.comments", $search_desc); } if (strlen(trim($search_amount))) { - $sql .= natural_search("erd.total_ht",$search_amount,1); + $sql .= natural_search("erd.total_ht", $search_amount, 1); } if (strlen(trim($search_account))) { - $sql .= natural_search("aa.account_number",$search_account); + $sql .= natural_search("aa.account_number", $search_account); } if (strlen(trim($search_vat))) { - $sql .= natural_search("erd.tva_tx",$search_vat,1); + $sql .= natural_search("erd.tva_tx", $search_vat, 1); } if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) - $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'"; elseif ($search_year > 0 && ! empty($search_day)) $sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else @@ -226,7 +226,7 @@ if ($search_month > 0) } elseif ($search_year > 0) { - $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; + $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } $sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy @@ -311,7 +311,7 @@ if ($result) { print ''; print ''; print ''; @@ -373,7 +373,7 @@ if ($result) { print ''; print ''; print ""; print ""; @@ -643,7 +643,7 @@ if (empty($action) || $action == 'view') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { print ''; print ""; @@ -661,7 +661,7 @@ if (empty($action) || $action == 'view') { // Subledger account print "'; - print ""; print '"; print '"; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 54024fe6471..1611de1e4ee 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; $langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors")); $id_journal = GETPOST('id_journal', 'int'); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -65,7 +65,7 @@ $parameters=array(); /* * Actions */ -$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks $accountingaccount = new AccountingAccount($db); @@ -94,7 +94,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end) $idpays = $mysoc->country_id; -$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; +$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; @@ -296,7 +296,7 @@ if ($action == 'writebookkeeping') { // Thirdparty if (! $errorforline) { - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -351,7 +351,7 @@ if ($action == 'writebookkeeping') { // Product / Service if (! $errorforline) { - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { //if ($mt) { // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { @@ -414,7 +414,7 @@ if ($action == 'writebookkeeping') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -432,7 +432,7 @@ if ($action == 'writebookkeeping') { $accountingaccount->fetch($k, null, true); $bookkeeping->label_compte = $accountingaccount->label; - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:''); + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:''); $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; @@ -471,7 +471,7 @@ if ($action == 'writebookkeeping') { // var_dump($tabother); if (! $errorforline && is_array($tabother[$key])) { - foreach ( $tabother[$key] as $k => $mt ) { + foreach ($tabother[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -593,7 +593,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $companystatic = new Fournisseur($db); $invoicestatic = new FactureFournisseur($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -628,7 +628,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -647,7 +647,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } // Product / Service - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); //if ($mt) { @@ -684,7 +684,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '""' . $sep; print '"' . $langs->trans("VAT") . ' - ' . $def_tva[$key] . '"' . $sep; - print '"' . utf8_decode(dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep; print '"' . $journal . '"' ; @@ -695,7 +695,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! // VAT counterpart for NPR if (is_array($tabother[$key])) { - foreach ( $tabother[$key] as $k => $mt ) { + foreach ($tabother[$key] as $k => $mt) { if ($mt) { print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -721,7 +721,7 @@ if (empty($action) || $action == 'view') { llxHeader('', $langs->trans("PurchasesJournal")); - $nom = $langs->trans("PurchasesJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1); + $nom = $langs->trans("PurchasesJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0, 1, 1, '', 1); $nomlink = ''; $periodlink = ''; $exportlink = ''; @@ -797,7 +797,7 @@ if (empty($action) || $action == 'view') { $invoicestatic = new FactureFournisseur($db); $companystatic = new Fournisseur($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -868,7 +868,7 @@ if (empty($action) || $action == 'view') { } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { print ''; print ""; @@ -900,7 +900,7 @@ if (empty($action) || $action == 'view') { } // Product / Service - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); @@ -937,7 +937,7 @@ if (empty($action) || $action == 'view') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { print ''; print ""; @@ -956,7 +956,7 @@ if (empty($action) || $action == 'view') { print "'; print ""; print '"; print '"; @@ -968,7 +968,7 @@ if (empty($action) || $action == 'view') { // VAT counterpart for NPR if (is_array($tabother[$key])) { - foreach ( $tabother[$key] as $k => $mt ) { + foreach ($tabother[$key] as $k => $mt) { if ($mt) { print ''; print ""; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 9526bc763ec..25c53863162 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; $langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors")); $id_journal = GETPOST('id_journal', 'int'); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -68,7 +68,7 @@ $parameters=array(); * Actions */ -$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks $accountingaccount = new AccountingAccount($db); @@ -307,7 +307,7 @@ if ($action == 'writebookkeeping') { // Thirdparty if (! $errorforline) { - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -362,7 +362,7 @@ if ($action == 'writebookkeeping') { // Product / Service if (! $errorforline) { - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { //if ($mt) { // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { @@ -424,7 +424,7 @@ if ($action == 'writebookkeeping') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -442,7 +442,7 @@ if ($action == 'writebookkeeping') { $accountingaccount->fetch($k, null, true); $bookkeeping->label_compte = $accountingaccount->label; - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:''); + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:''); $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt < 0) ? -$mt : 0; @@ -553,7 +553,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $companystatic = new Client($db); $invoicestatic = new Facture($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -642,7 +642,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '""' . $sep; print '"' . $langs->trans("VAT") . ' - ' . $def_tva[$key] . ' %"' . $sep; - print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . $journal . '"'; @@ -659,7 +659,7 @@ if (empty($action) || $action == 'view') { llxHeader('', $langs->trans("SellsJournal")); - $nom = $langs->trans("SellsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1); + $nom = $langs->trans("SellsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0, 1, 1, '', 1); $nomlink = ''; $periodlink = ''; $exportlink = ''; @@ -734,7 +734,7 @@ if (empty($action) || $action == 'view') { $companystatic = new Client($db); $invoicestatic = new Facture($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -875,7 +875,7 @@ if (empty($action) || $action == 'view') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { print ''; print ""; @@ -893,7 +893,7 @@ if (empty($action) || $action == 'view') { // Subledger account print "'; - print ""; print '"; print '"; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 770f6ec74c9..ab85507a7b4 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -43,7 +43,7 @@ if (! $user->rights->accounting->bind->write) $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); -if (GETPOST("year",'int')) $year_start = GETPOST("year",'int'); +if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int'); else { $year_start = dol_print_date(dol_now(), '%Y'); @@ -61,7 +61,7 @@ $search_date_end = dol_get_last_day($year_end, $month_end); $year_current = $year_start; // Validate History -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 247c2db93cd..1c687fb98cc 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -50,14 +50,14 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_day=GETPOST("search_day","int"); -$search_month=GETPOST("search_month","int"); -$search_year=GETPOST("search_year","int"); +$search_day=GETPOST("search_day", "int"); +$search_month=GETPOST("search_month", "int"); +$search_year=GETPOST("search_year", "int"); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); @@ -87,7 +87,7 @@ $formaccounting = new FormAccounting($db); */ // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_lineid = ''; $search_ref = ''; @@ -107,7 +107,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', if (is_array($changeaccount) && count($changeaccount) > 0) { $error = 0; - if (! (GETPOST('account_parent','int') >= 0)) + if (! (GETPOST('account_parent', 'int') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); @@ -119,7 +119,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $db->begin(); $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l"; - $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0'); + $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1); @@ -177,7 +177,7 @@ $sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as prod $sql.= " co.code as country_code, co.label as country,"; $sql.= " s.tva_intra"; $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; @@ -213,7 +213,7 @@ if (strlen(trim($search_vat))) { if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'"; elseif ($search_year > 0 && ! empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else @@ -221,7 +221,7 @@ if ($search_month > 0) } elseif ($search_year > 0) { - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } if (strlen(trim($search_country))) { $arrayofcode = getCountriesInEEC(); @@ -244,7 +244,7 @@ $sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -316,7 +316,7 @@ if ($result) { print ''; print ''; //print ''; @@ -393,7 +393,7 @@ if ($result) { print ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 99f0fb30ae5..f864824c740 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bills","compta","accountancy","other","productbatch")); -$action=GETPOST('action','alpha'); -$massaction=GETPOST('massaction','alpha'); -$show_files=GETPOST('show_files','int'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'alpha'); +$massaction=GETPOST('massaction', 'alpha'); +$show_files=GETPOST('show_files', 'int'); +$confirm=GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); // Select Box @@ -57,19 +57,19 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_day=GETPOST("search_day","int"); -$search_month=GETPOST("search_month","int"); -$search_year=GETPOST("search_year","int"); +$search_day=GETPOST("search_day", "int"); +$search_month=GETPOST("search_month", "int"); +$search_year=GETPOST("search_year", "int"); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); $btn_ventil = GETPOST('ventil', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); -$page = GETPOST('page','int'); +$page = GETPOST('page', 'int'); if (empty($page) || $page < 0) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; @@ -104,17 +104,17 @@ $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'acco * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $search_lineid = ''; $search_ref = ''; @@ -217,7 +217,7 @@ $sql.= " aa.rowid as aarowid,"; $sql.= " co.code as country_code, co.label as country,"; $sql.= " s.tva_intra"; $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; @@ -255,7 +255,7 @@ if (strlen(trim($search_vat))) { if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'"; elseif ($search_year > 0 && ! empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else @@ -263,7 +263,7 @@ if ($search_month > 0) } elseif ($search_year > 0) { - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } if (strlen(trim($search_country))) { $arrayofcode = getCountriesInEEC(); @@ -291,7 +291,7 @@ $sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -378,7 +378,7 @@ if ($result) { print ''; print ''; //print ''; @@ -488,7 +488,7 @@ if ($result) { print ''; print '\n"; // Company - print ''; + print ''; // Civility print ''; + print $formcompany->select_civility(GETPOST('civility_id', 'int')?GETPOST('civility_id', 'int'):$object->civility_id, 'civility_id').''; print ''; // Lastname - print ''; + print ''; print ''; // Firstname - print ''; + print ''; print ''; // Gender @@ -966,25 +966,25 @@ else print ''; // EMail - print ''; + print ''; // Address print ''; // Zip / Town print ''; // Country $object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; print ''; // State @@ -993,7 +993,7 @@ else print ''; + print ''; // Personal phone - print ''; + print ''; // Mobile phone - print ''; + print ''; // Skype if (! empty($conf->socialnetworks->enabled)) { - print ''; + print ''; } // Twitter if (! empty($conf->socialnetworks->enabled)) { - print ''; + print ''; } // Facebook if (! empty($conf->socialnetworks->enabled)) { - print ''; + print ''; } // Birthday print "\n"; // Public profil print "\n"; // Categories @@ -1082,7 +1082,7 @@ else $res=$object->fetch($id); if ($res < 0) { - dol_print_error($db,$object->error); exit; + dol_print_error($db, $object->error); exit; } $res=$object->fetch_optionals(); if ($res < 0) { @@ -1093,7 +1093,7 @@ else $adht->fetch($object->typeid); // We set country_id, and country_code, country of the chosen country - $country=GETPOST('country','int'); + $country=GETPOST('country', 'int'); if (!empty($country) || $object->country_id) { $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country)?$country:$object->country_id); @@ -1162,26 +1162,26 @@ else // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } // Morphy $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Morale"); print '"; // Type print '"; // Company - print ''; + print ''; // Civility print ''; // Lastname - print ''; + print ''; print ''; // Firstname - print ''; + print ''; print ''; // Gender @@ -1217,7 +1217,7 @@ else // Photo print ''; print ''; // EMail - print ''; + print ''; // Address print ''; // Zip / Town print ''; // Country //$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined print ''; // State if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''; } @@ -1288,12 +1288,12 @@ else // Birthday print "\n"; // Public profil print "\n"; // Categories @@ -1335,7 +1335,7 @@ else print ''; @@ -1366,7 +1366,7 @@ else $res=$object->fetch($id); if ($res < 0) { - dol_print_error($db,$object->error); exit; + dol_print_error($db, $object->error); exit; } $res=$object->fetch_optionals(); if ($res < 0) { @@ -1395,7 +1395,7 @@ else { // Full firstname and name separated with a dot : firstname.name include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $login=dol_buildlogin($object->lastname,$object->firstname); + $login=dol_buildlogin($object->lastname, $object->firstname); } if (empty($login)) $login=strtolower(substr($object->firstname, 0, 4)) . strtolower(substr($object->lastname, 0, 4)); @@ -1409,7 +1409,7 @@ else if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); } - print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrLogin"), $text, "confirm_create_user", $formquestion, 'yes'); } // Confirm create third party @@ -1485,7 +1485,7 @@ else $helpcontent.="
"; $helpcontent.=''.$langs->trans("Content").':
'; $helpcontent.=dol_htmlentitiesbr($texttosend)."\n"; - $label=$form->textwithpicto($tmp,$helpcontent,1,'help'); + $label=$form->textwithpicto($tmp, $helpcontent, 1, 'help'); // Create form popup $formquestion=array(); @@ -1546,7 +1546,7 @@ else $helpcontent.="
"; $helpcontent.=''.$langs->trans("Content").':
'; $helpcontent.=dol_htmlentitiesbr($texttosend)."\n"; - $label=$form->textwithpicto($tmp,$helpcontent,1,'help'); + $label=$form->textwithpicto($tmp, $helpcontent, 1, 'help'); // Create an array $formquestion=array(); @@ -1617,8 +1617,8 @@ else // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; } @@ -1637,7 +1637,7 @@ else print '"; print ""; print ""; - print ""; + print ""; print "\n"; } @@ -268,7 +268,7 @@ print ''; print ''; print ""; print '"; -print ""; +print ""; print "\n"; print "
'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - $formother->select_year($search_year,'search_year',1, 20, 5); + $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print '' . price($objp->total_ht) . ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - $formother->select_year($search_year,'search_year',1, 20, 5); + $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index d41af13d193..e350a3011a0 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -42,7 +42,7 @@ if (! $user->rights->accounting->bind->write) accessforbidden(); $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); -if (GETPOST("year",'int')) $year_start = GETPOST("year",'int'); +if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int'); else { $year_start = dol_print_date(dol_now(), '%Y'); @@ -60,7 +60,7 @@ $search_date_end = dol_get_last_day($year_end, $month_end); $year_current = $year_start; // Validate History -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 5d1c4ba7fc3..5dbacd501b9 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array("compta","bills","other","accountancy","trips","productbatch")); -$account_parent = GETPOST('account_parent','int'); +$account_parent = GETPOST('account_parent', 'int'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_expensereport = GETPOST('search_expensereport', 'alpha'); @@ -45,12 +45,12 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_day=GETPOST("search_day","int"); -$search_month=GETPOST("search_month","int"); -$search_year=GETPOST("search_year","int"); +$search_day=GETPOST("search_day", "int"); +$search_month=GETPOST("search_month", "int"); +$search_year=GETPOST("search_year", "int"); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); @@ -80,7 +80,7 @@ $formaccounting = new FormAccounting($db); */ // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers { $search_expensereport = ''; $search_label = ''; @@ -96,7 +96,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', if (is_array($changeaccount) && count($changeaccount) > 0) { $error = 0; - if (! (GETPOST('account_parent','int') >= 0)) + if (! (GETPOST('account_parent', 'int') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); @@ -107,7 +107,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $db->begin(); $sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd"; - $sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0'); + $sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); $sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')'; dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1); @@ -189,7 +189,7 @@ if (strlen(trim($search_vat))) { if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) - $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'"; elseif ($search_year > 0 && ! empty($search_day)) $sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else @@ -197,7 +197,7 @@ if ($search_month > 0) } elseif ($search_year > 0) { - $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; + $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } $sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy @@ -265,7 +265,7 @@ if ($result) { print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - $formother->select_year($search_year,'search_year',1, 20, 5); + $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments); print '' . price($objp->total_ht) . ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - $formother->select_year($search_year,'search_year',1, 20, 5); + $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments); print ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index b6b5137fe34..0c5ba39bd94 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -66,18 +66,18 @@ $langs->loadLangs(array("companies","other","compta","banks","bills","donations" // Multi journal $id_journal = GETPOST('id_journal', 'int'); -$date_startmonth = GETPOST('date_startmonth','int'); -$date_startday = GETPOST('date_startday','int'); -$date_startyear = GETPOST('date_startyear','int'); -$date_endmonth = GETPOST('date_endmonth','int'); -$date_endday = GETPOST('date_endday','int'); -$date_endyear = GETPOST('date_endyear','int'); -$in_bookkeeping = GETPOST('in_bookkeeping','aZ09'); +$date_startmonth = GETPOST('date_startmonth', 'int'); +$date_startday = GETPOST('date_startday', 'int'); +$date_startyear = GETPOST('date_startyear', 'int'); +$date_endmonth = GETPOST('date_endmonth', 'int'); +$date_endday = GETPOST('date_endday', 'int'); +$date_endyear = GETPOST('date_endyear', 'int'); +$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09'); if ($in_bookkeeping == '') $in_bookkeeping = 'notyet'; $now = dol_now(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); // Security check if ($user->societe_id > 0 && empty($id_journal)) @@ -452,7 +452,7 @@ if (! $error && $action == 'writebookkeeping') { $now = dol_now(); $error = 0; - foreach ( $tabpay as $key => $val ) // $key is rowid into llx_bank + foreach ($tabpay as $key => $val) // $key is rowid into llx_bank { $date = dol_print_date($db->jdate($val["date"]), 'day'); @@ -474,7 +474,7 @@ if (! $error && $action == 'writebookkeeping') { if (! $errorforline && is_array($tabbq[$key])) { // Line into bank account - foreach ( $tabbq[$key] as $k => $mt ) + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { @@ -537,7 +537,7 @@ if (! $error && $action == 'writebookkeeping') { if (is_array($tabtp[$key])) { // Line into thirdparty account - foreach ( $tabtp[$key] as $k => $mt ) { + foreach ($tabtp[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -672,7 +672,7 @@ if (! $error && $action == 'writebookkeeping') { } } else { // If thirdparty unkown, output the waiting account - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -800,14 +800,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print "\n"; - foreach ( $tabpay as $key => $val ) + foreach ($tabpay as $key => $val) { $date = dol_print_date($db->jdate($val["date"]), 'day'); $ref = getSourceDocRef($val, $tabtype[$key]); // Bank - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -832,7 +832,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! // Third party if (is_array($tabtp[$key])) { - foreach ( $tabtp[$key] as $k => $mt ) { + foreach ($tabtp[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -864,7 +864,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } } } else { // If thirdparty unkown, output the waiting account - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -908,7 +908,7 @@ if (empty($action) || $action == 'view') { llxHeader('', $langs->trans("FinanceJournal")); - $nom = $langs->trans("FinanceJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1); + $nom = $langs->trans("FinanceJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0, 1, 1, '', 1); $builddate=dol_now(); //$description = $langs->trans("DescFinanceJournal") . '
'; $description.= $langs->trans("DescJournalOnlyBindedVisible").'
'; @@ -1000,14 +1000,14 @@ if (empty($action) || $action == 'view') { $r = ''; - foreach ( $tabpay as $key => $val ) // $key is rowid in llx_bank + foreach ($tabpay as $key => $val) // $key is rowid in llx_bank { $date = dol_print_date($db->jdate($val["date"]), 'day'); $ref = getSourceDocRef($val, $tabtype[$key]); // Bank - foreach ( $tabbq[$key] as $k => $mt ) + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { @@ -1052,7 +1052,7 @@ if (empty($action) || $action == 'view') { // Third party if (is_array($tabtp[$key])) { - foreach ( $tabtp[$key] as $k => $mt ) { + foreach ($tabtp[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -1132,7 +1132,7 @@ if (empty($action) || $action == 'view') { } } } else { // Waiting account - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 34a8d219b90..30ed5a07207 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; $langs->loadLangs(array("commercial", "compta","bills","other","accountancy","trips","errors")); $id_journal = GETPOST('id_journal', 'int'); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -200,7 +200,7 @@ if ($action == 'writebookkeeping') { // Thirdparty if (! $errorforline) { - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -251,7 +251,7 @@ if ($action == 'writebookkeeping') { // Fees if (! $errorforline) { - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { if ($mt) { // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { @@ -309,7 +309,7 @@ if ($action == 'writebookkeeping') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { // get compte id and label $bookkeeping = new BookKeeping($db); @@ -326,7 +326,7 @@ if ($action == 'writebookkeeping') { $accountingaccount->fetch($k, null, true); $bookkeeping->label_compte = $accountingaccount->label; - $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'; + $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; @@ -442,14 +442,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $langs->transnoentitiesnoconv("Credit") . '"' . $sep; print "\n"; - foreach ( $taber as $key => $val ) { + foreach ($taber as $key => $val) { $date = dol_print_date($val["date"], 'day'); $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; // Fees - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); if ($mt) { @@ -463,7 +463,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } } // VAT - foreach ( $tabtva[$key] as $k => $mt ) { + foreach ($tabtva[$key] as $k => $mt) { if ($mt) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; @@ -476,7 +476,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; @@ -492,7 +492,7 @@ if (empty($action) || $action == 'view') { llxHeader('', $langs->trans("ExpenseReportsJournal")); - $nom = $langs->trans("ExpenseReportsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1); + $nom = $langs->trans("ExpenseReportsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0, 1, 1, '', 1); $nomlink = ''; $periodlink = ''; $exportlink = ''; @@ -564,7 +564,7 @@ if (empty($action) || $action == 'view') { $expensereportstatic = new ExpenseReport($db); $expensereportlinestatic = new ExpenseReportLine($db); - foreach ( $taber as $key => $val ) { + foreach ($taber as $key => $val) { $expensereportstatic->id = $key; $expensereportstatic->ref = $val["ref"]; $expensereportlinestatic->comments = html_entity_decode(dol_trunc($val["comments"], 32)); @@ -572,7 +572,7 @@ if (empty($action) || $action == 'view') { $date = dol_print_date($val["date"], 'day'); // Fees - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); @@ -605,7 +605,7 @@ if (empty($action) || $action == 'view') { } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { print '
" . $date . "
"; print '" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); + print "" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); print "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
"; print '"; - print $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); + print $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); print "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
"; print '" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); + print "" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); print "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - $formother->select_year($search_year,'search_year',1, 20, 5); + $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print '' . price($objp->total_ht) . ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - $formother->select_year($search_year,'search_year',1, 20, 5); + $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index bf14ff09fcd..78d2821bf90 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -41,7 +41,7 @@ if (! $user->admin) accessforbidden(); $type=array('yesno','texte','chaine'); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); /* @@ -82,7 +82,7 @@ if ($action == 'updateall') // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { - $constname=GETPOST('constname','alpha'); + $constname=GETPOST('constname', 'alpha'); $constvalue=(GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue')); if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE' || $constname=='ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue=''; @@ -92,9 +92,9 @@ if ($action == 'update' || $action == 'add') else $constvalue=1; } - $consttype=GETPOST('consttype','alpha'); + $consttype=GETPOST('consttype', 'alpha'); $constnote=GETPOST('constnote'); - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + $res=dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); if (! $res > 0) $error++; @@ -111,7 +111,7 @@ if ($action == 'update' || $action == 'add') // Action activation d'un sous module du module adherent if ($action == 'set') { - $result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value'),'',0,'',$conf->entity); + $result=dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity); if ($result < 0) { print $db->error(); @@ -121,7 +121,7 @@ if ($action == 'set') // Action desactivation d'un sous module du module adherent if ($action == 'unset') { - $result=dolibarr_del_const($db,GETPOST('name','alpha'),$conf->entity); + $result=dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity); if ($result < 0) { print $db->error(); @@ -138,11 +138,11 @@ $form = new Form($db); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$langs->trans("MembersSetup"),$help_url); +llxHeader('', $langs->trans("MembersSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); @@ -153,7 +153,7 @@ print '
'; print ''; print ''; -print load_fiche_titre($langs->trans("MemberMainOptions"),'',''); +print load_fiche_titre($langs->trans("MemberMainOptions"), '', ''); print ''; print ''; print ''; @@ -167,12 +167,12 @@ print "\n"; // Mail required for members print '\n"; // Send mail information is on by default print '\n"; // Insert subscription into bank account @@ -182,7 +182,7 @@ if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans(" if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly"); if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice"); print ''; print "\n"; @@ -199,7 +199,7 @@ if ($conf->facture->enabled) else { print ''; } print "\n"; @@ -237,7 +237,7 @@ $constantes=array( 'ADHERENT_CARD_FOOTER_TEXT' ); -print load_fiche_titre($langs->trans("MembersCards"),'',''); +print load_fiche_titre($langs->trans("MembersCards"), '', ''); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; @@ -254,7 +254,7 @@ print '
'; */ $constantes=array('ADHERENT_ETIQUETTE_TYPE','ADHERENT_ETIQUETTE_TEXT'); -print load_fiche_titre($langs->trans("MembersTickets"),'',''); +print load_fiche_titre($langs->trans("MembersTickets"), '', ''); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 33d42986256..09f7aa22032 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -41,7 +41,7 @@ if (! $user->admin) accessforbidden(); $oldtypetonewone=array('texte'=>'text','chaine'=>'string'); // old type to new ones -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); $error = 0; @@ -85,8 +85,8 @@ if ($action == 'updateall') // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { - $constlineid = GETPOST('rowid','int'); - $constname=GETPOST('constname','alpha'); + $constlineid = GETPOST('rowid', 'int'); + $constname=GETPOST('constname', 'alpha'); $constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); $consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); @@ -94,7 +94,7 @@ if ($action == 'update' || $action == 'add') $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; - $res=dolibarr_set_const($db,$constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); + $res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); if (! $res > 0) $error++; @@ -111,7 +111,7 @@ if ($action == 'update' || $action == 'add') // Action activation d'un sous module du module adherent if ($action == 'set') { - $result=dolibarr_set_const($db, GETPOST('name','alpha'), GETPOST('value'), '', 0, '', $conf->entity); + $result=dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity); if ($result < 0) { print $db->error(); @@ -121,7 +121,7 @@ if ($action == 'set') // Action desactivation d'un sous module du module adherent if ($action == 'unset') { - $result=dolibarr_del_const($db,GETPOST('name','alpha'),$conf->entity); + $result=dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity); if ($result < 0) { print $db->error(); @@ -138,11 +138,11 @@ $form = new Form($db); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$langs->trans("MembersSetup"),$help_url); +llxHeader('', $langs->trans("MembersSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 17921eabf3c..e8e112d42b6 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -61,11 +61,11 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("Members"); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$langs->trans("MembersSetup"),$help_url); +llxHeader('', $langs->trans("MembersSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index ab9815a8057..e9e7c601a30 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -64,11 +64,11 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("MembersTypes"); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$langs->trans("MembersSetup"),$help_url); +llxHeader('', $langs->trans("MembersSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 02364a3a1d8..70a37f0bf4b 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -57,12 +57,12 @@ if ($action == 'update') $payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype=GETPOST('MEMBER_NEWFORM_FORCETYPE'); - $res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity); - $res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity); - $res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity); - $res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity); - if ($forcetype < 0) $res=dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE",$conf->entity); - else $res=dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE",$forcetype,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); + $res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity); + $res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity); + $res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); + if ($forcetype < 0) $res=dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); + else $res=dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -84,11 +84,11 @@ if ($action == 'update') $form=new Form($db); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$langs->trans("MembersSetup"),$help_url); +llxHeader('', $langs->trans("MembersSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); @@ -144,14 +144,14 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { // Button off, click to enable $enabledisablehtml.=''; - $enabledisablehtml.=img_picto($langs->trans("Disabled"),'switch_off'); + $enabledisablehtml.=img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml.=''; } else { // Button on, click to disable $enabledisablehtml.=''; - $enabledisablehtml.=img_picto($langs->trans("Activated"),'switch_on'); + $enabledisablehtml.=img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml.=''; } print $enabledisablehtml; @@ -193,7 +193,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) print '\n"; // Jump to an online payment page @@ -206,7 +206,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox'; if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal'; if (! empty($conf->stripe->enabled)) $listofval['stripe']='Stripe'; - print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),0); + print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''), 0); print "\n"; print '
'.$langs->trans("Description").'
'.$langs->trans("AdherentMailRequired").''; -print $form->selectyesno('ADHERENT_MAIL_REQUIRED',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1); +print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0), 1); print "
'.$langs->trans("MemberSendInformationByMailByDefault").''; -print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1); +print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0), 1); print "
'; -print $form->selectarray('ADHERENT_BANK_USE',$arraychoices,$conf->global->ADHERENT_BANK_USE,0); +print $form->selectarray('ADHERENT_BANK_USE', $arraychoices, $conf->global->ADHERENT_BANK_USE, 0); print '
'; - print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name")); + print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name")); print '
'; print $langs->trans("CanEditAmount"); print ''; - print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1); + print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0), 1); print "
'; @@ -226,7 +226,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; - print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':
'; + print img_picto('', 'object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':
'; if ($conf->multicompany->enabled) { $entity_qr='?entity='.$conf->entity; } else { @@ -234,7 +234,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) } // Define $urlwithroot - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index f13efd96300..3869afccf6d 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -36,12 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies","members")); -$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int'); +$id = GETPOST('id', 'int')?GETPOST('id', 'int'):GETPOST('rowid', 'int'); -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -49,19 +49,19 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield='a.datep,a.id'; if (! $sortorder) $sortorder='DESC'; -if (GETPOST('actioncode','array')) +if (GETPOST('actioncode', 'array')) { - $actioncode=GETPOST('actioncode','array',3); + $actioncode=GETPOST('actioncode', 'array', 3); if (! count($actioncode)) $actioncode='0'; } else { - $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label=GETPOST('search_agenda_label'); // Security check -$result=restrictedArea($user,'adherent',$id); +$result=restrictedArea($user, 'adherent', $id); $object = new Adherent($db); $result=$object->fetch($id); @@ -79,20 +79,20 @@ if ($result > 0) */ $parameters=array('id'=>$id, 'objcanvas'=>$objcanvas); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { // Cancel - if (GETPOST('cancel','alpha') && ! empty($backtopage)) + if (GETPOST('cancel', 'alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; } // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $actioncode=''; $search_agenda_label=''; @@ -121,7 +121,7 @@ if ($object->id > 0) $title=$langs->trans("Member") . " - " . $langs->trans("Agenda"); $helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; - llxHeader("",$title,$helpurl); + llxHeader("", $title, $helpurl); if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = member_prepare_head($object); @@ -171,7 +171,7 @@ if ($object->id > 0) $filters['search_agenda_label']=$search_agenda_label; // TODO Replace this with same code than into list.php - show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); } } diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index d4c7147da57..d646a7cfb9b 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -121,7 +121,7 @@ abstract class ActionsAdherentCardCommon } else { - $this->tpl['company'] = $form->select_company($this->object->socid,'socid','',1); + $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); } // Civility @@ -139,26 +139,26 @@ abstract class ActionsAdherentCardCommon } // Zip - $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); + $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town','selectcountry_id','state_id'), 6); // Town - $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id')); + $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode','selectcountry_id','state_id')); if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id; // Country - $this->tpl['select_country'] = $form->select_country($this->object->country_id,'country_id'); + $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; - if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); // State - if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id,$this->object->country_code); + if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id, $this->object->country_code); else $this->tpl['select_state'] = $countrynotdefined; // Physical or Moral $selectarray=array('0'=>$langs->trans("Physical"),'1'=>$langs->trans("Moral")); - $this->tpl['select_morphy'] = $form->selectarray('morphy',$selectarray,$this->object->morphy,0); + $this->tpl['select_morphy'] = $form->selectarray('morphy', $selectarray, $this->object->morphy, 0); } if ($action == 'view' || $action == 'edit' || $action == 'delete') @@ -183,7 +183,7 @@ abstract class ActionsAdherentCardCommon if ($action == 'view' || $action == 'delete') { - $this->tpl['showrefnav'] = $form->showrefnav($this->object,'id'); + $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'id'); if ($this->object->socid > 0) { @@ -206,9 +206,9 @@ abstract class ActionsAdherentCardCommon $img=picto_from_langcode($this->object->country_code); $this->tpl['country'] = ($img?$img.' ':'').$this->object->country; - $this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso,$this->object->country_code,0,$this->object->id,'AC_TEL'); - $this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile,$this->object->country_code,0,$this->object->id,'AC_TEL'); - $this->tpl['email'] = dol_print_email($this->object->email,0,$this->object->id,'AC_EMAIL'); + $this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); + $this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); + $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL'); $this->tpl['visibility'] = $this->object->getmorphylib($this->object->morphy); @@ -230,7 +230,7 @@ abstract class ActionsAdherentCardCommon array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password)); - $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateAdherent"),"confirm_create_user",$formquestion,'no'); + $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("CreateDolibarrLogin"), $langs->trans("ConfirmCreateAdherent"), "confirm_create_user", $formquestion, 'no'); } } diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index 5ead332bf5f..67c1e33dbec 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -102,16 +102,16 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon $objsoc = new Societe($db); $objsoc->fetch($this->object->socid); - $this->tpl['actionstodo']=show_actions_todo($conf,$langs,$db,$objsoc,$this->object,1); + $this->tpl['actionstodo']=show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1); - $this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1); + $this->tpl['actionsdone']=show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); } else { // Confirm delete contact if ($action == 'delete' && $user->rights->adherent->supprimer) { - $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteAdherent"),$langs->trans("ConfirmDeleteAdherent"),"confirm_delete",'',0,1); + $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("DeleteAdherent"), $langs->trans("ConfirmDeleteAdherent"), "confirm_delete", '', 0, 1); } } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php index 99174e7770b..50c66a88f69 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php @@ -30,11 +30,11 @@ if (empty($conf) || ! is_object($conf)) control->tpl['title']); -dol_htmloutput_errors((is_numeric($object->error)?'':$object->error),$object->errors); +dol_htmloutput_errors((is_numeric($object->error)?'':$object->error), $object->errors); -dol_htmloutput_errors((is_numeric($GLOBALS['error'])?'':$GLOBALS['error']),$GLOBALS['errors']); +dol_htmloutput_errors((is_numeric($GLOBALS['error'])?'':$GLOBALS['error']), $GLOBALS['errors']); -dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']); +dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); echo $this->control->tpl['ajax_selectcountry']; ?> diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php index a0331fee35e..96d1a571e8a 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php @@ -33,17 +33,17 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['title']); -dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']); +dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); echo $this->control->tpl['ajax_selectcountry']; ?>
-"> +"> - + diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index 14439bb6e87..39c7810e621 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -32,7 +32,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['showhead']; ?> control->tpl['error'],$this->control->tpl['errors']); +dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); ?> control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?> diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7a6898da9d3..9629b8572fc 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -45,15 +45,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies","bills","members","users","other")); -$action=GETPOST('action','alpha'); -$cancel=GETPOST('cancel','alpha'); -$backtopage=GETPOST('backtopage','alpha'); -$confirm=GETPOST('confirm','alpha'); -$rowid=GETPOST('rowid','int'); -$id=GETPOST('id')?GETPOST('id','int'):$rowid; -$typeid=GETPOST('typeid','int'); -$userid=GETPOST('userid','int'); -$socid=GETPOST('socid','int'); +$action=GETPOST('action', 'alpha'); +$cancel=GETPOST('cancel', 'alpha'); +$backtopage=GETPOST('backtopage', 'alpha'); +$confirm=GETPOST('confirm', 'alpha'); +$rowid=GETPOST('rowid', 'int'); +$id=GETPOST('id')?GETPOST('id', 'int'):$rowid; +$typeid=GETPOST('typeid', 'int'); +$userid=GETPOST('userid', 'int'); +$socid=GETPOST('socid', 'int'); if (! empty($conf->mailmanspip->enabled)) { @@ -120,7 +120,7 @@ $hookmanager->initHooks(array('membercard','globalcard')); */ $parameters=array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas, 'confirm'=>$confirm); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -152,7 +152,7 @@ if (empty($reshook)) if ($userid != $object->user_id) // If link differs from currently in database { $result=$object->setUserId($userid); - if ($result < 0) dol_print_error($object->db,$object->error); + if ($result < 0) dol_print_error($object->db, $object->error); $action=''; } } @@ -179,14 +179,14 @@ if (empty($reshook)) $thirdparty=new Societe($db); $thirdparty->fetch($socid); $error++; - setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); } } if (! $error) { $result=$object->setThirdPartyId($socid); - if ($result < 0) dol_print_error($object->db,$object->error); + if ($result < 0) dol_print_error($object->db, $object->error); $action=''; } } @@ -200,7 +200,7 @@ if (empty($reshook)) { // Creation user $nuser = new User($db); - $result=$nuser->create_from_member($object,GETPOST('login')); + $result=$nuser->create_from_member($object, GETPOST('login')); if ($result < 0) { @@ -282,44 +282,44 @@ if (empty($reshook)) $object->oldcopy = clone $object; // Change values - $object->civility_id = trim(GETPOST("civility_id",'alpha')); - $object->firstname = trim(GETPOST("firstname",'alpha')); - $object->lastname = trim(GETPOST("lastname",'alpha')); - $object->gender = trim(GETPOST("gender",'alpha')); - $object->login = trim(GETPOST("login",'alpha')); - $object->pass = trim(GETPOST("pass",'alpha')); + $object->civility_id = trim(GETPOST("civility_id", 'alpha')); + $object->firstname = trim(GETPOST("firstname", 'alpha')); + $object->lastname = trim(GETPOST("lastname", 'alpha')); + $object->gender = trim(GETPOST("gender", 'alpha')); + $object->login = trim(GETPOST("login", 'alpha')); + $object->pass = trim(GETPOST("pass", 'alpha')); - $object->societe = trim(GETPOST("societe",'alpha')); - $object->company = trim(GETPOST("societe",'alpha')); + $object->societe = trim(GETPOST("societe", 'alpha')); + $object->company = trim(GETPOST("societe", 'alpha')); - $object->address = trim(GETPOST("address",'alpha')); - $object->zip = trim(GETPOST("zipcode",'alpha')); - $object->town = trim(GETPOST("town",'alpha')); - $object->state_id = GETPOST("state_id",'int'); - $object->country_id = GETPOST("country_id",'int'); + $object->address = trim(GETPOST("address", 'alpha')); + $object->zip = trim(GETPOST("zipcode", 'alpha')); + $object->town = trim(GETPOST("town", 'alpha')); + $object->state_id = GETPOST("state_id", 'int'); + $object->country_id = GETPOST("country_id", 'int'); - $object->phone = trim(GETPOST("phone",'alpha')); - $object->phone_perso = trim(GETPOST("phone_perso",'alpha')); - $object->phone_mobile= trim(GETPOST("phone_mobile",'alpha')); - $object->email = preg_replace('/\s+/', '', GETPOST("member_email",'alpha')); - $object->skype = trim(GETPOST("skype",'alpha')); - $object->twitter = trim(GETPOST("twitter",'alpha')); - $object->facebook = trim(GETPOST("facebook",'alpha')); + $object->phone = trim(GETPOST("phone", 'alpha')); + $object->phone_perso = trim(GETPOST("phone_perso", 'alpha')); + $object->phone_mobile= trim(GETPOST("phone_mobile", 'alpha')); + $object->email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); + $object->skype = trim(GETPOST("skype", 'alpha')); + $object->twitter = trim(GETPOST("twitter", 'alpha')); + $object->facebook = trim(GETPOST("facebook", 'alpha')); $object->birth = $birthdate; - $object->typeid = GETPOST("typeid",'int'); + $object->typeid = GETPOST("typeid", 'int'); //$object->note = trim(GETPOST("comment","alpha")); - $object->morphy = GETPOST("morphy",'alpha'); + $object->morphy = GETPOST("morphy", 'alpha'); - if (GETPOST('deletephoto','alpha')) $object->photo=''; + if (GETPOST('deletephoto', 'alpha')) $object->photo=''; elseif (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); // Get status and public property - $object->statut = GETPOST("statut",'alpha'); - $object->public = GETPOST("public",'alpha'); + $object->statut = GETPOST("statut", 'alpha'); + $object->public = GETPOST("public", 'alpha'); // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; // Check if we need to also synchronize user information @@ -336,7 +336,7 @@ if (empty($reshook)) if ($user->id != $object->user_id && empty($user->rights->user->user->password)) $nosyncuserpass=1; // Disable synchronizing } - $result=$object->update($user,0,$nosyncuser,$nosyncuserpass); + $result=$object->update($user, 0, $nosyncuser, $nosyncuserpass); if ($result >= 0 && ! count($object->errors)) { @@ -344,15 +344,15 @@ if (empty($reshook)) $object->setCategories($categories); // Logo/Photo save - $dir= $conf->adherent->dir_output . '/' . get_exdir(0,0,0,1,$object,'member').'/photos'; + $dir= $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 1, $object, 'member').'/photos'; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if ($file_OK) { if (GETPOST('deletephoto')) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $fileimg=$conf->adherent->dir_output.'/'.get_exdir(0,0,0,1,$object,'member').'/photos/'.$object->photo; - $dirthumbs=$conf->adherent->dir_output.'/'.get_exdir(0,0,0,1,$object,'member').'/photos/thumbs'; + $fileimg=$conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/'.$object->photo; + $dirthumbs=$conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/thumbs'; dol_delete_file($fileimg); dol_delete_dir_recursive($dirthumbs); } @@ -364,7 +364,7 @@ if (empty($reshook)) if (@is_dir($dir)) { $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); - if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0) + if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0) { setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } @@ -432,35 +432,35 @@ if (empty($reshook)) $datesubscription=dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); } - $typeid=GETPOST("typeid",'int'); - $civility_id=GETPOST("civility_id",'alpha'); - $lastname=GETPOST("lastname",'alpha'); - $firstname=GETPOST("firstname",'alpha'); - $gender=GETPOST("gender",'alpha'); - $societe=GETPOST("societe",'alpha'); - $address=GETPOST("address",'alpha'); - $zip=GETPOST("zipcode",'alpha'); - $town=GETPOST("town",'alpha'); - $state_id=GETPOST("state_id",'int'); - $country_id=GETPOST("country_id",'int'); + $typeid=GETPOST("typeid", 'int'); + $civility_id=GETPOST("civility_id", 'alpha'); + $lastname=GETPOST("lastname", 'alpha'); + $firstname=GETPOST("firstname", 'alpha'); + $gender=GETPOST("gender", 'alpha'); + $societe=GETPOST("societe", 'alpha'); + $address=GETPOST("address", 'alpha'); + $zip=GETPOST("zipcode", 'alpha'); + $town=GETPOST("town", 'alpha'); + $state_id=GETPOST("state_id", 'int'); + $country_id=GETPOST("country_id", 'int'); - $phone=GETPOST("phone",'alpha'); - $phone_perso=GETPOST("phone_perso",'alpha'); - $phone_mobile=GETPOST("phone_mobile",'alpha'); - $skype=GETPOST("member_skype",'alpha'); - $twitter=GETPOST("member_twitter",'alpha'); - $facebook=GETPOST("member_facebook",'alpha'); - $email=preg_replace('/\s+/', '', GETPOST("member_email",'alpha')); - $login=GETPOST("member_login",'alpha'); - $pass=GETPOST("password",'alpha'); - $photo=GETPOST("photo",'alpha'); + $phone=GETPOST("phone", 'alpha'); + $phone_perso=GETPOST("phone_perso", 'alpha'); + $phone_mobile=GETPOST("phone_mobile", 'alpha'); + $skype=GETPOST("member_skype", 'alpha'); + $twitter=GETPOST("member_twitter", 'alpha'); + $facebook=GETPOST("member_facebook", 'alpha'); + $email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); + $login=GETPOST("member_login", 'alpha'); + $pass=GETPOST("password", 'alpha'); + $photo=GETPOST("photo", 'alpha'); //$comment=GETPOST("comment",'none'); - $morphy=GETPOST("morphy",'alpha'); - $subscription=GETPOST("subscription",'alpha'); - $public=GETPOST("public",'alpha'); + $morphy=GETPOST("morphy", 'alpha'); + $subscription=GETPOST("subscription", 'alpha'); + $public=GETPOST("public", 'alpha'); - $userid=GETPOST("userid",'int'); - $socid=GETPOST("socid",'int'); + $userid=GETPOST("userid", 'int'); + $socid=GETPOST("socid", 'int'); $object->civility_id = $civility_id; $object->firstname = $firstname; @@ -493,7 +493,7 @@ if (empty($reshook)) $object->public = $public; // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; // Check parameters @@ -517,7 +517,7 @@ if (empty($reshook)) if ($num) { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorLoginAlreadyExists",$login), null, 'errors'); + setEventMessages($langs->trans("ErrorLoginAlreadyExists", $login), null, 'errors'); } } if (empty($pass)) { @@ -547,7 +547,7 @@ if (empty($reshook)) if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); + setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); } $public=0; if (isset($public)) $public=1; @@ -820,7 +820,7 @@ $formcompany = new FormCompany($db); $title=$langs->trans("Member") . " - " . $langs->trans("Card"); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$title,$help_url); +llxHeader('', $title, $help_url); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; @@ -833,7 +833,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object = new Adherent($db); $result=$object->fetch($id); - if ($result <= 0) dol_print_error('',$object->error); + if ($result <= 0) dol_print_error('', $object->error); } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template @@ -855,10 +855,10 @@ else $object->state_id = GETPOST('state_id', 'int'); // We set country_id, country_code and country for the selected country - $object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id; + $object->country_id=GETPOST('country_id', 'int')?GETPOST('country_id', 'int'):$mysoc->country_id; if ($object->country_id) { - $tmparray=getCountry($object->country_id,'all'); + $tmparray=getCountry($object->country_id, 'all'); $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; } @@ -929,7 +929,7 @@ else $listetype=$adht->liste_array(); if (count($listetype)) { - print $form->selectarray("typeid", $listetype, GETPOST('typeid','int')?GETPOST('typeid','int'):$typeid, count($listetype)>1?1:0); + print $form->selectarray("typeid", $listetype, GETPOST('typeid', 'int')?GETPOST('typeid', 'int'):$typeid, count($listetype)>1?1:0); } else { print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } @@ -939,23 +939,23 @@ else $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); print '
'.$langs->trans("Nature")."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1); + print $form->selectarray("morphy", $morphys, GETPOST('morphy', 'alpha')?GETPOST('morphy', 'alpha'):$object->morphy, 1); print "
'.$langs->trans("Company").'
'.$langs->trans("Company").'
'.$langs->trans("UserTitle").''; - print $formcompany->select_civility(GETPOST('civility_id','int')?GETPOST('civility_id','int'):$object->civility_id,'civility_id').'
'.$langs->trans("Lastname").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Firstname").'
'.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'
'.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'
'.$langs->trans("Address").''; - print ''; + print ''; print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((GETPOST('zipcode','alphanohtml')?GETPOST('zipcode','alphanohtml'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); + print $formcompany->select_ziptown((GETPOST('zipcode', 'alphanohtml')?GETPOST('zipcode', 'alphanohtml'):$object->zip), 'zipcode', array('town','selectcountry_id','state_id'), 6); print ' '; - print $formcompany->select_ziptown((GETPOST('town','alphanohtml')?GETPOST('town','alphanohtml'):$object->town),'town',array('zipcode','selectcountry_id','state_id')); + print $formcompany->select_ziptown((GETPOST('town', 'alphanohtml')?GETPOST('town', 'alphanohtml'):$object->town), 'town', array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans('Country').''; - print $form->select_country(GETPOST('country_id','alpha')?GETPOST('country_id','alpha'):$object->country_id,'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print $form->select_country(GETPOST('country_id', 'alpha')?GETPOST('country_id', 'alpha'):$object->country_id, 'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans('State').''; if ($object->country_id) { - print $formcompany->select_state(GETPOST('state_id','int')?GETPOST('state_id','int'):$object->state_id,$object->country_code); + print $formcompany->select_state(GETPOST('state_id', 'int')?GETPOST('state_id', 'int'):$object->state_id, $object->country_code); } else { @@ -1003,40 +1003,40 @@ else } // Pro phone - print '
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePerso").'
'.$langs->trans("PhonePerso").'
'.$langs->trans("PhoneMobile").'
'.$langs->trans("PhoneMobile").'
'.$langs->trans("Skype").'
'.$langs->trans("Skype").'
'.$langs->trans("Twitter").'
'.$langs->trans("Twitter").'
'.$langs->trans("Facebook").'
'.$langs->trans("Facebook").'
".$langs->trans("Birthday")."\n"; - print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); + print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc'); print "
".$langs->trans("Public")."\n"; - print $form->selectyesno("public",$object->public,1); + print $form->selectyesno("public", $object->public, 1); print "
'.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">
'.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">
'.$langs->trans("Password").'pass).'">
'.$langs->trans("Password").'pass).'">
'.$langs->trans("Nature").''; - print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy",'alpha'):$object->morphy)); + print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy", 'alpha'):$object->morphy)); print "
'.$langs->trans("Type").''; if ($user->rights->adherent->creer) { - print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid")?GETPOST("typeid",'int'):$object->typeid)); + print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid")?GETPOST("typeid", 'int'):$object->typeid)); } else { @@ -1191,7 +1191,7 @@ else print "
'.$langs->trans("Company").'societe).'">
'.$langs->trans("Company").'societe).'">
'.$langs->trans("UserTitle").''; @@ -1200,11 +1200,11 @@ else print '
'.$langs->trans("Lastname").'lastname).'">
'.$langs->trans("Lastname").'lastname).'">
'.$langs->trans("Firstname").'firstname).'">
'.$langs->trans("Firstname").'firstname).'">
'.$langs->trans("Photo").''; - print $form->showphoto('memberphoto',$object)."\n"; + print $form->showphoto('memberphoto', $object)."\n"; if ($caneditfieldmember) { if ($object->photo) print "
\n"; @@ -1230,32 +1230,32 @@ else print '
'.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">
'.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">
'.$langs->trans("Address").''; - print ''; + print ''; print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode",'',2):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); + print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode", '', 2):$object->zip), 'zipcode', array('town','selectcountry_id','state_id'), 6); print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town",'',2):$object->town),'town',array('zipcode','selectcountry_id','state_id')); + print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town", '', 2):$object->town), 'town', array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans('Country').''; - print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id, 'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans('State').''; - print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id); + print $formcompany->select_state($object->state_id, isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id); print '
".$langs->trans("Birthday")."\n"; - print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); + print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc'); print "
".$langs->trans("Public")."\n"; - print $form->selectyesno("public",(isset($_POST["public"])?GETPOST("public",'',2):$object->public),1); + print $form->selectyesno("public", (isset($_POST["public"])?GETPOST("public", '', 2):$object->public), 1); print "
'.$langs->trans("LinkedToDolibarrUser").''; if ($object->user_id) { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); } else print $langs->trans("NoDolibarrAccess"); print '
'.$langs->trans("Password").''.preg_replace('/./i','*',$object->pass); - if ($object->pass) print preg_replace('/./i','*',$object->pass); + print '
'.$langs->trans("Password").''.preg_replace('/./i', '*', $object->pass); + if ($object->pass) print preg_replace('/./i', '*', $object->pass); else { if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; @@ -1628,7 +1628,7 @@ else { $langs->load("errors"); $htmltext=$langs->trans("WarningPasswordSetWithNoAccount"); - print ' '.$form->textwithpicto('', $htmltext,1,'warning'); + print ' '.$form->textwithpicto('', $htmltext, 1, 'warning'); } print '
'.$langs->trans("SubscriptionEndDate").''; if ($object->datefin) { - print dol_print_date($object->datefin,'day'); + print dol_print_date($object->datefin, 'day'); if ($object->hasDelay()) { print " ".img_warning($langs->trans("Late")); } @@ -1673,7 +1673,7 @@ else print ''; print ''; print ''; print ''; print '
'; - print $form->select_company($object->fk_soc,'socid','',1); + print $form->select_company($object->fk_soc, 'socid', '', 1); print '
'; @@ -1701,13 +1701,13 @@ else print '
'; if ($action == 'editlogin') { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); } else { if ($object->user_id) { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); } else print $langs->trans("NoDolibarrAccess"); } @@ -1723,7 +1723,7 @@ else print ''; // Birthday - print ''; + print ''; // Public print ''; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index c50de6f8c81..412f0f4288d 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -33,14 +33,14 @@ $langs->loadLangs(array("members","errors")); // Choix de l'annee d'impression ou annee courante. $now = dol_now(); -$year=dol_print_date($now,'%Y'); -$month=dol_print_date($now,'%m'); -$day=dol_print_date($now,'%d'); -$foruserid=GETPOST('foruserid','alphanohtml'); -$foruserlogin=GETPOST('foruserlogin','alphanohtml'); -$mode=GETPOST('mode','aZ09'); -$model=GETPOST("model",'aZ09'); // Doc template to use for business cards -$modellabel=GETPOST("modellabel",'aZ09'); // Doc template to use for address sheet +$year=dol_print_date($now, '%Y'); +$month=dol_print_date($now, '%m'); +$day=dol_print_date($now, '%d'); +$foruserid=GETPOST('foruserid', 'alphanohtml'); +$foruserlogin=GETPOST('foruserlogin', 'alphanohtml'); +$mode=GETPOST('mode', 'aZ09'); +$model=GETPOST("model", 'aZ09'); // Doc template to use for business cards +$modellabel=GETPOST("modellabel", 'aZ09'); // Doc template to use for address sheet $mesg=''; $adherentstatic=new Adherent($db); @@ -57,7 +57,7 @@ $extralabels = $extrafields->fetch_name_optionals_label('adherent'); if ($mode == 'cardlogin' && empty($foruserlogin)) { - $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Login")); + $mesg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")); } if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg) @@ -128,7 +128,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg '__COUNTRY__'=>$objp->country, '__COUNTRY_CODE__'=>$objp->country_code, '__EMAIL__'=>$objp->email, - '__BIRTH__'=>dol_print_date($objp->birth,'day'), + '__BIRTH__'=>dol_print_date($objp->birth, 'day'), '__TYPE__'=>$objp->type, '__YEAR__'=>$year, '__MONTH__'=>$month, @@ -205,7 +205,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg } if (empty($model) || $model == '-1') { - $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE")); + $mesg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE")); } if (! $mesg) $result=members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs); } @@ -217,14 +217,14 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg } if (empty($modellabel) || $modellabel == '-1') { - $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_ETIQUETTE_TYPE")); + $mesg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_ETIQUETTE_TYPE")); } if (! $mesg) $result=doc_label_pdf_create($db, $arrayofmembers, $modellabel, $outputlangs); } if ($result <= 0) { - dol_print_error('',$result); + dol_print_error('', $result); } } else @@ -246,7 +246,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg $form=new Form($db); -llxHeader('',$langs->trans("MembersCards")); +llxHeader('', $langs->trans("MembersCards")); print load_fiche_titre($langs->trans("LinkToGeneratedPages")); print '
'; @@ -256,7 +256,7 @@ print '
'; dol_htmloutput_errors($mesg); -print img_picto('','puce').' '.$langs->trans("DocForAllMembersCards",($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; print ''; print ''; @@ -274,7 +274,7 @@ print '
'; print '
'; -print img_picto('','puce').' '.$langs->trans("DocForOneMemberCards",($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; print ''; print ''; @@ -286,13 +286,13 @@ foreach(array_keys($_Avery_Labels) as $codecards) $arrayoflabels[$codecards]=$_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model',$arrayoflabels,(GETPOST('model')?GETPOST('model'):$conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model')?GETPOST('model'):$conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'.$langs->trans("Login").': '; print '
'; print ''; print '
'; -print img_picto('','puce').' '.$langs->trans("DocForLabels",$conf->global->ADHERENT_ETIQUETTE_TYPE).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; print ''; print ''; print ''; @@ -304,7 +304,7 @@ foreach(array_keys($_Avery_Labels) as $codecards) $arrayoflabels[$codecards]=$_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('modellabel',$arrayoflabels,(GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print ''; print '
'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f5cb86304d5..0776efff98a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -255,7 +255,7 @@ class Adherent extends CommonObject if ($msgishtml == -1) { $msgishtml = 0; - if (dol_textishtml($text,0)) $msgishtml = 1; + if (dol_textishtml($text, 0)) $msgishtml = 1; } dol_syslog('send_an_email msgishtml='.$msgishtml); @@ -279,7 +279,7 @@ class Adherent extends CommonObject } else { - $this->error=$langs->trans("ErrorFailedToSendMail",$from,$this->email).'. '.$mailfile->error; + $this->error=$langs->trans("ErrorFailedToSendMail", $from, $this->email).'. '.$mailfile->error; return -1; } } @@ -295,10 +295,10 @@ class Adherent extends CommonObject { global $conf,$langs; - $birthday = dol_print_date($this->birth,'day'); + $birthday = dol_print_date($this->birth, 'day'); $msgishtml = 0; - if (dol_textishtml($text,1)) $msgishtml = 1; + if (dol_textishtml($text, 1)) $msgishtml = 1; $infos=''; if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel()."\n"; @@ -389,7 +389,7 @@ class Adherent extends CommonObject if (! empty($conf->global->ADHERENT_MAIL_REQUIRED) && ! isValidEMail($this->email)) { $langs->load("errors"); - $this->error = $langs->trans("ErrorBadEMail",$this->email); + $this->error = $langs->trans("ErrorBadEMail", $this->email); return -1; } if (! $this->datec) $this->datec=$now; @@ -397,7 +397,7 @@ class Adherent extends CommonObject { if (empty($this->login)) { - $this->error = $langs->trans("ErrorWrongValueForParameterX","Login"); + $this->error = $langs->trans("ErrorWrongValueForParameterX", "Login"); return -1; } } @@ -428,7 +428,7 @@ class Adherent extends CommonObject $this->ref=(string) $id; // Update minor fields - $result=$this->update($user,1,1,0,0,'add'); // nosync is 1 to avoid update data of user + $result=$this->update($user, 1, 1, 0, 0, 'add'); // nosync is 1 to avoid update data of user if ($result < 0) { $this->db->rollback(); @@ -455,14 +455,14 @@ class Adherent extends CommonObject if (! $notrigger) { // Call trigger - $result=$this->call_trigger('MEMBER_CREATE',$user); + $result=$this->call_trigger('MEMBER_CREATE', $user); if ($result < 0) { $error++; } // End call triggers } if (count($this->errors)) { - dol_syslog(get_class($this)."::create ".implode(',',$this->errors), LOG_ERR); + dol_syslog(get_class($this)."::create ".implode(',', $this->errors), LOG_ERR); $this->db->rollback(); return -3; } @@ -527,7 +527,7 @@ class Adherent extends CommonObject if (! empty($conf->global->ADHERENT_MAIL_REQUIRED) && ! isValidEMail($this->email)) { $langs->load("errors"); - $this->error = $langs->trans("ErrorBadEMail",$this->email); + $this->error = $langs->trans("ErrorBadEMail", $this->email); return -1; } @@ -598,7 +598,7 @@ class Adherent extends CommonObject $isencrypted = empty($conf->global->DATABASE_PWD_ENCRYPTED)?0:1; // If password to set differs from the one found into database - $result=$this->setPassword($user,$this->pass,$isencrypted,$notrigger,$nosyncuserpass); + $result=$this->setPassword($user, $this->pass, $isencrypted, $notrigger, $nosyncuserpass); if (! $nbrowsaffected) $nbrowsaffected++; } } @@ -665,11 +665,11 @@ class Adherent extends CommonObject $luser->fk_member=$this->id; - $result=$luser->update($user,0,1,1); // Use nosync to 1 to avoid cyclic updates + $result=$luser->update($user, 0, 1, 1); // Use nosync to 1 to avoid cyclic updates if ($result < 0) { $this->error=$luser->error; - dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); + dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); $error++; } } @@ -692,7 +692,7 @@ class Adherent extends CommonObject $lthirdparty=new Societe($this->db); $result=$lthirdparty->fetch($this->fk_soc); - if ($result >= 0) + if ($result > 0) { $lthirdparty->address=$this->address; $lthirdparty->zip=$this->zip; @@ -712,11 +712,11 @@ class Adherent extends CommonObject { $this->error=$lthirdparty->error; $this->errors=$lthirdparty->errors; - dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); + dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); $error++; } } - else + elseif ($result < 0) { $this->error=$lthirdparty->error; $error++; @@ -727,7 +727,7 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { // Call trigger - $result=$this->call_trigger('MEMBER_MODIFY',$user); + $result=$this->call_trigger('MEMBER_MODIFY', $user); if ($result < 0) { $error++; } // End call triggers } @@ -833,7 +833,7 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { // Call trigger - $result=$this->call_trigger('MEMBER_DELETE',$user); + $result=$this->call_trigger('MEMBER_DELETE', $user); if ($result < 0) $error++; // End call triggers } @@ -933,7 +933,7 @@ class Adherent extends CommonObject $error=0; - dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i','*',$password)." isencrypted=".$isencrypted); + dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." isencrypted=".$isencrypted); // If new password not provided, we generate one if (! $password) @@ -991,11 +991,11 @@ class Adherent extends CommonObject if ($result >= 0) { - $result=$luser->setPassword($user,$this->pass,0,0,1); + $result=$luser->setPassword($user, $this->pass, 0, 0, 1); if ($result < 0) { $this->error=$luser->error; - dol_syslog(get_class($this)."::setPassword ".$this->error,LOG_ERR); + dol_syslog(get_class($this)."::setPassword ".$this->error, LOG_ERR); $error++; } } @@ -1009,7 +1009,7 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { // Call trigger - $result=$this->call_trigger('MEMBER_NEW_PASSWORD',$user); + $result=$this->call_trigger('MEMBER_NEW_PASSWORD', $user); if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers } @@ -1420,8 +1420,8 @@ class Adherent extends CommonObject else { // If no end date, end date = date + 1 year - 1 day - $datefin = dol_time_plus_duree($date,1,'y'); - $datefin = dol_time_plus_duree($datefin,-1,'d'); + $datefin = dol_time_plus_duree($date, 1, 'y'); + $datefin = dol_time_plus_duree($datefin, -1, 'd'); } // Create subscription @@ -1653,7 +1653,7 @@ class Adherent extends CommonObject $vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription); } //print xx".$vattouse." - ".$mysoc." - ".$customer;exit; - $result=$invoice->addline($label,0,1,$vattouse,0,0,$idprodsubscription,0,$datesubscription,'',0,0,'','TTC',$amount,1); + $result=$invoice->addline($label, 0, 1, $vattouse, 0, 0, $idprodsubscription, 0, $datesubscription, '', 0, 0, '', 'TTC', $amount, 1); if ($result <= 0) { $this->error=$invoice->error; @@ -1692,7 +1692,7 @@ class Adherent extends CommonObject $paiement = new Paiement($this->db); $paiement->datepaye = $paymentdate; $paiement->amounts = $amounts; - $paiement->paiementid = dol_getIdFromCode($this->db,$operation,'c_paiement','code','id',1); + $paiement->paiementid = dol_getIdFromCode($this->db, $operation, 'c_paiement', 'code', 'id', 1); $paiement->num_paiement = $num_chq; $paiement->note = $label; $paiement->note_public = $label; @@ -1712,7 +1712,7 @@ class Adherent extends CommonObject if (! $error) { // Add transaction into bank account - $bank_line_id=$paiement->addPaymentToBank($user,'payment','(SubscriptionPayment)',$accountid,$emetteur_nom,$emetteur_banque); + $bank_line_id=$paiement->addPaymentToBank($user, 'payment', '(SubscriptionPayment)', $accountid, $emetteur_nom, $emetteur_banque); if (! ($bank_line_id > 0)) { $this->error=$paiement->error; @@ -1808,7 +1808,7 @@ class Adherent extends CommonObject $this->statut=1; // Call trigger - $result=$this->call_trigger('MEMBER_VALIDATE',$user); + $result=$this->call_trigger('MEMBER_VALIDATE', $user); if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers @@ -1858,7 +1858,7 @@ class Adherent extends CommonObject $this->statut=0; // Call trigger - $result=$this->call_trigger('MEMBER_RESILIATE',$user); + $result=$this->call_trigger('MEMBER_RESILIATE', $user); if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers @@ -1903,12 +1903,12 @@ class Adherent extends CommonObject foreach ($mailmanspip->mladded_ko as $tmplist => $tmpemail) { $langs->load("errors"); - $this->errors[]=$langs->trans("ErrorFailedToAddToMailmanList",$tmpemail,$tmplist); + $this->errors[]=$langs->trans("ErrorFailedToAddToMailmanList", $tmpemail, $tmplist); } foreach ($mailmanspip->mladded_ok as $tmplist => $tmpemail) { $langs->load("mailmanspip"); - $this->mesgs[]=$langs->trans("SuccessToAddToMailmanList",$tmpemail,$tmplist); + $this->mesgs[]=$langs->trans("SuccessToAddToMailmanList", $tmpemail, $tmplist); } } @@ -1962,12 +1962,12 @@ class Adherent extends CommonObject foreach ($mailmanspip->mlremoved_ko as $tmplist => $tmpemail) { $langs->load("errors"); - $this->errors[]=$langs->trans("ErrorFailedToRemoveToMailmanList",$tmpemail,$tmplist); + $this->errors[]=$langs->trans("ErrorFailedToRemoveToMailmanList", $tmpemail, $tmplist); } foreach ($mailmanspip->mlremoved_ok as $tmplist => $tmpemail) { $langs->load("mailmanspip"); - $this->mesgs[]=$langs->trans("SuccessToRemoveToMailmanList",$tmpemail,$tmplist); + $this->mesgs[]=$langs->trans("SuccessToRemoveToMailmanList", $tmpemail, $tmplist); } } @@ -2056,7 +2056,7 @@ class Adherent extends CommonObject { // Add param to save lastsearch_values or not $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; } @@ -2094,7 +2094,7 @@ class Adherent extends CommonObject if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); elseif ($mode == 'ref') $result.=$this->id; - else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + else $result.=$this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen); if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; } $result.=$linkend; @@ -2111,7 +2111,7 @@ class Adherent extends CommonObject */ function getLibStatut($mode = 0) { - return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode); + return $this->LibStatut($this->statut, $this->need_subscription, $this->datefin, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps @@ -2151,53 +2151,53 @@ class Adherent extends CommonObject } elseif ($mode == 2) { - if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort"); + if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort"); elseif ($statut >= 1) { - if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1').' '.$langs->trans("MemberStatusActiveShort"); - elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3').' '.$langs->trans("MemberStatusActiveLateShort"); - else return img_picto($langs->trans('MemberStatusPaid'),'statut4').' '.$langs->trans("MemberStatusPaidShort"); + if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort"); + elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort"); + else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort"); } - elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort"); + elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5').' '.$langs->trans("MemberStatusResiliatedShort"); } elseif ($mode == 3) { - if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0'); + if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0'); elseif ($statut >= 1) { - if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1'); - elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); - else return img_picto($langs->trans('MemberStatusPaid'),'statut4'); + if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1'); + elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3'); + else return img_picto($langs->trans('MemberStatusPaid'), 'statut4'); } - elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5'); } elseif ($mode == 4) { - if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft"); + if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft"); elseif ($statut >= 1) { - if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1').' '.$langs->trans("MemberStatusActive"); - elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3').' '.$langs->trans("MemberStatusActiveLate"); - else return img_picto($langs->trans('MemberStatusPaid'),'statut4').' '.$langs->trans("MemberStatusPaid"); + if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive"); + elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate"); + else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid"); } - if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); + if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5').' '.$langs->trans("MemberStatusResiliated"); } elseif ($mode == 5) { - if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); + if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0'); elseif ($statut >= 1) { - if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActiveShort").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); - elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLateShort").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); - else return ''.$langs->trans("MemberStatusPaidShort").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); + if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActiveShort").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1'); + elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLateShort").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3'); + else return ''.$langs->trans("MemberStatusPaidShort").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4'); } - if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'), 'statut5'); } elseif ($mode == 6) { - if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); + if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0'); if ($statut >= 1) { - if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); - elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); - else return ''.$langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); + if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1'); + elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3'); + else return ''.$langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4'); } - if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'), 'statut5'); } } @@ -2269,7 +2269,7 @@ class Adherent extends CommonObject $response->warning_delay=$conf->adherent->subscription->warning_delay/60/60/24; $response->label=$langs->trans("MembersWithSubscriptionToReceive"); $response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1&filter=outofdate'; - $response->img=img_object('',"user"); + $response->img=img_object('', "user"); $adherentstatic = new Adherent($this->db); @@ -2427,7 +2427,7 @@ class Adherent extends CommonObject $keymodified=false; // Object classes - $info["objectclass"]=explode(',',$conf->global->LDAP_MEMBER_OBJECT_CLASS); + $info["objectclass"]=explode(',', $conf->global->LDAP_MEMBER_OBJECT_CLASS); $this->fullname=$this->getFullName($langs); @@ -2476,9 +2476,9 @@ class Adherent extends CommonObject if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; if ($this->note_private && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note_private, 2); if ($this->note_public && ! empty($conf->global->LDAP_MEMBER_FIELD_NOTE_PUBLIC)) $info[$conf->global->LDAP_MEMBER_FIELD_NOTE_PUBLIC] = dol_string_nohtmltag($this->note_public, 2); - if ($this->birth && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->birth,'dayhourldap'); + if ($this->birth && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->birth, 'dayhourldap'); if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; - if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); + if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin, 'dayhourldap'); // When password is modified if (! empty($this->pass)) @@ -2510,9 +2510,9 @@ class Adherent extends CommonObject } // Subscriptions - if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap'); + if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date, 'dayhourldap'); if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount; - if ($this->last_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap'); + if ($this->last_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date, 'dayhourldap'); if (isset($this->last_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount; return $info; @@ -2721,7 +2721,7 @@ class Adherent extends CommonObject $nbok = 0; $nbko = 0; - $arraydaysbeforeend=explode(';',$daysbeforeendlist); + $arraydaysbeforeend=explode(';', $daysbeforeendlist); foreach($arraydaysbeforeend as $daysbeforeend) // Loop on each delay { dol_syslog(__METHOD__.' - Process delta = '.$daysbeforeend, LOG_DEBUG); @@ -2810,7 +2810,7 @@ class Adherent extends CommonObject $extraparams=''; $actionmsg=''; - $actionmsg2=$langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from,4,0,1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto,4,0,1); + $actionmsg2=$langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from, 4, 0, 1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto, 4, 0, 1); if ($message) { $actionmsg=$langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index dd9da927c25..9fd7a9b9d38 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -128,7 +128,7 @@ class AdherentType extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent_type"); - $result = $this->update($user,1); + $result = $this->update($user, 1); if ($result < 0) { $this->db->rollback(); @@ -138,7 +138,7 @@ class AdherentType extends CommonObject if (! $notrigger) { // Call trigger - $result=$this->call_trigger('MEMBER_TYPE_CREATE',$user); + $result=$this->call_trigger('MEMBER_TYPE_CREATE', $user); if ($result < 0) { $error++; } // End call triggers } @@ -208,7 +208,7 @@ class AdherentType extends CommonObject if (! $error && ! $notrigger) { // Call trigger - $result=$this->call_trigger('MEMBER_TYPE_MODIFY',$user); + $result=$this->call_trigger('MEMBER_TYPE_MODIFY', $user); if ($result < 0) { $error++; } // End call triggers } @@ -251,7 +251,7 @@ class AdherentType extends CommonObject if ($resql) { // Call trigger - $result=$this->call_trigger('MEMBER_TYPE_DELETE',$user); + $result=$this->call_trigger('MEMBER_TYPE_DELETE', $user); if ($result < 0) { $error++; $this->db->rollback(); return -2; } // End call triggers @@ -380,7 +380,7 @@ class AdherentType extends CommonObject { $memberstatic=new Adherent($this->db); if ($mode == 1) { - $memberstatic->fetch($obj->rowid,'','','',false, false); + $memberstatic->fetch($obj->rowid, '', '', '', false, false); } else { $memberstatic->fetch($obj->rowid); } @@ -416,14 +416,14 @@ class AdherentType extends CommonObject global $langs; $result=''; - $label=$langs->trans("ShowTypeCard",$this->label); + $label=$langs->trans("ShowTypeCard", $this->label); $linkstart = ''; $linkend=''; $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto != 2) $result.= ($maxlen?dol_trunc($this->label,$maxlen):$this->label); + if ($withpicto != 2) $result.= ($maxlen?dol_trunc($this->label, $maxlen):$this->label); $result .= $linkend; return $result; @@ -475,7 +475,7 @@ class AdherentType extends CommonObject $info=array(); // Object classes - $info["objectclass"]=explode(',',$conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS); + $info["objectclass"]=explode(',', $conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS); // Champs if ($this->label && ! empty($conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME] = $this->label; @@ -486,7 +486,7 @@ class AdherentType extends CommonObject foreach($this->members as $key=>$val) // This is array of users for group into dolibarr database. { $member=new Adherent($this->db); - $member->fetch($val->id,'','','',false,false); + $member->fetch($val->id, '', '', '', false, false); $info2 = $member->_load_ldap_info(); $valueofldapfield[] = $member->_load_ldap_dn($info2); } diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index f5ef24fb465..7468ddb92a9 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -95,7 +95,7 @@ class AdherentStats extends Stats $sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; - $sql.= $this->db->order('dm','DESC'); + $sql.= $this->db->order('dm', 'DESC'); return $this->_getNbByMonth($year, $sql, $format); } @@ -114,7 +114,7 @@ class AdherentStats extends Stats //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; $sql.= " GROUP BY dm"; - $sql.= $this->db->order('dm','DESC'); + $sql.= $this->db->order('dm', 'DESC'); return $this->_getNbByYear($sql); } @@ -136,7 +136,7 @@ class AdherentStats extends Stats $sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; - $sql.= $this->db->order('dm','DESC'); + $sql.= $this->db->order('dm', 'DESC'); return $this->_getAmountByMonth($year, $sql, $format); } @@ -157,7 +157,7 @@ class AdherentStats extends Stats $sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; - $sql.= $this->db->order('dm','DESC'); + $sql.= $this->db->order('dm', 'DESC'); return $this->_getAverageByMonth($year, $sql); } @@ -177,7 +177,7 @@ class AdherentStats extends Stats //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; $sql.= " GROUP BY year"; - $sql.= $this->db->order('year','DESC'); + $sql.= $this->db->order('year', 'DESC'); return $this->_getAllByYear($sql); } diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 9ced878a68e..7e43e17fd6f 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -69,7 +69,7 @@ class Members extends DolibarrApi throw new RestException(404, 'member not found'); } - if( ! DolibarrApi::_checkAccessToResource('adherent',$member->id)) { + if( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -199,7 +199,7 @@ class Members extends DolibarrApi throw new RestException(404, 'member not found'); } - if( ! DolibarrApi::_checkAccessToResource('member',$member->id)) { + if( ! DolibarrApi::_checkAccessToResource('member', $member->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -253,12 +253,12 @@ class Members extends DolibarrApi throw new RestException(404, 'member not found'); } - if( ! DolibarrApi::_checkAccessToResource('member',$member->id)) { + if( ! DolibarrApi::_checkAccessToResource('member', $member->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } if (! $member->delete($member->id, DolibarrApiAccess::$user)) { - throw new RestException(401,'error when deleting member'); + throw new RestException(401, 'error when deleting member'); } return array( diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index e82b126529b..e6ce4ace151 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -65,7 +65,7 @@ class MembersTypes extends DolibarrApi throw new RestException(404, 'member type not found'); } - if( ! DolibarrApi::_checkAccessToResource('member',$membertype->id,'adherent_type')) { + if( ! DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -191,7 +191,7 @@ class MembersTypes extends DolibarrApi throw new RestException(404, 'member type not found'); } - if( ! DolibarrApi::_checkAccessToResource('member',$membertype->id,'adherent_type')) { + if( ! DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -231,12 +231,12 @@ class MembersTypes extends DolibarrApi throw new RestException(404, 'member type not found'); } - if ( ! DolibarrApi::_checkAccessToResource('member',$membertype->id,'adherent_type')) { + if ( ! DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } if (! $membertype->delete($membertype->id)) { - throw new RestException(401,'error when deleting member type'); + throw new RestException(401, 'error when deleting member type'); } return array( diff --git a/htdocs/adherents/class/api_subscriptions.class.php b/htdocs/adherents/class/api_subscriptions.class.php index ed403167dd4..3089f2cfd98 100644 --- a/htdocs/adherents/class/api_subscriptions.class.php +++ b/htdocs/adherents/class/api_subscriptions.class.php @@ -222,7 +222,7 @@ class Subscriptions extends DolibarrApi } if (! $subscription->delete(DolibarrApiAccess::$user)) { - throw new RestException(401,'error when deleting subscription'); + throw new RestException(401, 'error when deleting subscription'); } return array( diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 04d54c79b21..0d43b9d3f09 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -133,7 +133,7 @@ class Subscription extends CommonObject if (! $error && ! $notrigger) { // Call triggers - $result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE',$user); + $result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE', $user); if ($result < 0) { $error++; } // End call triggers } @@ -235,7 +235,7 @@ class Subscription extends CommonObject if (! $error && ! $notrigger) { // Call triggers - $result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY',$user); + $result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user); if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail // End call triggers } @@ -371,7 +371,7 @@ class Subscription extends CommonObject { // Add param to save lastsearch_values or not $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; } diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index e8d80898041..8dca985af70 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -37,17 +37,17 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $langs->loadLangs(array("companies","members","other")); -$id=GETPOST('id','int'); -$action=GETPOST('action','alpha'); -$confirm=GETPOST('confirm','alpha'); +$id=GETPOST('id', 'int'); +$action=GETPOST('action', 'alpha'); +$confirm=GETPOST('confirm', 'alpha'); // Security check -$result=restrictedArea($user,'adherent',$id); +$result=restrictedArea($user, 'adherent', $id); // Get parameters -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; @@ -83,7 +83,7 @@ $form = new Form($db); $title=$langs->trans("Member") . " - " . $langs->trans("Documents"); $helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("",$title,$helpurl); +llxHeader("", $title, $helpurl); if ($id > 0) { @@ -92,7 +92,7 @@ if ($id > 0) { // Build file list - $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $filearray=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC), 1); $totalsize=0; foreach($filearray as $key => $file) { @@ -144,7 +144,7 @@ if ($id > 0) print ''; //Total taille - print ''; + print ''; print '
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Birthday").''.dol_print_date($object->birth, 'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize,1,1).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
'; diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index adc3d32eea4..4d860abcc68 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -60,7 +60,7 @@ if ($cotis==1) { $sql .= " AND datefin > '".$db->idate($now)."'"; } -$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->order($sortfield, $sortorder); //$sql.=$db->plimit($conf->liste_limit, $offset); $resql = $db->query($sql); @@ -69,13 +69,13 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',0); + print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0); print "
\n"; while ($i < $num) { $objp = $db->fetch_object($result); - $htpass=crypt($objp->pass,makesalt()); + $htpass=crypt($objp->pass, makesalt()); print $objp->login.":".$htpass."
\n"; $i++; } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index b3c40e0bfeb..43f4a99e6c1 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -33,14 +33,14 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; $langs->loadLangs(array("companies","members")); // Security check -$result=restrictedArea($user,'adherent'); +$result=restrictedArea($user, 'adherent'); /* * View */ -llxHeader('',$langs->trans("Members"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $langs->trans("Members"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $staticmember=new Adherent($db); $statictype=new AdherentType($db); @@ -174,7 +174,7 @@ if ($conf->use_javascript_ajax) $i=0; foreach ($AdherentType as $key => $adhtype) { - $datalabels[]=array($i,$adhtype->getNomUrl(0,dol_size(16))); + $datalabels[]=array($i,$adhtype->getNomUrl(0, dol_size(16))); $dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0); $dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0); $dataval['uptodate'][]=array($i,isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0); @@ -234,7 +234,7 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - $year=dol_print_date($db->jdate($objp->dateh),"%Y"); + $year=dol_print_date($db->jdate($objp->dateh), "%Y"); $Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->subscription; $Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1; $tot+=$objp->subscription; @@ -259,7 +259,7 @@ foreach ($Total as $key=>$value) print "
$key".$Number[$key]."".price($value)."".price(price2num($value/$Number[$key],'MT'))."".price(price2num($value/$Number[$key], 'MT'))."
'.$langs->trans("Total").'".$numb."'.price($tot)."".price(price2num($numb>0?($tot/$numb):0,'MT'))."".price(price2num($numb>0?($tot/$numb):0, 'MT'))."
"; print "
\n"; @@ -287,7 +287,7 @@ $sql.= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql.= " WHERE a.entity IN (".getEntity('adherent').")"; $sql.= " AND a.fk_adherent_type = ta.rowid"; -$sql.= $db->order("a.tms","DESC"); +$sql.= $db->order("a.tms", "DESC"); $sql.= $db->plimit($max, 0); $resql=$db->query($sql); @@ -296,7 +296,7 @@ if ($resql) print '
'; print ''; print ''; - print ''; + print ''; $num = $db->num_rows($resql); if ($num) @@ -322,10 +322,10 @@ if ($resql) $staticmember->ref=$staticmember->getFullName($langs); $statictype->id=$obj->typeid; $statictype->label=$obj->label; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; $i++; } @@ -350,7 +350,7 @@ $sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_sta $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; $sql.= " WHERE a.entity IN (".getEntity('adherent').")"; $sql.= " AND c.fk_adherent = a.rowid"; -$sql.= $db->order("c.tms","DESC"); +$sql.= $db->order("c.tms", "DESC"); $sql.= $db->plimit($max, 0); $resql=$db->query($sql); @@ -359,7 +359,7 @@ if ($resql) print '
'; print '
'.$langs->trans("LastMembersModified",$max).'
'.$langs->trans("LastMembersModified", $max).'
'.$staticmember->getNomUrl(1,32).''.$statictype->getNomUrl(1,32).''.dol_print_date($db->jdate($obj->datem),'dayhour').''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''.$staticmember->getNomUrl(1, 32).''.$statictype->getNomUrl(1, 32).''.dol_print_date($db->jdate($obj->datem), 'dayhour').''.$staticmember->LibStatut($obj->statut, ($obj->subscription=='yes'?1:0), $db->jdate($obj->date_end_subscription), 5).'
'; print ''; - print ''; + print ''; $num = $db->num_rows($resql); if ($num) @@ -383,11 +383,11 @@ if ($resql) } $staticmember->ref=$staticmember->getFullName($langs); print ''; - print ''; - print ''; + print ''; + print ''; print ''; //print ''; - print ''; + print ''; print ''; $i++; } @@ -416,18 +416,18 @@ foreach ($AdherentType as $key => $adhtype) { print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; } print ''; print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print ''; print "
'.$langs->trans("LastSubscriptionsModified",$max).'
'.$langs->trans("LastSubscriptionsModified", $max).'
'.$subscriptionstatic->getNomUrl(1).''.$staticmember->getNomUrl(1,32,'subscription').''.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).''.$staticmember->getNomUrl(1, 32, 'subscription').''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''.price($obj->subscription).''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec),'dayhour').''.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec), 'dayhour').'
'.$adhtype->getNomUrl(1, dol_size(32)).''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'
'.$langs->trans("Total").''.$SommeA.' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''.$SommeB.' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).''.$SommeD.' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'
\n"; diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index f45042d6581..f17638a9966 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies","members","ldap","admin")); -$rowid = GETPOST('id','int'); -$action = GETPOST('action','aZ09'); +$rowid = GETPOST('id', 'int'); +$action = GETPOST('action', 'aZ09'); // Protection $socid=0; @@ -46,7 +46,7 @@ $object = new Adherent($db); $result=$object->fetch($rowid); if (! $result) { - dol_print_error($db,"Failed to get adherent: ".$object->error); + dol_print_error($db, "Failed to get adherent: ".$object->error); exit; } @@ -66,7 +66,7 @@ if ($action == 'dolibarr2ldap') $dn=$object->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro - $result=$ldap->update($dn,$info,$user,$olddn); + $result=$ldap->update($dn, $info, $user, $olddn); } if ($result >= 0) { @@ -83,7 +83,7 @@ if ($action == 'dolibarr2ldap') * View */ -llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $form = new Form($db); @@ -176,8 +176,8 @@ $result=$ldap->connect_bind(); if ($result > 0) { $info=$object->_load_ldap_info(); - $dn=$object->_load_ldap_dn($info,1); - $search = "(".$object->_load_ldap_dn($info,2).")"; + $dn=$object->_load_ldap_dn($info, 1); + $search = "(".$object->_load_ldap_dn($info, 2).")"; if (empty($dn)) { @@ -186,7 +186,7 @@ if ($result > 0) } else { - $records = $ldap->getAttribute($dn,$search); + $records = $ldap->getAttribute($dn, $search); //print_r($records); @@ -199,7 +199,7 @@ if ($result > 0) } else { - $result=show_ldap_content($records,0,$records['count'],true); + $result=show_ldap_content($records, 0, $records['count'], true); } } else diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 79841823d08..8828a72df28 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -34,46 +34,46 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $langs->loadLangs(array("members","companies")); -$action=GETPOST('action','aZ09'); -$massaction=GETPOST('massaction','alpha'); -$show_files=GETPOST('show_files','int'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'aZ09'); +$massaction=GETPOST('massaction', 'alpha'); +$show_files=GETPOST('show_files', 'int'); +$confirm=GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); // Security check -$result=restrictedArea($user,'adherent'); +$result=restrictedArea($user, 'adherent'); -$filter=GETPOST("filter",'alpha'); -$statut=GETPOST("statut",'intcomma'); -$search=GETPOST("search",'alpha'); -$search_ref=GETPOST("search_ref",'alpha'); -$search_lastname=GETPOST("search_lastname",'alpha'); -$search_firstname=GETPOST("search_firstname",'alpha'); -$search_gender=GETPOST("search_gender",'alpha'); -$search_civility=GETPOST("search_civility",'alpha'); -$search_login=GETPOST("search_login",'alpha'); -$search_address=GETPOST("search_address",'alpha'); -$search_zip=GETPOST("search_zip",'alpha'); -$search_town=GETPOST("search_town",'alpha'); -$search_state=GETPOST("search_state",'alpha'); -$search_country=GETPOST("search_country",'alpha'); -$search_phone=GETPOST("search_phone",'alpha'); -$search_phone_perso=GETPOST("search_phone_perso",'alpha'); -$search_phone_mobile=GETPOST("search_phone_mobile",'alpha'); -$search_type=GETPOST("search_type",'alpha'); -$search_email=GETPOST("search_email",'alpha'); -$search_categ = GETPOST("search_categ",'int'); -$catid = GETPOST("catid",'int'); -$optioncss = GETPOST('optioncss','alpha'); +$filter=GETPOST("filter", 'alpha'); +$statut=GETPOST("statut", 'intcomma'); +$search=GETPOST("search", 'alpha'); +$search_ref=GETPOST("search_ref", 'alpha'); +$search_lastname=GETPOST("search_lastname", 'alpha'); +$search_firstname=GETPOST("search_firstname", 'alpha'); +$search_gender=GETPOST("search_gender", 'alpha'); +$search_civility=GETPOST("search_civility", 'alpha'); +$search_login=GETPOST("search_login", 'alpha'); +$search_address=GETPOST("search_address", 'alpha'); +$search_zip=GETPOST("search_zip", 'alpha'); +$search_town=GETPOST("search_town", 'alpha'); +$search_state=GETPOST("search_state", 'alpha'); +$search_country=GETPOST("search_country", 'alpha'); +$search_phone=GETPOST("search_phone", 'alpha'); +$search_phone_perso=GETPOST("search_phone_perso", 'alpha'); +$search_phone_mobile=GETPOST("search_phone_mobile", 'alpha'); +$search_type=GETPOST("search_type", 'alpha'); +$search_email=GETPOST("search_email", 'alpha'); +$search_categ = GETPOST("search_categ", 'int'); +$catid = GETPOST("catid", 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml')); if ($statut < -1) $statut = ''; -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; $pageprev = $page - 1; @@ -89,7 +89,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('adherent'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( @@ -147,11 +147,11 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -160,7 +160,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search=""; $search_ref=""; @@ -220,7 +220,7 @@ $sql.= " state.code_departement as state_code, state.nom as state_name"; foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)"; @@ -248,9 +248,9 @@ if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", " if ($search_gender != '' && $search_gender != '-1') $sql.= " AND d.gender = '".$search_gender."'"; if ($search_login) $sql.= natural_search("d.login", $search_login); if ($search_email) $sql.= natural_search("d.email", $search_email); -if ($search_town) $sql.= natural_search("d.town",$search_town); -if ($search_zip) $sql.= natural_search("d.zip",$search_zip); -if ($search_state) $sql.= natural_search("state.nom",$search_state); +if ($search_town) $sql.= natural_search("d.town", $search_town); +if ($search_zip) $sql.= natural_search("d.zip", $search_zip); +if ($search_state) $sql.= natural_search("state.nom", $search_state); if ($search_country) $sql .= " AND d.country IN (".$search_country.')'; if ($filter == 'uptodate') $sql.=" AND datefin >= '".$db->idate($now)."'"; if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')"; @@ -260,10 +260,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->order($sortfield, $sortorder); // Count total nb of records with no order and no limits $nbtotalofrecords = ''; @@ -301,7 +301,7 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && exit; } -llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $titre=$langs->trans("MembersList"); if (GETPOSTISSET("statut")) @@ -321,7 +321,7 @@ elseif ($action == 'search') if ($search_type > 0) { $membertype=new AdherentType($db); - $result=$membertype->fetch(GETPOST("type",'int')); + $result=$membertype->fetch(GETPOST("type", 'int')); $titre.=" (".$membertype->label.")"; } @@ -391,7 +391,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print '
'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; } // Filter on categories @@ -401,11 +401,11 @@ if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $moreforfilter.='
'; $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1); + $moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1); $moreforfilter.='
'; } $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; if (! empty($moreforfilter)) @@ -511,7 +511,7 @@ if (! empty($arrayfields['state.nom']['checked'])) if (! empty($arrayfields['country.code_iso']['checked'])) { print ''; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth100'); print ''; } // Phone pro @@ -549,7 +549,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters=array('arrayfields'=>$arrayfields); -$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['d.datec']['checked'])) @@ -584,37 +584,37 @@ print ''; print "\n"; print ''; -if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID",$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder); -if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.gender']['checked'])) print_liste_field_titre($arrayfields['d.gender']['label'],$_SERVER['PHP_SELF'],'d.gender',$param,"","",$sortfield,$sortorder); -if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'],$_SERVER["PHP_SELF"],'d.login','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'],$_SERVER["PHP_SELF"],'d.morphy','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'],$_SERVER["PHP_SELF"],'t.libelle','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'],$_SERVER["PHP_SELF"],'d.address','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'],$_SERVER["PHP_SELF"],'d.zip','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'],$_SERVER["PHP_SELF"],'d.town','',$param,'',$sortfield,$sortorder); -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['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); -if (! empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'],$_SERVER["PHP_SELF"],'d.phone','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'],$_SERVER["PHP_SELF"],'d.phone_perso','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'],$_SERVER["PHP_SELF"],'d.phone_mobile','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.email']['checked'])) print_liste_field_titre($arrayfields['d.email']['label'],$_SERVER["PHP_SELF"],'d.email','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.datefin']['checked'])) print_liste_field_titre($arrayfields['d.datefin']['label'],$_SERVER["PHP_SELF"],'d.datefin','',$param,'align="center"',$sortfield,$sortorder); +if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder); +if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], 'd.rowid', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'], $_SERVER["PHP_SELF"], 'd.civility', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], 'd.firstname', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], 'd.lastname', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.gender']['checked'])) print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'], $_SERVER["PHP_SELF"], 'd.morphy', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'], $_SERVER["PHP_SELF"], 't.libelle', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'], $_SERVER["PHP_SELF"], 'd.address', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'], $_SERVER["PHP_SELF"], 'd.zip', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'], $_SERVER["PHP_SELF"], 'd.town', '', $param, '', $sortfield, $sortorder); +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['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder); +if (! empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'], $_SERVER["PHP_SELF"], 'd.phone', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'], $_SERVER["PHP_SELF"], 'd.phone_perso', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'], $_SERVER["PHP_SELF"], 'd.phone_mobile', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.email']['checked'])) print_liste_field_titre($arrayfields['d.email']['label'], $_SERVER["PHP_SELF"], 'd.email', '', $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['d.datefin']['checked'])) print_liste_field_titre($arrayfields['d.datefin']['label'], $_SERVER["PHP_SELF"], 'd.datefin', '', $param, 'align="center"', $sortfield, $sortorder); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); -$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'class="right"',$sortfield,$sortorder); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); +if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'], $_SERVER["PHP_SELF"], "d.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); +if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); +if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; $i = 0; @@ -716,7 +716,7 @@ while ($i < min($num, $limit)) $membertypestatic->id=$obj->type_id; $membertypestatic->label=$obj->type; print ''; - print $membertypestatic->getNomUrl(1,32); + print $membertypestatic->getNomUrl(1, 32); print ''; if (! $i) $totalarray['nbfield']++; } @@ -754,7 +754,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['country.code_iso']['checked'])) { print ''; - $tmparray=getCountry($obj->country,'all'); + $tmparray=getCountry($obj->country, 'all'); print $tmparray['label']; print ''; if (! $i) $totalarray['nbfield']++; @@ -786,7 +786,7 @@ while ($i < min($num, $limit)) // EMail if (! empty($arrayfields['d.email']['checked'])) { - print "".dol_print_email($obj->email,0,0,1)."\n"; + print "".dol_print_email($obj->email, 0, 0, 1)."\n"; } // End of subscription date $datefin=$db->jdate($obj->datefin); @@ -795,7 +795,7 @@ while ($i < min($num, $limit)) if ($datefin) { print ''; - print dol_print_date($datefin,'day'); + print dol_print_date($datefin, 'day'); if ($memberstatic->hasDelay()) { $textlate .= ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay/60/60/24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay/60/60/24).' '.$langs->trans("days").')'; print " ".img_warning($langs->trans("SubscriptionLate").$textlate); @@ -821,7 +821,7 @@ while ($i < min($num, $limit)) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['d.datec']['checked'])) @@ -843,7 +843,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['d.statut']['checked'])) { print ''; - print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,5); + print $memberstatic->LibStatut($obj->statut, $obj->subscription, $datefin, 5); print ''; if (! $i) $totalarray['nbfield']++; } @@ -895,7 +895,7 @@ if ($num == 0) $db->free($resql); $parameters=array('sql' => $sql); -$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "\n"; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index c12c45de8b7..0acd98a9ead 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -31,11 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies","members","bills")); -$action=GETPOST('action','alpha'); -$id=GETPOST('id','int'); +$action=GETPOST('action', 'alpha'); +$id=GETPOST('id', 'int'); // Security check -$result=restrictedArea($user,'adherent',$id); +$result=restrictedArea($user, 'adherent', $id); $object = new Adherent($db); $result=$object->fetch($id); @@ -60,7 +60,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, */ $title=$langs->trans("Member") . " - " . $langs->trans("Note"); $helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("",$title,$helpurl); +llxHeader("", $title, $helpurl); $form = new Form($db); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index cc40a5a4120..164606431ff 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -38,7 +38,7 @@ if ($user->societe_id > 0) $action = ''; $socid = $user->societe_id; } -$result=restrictedArea($user,'adherent','','','cotisation'); +$result=restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = strftime("%Y", time()); $startyear=$year-2; @@ -54,7 +54,7 @@ $langs->loadLangs(array("companies","members")); $memberstatic=new Adherent($db); -llxHeader('',$langs->trans("MembersStatisticsByProperties"),'','',0,0,array('https://www.google.com/jsapi')); +llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, array('https://www.google.com/jsapi')); $title=$langs->trans("MembersStatisticsByProperties"); @@ -112,7 +112,7 @@ if (! count($data)) } else { - print load_fiche_titre($langs->trans("MembersByNature"),'',''); + print load_fiche_titre($langs->trans("MembersByNature"), '', ''); } // Print array @@ -133,7 +133,7 @@ foreach ($data as $val) print ''; print ''.$memberstatic->getmorphylib($val['label']).''; print ''.$val['nb'].''; - print ''.dol_print_date($val['lastdate'],'dayhour').''; + print ''.dol_print_date($val['lastdate'], 'dayhour').''; print ''; $oldyear=$year; } diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index c62534ec293..f5816f46aca 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; -$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700); +$graphwidth=DolGraph::getDefaultGraphSizeForStats('width', 700); $mapratio = 0.5; $graphheight = round($graphwidth * $mapratio); @@ -39,7 +39,7 @@ if ($user->societe_id > 0) $action = ''; $socid = $user->societe_id; } -$result=restrictedArea($user,'adherent','','','cotisation'); +$result=restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = strftime("%Y", time()); $startyear=$year-2; @@ -62,7 +62,7 @@ if ($mode == 'memberbystate') $title=$langs->trans("MembersStatisticsByState"); if ($mode == 'memberbytown') $title=$langs->trans("MembersStatisticsByTown"); if ($mode == 'memberbyregion') $title=$langs->trans("MembersStatisticsByRegion"); -llxHeader('', $title,'','',0,0,$arrayjs); +llxHeader('', $title, '', '', 0, 0, $arrayjs); print load_fiche_titre($title, $mesg); @@ -133,7 +133,7 @@ if ($mode) //print $sql; } - $langsen=new Translate('',$conf); + $langsen=new Translate('', $conf); $langsen->setDefaultLang('en_US'); $langsen->load("dict"); //print $langsen->trans("Country"."FI");exit; @@ -268,7 +268,7 @@ if (count($arrayjs) && $mode == 'memberbycountry') //print "\toptions['zoomOutLabel'] = '".dol_escape_js($langs->transnoentitiesnoconv("Numbers"))."';\n"; print "\toptions['width'] = ".$graphwidth.";\n"; print "\toptions['height'] = ".$graphheight.";\n"; - print "\toptions['colors'] = [0x".colorArrayToHex($theme_datacolor[1],'BBBBBB').", 0x".colorArrayToHex($theme_datacolor[0],'444444')."];\n"; + print "\toptions['colors'] = [0x".colorArrayToHex($theme_datacolor[1], 'BBBBBB').", 0x".colorArrayToHex($theme_datacolor[0], '444444')."];\n"; print "\tvar container = document.getElementById('".$mode."');\n"; print "\tvar geomap = new google.visualization.GeoMap(container);\n"; print "\tgeomap.draw(data, options);\n"; @@ -299,7 +299,7 @@ if ($mode) print ''.$val['label'].''; if ($label2) print ''.$val['label2'].''; print ''.$val['nb'].''; - print ''.dol_print_date($val['lastdate'],'dayhour').''; + print ''.dol_print_date($val['lastdate'], 'dayhour').''; print ''; $oldyear=$year; } diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index e9866d20f1a..2492e0c0602 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); -$userid=GETPOST('userid','int'); if ($userid < 0) $userid=0; -$socid=GETPOST('socid','int'); if ($socid < 0) $socid=0; +$userid=GETPOST('userid', 'int'); if ($userid < 0) $userid=0; +$socid=GETPOST('socid', 'int'); if ($socid < 0) $socid=0; // Security check if ($user->societe_id > 0) @@ -40,7 +40,7 @@ if ($user->societe_id > 0) $action = ''; $socid = $user->societe_id; } -$result=restrictedArea($user,'adherent','','','cotisation'); +$result=restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = strftime("%Y", time()); $startyear=$year-2; @@ -67,7 +67,7 @@ dol_mkdir($dir); $stats = new AdherentStats($db, $socid, $userid); // Build graphic number of object -$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); +$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) @@ -90,7 +90,7 @@ if (! $mesg) } $px1->SetLegend($legend); $px1->SetMaxValue($px1->GetCeilMaxValue()); - $px1->SetMinValue(min(0,$px1->GetFloorMinValue())); + $px1->SetMinValue(min(0, $px1->GetFloorMinValue())); $px1->SetWidth($WIDTH); $px1->SetHeight($HEIGHT); $px1->SetYLabel($langs->trans("NbOfSubscriptions")); @@ -100,11 +100,11 @@ if (! $mesg) $px1->mode='depth'; $px1->SetTitle($langs->trans("NbOfSubscriptions")); - $px1->draw($filenamenb,$fileurlnb); + $px1->draw($filenamenb, $fileurlnb); } // Build graphic amount of object -$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); +$data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) @@ -125,7 +125,7 @@ if (! $mesg) } $px2->SetLegend($legend); $px2->SetMaxValue($px2->GetCeilMaxValue()); - $px2->SetMinValue(min(0,$px2->GetFloorMinValue())); + $px2->SetMinValue(min(0, $px2->GetFloorMinValue())); $px2->SetWidth($WIDTH); $px2->SetHeight($HEIGHT); $px2->SetYLabel($langs->trans("AmountOfSubscriptions")); @@ -135,7 +135,7 @@ if (! $mesg) $px2->mode='depth'; $px2->SetTitle($langs->trans("AmountOfSubscriptions")); - $px2->draw($filenameamount,$fileurlamount); + $px2->draw($filenameamount, $fileurlamount); } @@ -201,8 +201,8 @@ foreach ($data as $val) //print ''; print ''; print ''.$val['nb'].''; - print ''.price(price2num($val['total'],'MT'),1).''; - print ''.price(price2num($val['avg'],'MT'),1).''; + print ''.price(price2num($val['total'], 'MT'), 1).''; + print ''.price(price2num($val['avg'], 'MT'), 1).''; print ''; $oldyear=$year; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index da35a182f24..605a35aef3d 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -39,16 +39,16 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; $langs->loadLangs(array("companies","bills","members","users","mails",'other')); -$action=GETPOST('action','alpha'); -$confirm=GETPOST('confirm','alpha'); -$rowid=GETPOST('rowid','int')?GETPOST('rowid','int'):GETPOST('id','int'); -$typeid=GETPOST('typeid','int'); +$action=GETPOST('action', 'alpha'); +$confirm=GETPOST('confirm', 'alpha'); +$rowid=GETPOST('rowid', 'int')?GETPOST('rowid', 'int'):GETPOST('id', 'int'); +$typeid=GETPOST('typeid', 'int'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -60,7 +60,7 @@ if (! $sortorder) $sortorder="DESC"; // Security check -$result=restrictedArea($user,'adherent',$rowid,'','cotisation'); +$result=restrictedArea($user, 'adherent', $rowid, '', 'cotisation'); $object = new Adherent($db); $extrafields = new ExtraFields($db); @@ -156,7 +156,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights if ($_POST["userid"] != $object->user_id) // If link differs from currently in database { $result=$object->setUserId($_POST["userid"]); - if ($result < 0) dol_print_error('',$object->error); + if ($result < 0) dol_print_error('', $object->error); $_POST['action']=''; $action=''; } @@ -168,10 +168,10 @@ if ($action == 'setsocid') $error=0; if (! $error) { - if (GETPOST('socid','int') != $object->fk_soc) // If link differs from currently in database + if (GETPOST('socid', 'int') != $object->fk_soc) // If link differs from currently in database { $sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; - $sql.=" WHERE fk_soc = '".GETPOST('socid','int')."'"; + $sql.=" WHERE fk_soc = '".GETPOST('socid', 'int')."'"; $resql = $db->query($sql); if ($resql) { @@ -181,16 +181,16 @@ if ($action == 'setsocid') $othermember=new Adherent($db); $othermember->fetch($obj->rowid); $thirdparty=new Societe($db); - $thirdparty->fetch(GETPOST('socid','int')); + $thirdparty->fetch(GETPOST('socid', 'int')); $error++; - setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); } } if (! $error) { - $result=$object->setThirdPartyId(GETPOST('socid','int')); - if ($result < 0) dol_print_error('',$object->error); + $result=$object->setThirdPartyId(GETPOST('socid', 'int')); + if ($result < 0) dol_print_error('', $object->error); $_POST['action']=''; $action=''; } @@ -223,7 +223,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]); } - $amount=price2num(GETPOST("subscription",'alpha')); // Amount of subscription + $amount=price2num(GETPOST("subscription", 'alpha')); // Amount of subscription $label=$_POST["label"]; // Payment informations @@ -234,14 +234,14 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $emetteur_banque=$_POST["chqbank"]; $option=$_POST["paymentsave"]; if (empty($option)) $option='none'; - $sendalsoemail=GETPOST("sendmail",'alpha'); + $sendalsoemail=GETPOST("sendmail", 'alpha'); // Check parameters if (! $datesubscription) { $error++; $langs->load("errors"); - $errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription")); + $errmsg=$langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateSubscription")); setEventMessages($errmsg, null, 'errors'); $action='addsubscription'; } @@ -249,13 +249,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $error++; $langs->load("errors"); - $errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription")); + $errmsg=$langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateEndSubscription")); setEventMessages($errmsg, null, 'errors'); $action='addsubscription'; } if (! $datesubend) { - $datesubend=dol_time_plus_duree(dol_time_plus_duree($datesubscription,$defaultdelay,$defaultdelayunit),-1,'d'); + $datesubend=dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd'); } if (($option == 'bankviainvoice' || $option == 'bankdirect') && ! $paymentdate) { @@ -271,7 +271,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! if (! is_numeric($amount)) { // If field is '' or not a numeric value - $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); + $errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); setEventMessages($errmsg, null, 'errors'); $error++; $action='addsubscription'; @@ -282,9 +282,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { if ($_POST["subscription"]) { - if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); - if ($_POST["paymentsave"] != 'invoiceonly' && ! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); - if ($_POST["paymentsave"] != 'invoiceonly' && ! ($_POST["accountid"] > 0)) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); + if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); + if ($_POST["paymentsave"] != 'invoiceonly' && ! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); + if ($_POST["paymentsave"] != 'invoiceonly' && ! ($_POST["accountid"] > 0)) $errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); } else { @@ -312,7 +312,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $error++; $errmsg=$object->error; - setEventMessages($object->error,$object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } if (! $error) @@ -438,7 +438,7 @@ $now=dol_now(); $title=$langs->trans("Member") . " - " . $langs->trans("Subscriptions"); $helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("",$title,$helpurl); +llxHeader("", $title, $helpurl); $param=''; @@ -453,7 +453,7 @@ if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($rowid > 0) { $res=$object->fetch($rowid); - if ($res < 0) { dol_print_error($db,$object->error); exit; } + if ($res < 0) { dol_print_error($db, $object->error); exit; } $adht->fetch($object->typeid); @@ -502,12 +502,12 @@ if ($rowid > 0) // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Password").''.preg_replace('/./i','*',$object->pass); + print ''.$langs->trans("Password").''.preg_replace('/./i', '*', $object->pass); if ((! empty($object->pass) || ! empty($object->pass_crypted)) && empty($object->user_id)) { $langs->load("errors"); $htmltext=$langs->trans("WarningPasswordSetWithNoAccount"); - print ' '.$form->textwithpicto('', $htmltext,1,'warning'); + print ' '.$form->textwithpicto('', $htmltext, 1, 'warning'); } print ''; } @@ -521,7 +521,7 @@ if ($rowid > 0) print ''; // Birthday - print ''; + print ''; // Public print ''; @@ -543,7 +543,7 @@ if ($rowid > 0) print ''; } @@ -621,13 +621,13 @@ if ($rowid > 0) print ' - + '; print ''; if ($user->rights->adherent->configurer) @@ -331,15 +328,15 @@ if ($action == 'create') print ''; print ''; - + print ''; print ''; print ''; // Other attributes $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields,'edit'); + print $object->showOptionals($extrafields, 'edit'); } print ''; print "
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Birthday").''.dol_print_date($object->birth, 'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("SubscriptionEndDate").''; if ($object->datefin) { - print dol_print_date($object->datefin,'day'); + print dol_print_date($object->datefin, 'day'); if ($object->hasDelay()) { print " ".img_warning($langs->trans("Late")); } @@ -570,7 +570,7 @@ if ($rowid > 0) print ''; - if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; + if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; print '
'; print $langs->trans("LinkedToDolibarrThirdParty"); print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'
'; print '
'; if ($action == 'editthirdparty') @@ -582,7 +582,7 @@ if ($rowid > 0) print ''; print ''; print ''; print ''; print '
'; - print $form->select_company($object->fk_soc,'socid','',1); + print $form->select_company($object->fk_soc, 'socid', '', 1); print '
'; @@ -613,7 +613,7 @@ if ($rowid > 0) print '
'; if ($user->rights->user->user->creer) { - print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).''; + print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).''; } print ''; if ($action == 'editlogin') { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); } else { if ($object->user_id) { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); } else print $langs->trans("NoDolibarrAccess"); } @@ -691,7 +691,7 @@ if ($rowid > 0) print ''."\n"; print ''; - print_liste_field_titre('Ref',$_SERVER["PHP_SELF"],'c.rowid','',$param,'',$sortfield,$sortorder); + print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder); print ''; print ''; print ''; @@ -713,9 +713,9 @@ if ($rowid > 0) print ''; print ''; - print '\n"; - print '\n"; - print '\n"; + print '\n"; + print '\n"; + print '\n"; print ''; if (! empty($conf->banque->enabled)) { @@ -732,7 +732,7 @@ if ($rowid > 0) $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objp->fk_accountancy_journal); - $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); } $accountstatic->ref=$objp->ref; @@ -875,7 +875,7 @@ if ($rowid > 0) } // @TODO Add other extrafields mandatory for thirdparty creation - print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrThirdParty"), $langs->trans("ConfirmCreateThirdParty"), "confirm_create_thirdparty", $formquestion, 1); } @@ -907,14 +907,14 @@ if ($rowid > 0) print ''; print ''; // Complementary action @@ -983,7 +983,7 @@ if ($rowid > 0) print $langs->trans("CreateDolibarrThirdParty"); print ')'; } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0); + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0); if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) { $prodtmp=new Product($db); @@ -1008,7 +1008,7 @@ if ($rowid > 0) print $langs->trans("CreateDolibarrThirdParty"); print ')'; } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0); + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0); if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) { $prodtmp=new Product($db); @@ -1021,12 +1021,12 @@ if ($rowid > 0) // Bank account print '\n"; // Payment mode print '\n"; // Date of payment @@ -1093,7 +1093,7 @@ if ($rowid > 0) $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); - $tmp='global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>'; + $tmp='global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>'; $helpcontent=''; $helpcontent.=''.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.'
'."\n"; $helpcontent.=''.$langs->trans("MailRecipient").': '.$object->email.'
'."\n"; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 31944968632..31cf3020765 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -39,10 +39,10 @@ $adht = new AdherentType($db); $object = new Subscription($db); $errmsg=''; -$action=GETPOST("action",'alpha'); -$rowid=GETPOST("rowid","int")?GETPOST("rowid","int"):GETPOST("id","int"); -$typeid=GETPOST("typeid","int"); -$cancel=GETPOST('cancel','alpha'); +$action=GETPOST("action", 'alpha'); +$rowid=GETPOST("rowid", "int")?GETPOST("rowid", "int"):GETPOST("id", "int"); +$typeid=GETPOST("typeid", "int"); +$cancel=GETPOST('cancel', 'alpha'); $confirm=GETPOST('confirm'); if (! $user->rights->adherent->cotisation->lire) @@ -167,7 +167,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent- $form = new Form($db); -llxHeader('',$langs->trans("SubscriptionCard"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $langs->trans("SubscriptionCard"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); dol_htmloutput_errors($errmsg); @@ -214,7 +214,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') // Member $adh->ref=$adh->getFullName($langs); print ''; - print ''; + print ''; print ''; // Date start subscription @@ -247,7 +247,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') { $bankline=new AccountLine($db); $result=$bankline->fetch($object->fk_bank); - print $bankline->getNomUrl(1,0,'showall'); + print $bankline->getNomUrl(1, 0, 'showall'); } else { @@ -293,7 +293,7 @@ if ($rowid && $action != 'edit') //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text=$langs->trans("ConfirmDeleteSubscription"); if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); - print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("DeleteSubscription"), $text, "confirm_delete", $formquestion, 0, 1); } print ''; @@ -324,7 +324,7 @@ if ($rowid && $action != 'edit') // Member $adh->ref=$adh->getFullName($langs); print ''; - print ''; + print ''; print ''; // Date record @@ -334,12 +334,12 @@ if ($rowid && $action != 'edit') // Date subscription print ''; - print ''; + print ''; print ''; // Date end subscription print ''; - print ''; + print ''; print ''; // Amount @@ -358,7 +358,7 @@ if ($rowid && $action != 'edit') { $bankline=new AccountLine($db); $result=$bankline->fetch($object->fk_bank); - print $bankline->getNomUrl(1,0,'showall'); + print $bankline->getNomUrl(1, 0, 'showall'); } else { diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index a792da530f1..37a719e52bc 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -34,7 +34,7 @@ $langs->loadLangs(array("companies","members","bills","users")); if (!$user->rights->adherent->lire) accessforbidden(); -$rowid=GETPOST("rowid",'int'); +$rowid=GETPOST("rowid", 'int'); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index f4c5cb8bebc..23150ab7b35 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -31,29 +31,29 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->loadLangs(array("members","companies")); -$action=GETPOST('action','aZ09'); -$massaction=GETPOST('massaction','alpha'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'aZ09'); +$massaction=GETPOST('massaction', 'alpha'); +$confirm=GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); -$filter=GETPOST("filter","alpha"); -$statut=(GETPOSTISSET("statut")?GETPOST("statut","alpha"):1); -$search_ref=GETPOST('search_ref','alpha'); -$search_type=GETPOST('search_type','alpha'); -$search_lastname=GETPOST('search_lastname','alpha'); -$search_firstname=GETPOST('search_firstname','alpha'); -$search_login=GETPOST('search_login','alpha'); -$search_note=GETPOST('search_note','alpha'); -$search_account=GETPOST('search_account','int'); -$search_amount=GETPOST('search_amount','alpha'); -$optioncss = GETPOST('optioncss','alpha'); +$filter=GETPOST("filter", "alpha"); +$statut=(GETPOSTISSET("statut")?GETPOST("statut", "alpha"):1); +$search_ref=GETPOST('search_ref', 'alpha'); +$search_type=GETPOST('search_type', 'alpha'); +$search_lastname=GETPOST('search_lastname', 'alpha'); +$search_firstname=GETPOST('search_firstname', 'alpha'); +$search_login=GETPOST('search_login', 'alpha'); +$search_note=GETPOST('search_note', 'alpha'); +$search_account=GETPOST('search_account', 'int'); +$search_amount=GETPOST('search_amount', 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); -$date_select=GETPOST("date_select",'alpha'); +$date_select=GETPOST("date_select", 'alpha'); -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; $pageprev = $page - 1; @@ -69,7 +69,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('subscription'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( @@ -93,18 +93,18 @@ $arrayfields=array( ); // Security check -$result=restrictedArea($user,'adherent','','','cotisation'); +$result=restrictedArea($user, 'adherent', '', '', 'cotisation'); /* * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -113,7 +113,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search=""; $search_type=""; @@ -174,10 +174,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->order($sortfield, $sortorder); // Count total nb of records with no order and no limits $nbtotalofrecords = ''; @@ -214,7 +214,7 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && exit; } -llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $langs->trans("ListOfSubscriptions"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $i = 0; @@ -274,7 +274,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print '
'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; } $moreforfilter = ''; @@ -364,7 +364,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters=array('arrayfields'=>$arrayfields); -$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['d.datec']['checked'])) @@ -391,54 +391,54 @@ print "\n"; print ''; if (! empty($arrayfields['d.ref']['checked'])) { - print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); } if (! empty($arrayfields['d.fk_type']['checked'])) { - print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.fk_type",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); } if (! empty($arrayfields['d.lastname']['checked'])) { - print_liste_field_titre("LastName",$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("LastName", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); } if (! empty($arrayfields['d.firstname']['checked'])) { - print_liste_field_titre("FirstName",$_SERVER["PHP_SELF"],"d.firstname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("FirstName", $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); } if (! empty($arrayfields['d.login']['checked'])) { - print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); } if (! empty($arrayfields['t.libelle']['checked'])) { - print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", 'align="left"', $sortfield, $sortorder); } if (! empty($arrayfields['d.bank']['checked'])) { - print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder); + print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $pram, "", "", $sortfield, $sortorder); } if (! empty($arrayfields['d.date_debut']['checked'])) { - print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", 'align="center"', $sortfield, $sortorder); } if (! empty($arrayfields['d.date_fin']['checked'])) { - print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", 'align="center"', $sortfield, $sortorder); } if (! empty($arrayfields['d.amount']['checked'])) { - print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'class="right"',$sortfield,$sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", 'class="right"', $sortfield, $sortorder); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); -$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); +if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'], $_SERVER["PHP_SELF"], "d.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); +if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -506,7 +506,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['t.libelle']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -529,13 +529,13 @@ while ($i < min($num, $limit)) // Date start if (! empty($arrayfields['d.date_start']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; } // Date end if (! empty($arrayfields['d.date_end']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; } // Price @@ -550,7 +550,7 @@ while ($i < min($num, $limit)) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['d.datec']['checked'])) @@ -616,7 +616,7 @@ if ($num == 0) $db->free($resql); $parameters=array('sql' => $sql); -$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "
'.$langs->trans("DateCreation").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").'
'.$subscriptionstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->datec),'dayhour')."'.dol_print_date($db->jdate($objp->dateh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.dol_print_date($db->jdate($objp->datec), 'dayhour')."'.dol_print_date($db->jdate($objp->dateh), 'day')."'.dol_print_date($db->jdate($objp->datef), 'day')."'.price($objp->subscription).''.$langs->trans("DateSubscription").''; if (GETPOST('reday')) { - $datefrom=dol_mktime(0,0,0,GETPOST('remonth'),GETPOST('reday'),GETPOST('reyear')); + $datefrom=dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); } if (! $datefrom) { $datefrom=$object->datevalid; if ($object->datefin > 0) { - $datefrom=dol_time_plus_duree($object->datefin,1,'d'); + $datefrom=dol_time_plus_duree($object->datefin, 1, 'd'); } } print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1); @@ -923,7 +923,7 @@ if ($rowid > 0) // Date end subscription if (GETPOST('endday')) { - $dateto=dol_mktime(0,0,0,GETPOST('endmonth'),GETPOST('endday'),GETPOST('endyear')); + $dateto=dol_mktime(0, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); } if (! $dateto) { @@ -941,7 +941,7 @@ if ($rowid > 0) // Label print '
'.$langs->trans("Label").'global->MEMBER_NO_DEFAULT_LABEL)) print $langs->trans("Subscription").' '.dol_print_date(($datefrom?$datefrom:time()), "%Y"); print '">
'.$langs->trans("FinancialAccount").''; - $form->select_comptes(GETPOST('accountid'),'accountid',0,'',1); + $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 1); print "
'.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOST('operation'),'operation','',2); + $form->select_types_paiements(GETPOST('operation'), 'operation', '', 2); print "
'.$langs->trans("Member").''.$adh->getNomUrl(1,0,'subscription').''.$langs->trans("Member").''.$adh->getNomUrl(1, 0, 'subscription').'
'.$langs->trans("Member").''.$adh->getNomUrl(1,0,'subscription').''.$langs->trans("Member").''.$adh->getNomUrl(1, 0, 'subscription').'
'.$langs->trans("DateSubscription").''.dol_print_date($object->dateh,'day').''.$langs->trans("DateSubscription").''.dol_print_date($object->dateh, 'day').'
'.$langs->trans("DateEndSubscription").''.dol_print_date($object->datef,'day').''.$langs->trans("DateEndSubscription").''.dol_print_date($object->datef, 'day').'
'; - print dol_trunc($obj->note,128); + print dol_trunc($obj->note, 128); print ''.dol_print_date($db->jdate($obj->dateadh),'day')."'.dol_print_date($db->jdate($obj->dateadh), 'day')."'.dol_print_date($db->jdate($obj->datef),'day')."'.dol_print_date($db->jdate($obj->datef), 'day')."
"; diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index 988dda8fce6..622d20f7d42 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -45,7 +45,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
trans("Subscription"); ?> getNomUrl(1); ?> dateh,'day'); ?>dateh, 'day'); ?> rights->adherent->lire) { $total = $total + $objectlink->amount; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index e7c71d06e40..6d09ccac022 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -34,21 +34,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("members"); -$rowid = GETPOST('rowid','int'); -$action = GETPOST('action','alpha'); -$cancel = GETPOST('cancel','alpha'); -$backtopage = GETPOST('backtopage','alpha'); +$rowid = GETPOST('rowid', 'int'); +$action = GETPOST('action', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); -$search_lastname = GETPOST('search_lastname','alpha'); -$search_login = GETPOST('search_login','alpha'); -$search_email = GETPOST('search_email','alpha'); -$type = GETPOST('type','intcomma'); -$status = GETPOST('status','alpha'); +$search_lastname = GETPOST('search_lastname', 'alpha'); +$search_login = GETPOST('search_login', 'alpha'); +$search_email = GETPOST('search_email', 'alpha'); +$type = GETPOST('type', 'intcomma'); +$status = GETPOST('status', 'alpha'); -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; $pageprev = $page - 1; @@ -56,15 +56,15 @@ $pagenext = $page + 1; if (! $sortorder) { $sortorder="DESC"; } if (! $sortfield) { $sortfield="d.lastname"; } -$label=GETPOST("label","alpha"); -$statut=GETPOST("statut","int"); -$subscription=GETPOST("subscription","int"); -$vote=GETPOST("vote","int"); -$comment=GETPOST("comment",'alphanohtml'); -$mail_valid=GETPOST("mail_valid",'none'); +$label=GETPOST("label", "alpha"); +$statut=GETPOST("statut", "int"); +$subscription=GETPOST("subscription", "int"); +$vote=GETPOST("vote", "int"); +$comment=GETPOST("comment", 'alphanohtml'); +$mail_valid=GETPOST("mail_valid", 'none'); // Security check -$result=restrictedArea($user,'adherent',$rowid,'adherent_type'); +$result=restrictedArea($user, 'adherent', $rowid, 'adherent_type'); $object = new AdherentType($db); @@ -73,7 +73,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('adherent_type'); -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_lastname=""; $search_login=""; @@ -95,15 +95,13 @@ if ($cancel) { $action=''; - if (! empty($backtopage)) - { + if (! empty($backtopage)) { header("Location: ".$backtopage); exit; } } -if ($action == 'add' && $user->rights->adherent->configurer) -{ +if ($action == 'add' && $user->rights->adherent->configurer) { $object->label = trim($label); $object->statut = (int) $statut; $object->subscription = (int) $subscription; @@ -112,12 +110,12 @@ if ($action == 'add' && $user->rights->adherent->configurer) $object->vote = (boolean) trim($vote); // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; if (empty($object->label)) { $error++; - setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } else { $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle='".$db->escape($object->label)."'"; @@ -128,7 +126,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) if ($num) { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorLabelAlreadyExists",$login), null, 'errors'); + setEventMessages($langs->trans("ErrorLabelAlreadyExists", $login), null, 'errors'); } } @@ -166,7 +164,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object->vote = (boolean) trim($vote); // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; $ret=$object->update($user); @@ -209,7 +207,7 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer) $form=new Form($db); -llxHeader('',$langs->trans("MembersTypeSetup"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); // List of members type @@ -266,8 +264,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') $membertype = new AdherentType($db); - while ($i < $num) - { + while ($i < $num) { $objp = $db->fetch_object($result); $membertype->id = $objp->rowid; @@ -284,9 +281,9 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''.yn($objp->vote).''; if ( !empty($objp->statut) ) { - print img_picto($langs->trans("InActivity"),'statut4'); + print img_picto($langs->trans("InActivity"), 'statut4'); } else { - print img_picto($langs->trans("ActivityCeased"),'statut5'); + print img_picto($langs->trans("ActivityCeased"), 'statut5'); } print '
'.$langs->trans("Label").'
'.$langs->trans("Status").''; - print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1); + print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1); print '
'.$langs->trans("SubscriptionRequired").''; - print $form->selectyesno("subscription",1,1); + print $form->selectyesno("subscription", 1, 1); print '
'.$langs->trans("VoteAllowed").''; - print $form->selectyesno("vote",0,1); + print $form->selectyesno("vote", 0, 1); print '
'.$langs->trans("Description").''; @@ -347,17 +344,17 @@ if ($action == 'create') print '
'.$langs->trans("WelcomeEMail").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%'); + $doleditor=new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print '
\n"; @@ -391,7 +388,7 @@ if ($rowid > 0) */ if ($action == 'delete') { - print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$object->id,$langs->trans("DeleteAMemberType"),$langs->trans("ConfirmDeleteMemberType",$object->label),"confirm_delete", '',0,1); + print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$object->id, $langs->trans("DeleteAMemberType"), $langs->trans("ConfirmDeleteMemberType", $object->label), "confirm_delete", '', 0, 1); } $head = member_type_prepare_head($object); @@ -409,9 +406,9 @@ if ($rowid > 0) print ''.$langs->trans("Status").''; if ( !empty($object->statut) ) { - print img_picto($langs->trans('TypeStatusActive'),'statut4').' '.$langs->trans("InActivity"); + print img_picto($langs->trans('TypeStatusActive'), 'statut4').' '.$langs->trans("InActivity"); } else { - print img_picto($langs->trans('TypeStatusInactive'),'statut5').' '.$langs->trans("ActivityCeased"); + print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased"); } print ''; @@ -490,9 +487,9 @@ if ($rowid > 0) } if ($action == 'search') { - if (GETPOST('search','alpha')) + if (GETPOST('search', 'alpha')) { - $sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search','alpha')); + $sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search', 'alpha')); } } if (! empty($search_lastname)) @@ -516,7 +513,7 @@ if ($rowid > 0) $sql.=" AND datefin < '".$db->idate($now)."'"; } - $sql.= " ".$db->order($sortfield,$sortorder); + $sql.= " ".$db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; @@ -579,7 +576,7 @@ if ($rowid > 0) print ''; print '
'; - print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); $moreforfilter = ''; @@ -611,13 +608,13 @@ if ($rowid > 0) print "\n"; print ''; - print_liste_field_titre( $langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre("Nature",$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder); - print_liste_field_titre("EMail",$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder); - print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); - print_liste_field_titre("EndSubscription",$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre("Action",$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Name")." / ".$langs->trans("Company"), $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("Nature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.statut,d.datefin", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("EndSubscription", $_SERVER["PHP_SELF"], "d.datefin", $param, "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; while ($i < $num && $i < $conf->liste_limit) @@ -634,11 +631,11 @@ if ($rowid > 0) print ''; if ($objp->societe != '') { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).''."\n"; + print ''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).''."\n"; } else { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).''."\n"; + print ''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 32).''."\n"; } // Login @@ -656,11 +653,11 @@ if ($rowid > 0) print "".$adh->getmorphylib($objp->morphy)."\n"; // EMail - print "".dol_print_email($objp->email,0,0,1)."\n"; + print "".dol_print_email($objp->email, 0, 0, 1)."\n"; // Statut print ''; - print $adh->LibStatut($objp->statut,$objp->subscription,$datefin,2); + print $adh->LibStatut($objp->statut, $objp->subscription, $datefin, 2); print ""; // Date end subscription @@ -669,11 +666,11 @@ if ($rowid > 0) print ''; if ($datefin < dol_now() && $objp->statut > 0) { - print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate")); + print dol_print_date($datefin, 'day')." ".img_warning($langs->trans("SubscriptionLate")); } else { - print dol_print_date($datefin,'day'); + print dol_print_date($datefin, 'day'); } print ''; } @@ -701,7 +698,7 @@ if ($rowid > 0) print ' '; if ($user->rights->adherent->supprimer) { - print ''.img_picto($langs->trans("Resiliate"),'disable.png').''; + print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; } print ""; @@ -715,7 +712,7 @@ if ($rowid > 0) if ($num > $conf->liste_limit) { - print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,''); + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); } } else @@ -754,13 +751,13 @@ if ($rowid > 0) print ''.$langs->trans("Status").''; print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut); print ''; - + print ''.$langs->trans("SubscriptionRequired").''; - print $form->selectyesno("subscription",$object->subscription,1); + print $form->selectyesno("subscription", $object->subscription, 1); print ''; print ''.$langs->trans("VoteAllowed").''; - print $form->selectyesno("vote",$object->vote,1); + print $form->selectyesno("vote", $object->vote, 1); print ''; print ''.$langs->trans("Description").''; @@ -768,17 +765,17 @@ if ($rowid > 0) print ''.$langs->trans("WelcomeEMail").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%'); + $doleditor=new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print ""; // Other attributes $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields,'edit'); + print $object->showOptionals($extrafields, 'edit'); } print ''; @@ -800,7 +797,7 @@ if ($rowid > 0) $value = $adht->array_options["options_" . $key]; } print ''.$label.''; - print $extrafields->showInputField($key,$value); + print $extrafields->showInputField($key, $value); print "\n"; } print '

'; diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 3cd57e43390..6fe29379b58 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -33,10 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; $langs->loadLangs(array("admin","members","ldap")); $id = GETPOST('rowid', 'int'); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); // Security check -$result=restrictedArea($user,'adherent',$id,'adherent_type'); +$result=restrictedArea($user, 'adherent', $id, 'adherent_type'); $object = new AdherentType($db); $object->fetch($id); @@ -50,7 +50,7 @@ $hookmanager->initHooks(array('membertypeldapcard','globalcard')); $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -153,9 +153,9 @@ $result=$ldap->connect_bind(); if ($result > 0) { $info=$object->_load_ldap_info(); - $dn=$object->_load_ldap_dn($info,1); - $search = "(".$object->_load_ldap_dn($info,2).")"; - $records = $ldap->getAttribute($dn,$search); + $dn=$object->_load_ldap_dn($info, 1); + $search = "(".$object->_load_ldap_dn($info, 2).")"; + $records = $ldap->getAttribute($dn, $search); //print_r($records); @@ -168,7 +168,7 @@ if ($result > 0) } else { - $result=show_ldap_content($records,0,$records['count'],true); + $result=show_ldap_content($records, 0, $records['count'], true); } } else diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 7b24260cd8d..38e19adb745 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -$action=GETPOST('action','aZ09'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminaccoutant'; // To manage different context of search +$action=GETPOST('action', 'aZ09'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'adminaccoutant'; // To manage different context of search // Load translation files required by the page $langs->loadLangs(array('admin', 'companies')); @@ -44,25 +44,25 @@ $error=0; */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) +if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) || ($action == 'updateedit') ) { - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id','int'), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity); if ($action != 'updateedit' && ! $error) { @@ -76,9 +76,9 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) */ $help_url=''; -llxHeader('',$langs->trans("CompanyFoundation"),$help_url); +llxHeader('', $langs->trans("CompanyFoundation"), $help_url); -print load_fiche_titre($langs->trans("CompanyFoundation"),'','title_setup'); +print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); @@ -116,23 +116,23 @@ if ($action == 'edit' || $action == 'updateedit') // Name print ''; - print ''."\n"; + print ''."\n"; // Address print ''; - print ''."\n"; + print ''."\n"; print ''; - print ''."\n"; + print ''."\n"; print ''; - print ''."\n"; + print ''."\n"; // Country print ''; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''."\n"; print ''; @@ -158,11 +158,11 @@ if ($action == 'edit' || $action == 'updateedit') // Code print ''; - print ''."\n"; + print ''."\n"; // Note print ''; - print ''; + print ''; print ''; print ''; @@ -212,24 +212,24 @@ else $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); $img=picto_from_langcode($code); print $img?$img.' ':''; - print getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY,1); + print getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 1); } print ''; if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''.$langs->trans("Region-State").''; else print ''.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE,$conf->global->MAIN_SHOW_STATE_CODE,0,$conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); + if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); else print ' '; print ''; - print ''.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE,$mysoc->country_code) . ''; + print ''.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . ''; - print ''.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX,$mysoc->country_code) . ''; + print ''.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . ''; - print ''.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL,0,0,0,80) . ''; + print ''.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . ''; - print ''.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB,'_blank',80) . ''; + print ''.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . ''; print ''.$langs->trans("AccountantFileNumber").'' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . ''; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 27dad04dc32..eb2f413b340 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -34,8 +34,8 @@ if (!$user->admin) // Load translation files required by the page $langs->loadLangs(array('admin', 'other', 'agenda')); -$action = GETPOST('action','alpha'); -$cancel = GETPOST('cancel','alpha'); +$action = GETPOST('action', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); $search_event = GETPOST('search_event', 'alpha'); @@ -71,13 +71,13 @@ else */ // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_event = ''; $action = ''; } -if (GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') ||GETPOST('button_search','alpha')) // To avoid the save when we click on search +if (GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') ||GETPOST('button_search', 'alpha')) // To avoid the save when we click on search { $action = ''; } @@ -92,9 +92,9 @@ if ($action == "save" && empty($cancel)) { $keyparam='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; //print "param=".$param." - ".$_POST[$param]; - if ($search_event === '' || preg_match('/'.preg_quote($search_event,'/').'/i', $keyparam)) + if ($search_event === '' || preg_match('/'.preg_quote($search_event, '/').'/i', $keyparam)) { - $res = dolibarr_set_const($db,$keyparam,(GETPOST($keyparam,'alpha')?GETPOST($keyparam,'alpha'):''),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, $keyparam, (GETPOST($keyparam, 'alpha')?GETPOST($keyparam, 'alpha'):''), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; } } @@ -106,7 +106,7 @@ if ($action == "save" && empty($cancel)) } else { - setEventMessages($langs->trans("Error"),null, 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); $db->rollback(); } } @@ -121,7 +121,7 @@ $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); print ''; print ''; @@ -174,7 +174,7 @@ if (! empty($triggers)) if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; if ($trigger['code'] == 'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; - if ($search_event === '' || preg_match('/'.preg_quote($search_event,'/').'/i', $trigger['code'])) + if ($search_event === '' || preg_match('/'.preg_quote($search_event, '/').'/i', $trigger['code'])) { print ''; print ''.$trigger['code'].''; diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 29323020325..d0eb1bbaeed 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -70,7 +70,7 @@ $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); $head=agenda_prepare_head(); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 3fe540a2baf..c9ba17d2461 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -38,8 +38,8 @@ if (!$user->admin) accessforbidden(); $langs->loadLangs(array('agenda', 'admin', 'other')); $def = array(); -$actiontest=GETPOST('test','alpha'); -$actionsave=GETPOST('save','alpha'); +$actiontest=GETPOST('test', 'alpha'); +$actionsave=GETPOST('save', 'alpha'); if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=$conf->global->AGENDA_EXT_NB; @@ -56,8 +56,8 @@ if ($actionsave) { $db->begin(); - $disableext=GETPOST('AGENDA_DISABLE_EXT','alpha'); - $res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0,'',$conf->entity); + $disableext=GETPOST('AGENDA_DISABLE_EXT', 'alpha'); + $res=dolibarr_set_const($db, 'AGENDA_DISABLE_EXT', $disableext, 'chaine', 0, '', $conf->entity); $i=1; $errorsaved=0; $error=0; @@ -65,12 +65,12 @@ if ($actionsave) // Save agendas while ($i <= $MAXAGENDA) { - $name=trim(GETPOST('AGENDA_EXT_NAME'.$i,'alpha')); - $src=trim(GETPOST('AGENDA_EXT_SRC'.$i,'alpha')); - $offsettz=trim(GETPOST('AGENDA_EXT_OFFSETTZ'.$i,'alpha')); - $color=trim(GETPOST('AGENDA_EXT_COLOR'.$i,'alpha')); + $name=trim(GETPOST('AGENDA_EXT_NAME'.$i, 'alpha')); + $src=trim(GETPOST('AGENDA_EXT_SRC'.$i, 'alpha')); + $offsettz=trim(GETPOST('AGENDA_EXT_OFFSETTZ'.$i, 'alpha')); + $color=trim(GETPOST('AGENDA_EXT_COLOR'.$i, 'alpha')); if ($color=='-1') $color=''; - $enabled=trim(GETPOST('AGENDA_EXT_ENABLED'.$i,'alpha')); + $enabled=trim(GETPOST('AGENDA_EXT_ENABLED'.$i, 'alpha')); if (! empty($src) && ! dol_is_url($src)) { @@ -81,15 +81,15 @@ if ($actionsave) } //print '-name='.$name.'-color='.$color; - $res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, 'AGENDA_EXT_NAME'.$i, $name, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, 'AGENDA_EXT_SRC'.$i, $src, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_OFFSETTZ'.$i,$offsettz,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, 'AGENDA_EXT_OFFSETTZ'.$i, $offsettz, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, 'AGENDA_EXT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_ENABLED'.$i,$enabled,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, 'AGENDA_EXT_ENABLED'.$i, $enabled, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; $i++; } @@ -97,7 +97,7 @@ if ($actionsave) // Save nb of agenda if (! $error) { - $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOST('AGENDA_EXT_NB', 'int')), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; @@ -127,10 +127,10 @@ $arrayofjs=array(); $arrayofcss=array(); $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; -llxHeader('',$langs->trans("AgendaSetup"),$wikihelp,'',0,0,$arrayofjs,$arrayofcss); +llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, $arrayofjs, $arrayofcss); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); print ''; print ''; @@ -161,17 +161,17 @@ print "".$langs->trans("ExtSitesEnableThisTool").""; print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('AGENDA_DISABLE_EXT',array('enabled'=>array(0=>'.hideifnotset')),null,1); + print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1); } else { if (empty($conf->global->AGENDA_DISABLE_EXT)) { - print ''.img_picto($langs->trans("Enabled"),'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"),'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -212,7 +212,7 @@ while ($i <= $MAXAGENDA) print ''; // Nb - print ''.$langs->trans("AgendaExtNb",$key).""; + print ''.$langs->trans("AgendaExtNb", $key).""; // Name print ''; // URL diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 639671b4647..f78cd42034c 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -37,11 +37,11 @@ if (!$user->admin) // Load translation files required by the page $langs->loadLangs(array('admin', 'other', 'agenda', 'users')); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$param = GETPOST('param','alpha'); -$cancel = GETPOST('cancel','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$param = GETPOST('param', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type = 'action'; @@ -51,7 +51,7 @@ $type = 'action'; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; $value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); @@ -66,7 +66,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) } } -if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -88,7 +88,7 @@ if ($action == 'set') } elseif ($action == 'specimen') // For orders { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $commande = new CommandeFournisseur($db); $commande->initAsSpecimen(); @@ -96,10 +96,10 @@ elseif ($action == 'specimen') // For orders // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -112,9 +112,9 @@ elseif ($action == 'specimen') // For orders { require_once $file; - $module = new $classname($db,$commande); + $module = new $classname($db, $commande); - if ($module->write_file($commande,$langs) > 0) + if ($module->write_file($commande, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf"); return; @@ -144,14 +144,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF',$conf->entity); + if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -172,13 +172,13 @@ elseif ($action == 'setdoc') */ $formactions=new FormActions($db); -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; -llxHeader('', $langs->trans("AgendaSetup"),$wikihelp); +llxHeader('', $langs->trans("AgendaSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); @@ -219,7 +219,7 @@ else if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print load_fiche_titre($langs->trans("AgendaModelModule"),'',''); + print load_fiche_titre($langs->trans("AgendaModelModule"), '', ''); print ''."\n"; print ''."\n"; @@ -244,7 +244,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { while (($file = readdir($handle))!==false) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -258,8 +258,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print "\n"; print ""; } else { print '"; } @@ -293,11 +293,11 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print ''; @@ -306,12 +306,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; print ''; print "\n"; @@ -343,11 +343,11 @@ print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 10d716a1af6..d92ce1ee213 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -32,11 +32,11 @@ if (!$user->admin) // Load translation files required by the page $langs->loadLangs(array("admin","other","agenda")); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$param = GETPOST('param','alpha'); -$cancel = GETPOST('cancel','alpha'); -$scandir = GETPOST('scandir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$param = GETPOST('param', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$scandir = GETPOST('scandir', 'alpha'); $type = 'action'; @@ -46,7 +46,7 @@ $type = 'action'; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; $value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); @@ -61,7 +61,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) } } -if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -83,7 +83,7 @@ if ($action == 'set') } elseif ($action == 'specimen') // For orders { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $commande = new CommandeFournisseur($db); $commande->initAsSpecimen(); @@ -91,10 +91,10 @@ elseif ($action == 'specimen') // For orders // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -107,9 +107,9 @@ elseif ($action == 'specimen') // For orders { require_once $file; - $module = new $classname($db,$commande); + $module = new $classname($db, $commande); - if ($module->write_file($commande,$langs) > 0) + if ($module->write_file($commande, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf"); return; @@ -139,14 +139,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF',$conf->entity); + if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -167,11 +167,11 @@ elseif ($action == 'setdoc') */ $formactions=new FormActions($db); -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); @@ -199,10 +199,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print ''."\n"; } else { - print ''.img_picto($langs->trans('Enabled'),'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; print ''."\n"; } } @@ -216,10 +216,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print ''."\n"; } else { - print ''.img_picto($langs->trans('Enabled'),'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; print ''."\n"; print ''."\n"; @@ -228,9 +228,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print ''."\n"; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index d55a3713ae1..fe2a2ef84e7 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -36,7 +36,7 @@ if (!$user->admin) $langs->loadLangs(array("admin","other","agenda")); $def = array(); -$actionsave=GETPOST('save','alpha'); +$actionsave=GETPOST('save', 'alpha'); // Sauvegardes parametres if ($actionsave) @@ -45,10 +45,10 @@ if ($actionsave) $db->begin(); - $i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'AGENDA_EXPORT_FIX_TZ',trim(GETPOST('AGENDA_EXPORT_FIX_TZ','alpha')),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db, 'MAIN_AGENDA_XCAL_EXPORTKEY', trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY', 'alpha')), 'chaine', 0, '', $conf->entity); + $i+=dolibarr_set_const($db, 'MAIN_AGENDA_EXPORT_PAST_DELAY', trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY', 'alpha')), 'chaine', 0, '', $conf->entity); + $i+=dolibarr_set_const($db, 'MAIN_AGENDA_EXPORT_CACHE', trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE', 'alpha')), 'chaine', 0, '', $conf->entity); + $i+=dolibarr_set_const($db, 'AGENDA_EXPORT_FIX_TZ', trim(GETPOST('AGENDA_EXPORT_FIX_TZ', 'alpha')), 'chaine', 0, '', $conf->entity); if ($i >= 4) { @@ -74,7 +74,7 @@ $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); print ''; @@ -98,7 +98,7 @@ print ""; print ''; print '"; -print ''; @@ -107,13 +107,13 @@ print ""; print ''; print ""; -print ""; +print ""; print ""; print ""; print ''; print ""; -print ""; +print ""; print ""; print ""; @@ -153,7 +153,7 @@ print "
"; // Define $urlwithroot -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current @@ -161,23 +161,23 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain // Show message $message=''; $urlvcal=''.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').''; -$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); +$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal); $message.='
'; $urlical=''.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').''; -$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'ical/ics',$urlical); +$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical); $message.='
'; $urlrss=''.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').''; -$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'rss',$urlrss); +$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss); $message.='
'; $message.='
'; print $message; -$message =$langs->trans("AgendaUrlOptions1",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptionsNotAdmin",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptionsProject",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptionsNotAutoEvent",'systemauto','systemauto').'
'; +$message =$langs->trans("AgendaUrlOptions1", $user->login, $user->login).'
'; +$message.=$langs->trans("AgendaUrlOptions3", $user->login, $user->login).'
'; +$message.=$langs->trans("AgendaUrlOptionsNotAdmin", $user->login, $user->login).'
'; +$message.=$langs->trans("AgendaUrlOptions4", $user->login, $user->login).'
'; +$message.=$langs->trans("AgendaUrlOptionsProject", $user->login, $user->login).'
'; +$message.=$langs->trans("AgendaUrlOptionsNotAutoEvent", 'systemauto', 'systemauto').'
'; print info_admin($message); diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index f6a729743cf..de04c6d3a32 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -62,11 +62,11 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("Bank"); -llxHeader('',$langs->trans("BankSetupModule"),$help_url); +llxHeader('', $langs->trans("BankSetupModule"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 45b908487a3..92b1c73060d 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -33,7 +33,7 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); /* @@ -53,8 +53,8 @@ elseif ($action == 'setbarcodeproductoff') if ($action == 'setcoder') { - $coder = GETPOST('coder','alpha'); - $code_id = GETPOST('code_id','alpha'); + $coder = GETPOST('coder', 'alpha'); + $code_id = GETPOST('code_id', 'alpha'); $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; $sqlp.= " SET coder = '" . $coder."'"; $sqlp.= " WHERE rowid = ". $code_id; @@ -65,12 +65,12 @@ if ($action == 'setcoder') } elseif ($action == 'update') { - $location = GETPOST('GENBARCODE_LOCATION','alpha'); - $res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity); - $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha'); - $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity); - $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha'); - $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity); + $location = GETPOST('GENBARCODE_LOCATION', 'alpha'); + $res = dolibarr_set_const($db, "GENBARCODE_LOCATION", $location, 'chaine', 0, '', $conf->entity); + $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE', 'alpha'); + $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id, 'chaine', 0, '', $conf->entity); + $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY', 'alpha'); + $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id, 'chaine', 0, '', $conf->entity); if ($res > 0) { @@ -100,7 +100,7 @@ elseif ($action == 'updateengine') if (GETPOST('coder'.$obj->rowid, 'alpha')) { - $coder = GETPOST('coder'.$obj->rowid,'alpha'); + $coder = GETPOST('coder'.$obj->rowid, 'alpha'); $code_id = $obj->rowid; $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; @@ -126,10 +126,10 @@ $form = new Form($db); $formbarcode = new FormBarCode($db); $help_url='EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra'; -llxHeader('',$langs->trans("BarcodeSetup"),$help_url); +llxHeader('', $langs->trans("BarcodeSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BarcodeSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup'); // Detect bar codes modules $barcodelist=array(); @@ -157,7 +157,7 @@ foreach($dirbarcode as $reldir) { if (is_readable($newdir.$file)) { - if (preg_match('/(.*)\.modules\.php$/i',$file,$reg)) + if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) { $filebis=$reg[1]; @@ -186,7 +186,7 @@ foreach($dirbarcode as $reldir) */ print '
'; -print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'',''); +print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', ''); if (empty($conf->use_javascript_ajax)) { @@ -236,7 +236,7 @@ if ($resql) foreach($dirbarcode as $reldir) { - $dir=dol_buildpath($reldir,0); + $dir=dol_buildpath($reldir, 0); $newdir=dol_osencode($dir); // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php) @@ -254,7 +254,7 @@ if ($resql) if ($module->encodingIsSupported($obj->encoding)) { // Build barcode on disk (not used, this is done to make debug easier) - $result=$module->writeBarCode($obj->example,$obj->encoding,'Y'); + $result=$module->writeBarCode($obj->example, $obj->encoding, 'Y'); // Generate on the fly and output barcode with generator $url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); //print $url; @@ -278,7 +278,7 @@ if ($resql) print ''; print '\n"; $i++; @@ -298,7 +298,7 @@ print "
"; /* * Other options */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ""; print ''; @@ -322,7 +322,7 @@ if (! isset($_SERVER['WINDIR'])) if (! empty($conf->global->GENBARCODE_LOCATION) && ! @file_exists($conf->global->GENBARCODE_LOCATION)) { $langs->load("errors"); - print '
'.$langs->trans("ErrorFileNotFound",$conf->global->GENBARCODE_LOCATION).''; + print '
'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).''; } print ''; } @@ -362,7 +362,7 @@ print '
'; // Select barcode numbering module if ($conf->produit->enabled) { - print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")",'',''); + print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', ''); print '
\n"; require_once $dir.$file; - $module = new $classname($db,$specimenthirdparty); - if (method_exists($module,'info')) + $module = new $classname($db, $specimenthirdparty); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; @@ -273,19 +273,19 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") { print 'scandir.'&label='.urlencode($module->name).'&type=action">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } else { - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); } print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; - print ''.img_object($langs->trans("Preview"),'order').''; + print ''.img_object($langs->trans("Preview"), 'order').''; print '
'."\n"; //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print '
'."\n"; if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { - print ''.img_picto($langs->trans('Disabled'),'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; print '
'."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { - print ''.img_picto($langs->trans('Disabled'),'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; print '
'."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { - print ''.img_picto($langs->trans('Disabled'),'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; } else { - print ''.img_picto($langs->trans('Enabled'),'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; } print '
'.$langs->trans("PasswordTogetVCalExport")."'; +print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); print '
".$langs->trans("PastDelayVCalExport")."global->MAIN_AGENDA_EXPORT_PAST_DELAY) . "\" size=\"10\"> ".$langs->trans("days")."global->MAIN_AGENDA_EXPORT_PAST_DELAY) . "\" size=\"10\"> ".$langs->trans("days")." 
".$langs->trans("UseACacheDelay")."global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\">global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\"> 
'; - print $formbarcode->setBarcodeEncoder($obj->coder,$barcodelist,$obj->rowid,'form'.$i); + print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i); print "
'; print ''; @@ -373,11 +373,11 @@ if ($conf->produit->enabled) print ''; print "\n"; - $dirbarcodenum=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']); + $dirbarcodenum=array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); foreach ($dirbarcodenum as $dirroot) { - $dir = dol_buildpath($dirroot,0); + $dir = dol_buildpath($dirroot, 0); $handle = @opendir($dir); if (is_resource($handle)) @@ -407,18 +407,18 @@ if ($conf->produit->enabled) if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { print ''; } else { print ''; } print ''; print "\n"; } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c5bc3f596b4..3cee6aa27f4 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -33,8 +33,8 @@ $langs->loadLangs(array('admin', 'boxes')); if (! $user->admin) accessforbidden(); -$rowid = GETPOST('rowid','int'); -$action = GETPOST('action','alpha'); +$rowid = GETPOST('rowid', 'int'); +$action = GETPOST('action', 'alpha'); // Define possible position of boxes @@ -48,8 +48,8 @@ $boxes = array(); if ($action == 'addconst') { - dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", $_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", $_POST["MAIN_BOXES_MAXLINES"], '', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"], 'chaine', 0, '', $conf->entity); } if ($action == 'add') { @@ -106,8 +106,8 @@ if ($action == 'add') { while($obj = $db->fetch_object($resql)) { $boxorder=$obj->box_order; - if (preg_match('/A/',$boxorder)) $nbboxonleft++; - if (preg_match('/B/',$boxorder)) $nbboxonright++; + if (preg_match('/A/', $boxorder)) $nbboxonleft++; + if (preg_match('/B/', $boxorder)) $nbboxonright++; } } else dol_print_error($db); @@ -186,9 +186,9 @@ if ($action == 'switch') $newsecond=$objfrom->box_order; if ($newfirst == $newsecond) { - $newsecondchar=preg_replace('/[0-9]+/','',$newsecond); - $newsecondnum=preg_replace('/[a-zA-Z]+/','',$newsecond); - $newsecond=sprintf("%s%02d",$newsecondchar?$newsecondchar:'A',$newsecondnum+1); + $newsecondchar=preg_replace('/[0-9]+/', '', $newsecond); + $newsecondnum=preg_replace('/[a-zA-Z]+/', '', $newsecond); + $newsecond=sprintf("%s%02d", $newsecondchar?$newsecondchar:'A', $newsecondnum+1); } $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$newfirst."' WHERE rowid=".$objfrom->rowid; dol_syslog($sql); @@ -218,9 +218,9 @@ if ($action == 'switch') $form=new Form($db); -llxHeader('',$langs->trans("Boxes")); +llxHeader('', $langs->trans("Boxes")); -print load_fiche_titre($langs->trans("Boxes"),'','title_setup'); +print load_fiche_titre($langs->trans("Boxes"), '', 'title_setup'); print $langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; @@ -254,7 +254,7 @@ if ($resql) $boxes[$obj->position][$obj->box_id]=1; $i++; - array_push($actives,$obj->box_id); + array_push($actives, $obj->box_id); if ($obj->box_order == '' || $obj->box_order == '0' || $decalage) $decalage++; // On renumerote l'ordre des boites si l'une d'elle est a '' @@ -283,13 +283,13 @@ if ($resql) { if (dol_strlen($record['box_order']) == 1) { - if (preg_match("/[13579]{1}/",substr($record['box_order'],-1))) + if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) { $box_order = "A0".$record['box_order']; $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; $resql = $db->query($sql); } - elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1))) + elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) { $box_order = "B0".$record['box_order']; $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; @@ -298,13 +298,13 @@ if ($resql) } elseif (dol_strlen($record['box_order']) == 2) { - if (preg_match("/[13579]{1}/",substr($record['box_order'],-1))) + if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) { $box_order = "A".$record['box_order']; $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; $resql = $db->query($sql); } - elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1))) + elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) { $box_order = "B".$record['box_order']; $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; @@ -318,9 +318,9 @@ if ($resql) } // Available boxes to activate -$boxtoadd=InfoBox::listBoxes($db,'available',-1,null,$actives); +$boxtoadd=InfoBox::listBoxes($db, 'available', -1, null, $actives); // Activated boxes -$boxactivated=InfoBox::listBoxes($db,'activated',-1,null); +$boxactivated=InfoBox::listBoxes($db, 'activated', -1, null); print "
\n"; print "\n\n".''."\n"; @@ -342,19 +342,19 @@ print "\n"; foreach($boxtoadd as $box) { - if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) + if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) { $logo = $box->boximg; } else { - $logo=preg_replace("/^object_/i","",$box->boximg); + $logo=preg_replace("/^object_/i", "", $box->boximg); } print "\n".''."\n"; print ''."\n"; - print ''."\n"; print ''; - print ''; print ''; @@ -476,7 +476,7 @@ print ''; if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { print ''; print ''; } diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 013b140ee60..4efa3bc487b 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -37,8 +37,8 @@ $langs->loadLangs(array("admin","companies","bills","other","banks")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_ADDON = 'mod_chequereceipts_mint.php'; @@ -51,9 +51,9 @@ if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_AD if ($action == 'updateMask') { - $maskconstchequereceipts=GETPOST('maskconstchequereceipts','alpha'); - $maskchequereceipts=GETPOST('maskchequereceipts','alpha'); - if ($maskconstchequereceipts) $res = dolibarr_set_const($db,$maskconstchequereceipts,$maskchequereceipts,'chaine',0,'',$conf->entity); + $maskconstchequereceipts=GETPOST('maskconstchequereceipts', 'alpha'); + $maskchequereceipts=GETPOST('maskchequereceipts', 'alpha'); + if ($maskconstchequereceipts) $res = dolibarr_set_const($db, $maskconstchequereceipts, $maskchequereceipts, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -69,14 +69,14 @@ if ($action == 'updateMask') if ($action == 'setmod') { - dolibarr_set_const($db, "CHEQUERECEIPTS_ADDON",$value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "CHEQUERECEIPTS_ADDON", $value, 'chaine', 0, '', $conf->entity); } if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') { - $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT','none'); // No alpha here, we want exact string + $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -94,13 +94,13 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') * view */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("BankSetupModule")); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); +llxHeader("", $langs->trans("BankSetupModule")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'checkreceipts', $langs->trans("BankSetupModule"), -1, 'account'); @@ -136,7 +136,7 @@ foreach ($dirmodels as $reldir) { $filebis = $file; $name = substr($file, 4, dol_strlen($file) -16); - $classname = preg_replace('/\.php$/','',$file); + $classname = preg_replace('/\.php$/', '', $file); // For compatibility if (! is_file($dir.$filebis)) { @@ -144,11 +144,11 @@ foreach ($dirmodels as $reldir) $classname = "mod_chequereceipt_".$file; } // Check if there is a filter on country - preg_match('/\-(.*)_(.*)$/',$classname,$reg); + preg_match('/\-(.*)_(.*)$/', $classname, $reg); if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue; - $classname = preg_replace('/\-.*$/','',$classname); - if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') + $classname = preg_replace('/\-.*$/', '', $classname); + if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/', $filebis) || preg_match('/mod_/', $classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') { // Charging the numbering class require_once $dir.$filebis; @@ -172,7 +172,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''."\n"; @@ -180,11 +180,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -194,11 +194,11 @@ foreach ($dirmodels as $reldir) // Example $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$chequereceipts); + $nextval=$module->getNextValue($mysoc, $chequereceipts); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -207,11 +207,11 @@ foreach ($dirmodels as $reldir) } print ''; @@ -235,7 +235,7 @@ print '
'; * Other options * */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; @@ -264,7 +264,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; @@ -453,14 +451,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -468,11 +466,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -484,28 +482,28 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); //$htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -526,7 +524,7 @@ print "
"; * Other options */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->trans("ShortInfo").'
'; - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; - $s=$modBarCode->getToolTip($langs,null,-1); - print $form->textwithpicto('',$s,1); + $s=$modBarCode->getToolTip($langs, null, -1); + print $form->textwithpicto('', $s, 1); print '
'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); - if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + print ''.img_object("", $logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + if (! empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')'; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') @@ -407,25 +407,25 @@ $box_order=1; $foundrupture=1; foreach($boxactivated as $key => $box) { - if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) + if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) { $logo = $box->boximg; } else { - $logo=preg_replace("/^object_/i","",$box->boximg); + $logo=preg_replace("/^object_/i", "", $box->boximg); } print "\n".''."\n"; print '
'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); - if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + print ''.img_object("", $logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + if (! empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')'; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') { $langs->load("errors"); - print img_warning('',0).' '.$langs->trans("WarningUsingThisBoxSlowDown"); + print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown"); } else print ($box->note?$box->note:' '); print '
'.$langs->trans("EnableFileCache").''; - print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1); + print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', $conf->global->MAIN_ACTIVATE_FILECACHE, 1); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); if ($conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) // If module is the one used, we show existing errors { - if (! empty($module->error)) dol_htmloutput_mesg($module->error,'','error',1); + if (! empty($module->error)) dol_htmloutput_mesg($module->error, '', 'error', 1); } print ''; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 34a641137dc..7f4a167edd9 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -31,7 +31,7 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* @@ -61,10 +61,10 @@ if ($action == 'setvalue' && $user->admin) $user->fetch_clicktodial(); $wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; -llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp); +llxHeader('', $langs->trans("ClickToDialSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ClickToDialSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ClickToDialSetup"), $linkback, 'title_setup'); print $langs->trans("ClickToDialDesc")."
\n"; @@ -119,19 +119,19 @@ if (! empty($conf->global->CLICKTODIAL_URL)) if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest'); print ''; - print $langs->trans("LinkToTestClickToDial",$user->login).' : '; + print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; print ''; print ''; $setupcomplete=1; - if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; - if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; - if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; + if (preg_match('/__LOGIN__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; + if (preg_match('/__PASSWORD__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; + if (preg_match('/__PHONEFROM__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; if ($setupcomplete) { - print $langs->trans("LinkToTest",$user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); + print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); } else { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 42ea60d0f9f..3dc59b1b247 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -41,10 +41,10 @@ $langs->loadLangs(array('admin', 'errors', 'orders', 'other')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type = 'order'; @@ -56,10 +56,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstorder=GETPOST('maskconstorder','alpha'); - $maskorder=GETPOST('maskorder','alpha'); + $maskconstorder=GETPOST('maskconstorder', 'alpha'); + $maskorder=GETPOST('maskorder', 'alpha'); - if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity); + if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -75,17 +75,17 @@ if ($action == 'updateMask') elseif ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $commande = new Commande($db); $commande->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -100,7 +100,7 @@ elseif ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($commande,$langs) > 0) + if ($module->write_file($commande, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); return; @@ -129,14 +129,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); + if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // The constant that was read before the new set // We therefore requires a variable to have a coherent view @@ -156,13 +156,13 @@ elseif ($action == 'setmod') // TODO Check if numbering module chosen can be activated // by calling method canBeActivated - dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "COMMANDE_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') { $draft = GETPOST("COMMANDE_DRAFT_WATERMARK"); - $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -178,9 +178,9 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') elseif ($action == 'set_ORDER_FREE_TEXT') { - $freetext = GETPOST("ORDER_FREE_TEXT",'none'); // No alpha here, we want exact string + $freetext = GETPOST("ORDER_FREE_TEXT", 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -192,12 +192,10 @@ elseif ($action == 'set_ORDER_FREE_TEXT') { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -// Activate Set Shippable Icon In List -elseif ($action=="setshippableiconinlist") { - $setshippableiconinlist = GETPOST('value','int'); - $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); +} elseif ($action=="setshippableiconinlist") { + // Activate Set Shippable Icon In List + $setshippableiconinlist = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -209,7 +207,7 @@ elseif ($action=="setshippableiconinlist") { // Activate ask for payment bank elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { - $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -226,7 +224,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') // Activate ask for warehouse elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') { - $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -247,12 +245,12 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') $form=new Form($db); -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("OrdersSetup")); +llxHeader("", $langs->trans("OrdersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); $head = order_admin_prepare_head(); @@ -262,7 +260,7 @@ dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order'); * Orders Numbering model */ -print load_fiche_titre($langs->trans("OrdersNumberingModules"),'',''); +print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', ''); print ''; print ''; @@ -309,7 +307,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -317,12 +315,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -334,11 +332,11 @@ foreach ($dirmodels as $reldir) $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; $commande->type=0; - $nextval=$module->getNextValue($mysoc,$commande); + $nextval=$module->getNextValue($mysoc, $commande); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -347,7 +345,7 @@ foreach ($dirmodels as $reldir) } print ''; print "\n"; @@ -365,7 +363,7 @@ print "
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->COMMANDE_ADDON == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '

\n"; * Document templates generators */ -print load_fiche_titre($langs->trans("OrdersModelModule"),'',''); +print load_fiche_titre($langs->trans("OrdersModelModule"), '', ''); // Load array def with activated templates $def = array(); @@ -423,7 +421,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -444,7 +442,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->COMMANDE_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'bill').''; + print ''.img_object($langs->trans("Preview"), 'bill').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -553,7 +551,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; // ProfID1 - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { - print ''; + print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1) . ''; print "
'.$langs->trans("Parameter").''; @@ -664,7 +662,7 @@ print '
'; * Notifications */ -print load_fiche_titre($langs->trans("Notifications"),'',''); +print load_fiche_titre($langs->trans("Notifications"), '', ''); print ''; print ''; print ''; diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 9abc3dc23c7..cf2c7e20627 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -71,10 +71,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Receptions"); -llxHeader('',$langs->trans("ReceptionsSetup")); +llxHeader('', $langs->trans("ReceptionsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ReceptionsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup'); print "
\n"; $head = reception_admin_prepare_head(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 16b57ab1e74..f9f4896da79 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -$action=GETPOST('action','aZ09'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search +$action=GETPOST('action', 'aZ09'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'admincompany'; // To manage different context of search // Load translation files required by the page $langs->loadLangs(array('admin', 'companies')); @@ -56,13 +56,13 @@ $hookmanager->initHooks(array('admincompany','globaladmin')); */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) +if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) || ($action == 'updateedit') ) { - $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); + $tmparray=getCountry(GETPOST('country_id', 'int'), 'all', $db, $langs, 0); if (! empty($tmparray['id'])) { $mysoc->country_id =$tmparray['id']; @@ -70,31 +70,31 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) $mysoc->country_label=$tmparray['label']; $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity); activateModulesRequiredByCountry($mysoc->country_code); } $db->begin(); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'aZ09'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode",'alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode", 'alpha'), 'chaine', 0, '', $conf->entity); $varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { - if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) + if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -106,10 +106,10 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) { dol_mkdir($dirforimage); } - $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); if ($result > 0) { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO", $original_file, 'chaine', 0, '', $conf->entity); // Create thumbs of logo (Note that PDF use original file and not thumbs) if ($isimage > 0) @@ -119,30 +119,28 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) // Create small thumb, Used on logon for example $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) { $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbSmall); // Create mini thumb, Used on menu or for setup page for example $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); - if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) { $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbMini); } - else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); - } - elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) - { + else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); + } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); - $tmparray=explode(':',$result); - setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); + $tmparray=explode(':', $result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } else { @@ -159,26 +157,26 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) } } - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'nohtml'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'int'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START", 'int'), 'chaine', 0, '', $conf->entity); // Sale tax options - $usevat = GETPOST("optiontva",'aZ09'); - $uselocaltax1 = GETPOST("optionlocaltax1",'aZ09'); - $uselocaltax2 = GETPOST("optionlocaltax2",'aZ09'); + $usevat = GETPOST("optiontva", 'aZ09'); + $uselocaltax1 = GETPOST("optionlocaltax1", 'aZ09'); + $uselocaltax2 = GETPOST("optionlocaltax2", 'aZ09'); if ($uselocaltax1 == 'localtax1on' && ! $usevat) { setEventMessages($langs->trans("IfYouUseASecondTaxYouMustSetYouUseTheMainTax"), null, 'errors'); @@ -190,33 +188,33 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) $error++; } - dolibarr_set_const($db, "FACTURE_TVAOPTION", $usevat,'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1,'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FACTURE_TVAOPTION", $usevat, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2, 'chaine', 0, '', $conf->entity); if($_POST["optionlocaltax1"]=="localtax1on") { if(!isset($_REQUEST['lt1'])) { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0,'chaine',0,'',$conf->entity); + 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); + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity); } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1", 'aZ09'), 'chaine', 0, '', $conf->entity); } if($_POST["optionlocaltax2"]=="localtax2on") { if(!isset($_REQUEST['lt2'])) { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0,'chaine',0,'',$conf->entity); + 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); + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity); } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity); } if (! $error) @@ -248,20 +246,20 @@ if ($action == 'addthumb') // Regenerate thumbs //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... // Create small thumb. Used on logon for example - $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) { $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbSmall); // Create mini thumbs. Used on menu or for setup page for example - $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) { $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbMini); @@ -273,15 +271,15 @@ if ($action == 'addthumb') // Regenerate thumbs $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); - dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); + dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_WARNING); } } else { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors'); - dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); + setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors'); + dol_syslog($langs->transnoentities("ErrorFileDoesNotExists", $_GET["file"]), LOG_WARNING); } } @@ -291,17 +289,17 @@ if ($action == 'removelogo') $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; if ($mysoc->logo != '') dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO", $conf->entity); $mysoc->logo=''; $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; if ($mysoc->logo_small != '') dol_delete_file($logosmallfile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); $mysoc->logo_small=''; $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; if ($mysoc->logo_mini != '') dol_delete_file($logominifile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); $mysoc->logo_mini=''; } @@ -311,7 +309,7 @@ if ($action == 'removelogo') */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $form=new Form($db); $formother=new FormOther($db); @@ -319,7 +317,7 @@ $formcompany=new FormCompany($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -print load_fiche_titre($langs->trans("CompanyFoundation"),'','title_setup'); +print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); @@ -352,27 +350,27 @@ if ($action == 'edit' || $action == 'updateedit') // Name print ''."\n"; + print ''."\n"; // Addresse print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; // Country print ''."\n"; @@ -432,7 +430,7 @@ if ($action == 'edit' || $action == 'updateedit') // Note print ''; + print ''; print ''; print '
'.$langs->trans("Parameter").'
'; - print '
'; - print '
'; - print '
'; - print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id, 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; - print '
'; @@ -473,10 +471,10 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -489,10 +487,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId2 - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -505,10 +503,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId3 - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -521,10 +519,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId4 - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -537,10 +535,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId5 - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -553,10 +551,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId6 - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -592,7 +590,7 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; - print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'SOCIETE_FISCAL_MONTH_START',0,1) . '
"; @@ -634,21 +632,21 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print ''; @@ -459,14 +459,14 @@ foreach ($dirmodels as $reldir) { print ""; } else { print ""; } @@ -474,11 +474,11 @@ foreach ($dirmodels as $reldir) print "'; @@ -487,24 +487,24 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -524,7 +524,7 @@ print "
"; * Other options */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."'; print ''; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(1)) { print ''; } @@ -661,12 +659,12 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; - print ""; + print ""; print '\n"; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
: '; - $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); + $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); print '
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; print "
"; @@ -677,22 +675,22 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print ''; @@ -759,35 +757,35 @@ else { $img=picto_from_langcode($mysoc->country_code); print $img?$img.' ':''; - print getCountry($mysoc->country_code,1); + print getCountry($mysoc->country_code, 1); } - else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; + else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; print ''; if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; // Web @@ -795,7 +793,7 @@ else $arrayofurl = preg_split('/\s/', $conf->global->MAIN_INFO_SOCIETE_WEB); foreach($arrayofurl as $urltoshow) { - if ($urltoshow) print dol_print_url($urltoshow,'_blank',80); + if ($urltoshow) print dol_print_url($urltoshow, '_blank', 80); } print ''; @@ -817,9 +815,9 @@ else print '
'; // It offers the generation of the thumbnail if it does not exist - if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo)) + if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i', $mysoc->logo)) { - print '  '; + print '  '; } elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { @@ -872,14 +870,14 @@ else print ''; // ProfId1 - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { - print '
'; + print dol_print_date(dol_mktime(12, 0, 0, $monthstart, 1, 2000, 1), '%B', 'gm') . ''; print "
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."'; print ''; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(2)) { print ''; } print '\n"; - print ""; + print ""; print '\n"; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
: '; - $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); + $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); print '
: '; @@ -702,12 +700,12 @@ if ($action == 'edit' || $action == 'updateedit') print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; print "
"; @@ -741,7 +739,7 @@ else print '
'.$langs->trans("CompanyName").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; - else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; + else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyName")).''; print '
'.$langs->trans("Region-State").''; else print '
'.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE,$conf->global->MAIN_SHOW_STATE_CODE,0,$conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); + if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); else print ' '; print '
'.$langs->trans("CompanyCurrency").''; - print currency_name($conf->currency,0); + print currency_name($conf->currency, 0); print ' ('.$conf->currency; print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); print ')'; - print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333','MT'), 1, $langs, 1, -1, -1, $conf->currency); + print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333', 'MT'), 1, $langs, 1, -1, -1, $conf->currency); print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId1", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; - $s = $mysoc->id_prof_url(1,$mysoc); + $s = $mysoc->id_prof_url(1, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -888,14 +886,14 @@ else } // ProfId2 - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId2", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; - $s = $mysoc->id_prof_url(2,$mysoc); + $s = $mysoc->id_prof_url(2, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -904,14 +902,14 @@ else } // ProfId3 - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId3", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; - $s = $mysoc->id_prof_url(3,$mysoc); + $s = $mysoc->id_prof_url(3, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -920,14 +918,14 @@ else } // ProfId4 - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId4", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; - $s = $mysoc->id_prof_url(4,$mysoc); + $s = $mysoc->id_prof_url(4, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -936,14 +934,14 @@ else } // ProfId5 - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId5", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; - $s = $mysoc->id_prof_url(5,$mysoc); + $s = $mysoc->id_prof_url(5, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -952,14 +950,14 @@ else } // ProfId6 - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId6", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; - $s = $mysoc->id_prof_url(6,$mysoc); + $s = $mysoc->id_prof_url(6, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -989,11 +987,11 @@ else print ''; print "\n"; $s.=''.$langs->trans("VATIntraCheck").''; - $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1); } else { - $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } print $s; @@ -1027,7 +1025,7 @@ else print '
'.$langs->trans("FiscalMonthStart").''; $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; - print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '
"; print ""; @@ -1076,18 +1074,18 @@ else print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; print ""; + print "global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).""; print ''; @@ -538,14 +538,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print ""; } @@ -553,11 +553,11 @@ foreach ($dirmodels as $reldir) print "'; @@ -569,28 +569,28 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); - $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte, 1, 1); + $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -611,7 +611,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf * Document templates generators */ print '
'; - print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"),'',''); + print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"), '', ''); print ''; print ''; print ''; @@ -639,7 +639,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf $current = !empty($conf->global->{$thisTypeConfName})?$conf->global->{$thisTypeConfName}:$conf->global->FACTURE_ADDON_PDF; print ''; print ''; - print ''; + print ''; print "\n"; } @@ -651,7 +651,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf * Modes de reglement */ print '
'; -print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"),'',''); +print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', ''); print ''; print ''; @@ -733,7 +733,7 @@ if ($resql) print ''; + print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).''; $i++; } @@ -745,7 +745,7 @@ print ""; print "
"; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
"; - print "global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) { print ''; @@ -1111,12 +1109,12 @@ else print '"; + print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code).""; print '\n"; @@ -1130,18 +1128,18 @@ else print '
'; print '
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
".$langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'; - print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; print "
'; print ''; - print ''; + print ''; print ''; print "\n"; print ""; + print "global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).""; print ''; @@ -386,14 +386,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -401,11 +401,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -417,26 +417,26 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -462,7 +462,7 @@ print ''; print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
"; - print "global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) { print ''; @@ -1165,12 +1163,12 @@ else print "\n"; - print ""; + print ""; print '\n"; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 86d96227f3c..5bbfd15a0c4 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -35,7 +35,7 @@ $langs->loadLangs(array('admin', 'compta', 'accountancy')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); // Other parameters ACCOUNTING_* $list = array( @@ -64,10 +64,10 @@ if ($action == 'update') 'CREANCES-DETTES' ); - $accounting_mode = GETPOST('accounting_mode','alpha'); + $accounting_mode = GETPOST('accounting_mode', 'alpha'); - if (in_array($accounting_mode,$accounting_modes)) { + if (in_array($accounting_mode, $accounting_modes)) { if (!dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) { $error++; @@ -103,7 +103,7 @@ llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans('ComptaSetup'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ComptaSetup'), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index a54e1eb7aeb..cead92670a4 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -35,7 +35,7 @@ $langs->loadLangs(array('admin', 'sendings', 'deliveries')); if (!$user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); /* @@ -46,7 +46,7 @@ $action=GETPOST('action','alpha'); if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { // This option should always be set to on when module is on. - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); } /* if ($action == 'activate_sending') @@ -66,14 +66,14 @@ if ($action == 'disable_sending') // Delivery note if ($action == 'activate_delivery') { - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this + dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } elseif ($action == 'disable_delivery') { - dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity); + dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); header("Location: confexped.php"); exit; } @@ -86,10 +86,10 @@ elseif ($action == 'disable_delivery') $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/"; $form=new Form($db); -llxHeader("",$langs->trans("SendingsSetup")); +llxHeader("", $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; $head = expedition_admin_prepare_head(); @@ -134,11 +134,11 @@ print '"; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index bc48425017b..720b43a2275 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -33,16 +33,16 @@ $langs->load("admin"); if (! $user->admin) accessforbidden(); -$rowid=GETPOST('rowid','int'); -$entity=GETPOST('entity','int'); -$action=GETPOST('action','alpha'); -$update=GETPOST('update','alpha'); -$delete=GETPOST('delete','none'); // Do not use alpha here -$debug=GETPOST('debug','int'); -$consts=GETPOST('const','array'); -$constname=GETPOST('constname','alpha'); -$constvalue=GETPOST('constvalue','none'); // We shoul dbe able to send everything here -$constnote=GETPOST('constnote','alpha'); +$rowid=GETPOST('rowid', 'int'); +$entity=GETPOST('entity', 'int'); +$action=GETPOST('action', 'alpha'); +$update=GETPOST('update', 'alpha'); +$delete=GETPOST('delete', 'none'); // Do not use alpha here +$debug=GETPOST('debug', 'int'); +$consts=GETPOST('const', 'array'); +$constname=GETPOST('constname', 'alpha'); +$constvalue=GETPOST('constvalue', 'none'); // We shoul dbe able to send everything here +$constnote=GETPOST('constnote', 'alpha'); @@ -148,7 +148,7 @@ if ($action == 'delete') $form = new Form($db); $wikihelp='EN:Setup_Other|FR:Paramétrage_Divers|ES:Configuración_Varios'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); // Add logic to show/hide buttons if ($conf->use_javascript_ajax) @@ -174,7 +174,7 @@ jQuery(document).ready(function() { trans("OtherSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("OtherSetup"), '', 'title_setup'); print $langs->trans("ConstDesc")."
\n"; print "
\n"; @@ -264,7 +264,7 @@ if ($result) // Note print ''; // Entity limit to superadmin diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 0a704ce5ee8..7cad76585e2 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -33,10 +33,10 @@ $langs->loadLangs(array("admin","errors","contracts")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='contract'; if (empty($conf->global->CONTRACT_ADDON)) @@ -53,9 +53,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst = GETPOST('maskconstcontract','alpha'); - $maskvalue = GETPOST('maskcontract','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst = GETPOST('maskconstcontract', 'alpha'); + $maskvalue = GETPOST('maskcontract', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -71,17 +71,17 @@ if ($action == 'updateMask') elseif ($action == 'specimen') // For contract { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $contract = new Contrat($db); $contract->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -96,7 +96,7 @@ elseif ($action == 'specimen') // For contract $module = new $classname($db); - if ($module->write_file($contract,$langs) > 0) + if ($module->write_file($contract, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf"); return; @@ -125,14 +125,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->CONTRACT_ADDON_PDF == "$value") dolibarr_del_const($db, 'CONTRACT_ADDON_PDF',$conf->entity); + if ($conf->global->CONTRACT_ADDON_PDF == "$value") dolibarr_del_const($db, 'CONTRACT_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -152,16 +152,16 @@ elseif ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "CONTRACT_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'set_other') { - $freetext= GETPOST('CONTRACT_FREE_TEXT','none'); // No alpha here, we want exact string - $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('CONTRACT_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - $draft= GETPOST('CONTRACT_DRAFT_WATERMARK','alpha'); - $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha'); + $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res1 > 0 || ! $res2 > 0) $error++; @@ -180,14 +180,14 @@ elseif ($action == 'set_other') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ContractsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); $head=contract_admin_prepare_head(); @@ -197,7 +197,7 @@ dol_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract'); * Contracts Numbering model */ -print load_fiche_titre($langs->trans("ContractsNumberingModules"),'',''); +print load_fiche_titre($langs->trans("ContractsNumberingModules"), '', ''); print '
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; print "
'; if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "'; - print ''; + print ''; print '
'; print ''; @@ -244,7 +244,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -252,12 +252,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -268,11 +268,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$contract); + $nextval=$module->getNextValue($mysoc, $contract); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -281,7 +281,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -299,7 +299,7 @@ print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->CONTRACT_ADDON == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '

'; * Documents models for Contracts */ -print load_fiche_titre($langs->trans("TemplatePDFContracts"),'',''); +print load_fiche_titre($langs->trans("TemplatePDFContracts"), '', ''); // Defini tableau def des modeles $def = array(); @@ -357,7 +357,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -377,7 +377,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->CONTRACT_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'contract').''; + print ''.img_object($langs->trans("Preview"), 'contract').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -486,7 +486,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''."\n"; diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 51f68ffb7ff..1ab783474b8 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -57,7 +57,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; llxHeader('', $langs->trans("DAVSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("DAVSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("DAVSetup"), $linkback, 'title_setup'); print ''; @@ -112,7 +112,7 @@ else foreach($arrayofparameters as $key => $val) { print '\n"; @@ -300,11 +300,11 @@ print "\n"; print ''; // Page print ''."\n"; // Field print ''; // Value if ($mode != 'focus' && $mode != 'mandatory') diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index a48be10b4e0..a9b7d9e75ca 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -32,7 +32,7 @@ $langs->load("admin"); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); $modules=array( 'agenda' => array( @@ -145,15 +145,15 @@ if ($action == 'update') } } - dolibarr_set_const($db, "MAIN_DISABLE_METEO",$_POST["MAIN_DISABLE_METEO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE",GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_METEO", $_POST["MAIN_DISABLE_METEO"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE", GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"), 'chaine', 0, '', $conf->entity); // For update value with percentage $plus=''; if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE'; // Update values for($i=0; $i<4; $i++) { - if(isset($_POST['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); + if(isset($_POST['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); } } @@ -166,10 +166,10 @@ $form = new Form($db); llxHeader(); -print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"),'','title_setup'); +print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup'); -print $langs->transnoentities("DelaysOfToleranceDesc",img_warning()); -print " ".$langs->trans("OnlyActiveElementsAreShown",DOL_URL_ROOT.'/admin/modules.php')."
\n"; +print $langs->transnoentities("DelaysOfToleranceDesc", img_warning()); +print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."
\n"; print "
\n"; $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; @@ -192,7 +192,7 @@ if ($action == 'edit') $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); print ''; - print ''; + print ''; print ''; } @@ -232,7 +232,7 @@ else $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); print ''; - print ''; + print ''; print ''; print ''; } @@ -294,16 +294,16 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png', $options); + print img_weather($text, 'weather-clear.png', $options); print '= '; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<= '; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<= '; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<= '; print '
'; print '
'; @@ -314,16 +314,16 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png',$options); + print img_weather($text, 'weather-clear.png', $options); print '=  %'; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<=  %'; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<=  %'; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<=  %'; print '
'; print '
'; @@ -365,19 +365,19 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png',$options); + print img_weather($text, 'weather-clear.png', $options); print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.' %'; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.' %'; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.' %'; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %'; print '
'; - print img_weather($text,'weather-storm.png',$options); + print img_weather($text, 'weather-storm.png', $options); print '> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %'; print '
'; print '
'; @@ -385,19 +385,19 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png',$options); + print img_weather($text, 'weather-clear.png', $options); print '= '.$level0; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<= '.$level1; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<= '.$level2; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<= '.$level3; print '
'; - print img_weather($text,'weather-storm.png',$options); + print img_weather($text, 'weather-storm.png', $options); print '> '.$level3; print '
'; print '
'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 537e79ca6a5..2a4ee7c7bd6 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -44,12 +44,12 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core // Load translation files required by the page $langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions")); -$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; -$confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); -$rowid=GETPOST('rowid','alpha'); -$entity=GETPOST('entity','int'); -$code=GETPOST('code','alpha'); +$action=GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; +$confirm=GETPOST('confirm', 'alpha'); +$id=GETPOST('id', 'int'); +$rowid=GETPOST('rowid', 'alpha'); +$entity=GETPOST('entity', 'int'); +$code=GETPOST('code', 'alpha'); $allowed=$user->admin; if ($id == 7 && ! empty($user->rights->accounting->chartofaccount)) $allowed=1; // Tax page allowed to manager of chart account @@ -59,27 +59,27 @@ if (! $allowed) accessforbidden(); $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); $listoffset=GETPOST('listoffset'); $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; // To avoid too long dictionaries $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$search_country_id = GETPOST('search_country_id','int'); +$search_country_id = GETPOST('search_country_id', 'int'); if ($search_country_id == '' && ($id == 2 || $id == 3 || $id == 10)) // Not a so good idea to force on current country for all dictionaries. Some tables have entries that are for all countries, we must be able to see them, so this is done for dedicated dictionaries only. { $search_country_id = $mysoc->country_id; } -$search_code = GETPOST('search_code','alpha'); +$search_code = GETPOST('search_code', 'alpha'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); @@ -522,14 +522,14 @@ $tabfieldcheck[35]= array(); $tabfieldcheck[36]= array(); // Complete all arrays with entries found into modules -complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); +complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); // Defaut sortorder if (empty($sortfield)) { - $tmp1 = explode(',',$tabsqlsort[$id]); - $tmp2 = explode(' ',$tmp1[0]); + $tmp1 = explode(',', $tabsqlsort[$id]); + $tmp2 = explode(' ', $tmp1[0]); $sortfield=preg_replace('/^.*\./', '', $tmp2[0]); } @@ -601,17 +601,17 @@ if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', // Actions add or modify an entry into a dictionary if (GETPOST('actionadd') || GETPOST('actionmodify')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory + if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; @@ -646,7 +646,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } } // Other checks - if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { + if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system','systemauto'))) { $ok=0; setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } @@ -665,20 +665,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2)) { - if (in_array($tablib[$id],array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries + if (in_array($tablib[$id], array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries { $_POST["country"]=''; } else { $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } } if ($id == 3 && ! is_numeric($_POST["code"])) { $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric", $langs->transnoentities("Code")), null, 'errors'); } // Clean some parameters @@ -689,7 +689,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code { - $_POST["code"]=preg_replace('/\s/','',$_POST["code"]); + $_POST["code"]=preg_replace('/\s/', '', $_POST["code"]); } // Si verif ok et action add, on ajoute la ligne @@ -713,20 +713,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; $sql.=",active)"; $sql.= " VALUES("; // List of values - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $newid.","; $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } elseif ($value == 'entity') { $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]); @@ -769,7 +769,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldmodify)) { $sql.= $tabrowid[$id]."="; $sql.= "'".$db->escape($rowid)."', "; @@ -777,8 +777,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } elseif ($field == 'entity') { $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]); @@ -943,7 +943,7 @@ if ($id == 7 && GETPOST('from') == 'accountancy') $titlepicto='title_accountancy'; } -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); if (empty($id)) { @@ -960,13 +960,13 @@ if ($entity != '') $param.= '&entity=' . (int) $entity; $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder); if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); -if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha')); +if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from', 'alpha')); // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -978,7 +978,7 @@ if ($id) // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1"; + if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1"; if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id; if ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code); if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code); @@ -994,14 +994,14 @@ if ($id) } $sql.=", "; // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); + $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i', '', $tabsqlsort[$id]); + $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i', '', $tabsqlsort[$id]); } else { $sql.=" ORDER BY "; } $sql.=$tabsqlsort[$id]; - $sql.=$db->plimit($listlimit+1,$offset); + $sql.=$db->plimit($listlimit+1, $offset); //print $sql; if (empty($tabfield[$id])) @@ -1009,11 +1009,11 @@ if ($id) dol_print_error($db, 'The table with id '.$id.' has no array tabfield defined'); exit; } - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print ''; print ''; - print ''; + print ''; if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION)) { @@ -1028,7 +1028,7 @@ if ($id) $alabelisused=0; $withentity=null; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print '
'; print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip')); + print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); print ''; if ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') { @@ -149,7 +149,7 @@ print "
"; // Define $urlwithroot -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current @@ -157,13 +157,13 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain // Show message $message=''; $url=''.$urlwithroot.'/dav/fileserver.php'; -$message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'WebDAV',$url); +$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV', $url); $message.='
'; if (! empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) { $urlEntity = (! empty($conf->multicompany->enabled)?'?entity='.$conf->entity:''); $url=''.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.''; - $message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'WebDAV public',$url); + $message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV public', $url); $message.='
'; } print $message; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index dcd6548b498..41c1c990d39 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -36,15 +36,15 @@ $langs->loadLangs(array('companies', 'products', 'admin', 'sms', 'other', 'error if (!$user->admin) accessforbidden(); -$id=GETPOST('rowid','int'); -$action=GETPOST('action','alpha'); +$id=GETPOST('rowid', 'int'); +$action=GETPOST('action', 'alpha'); -$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus' +$mode = GETPOST('mode', 'aZ09')?GETPOST('mode', 'aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus' -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -53,7 +53,7 @@ if (! $sortfield) $sortfield='page,param'; if (! $sortorder) $sortorder='ASC'; $defaulturl = GETPOST('defaulturl'); -$defaultkey = GETPOST('defaultkey','alpha'); +$defaultkey = GETPOST('defaultkey', 'alpha'); $defaultvalue = GETPOST('defaultvalue'); $defaulturl=preg_replace('/^\//', '', $defaulturl); @@ -70,17 +70,17 @@ $hookmanager->initHooks(array('admindefaultvalues','globaladmin')); * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $defaulturl=''; $defaultkey=''; @@ -185,7 +185,7 @@ $form=new Form($db); $formadmin = new FormAdmin($db); $wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $param='&mode='.$mode; @@ -194,14 +194,14 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { // Button off, click to enable $enabledisablehtml.= ''; - $enabledisablehtml.= img_picto($langs->trans("Disabled"),'switch_off'); + $enabledisablehtml.= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml.= ''; } else { // Button on, click to disable $enabledisablehtml.= ''; - $enabledisablehtml.= img_picto($langs->trans("Activated"),'switch_on'); + $enabledisablehtml.= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml.= ''; } @@ -252,7 +252,7 @@ $texthelp=$langs->trans("PageUrlForDefaultValues"); if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php', 'societe/card.php?abc=val1&def=val2'); else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php', 'societe/list.php?abc=val1&def=val2'); $texturl=$form->textwithpicto($langs->trans("Url"), $texthelp); -print_liste_field_titre($texturl,$_SERVER["PHP_SELF"],'page,param','',$param,'',$sortfield,$sortorder); +print_liste_field_titre($texturl, $_SERVER["PHP_SELF"], 'page,param', '', $param, '', $sortfield, $sortorder); // Field $texthelp=$langs->trans("TheKeyIsTheNameOfHtmlField"); if ($mode != 'sortorder') @@ -264,7 +264,7 @@ else $texthelp='field or alias.field'; $textkey=$form->textwithpicto($langs->trans("Field"), $texthelp); } -print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'param','',$param,'',$sortfield,$sortorder); +print_liste_field_titre($textkey, $_SERVER["PHP_SELF"], 'param', '', $param, '', $sortfield, $sortorder); // Value if ($mode != 'focus' && $mode != 'mandatory') { @@ -287,10 +287,10 @@ if ($mode != 'focus' && $mode != 'mandatory') print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder); } // Entity -if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder); -else print_liste_field_titre("",$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); +if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder); +else print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); // Actions -print_liste_field_titre("",$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); +print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); print "
'; -print ''; +print ''; print ''; -print ''; +print ''; print '
'.img_object('',$delay['img']).''.img_object('', $delay['img']).''.$langs->trans('Delays_'.$delay['code']).''; print ' '.$langs->trans("days").'
'.img_object('',$delay['img']).''.img_object('', $delay['img']).''.$langs->trans('Delays_'.$delay['code']).''.$value.' '.$langs->trans("days").'
'; @@ -1061,19 +1061,19 @@ if ($id) if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { - if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); + if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); else $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); $class='width100'; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { - $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); } if ($fieldlist[$field]=='libelle_facture') { - $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); } if ($fieldlist[$field]=='country') { - if (in_array('region_id',$fieldlist)) { print ''; continue; } // For region page, we do not show the country input + if (in_array('region_id', $fieldlist)) { print ''; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $class="center"; } @@ -1117,15 +1117,15 @@ if ($id) if ($id == 2) // Special cas for state page { - if ($fieldlist[$field]=='region_id') { $valuetoshow=' '; $showfield=1; } - if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; } + if ($fieldlist[$field]=='region_id') { $valuetoshow=' '; $showfield=1; } + if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; } } if ($valuetoshow != '') { print ''; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; - elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); else print $valuetoshow; print ''; } @@ -1158,7 +1158,7 @@ if ($id) $tmpaction = 'create'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionary Regions @@ -1190,7 +1190,7 @@ if ($id) print ''; print ''; - print ''; + print ''; // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); @@ -1363,7 +1363,7 @@ if ($id) { $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields @@ -1385,7 +1385,7 @@ if ($id) { $tmpaction = 'view'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -1436,8 +1436,7 @@ if ($id) elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth'); elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext'); $align="center"; - } - elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) { + } elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i', $fieldlist[$field])) { $valuetoshow=price($valuetoshow); } if ($value == 'private') @@ -1523,7 +1522,7 @@ if ($id) $showfield=0; } elseif ($fieldlist[$field]=='unicode') { - $valuetoshow = $langs->getCurrencySymbol($obj->code,1); + $valuetoshow = $langs->getCurrencySymbol($obj->code, 1); } elseif ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { $langs->load("products"); @@ -1558,9 +1557,7 @@ if ($id) elseif ($fieldlist[$field]=='taux') { $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); $align="center"; - } - elseif (in_array($fieldlist[$field],array('recuperableonly'))) - { + } elseif (in_array($fieldlist[$field], array('recuperableonly'))) { $align="center"; } elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { @@ -1600,10 +1597,13 @@ if ($id) } // Can an entry be erased or disabled ? - $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default + // all true by default + $iserasable=1; + $canbedisabled=1; + $canbemodified=1; if (isset($obj->code) && $id != 10) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } @@ -1786,7 +1786,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } elseif ($fieldlist[$field] == 'country') { - if (in_array('region_id',$fieldlist)) + if (in_array('region_id', $fieldlist)) { print ''; } elseif ($fieldlist[$field] == 'region_id') @@ -1824,27 +1824,27 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') elseif ($fieldlist[$field] == 'lang') { print ''; } // Le type de l'element (pour les type de contact) elseif ($fieldlist[$field] == 'element') { print ''; } // La source de l'element (pour les type de contact) elseif ($fieldlist[$field] == 'source') { print ''; } elseif ($fieldlist[$field] == 'private') { print ''; } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") @@ -1860,13 +1860,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($fieldlist[$field] == 'type_cdr') { print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); } else { - print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); + print $form->selectyesno($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1); } print ''; } - elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) { + elseif (in_array($fieldlist[$field], array('nbjour','decalage','taux','localtax1','localtax2'))) { $align="left"; - if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="center"; // Fields aligned on right + if (in_array($fieldlist[$field], array('taux','localtax1','localtax2'))) $align="center"; // Fields aligned on right print ''; @@ -1891,7 +1891,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } print ''; } - elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { + elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) { print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index c8fcd061689..9c691c88e88 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -226,7 +226,7 @@ class PrestaShopWebservice { libxml_clear_errors(); libxml_use_internal_errors(true); - $xml = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOCDATA); + $xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA); if (libxml_get_errors()) { $msg = var_export(libxml_get_errors(), true); diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index e058778155a..205f7e7cb1a 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -34,7 +34,7 @@ if (! $user->admin) accessforbidden(); /* * Action */ -if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -48,7 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) } } -if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -68,10 +68,10 @@ if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) */ $help_url=''; -llxHeader('',$langs->trans("ECMSetup"),$help_url); +llxHeader('', $langs->trans("ECMSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ECMSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup'); print '
'; print '
  '; //print join(',',$fieldlist); @@ -1800,7 +1800,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } elseif ($fieldlist[$field] == 'country_id') { - if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) + if (! in_array('country', $fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0); print ''; @@ -1811,7 +1811,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') elseif ($fieldlist[$field] == 'region') { print ''; - $formcompany->select_region($region_id,'region'); + $formcompany->select_region($region_id, 'region'); print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); + print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print ''; - print $form->selectarray('element', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectarray('element', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; - print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectarray('source', $sourceList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; - print $form->selectyesno("private",(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectyesno("private", (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; print ''; print '
'; @@ -98,11 +98,11 @@ else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { - print ''.img_picto($langs->trans("Disabled"),'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } elseif(! empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Enabled"),'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 12dd01d20f8..de4959354db 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -45,7 +45,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); -$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectcard'; // To manage different context of search +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects @@ -61,7 +61,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $search_all = trim(GETPOST("search_all", 'alpha')); $search = array(); foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } if (empty($action) && empty($id) && empty($ref)) $action='view'; @@ -103,10 +103,10 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; } -if (GETPOST('addfilter','alpha')) +if (GETPOST('addfilter', 'alpha')) { $emailcollectorfilter = new EmailCollectorFilter($db); - $emailcollectorfilter->type = GETPOST('filtertype','az09'); + $emailcollectorfilter->type = GETPOST('filtertype', 'az09'); $emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha'); $emailcollectorfilter->fk_emailcollector = $object->id; $emailcollectorfilter->status = 1; @@ -125,7 +125,7 @@ if (GETPOST('addfilter','alpha')) if ($action == 'deletefilter') { $emailcollectorfilter = new EmailCollectorFilter($db); - $emailcollectorfilter->fetch(GETPOST('filterid','int')); + $emailcollectorfilter->fetch(GETPOST('filterid', 'int')); $result = $emailcollectorfilter->delete($user); if ($result > 0) { @@ -137,10 +137,10 @@ if ($action == 'deletefilter') } } -if (GETPOST('addoperation','alpha')) +if (GETPOST('addoperation', 'alpha')) { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->type = GETPOST('operationtype','az09'); + $emailcollectoroperation->type = GETPOST('operationtype', 'az09'); $emailcollectoroperation->actionparam = GETPOST('operationparam', 'none'); $emailcollectoroperation->fk_emailcollector = $object->id; $emailcollectoroperation->status = 1; @@ -161,7 +161,7 @@ if (GETPOST('addoperation','alpha')) if ($action == 'deleteoperation') { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->fetch(GETPOST('operationid','int')); + $emailcollectoroperation->fetch(GETPOST('operationid', 'int')); $result = $emailcollectoroperation->delete($user); if ($result > 0) { diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index bb6fa4bdd87..755d44d42ba 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -36,24 +36,24 @@ if (!$user->admin) accessforbidden(); // Load traductions files requiredby by page $langs->loadLangs(array("admin", "other")); -$action = GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'emailcollectorlist'; // To manage different context of search -$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'emailcollectorlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('id','int'); +$id = GETPOST('id', 'int'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); -if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -83,11 +83,11 @@ if ($user->societe_id > 0) // Protection if external user //$result = restrictedArea($user, 'emailcollector', $id, ''); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all",'alpha')); +$search_all=trim(GETPOST("search_all", 'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } // List of fields to search into when doing a "search in all" @@ -122,8 +122,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -135,7 +135,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { foreach($object->fields as $key => $val) { @@ -144,8 +144,8 @@ if (empty($reshook)) $toselect=''; $search_array_options=array(); } - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') - || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation } @@ -188,7 +188,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/','', $sql); +$sql=preg_replace('/, $/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; @@ -223,7 +223,7 @@ $sql.=$hookmanager->resPrint; $sql=preg_replace('/, $/','', $sql); */ -$sql.=$db->order($sortfield,$sortorder); +$sql.=$db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; @@ -305,7 +305,7 @@ $arrayofmassactions = array( //'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->emailcollector->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); -if (GETPOST('nomassaction','int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); print ''; @@ -338,7 +338,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print '
'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; } $moreforfilter = ''; @@ -412,7 +412,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print ''."\n"; @@ -422,7 +422,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object } } @@ -537,7 +537,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; @@ -547,13 +547,13 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb // Show list of available documents $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + $urlsource.=str_replace('&', '&', $param); $filedir=$diroutputmassaction; $genallowed=$user->rights->emailcollector->read; $delallowed=$user->rights->emailcollector->create; - print $formfile->showdocuments('massfilesarea_emailcollector','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); + print $formfile->showdocuments('massfilesarea_emailcollector', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } // End of page diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 347f4c27489..f6e731aaee6 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -34,7 +34,7 @@ accessforbidden(); // Load translation files required by the page $langs->loadLangs(array("users","admin","other")); -$action=GETPOST('action','aZ09'); +$action=GETPOST('action', 'aZ09'); $securityevent=new Events($db); @@ -54,8 +54,8 @@ if ($action == "save") { $param='MAIN_LOGEVENTS_'.$arr['id']; //print "param=".$param." - ".$_POST[$param]; - if (! empty($_POST[$param])) dolibarr_set_const($db,$param,$_POST[$param],'chaine',0,'',$conf->entity); - else dolibarr_del_const($db,$param,$conf->entity); + if (! empty($_POST[$param])) dolibarr_set_const($db, $param, $_POST[$param], 'chaine', 0, '', $conf->entity); + else dolibarr_del_const($db, $param, $conf->entity); } $db->commit(); @@ -69,10 +69,10 @@ if ($action == "save") */ $wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; -llxHeader('',$langs->trans("Audit"),$wikihelp); +llxHeader('', $langs->trans("Audit"), $wikihelp); //$linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); print $langs->trans("LogEventDesc", $langs->transnoentitiesnoconv("AdminTools"), $langs->transnoentitiesnoconv("Audit"))."
\n"; print "
\n"; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 2dec14f0a24..d8398f610ba 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -40,10 +40,10 @@ $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); -$value=GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action=GETPOST('action', 'alpha'); +$value=GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='shipping'; if (empty($conf->global->EXPEDITION_ADDON_NUMBER)) @@ -60,10 +60,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst=GETPOST('maskconstexpedition','alpha'); - $maskvalue=GETPOST('maskexpedition','alpha'); + $maskconst=GETPOST('maskconstexpedition', 'alpha'); + $maskvalue=GETPOST('maskexpedition', 'alpha'); if (! empty($maskconst)) - $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (isset($res)) { @@ -76,16 +76,16 @@ if ($action == 'updateMask') elseif ($action == 'set_param') { - $freetext=GETPOST('SHIPPING_FREE_TEXT','none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext=GETPOST('SHIPPING_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if ($res <= 0) { $error++; setEventMessages($langs->trans("Error"), null, 'errors'); } - $draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha'); - $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft=GETPOST('SHIPPING_DRAFT_WATERMARK', 'alpha'); + $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if ($res <= 0) { $error++; @@ -100,17 +100,17 @@ elseif ($action == 'set_param') elseif ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $exp = new Expedition($db); $exp->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -125,7 +125,7 @@ elseif ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($exp,$langs) > 0) + if ($module->write_file($exp, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf"); return; @@ -154,14 +154,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF',$conf->entity); + if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -178,7 +178,7 @@ elseif ($action == 'setdoc') elseif ($action == 'setmodel') { - dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -186,14 +186,14 @@ elseif ($action == 'setmodel') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); $form=new Form($db); -llxHeader("",$langs->trans("SendingsSetup")); +llxHeader("", $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; $head = expedition_admin_prepare_head(); @@ -247,7 +247,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; @@ -273,11 +273,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$expedition); + $nextval=$module->getNextValue($mysoc, $expedition); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -286,7 +286,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -364,7 +364,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir) print ''; @@ -393,14 +393,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -408,11 +408,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -424,25 +424,25 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -491,7 +491,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print "\n"; diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 87682fe7514..9ef686962ed 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -68,10 +68,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Sendings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index e533ca64ac3..9c0fa60f12a 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -69,10 +69,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Sendings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 23d2571b256..687e3fdf1e2 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -39,10 +39,10 @@ $langs->loadLangs(array('admin', 'errors', 'trips', 'other')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='expensereport'; @@ -54,9 +54,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst=GETPOST('maskconst','alpha'); - $maskvalue=GETPOST('maskvalue','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst=GETPOST('maskconst', 'alpha'); + $maskvalue=GETPOST('maskvalue', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -72,7 +72,7 @@ if ($action == 'updateMask') elseif ($action == 'specimen') // For fiche inter { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $inter = new ExpenseReport($db); $inter->initAsSpecimen(); @@ -81,10 +81,10 @@ elseif ($action == 'specimen') // For fiche inter // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -99,14 +99,14 @@ elseif ($action == 'specimen') // For fiche inter $module = new $classname($db); - if ($module->write_file($inter,$langs) > 0) + if ($module->write_file($inter, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf"); return; } else { - setEventMessages($module->error, $module->errors,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } @@ -123,7 +123,7 @@ elseif ($action == 'set') $ret = addDocumentModel($value, $type, $label, $scandir); if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF)) { - dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity); } } @@ -132,14 +132,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF',$conf->entity); + if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -159,18 +159,18 @@ elseif ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'setoptions') { $db->begin(); - $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT','none'); // No alpha here, we want exact string - $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK','alpha'); - $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha'); + $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res1 > 0 || ! $res2 > 0) $error++; @@ -191,14 +191,14 @@ elseif ($action == 'setoptions') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); $head=expensereport_admin_prepare_head(); @@ -209,7 +209,7 @@ dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'tri * Expense report numbering model */ -print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"),'',''); +print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', ''); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); @@ -257,12 +257,12 @@ foreach ($dirmodels as $reldir) print '
'; if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->EXPEDITION_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; @@ -255,7 +255,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -263,12 +263,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir) if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -292,7 +292,7 @@ foreach ($dirmodels as $reldir) } print ''; print "\n"; @@ -365,7 +365,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) print ''; @@ -395,14 +395,14 @@ foreach ($dirmodels as $reldir) { print ""; } else { print ""; } @@ -410,11 +410,11 @@ foreach ($dirmodels as $reldir) print "'; @@ -423,24 +423,24 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -491,7 +491,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''."\n"; diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 99de68e9e14..8d102bc8328 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -65,10 +65,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("expensereports"); -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); $head = expensereport_admin_prepare_head(); diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 0f01fa7a750..e79e7888f69 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -39,10 +39,10 @@ if (!$user->admin) accessforbidden(); $error = false; $message = false; -$action = GETPOST('action','alpha'); -$id = GETPOST('id','int'); -$offset = GETPOST('offset','int'); -$coef = GETPOST('coef','int'); +$action = GETPOST('action', 'alpha'); +$id = GETPOST('id', 'int'); +$offset = GETPOST('offset', 'int'); +$coef = GETPOST('coef', 'int'); $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat'); $fk_range = GETPOST('fk_range'); @@ -86,12 +86,12 @@ $rangesbycateg = ExpenseReportIk::getAllRanges(); * View */ -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsIkSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsIkSetup"), $linkback, 'title_setup'); $head=expensereport_admin_prepare_head(); dol_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"), -1, 'trip'); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 8594d060951..835a4b2b824 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -40,8 +40,8 @@ if (!$user->admin) accessforbidden(); $error = false; $message = false; -$action = GETPOST('action','alpha'); -$id = GETPOST('id','int'); +$action = GETPOST('action', 'alpha'); +$id = GETPOST('id', 'int'); $apply_to = GETPOST('apply_to'); $fk_user = GETPOST('fk_user'); @@ -143,12 +143,12 @@ $tab_rules_type = array('EX_DAY' => $langs->trans('Day'), 'EX_MON' => $langs->tr * View */ -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsRulesSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsRulesSetup"), $linkback, 'title_setup'); $head=expensereport_admin_prepare_head(); dol_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip'); diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index cb97502c3f8..b477a75256b 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -37,8 +37,8 @@ $langs->loadLangs(array('admin', 'exports', 'other')); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); -$value=GETPOST('value','alpha'); +$action=GETPOST('action', 'alpha'); +$value=GETPOST('value', 'alpha'); /* * Actions diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index c289c64b217..b9b78e55ec9 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -39,7 +39,7 @@ if (!$user->admin) accessforbidden(); $def = array(); $lastexternalrss=0; -$action=GETPOST('action','aZ09'); +$action=GETPOST('action', 'aZ09'); /* @@ -55,7 +55,7 @@ if ($result) { while ($obj = $db->fetch_object($result)) { - preg_match('/([0-9]+)$/i',$obj->name,$reg); + preg_match('/([0-9]+)$/i', $obj->name, $reg); if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; } } @@ -103,8 +103,8 @@ if ($action == 'add' || GETPOST("modify")) } } - $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"),GETPOST($external_rss_title),'chaine',0,'',$conf->entity); - if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),GETPOST($external_rss_urlrss),'chaine',0,'',$conf->entity); + $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), GETPOST($external_rss_title), 'chaine', 0, '', $conf->entity); + if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), GETPOST($external_rss_urlrss), 'chaine', 0, '', $conf->entity); if ($result1 && $result2) { @@ -151,7 +151,7 @@ if ($_POST["delete"]) if (! $resql) { $db->rollback(); - dol_print_error($db,"sql=".$sql); + dol_print_error($db, "sql=".$sql); exit; } @@ -163,13 +163,13 @@ if ($_POST["delete"]) else { $db->rollback(); - dol_print_error($db,"sql=".$sql); + dol_print_error($db, "sql=".$sql); exit; } - $result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . GETPOST("norss"),$conf->entity); - if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),$conf->entity); + $result1=dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), $conf->entity); + if ($result1) $result2=dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), $conf->entity); if ($result1 && $result2) { @@ -190,7 +190,7 @@ if ($_POST["delete"]) * View */ -llxHeader('',$langs->trans("ExternalRSSSetup")); +llxHeader('', $langs->trans("ExternalRSSSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExternalRSSSetup"), $linkback, 'title_setup'); @@ -242,7 +242,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - preg_match('/^([0-9]+)/i',$obj->note,$reg); + preg_match('/^([0-9]+)/i', $obj->note, $reg); $idrss = $reg[1]; $keyrsstitle="EXTERNAL_RSS_TITLE_".$idrss; $keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 6e9ccf792b0..3312b44aba2 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -38,10 +38,10 @@ $langs->loadLangs(array('admin', 'errors', 'other', 'bills')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='invoice'; @@ -53,18 +53,18 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstinvoice=GETPOST('maskconstinvoice','alpha'); - $maskconstreplacement=GETPOST('maskconstreplacement','alpha'); - $maskconstcredit=GETPOST('maskconstcredit','alpha'); - $maskconstdeposit=GETPOST('maskconstdeposit','alpha'); - $maskinvoice=GETPOST('maskinvoice','alpha'); - $maskreplacement=GETPOST('maskreplacement','alpha'); - $maskcredit=GETPOST('maskcredit','alpha'); - $maskdeposit=GETPOST('maskdeposit','alpha'); - if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity); - if ($maskconstreplacement) $res = dolibarr_set_const($db,$maskconstreplacement,$maskreplacement,'chaine',0,'',$conf->entity); - if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity); - if ($maskconstdeposit) $res = dolibarr_set_const($db,$maskconstdeposit,$maskdeposit,'chaine',0,'',$conf->entity); + $maskconstinvoice=GETPOST('maskconstinvoice', 'alpha'); + $maskconstreplacement=GETPOST('maskconstreplacement', 'alpha'); + $maskconstcredit=GETPOST('maskconstcredit', 'alpha'); + $maskconstdeposit=GETPOST('maskconstdeposit', 'alpha'); + $maskinvoice=GETPOST('maskinvoice', 'alpha'); + $maskreplacement=GETPOST('maskreplacement', 'alpha'); + $maskcredit=GETPOST('maskcredit', 'alpha'); + $maskdeposit=GETPOST('maskdeposit', 'alpha'); + if ($maskconstinvoice) $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity); + if ($maskconstreplacement) $res = dolibarr_set_const($db, $maskconstreplacement, $maskreplacement, 'chaine', 0, '', $conf->entity); + if ($maskconstcredit) $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity); + if ($maskconstdeposit) $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -80,17 +80,17 @@ if ($action == 'updateMask') if ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $facture = new Facture($db); $facture->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -105,7 +105,7 @@ if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($facture,$langs) > 0) + if ($module->write_file($facture, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf"); return; @@ -134,14 +134,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity); + if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "FACTURE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -161,16 +161,16 @@ elseif ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "FACTURE_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); } if ($action == 'setribchq') { - $rib = GETPOST('rib','alpha'); - $chq = GETPOST('chq','alpha'); + $rib = GETPOST('rib', 'alpha'); + $chq = GETPOST('chq', 'alpha'); - $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -186,9 +186,9 @@ if ($action == 'setribchq') if ($action == 'set_FACTURE_DRAFT_WATERMARK') { - $draft = GETPOST('FACTURE_DRAFT_WATERMARK','alpha'); + $draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha'); - $res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -204,9 +204,9 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK') if ($action == 'set_INVOICE_FREE_TEXT') { - $freetext = GETPOST('INVOICE_FREE_TEXT','none'); // No alpha here, we want exact string + $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "INVOICE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -222,9 +222,9 @@ if ($action == 'set_INVOICE_FREE_TEXT') if ($action == 'setforcedate') { - $forcedate = GETPOST('forcedate','alpha'); + $forcedate = GETPOST('forcedate', 'alpha'); - $res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION",$forcedate,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION", $forcedate, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -248,7 +248,7 @@ if ($action == 'setDefaultPDFModulesByType') foreach ($invoicetypemodels as $type => $value) { - $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type), $value, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; } @@ -268,15 +268,15 @@ if ($action == 'setDefaultPDFModulesByType') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("BillsSetup"),'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); +llxHeader("", $langs->trans("BillsSetup"), 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); @@ -285,7 +285,7 @@ dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); * Numbering module */ -print load_fiche_titre($langs->trans("BillsNumberingModule"),'',''); +print load_fiche_titre($langs->trans("BillsNumberingModule"), '', ''); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->EXPENSEREPORT_ADDON == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print '\n"; print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,-1,0); + print $form->textwithpicto('', $htmltooltip, -1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'intervention').''; + print ''.img_object($langs->trans("Preview"), 'intervention').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; @@ -311,7 +311,7 @@ foreach ($dirmodels as $reldir) if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) { $filebis = $file; - $classname = preg_replace('/\.php$/','',$file); + $classname = preg_replace('/\.php$/', '', $file); // For compatibility if (! is_file($dir.$filebis)) { @@ -319,11 +319,11 @@ foreach ($dirmodels as $reldir) $classname = "mod_facture_".$file; } // Check if there is a filter on country - preg_match('/\-(.*)_(.*)$/',$classname,$reg); + preg_match('/\-(.*)_(.*)$/', $classname, $reg); if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue; - $classname = preg_replace('/\-.*$/','',$classname); - if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') + $classname = preg_replace('/\-.*$/', '', $classname); + if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/', $filebis) || preg_match('/mod_/', $classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') { // Charging the numbering class require_once $dir.$filebis; @@ -337,7 +337,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { print ''."\n"; @@ -356,11 +356,11 @@ foreach ($dirmodels as $reldir) //print "> ".$conf->global->FACTURE_ADDON." - ".$file; if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.'.php' == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -371,11 +371,11 @@ foreach ($dirmodels as $reldir) $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; $facture->type=0; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForInvoices").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -384,11 +384,11 @@ foreach ($dirmodels as $reldir) } // Example for remplacement $facture->type=1; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForReplacements").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -398,11 +398,11 @@ foreach ($dirmodels as $reldir) // Example for credit invoice $facture->type=2; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForCreditNotes").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -411,11 +411,11 @@ foreach ($dirmodels as $reldir) } // Example for deposit invoice $facture->type=3; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForDeposit").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval; } else { @@ -424,11 +424,11 @@ foreach ($dirmodels as $reldir) } print ''; @@ -450,7 +450,7 @@ print '
'; - echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); + echo preg_replace('/\-.*$/', '', preg_replace('/mod_facture_/', '', preg_replace('/\.php$/', '', $file))); print "\n"; print $module->info(); @@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); if ($conf->global->FACTURE_ADDON.'.php' == $file) // If module is the one used, we show existing errors { - if (! empty($module->error)) dol_htmloutput_mesg($module->error,'','error',1); + if (! empty($module->error)) dol_htmloutput_mesg($module->error, '', 'error', 1); } print '
'; * Document templates generators */ print '
'; -print load_fiche_titre($langs->trans("BillsPDFModules"),'',''); +print load_fiche_titre($langs->trans("BillsPDFModules"), '', ''); // Load array def with activated templates $type='invoice'; @@ -510,7 +510,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { @@ -529,7 +529,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; if ($conf->global->FACTURE_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'bill').''; + print ''.img_object($langs->trans("Preview"), 'bill').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'.$trans.''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current, 0, 0, 0).'
'; print ''; @@ -761,7 +761,7 @@ print ''; print '\n"; @@ -786,7 +786,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print '
'; print $langs->trans("ForceInvoiceDate"); print ''; -print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1); +print $form->selectyesno("forcedate", $conf->global->FAC_FORCE_DATE_VALIDATION, 1); print ''; print ''; print "
'; @@ -814,7 +814,7 @@ print '
'; * Repertoire */ print '
'; -print load_fiche_titre($langs->trans("PathToDocuments"),'',''); +print load_fiche_titre($langs->trans("PathToDocuments"), '', ''); print ''."\n"; print ''."\n"; @@ -832,7 +832,7 @@ print "
\n"; * Notifications */ print '
'; -print load_fiche_titre($langs->trans("Notifications"),'',''); +print load_fiche_titre($langs->trans("Notifications"), '', ''); print ''; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index e975a2f0ff8..5b695066c58 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -31,14 +31,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'fckeditor')); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); // Possible modes are: // dolibarr_details // dolibarr_notes // dolibarr_readonly // dolibarr_mailings // Full (not sure this one is used) -$mode=GETPOST('mode')?GETPOST('mode','alpha'):'dolibarr_notes'; +$mode=GETPOST('mode')?GETPOST('mode', 'alpha'):'dolibarr_notes'; if (!$user->admin) accessforbidden(); @@ -80,24 +80,24 @@ foreach($modules as $const => $desc) { if ($action == 'activate_'.strtolower($const)) { - dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // Si fckeditor est active dans la description produit/service, on l'active dans les formulaires if ($const == 'PRODUCTDESC' && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) { - dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity); } header("Location: ".$_SERVER["PHP_SELF"]); exit; } if ($action == 'disable_'.strtolower($const)) { - dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const,$conf->entity); + dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const, $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; } } -if (GETPOST('save','alpha')) +if (GETPOST('save', 'alpha')) { $error = 0; @@ -136,7 +136,7 @@ if (GETPOST('save','alpha')) llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AdvancedEditor"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AdvancedEditor"), $linkback, 'title_setup'); print '
'; if (empty($conf->use_javascript_ajax)) @@ -158,18 +158,18 @@ else if (! $conditions[$const]) continue; print ''; - print ''; + print ''; print ''; print '"; @@ -183,7 +183,7 @@ else print ''."\n"; // Skins - show_skin(null,1); + show_skin(null, 1); print '
'."\n"; $listofmodes=array('dolibarr_mailings','dolibarr_notes','dolibarr_details','dolibarr_readonly','Full'); @@ -198,11 +198,11 @@ else $linkstomode.=''; } $linkstomode.=''; - print load_fiche_titre($langs->trans("TestSubmitForm"),$linkstomode,''); + print load_fiche_titre($langs->trans("TestSubmitForm"), $linkstomode, ''); print ''; $uselocalbrowser=true; $readonly=($mode=='dolibarr_readonly'?1:0); - $editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,$mode,'In', true, $uselocalbrowser, 1, 120, 8, $readonly); + $editor=new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly); $editor->Create(); print '
'."\n"; print '
'; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 7e263a5e285..a66f3d8e4ef 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -39,10 +39,10 @@ $langs->loadLangs(array('admin', 'errors', 'interventions', 'other')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='ficheinter'; @@ -54,9 +54,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst=GETPOST('maskconst','alpha'); - $maskvalue=GETPOST('maskvalue','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst=GETPOST('maskconst', 'alpha'); + $maskvalue=GETPOST('maskvalue', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -72,17 +72,17 @@ if ($action == 'updateMask') elseif ($action == 'specimen') // For fiche inter { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $inter = new Fichinter($db); $inter->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -97,7 +97,7 @@ elseif ($action == 'specimen') // For fiche inter $module = new $classname($db); - if ($module->write_file($inter,$langs) > 0) + if ($module->write_file($inter, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf"); return; @@ -126,14 +126,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity); + if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -153,13 +153,13 @@ elseif ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'set_FICHINTER_FREE_TEXT') { - $freetext= GETPOST('FICHINTER_FREE_TEXT','none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('FICHINTER_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -175,8 +175,8 @@ elseif ($action == 'set_FICHINTER_FREE_TEXT') elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') { - $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -192,8 +192,8 @@ elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') { - $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on' ? 1 : 0),'bool',0,'',$conf->entity); + $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -255,14 +255,14 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup'); $head=fichinter_admin_prepare_head(); @@ -271,7 +271,7 @@ dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'interve // Interventions numbering model -print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'',''); +print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', ''); print '
'.$langs->trans("Parameter").'
'.img_object("",$picto[$const]).''.img_object("", $picto[$const]).''.$langs->trans($desc).''; $constante = 'FCKEDITOR_ENABLE_'.$const; $value = (isset($conf->global->$constante)?$conf->global->$constante:0); if ($value == 0) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } elseif ($value == 1) { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "
'; print ''; @@ -296,10 +296,10 @@ foreach ($dirmodels as $reldir) while (($file = readdir($handle))!==false) { - if (preg_match('/^(mod_.*)\.php$/i',$file,$reg)) + if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) { $file = $reg[1]; - $classname = substr($file,4); + $classname = substr($file, 4); require_once $dir.$file.'.php'; @@ -319,7 +319,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -327,11 +327,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -341,11 +341,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$ficheinter); + $nextval=$module->getNextValue($mysoc, $ficheinter); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -353,7 +353,7 @@ foreach ($dirmodels as $reldir) } } print ''; print ''; @@ -372,7 +372,7 @@ print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->FICHEINTER_ADDON == $classname) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '

'; * Documents models for Interventions */ -print load_fiche_titre($langs->trans("TemplatePDFInterventions"),'',''); +print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', ''); // Defini tableau def des modeles $type='ficheinter'; @@ -429,7 +429,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { @@ -450,7 +450,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print '\n"; print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,-1,0); + print $form->textwithpicto('', $htmltooltip, -1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'intervention').''; + print ''.img_object($langs->trans("Preview"), 'intervention').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -551,7 +551,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; print ''; print ''; // First day for weeks print ''; print ''; print ''; @@ -321,14 +321,14 @@ if ($action == 'edit') // Edit // Hide unauthorized button print ''; print ''; print ''; // Show logo print ''; print ''; print ''; @@ -345,15 +345,15 @@ if ($action == 'edit') // Edit // Show bugtrack link print ''; print ''; print ''; // Hide wiki link on login page $pictohelp=''; - print ''; print ''; print ''; @@ -404,7 +404,7 @@ if ($action == 'edit') // Edit // Hide helpcenter link on login page print ''; print ''; print ''; @@ -448,7 +448,7 @@ else // Show print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; print ''; print ""; @@ -460,7 +460,7 @@ else // Show // Themes - show_theme(null,0); + show_theme(null, 0); print '
'; @@ -506,7 +506,7 @@ else // Show // Hide unauthorized button print ''; // Show logo @@ -528,8 +528,8 @@ else // Show // Link to wiki help $pictohelp=''; - print ''; // Message of the day @@ -556,7 +556,7 @@ else // Show // Link to help center print ''; // Background login diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index be9859c1beb..bce8c560d7c 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -38,25 +38,25 @@ $hookmanager->initHooks(array('homesetup')); */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $form = new Form($db); -print load_fiche_titre($langs->trans("SetupArea"),'','title_setup.png'); +print load_fiche_titre($langs->trans("SetupArea"), '', 'title_setup.png'); if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) { - $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('//i','
',$conf->global->MAIN_MOTD_SETUPPAGE); + $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('//i', '
', $conf->global->MAIN_MOTD_SETUPPAGE); if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $i=0; - while (preg_match('/__\(([a-zA-Z|@]+)\)__/i',$conf->global->MAIN_MOTD_SETUPPAGE,$reg) && $i < 100) + while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) { - $tmp=explode('|',$reg[1]); + $tmp=explode('|', $reg[1]); if (! empty($tmp[1])) $langs->load($tmp[1]); - $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i',$langs->trans($tmp[0]),$conf->global->MAIN_MOTD_SETUPPAGE); + $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), $conf->global->MAIN_MOTD_SETUPPAGE); $i++; } @@ -76,7 +76,7 @@ print '
'; // Show info setup company if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; -print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); +print img_picto('', 'puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); if (! empty($setupcompanynotcomplete)) { $langs->load("errors"); @@ -88,7 +88,7 @@ print '
'; print '
'; // Show info setup module -print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); +print img_picto('', 'puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); /* $nbofactivatedmodules=count($conf->modules); @@ -110,7 +110,7 @@ print '
'; // Add hook to add information $parameters=array(); -$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('addHomeSetup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; if (empty($reshook)) { diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index dc21ca36daa..f110c32e441 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -37,7 +37,7 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('adminldap','globaladmin')); @@ -47,7 +47,7 @@ $hookmanager->initHooks(array('adminldap','globaladmin')); */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -57,19 +57,19 @@ if (empty($reshook)) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_SERVER_TYPE',GETPOST("type"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION',GETPOST("LDAP_SERVER_PROTOCOLVERSION"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST',GETPOST("host"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE',GETPOST("slave"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_PORT',GETPOST("port"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_DN',GETPOST("dn"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_ADMIN_DN',GETPOST("admin"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_ADMIN_PASS',GETPOST("pass"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS',GETPOST("usetls"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE',GETPOST("activesynchro"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',GETPOST("activecontact"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE',GETPOST("activemembers"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE',GETPOST("activememberstypes"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST', GETPOST("host"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_ADMIN_DN', GETPOST("admin"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_ADMIN_PASS', GETPOST("pass"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS', GETPOST("usetls"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE', GETPOST("activesynchro"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE', GETPOST("activecontact"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE', GETPOST("activemembers"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE', GETPOST("activememberstypes"), 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -88,11 +88,11 @@ if (empty($reshook)) * View */ -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -125,7 +125,7 @@ $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr"); $arraylist['dolibarr2ldap']=$langs->trans("DolibarrToLDAP"); -print $form->selectarray('activesynchro',$arraylist,$conf->global->LDAP_SYNCHRO_ACTIVE); +print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE); print '
'; } @@ -152,7 +152,7 @@ if (! empty($conf->adherent->enabled)) $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')'; - print $form->selectarray('activemembers',$arraylist,$conf->global->LDAP_MEMBER_ACTIVE); + print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE); print ''; } @@ -164,13 +164,13 @@ if (! empty($conf->adherent->enabled)) $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')'; - print $form->selectarray('activememberstypes',$arraylist,$conf->global->LDAP_MEMBER_TYPE_ACTIVE); + print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE); print ''; } // Fields from hook $parameters=array(); -$reshook=$hookmanager->executeHooks('addAdminLdapOptions',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('addAdminLdapOptions', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ''; @@ -185,7 +185,7 @@ $arraylist=array(); $arraylist['activedirectory']='Active Directory'; $arraylist['openldap']='OpenLdap'; $arraylist['egroupware']='Egroupware'; -print $form->selectarray('type',$arraylist,$conf->global->LDAP_SERVER_TYPE); +print $form->selectarray('type', $arraylist, $conf->global->LDAP_SERVER_TYPE); print ''; // Version @@ -193,7 +193,7 @@ print ''; // Serveur primaire @@ -230,7 +230,7 @@ print ''; print ''; @@ -283,22 +283,22 @@ if (function_exists("ldap_connect")) if ($result > 0) { // Test ldap connect and bind - print img_picto('','info').' '; - print ''.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).''; + print img_picto('', 'info').' '; + print ''.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; if ($conf->global->LDAP_ADMIN_DN && ! empty($conf->global->LDAP_ADMIN_PASS)) { if ($result == 2) { - print img_picto('','info').' '; - print ''.$langs->trans("LDAPBindOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)).''; + print img_picto('', 'info').' '; + print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; } else { - print img_picto('','error').' '; - print ''.$langs->trans("LDAPBindKO",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)).''; + print img_picto('', 'error').' '; + print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; @@ -306,7 +306,7 @@ if (function_exists("ldap_connect")) } else { - print img_picto('','warning').' '; + print img_picto('', 'warning').' '; print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; print '
'; } @@ -315,13 +315,13 @@ if (function_exists("ldap_connect")) // Test ldap_getversion if (($ldap->getVersion() == 3)) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion3").''; print '
'; } else { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion2").''; print '
'; } @@ -330,8 +330,8 @@ if (function_exists("ldap_connect")) } else { - print img_picto('','error').' '; - print ''.$langs->trans("LDAPTCPConnectKO",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).''; + print img_picto('', 'error').' '; + print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 56866fdaea7..03fafaaf3c8 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -38,7 +38,7 @@ $langs->loadLangs(array("admin","errors")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -50,29 +50,29 @@ if ($action == 'setvalue' && $user->admin) $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN',GETPOST("contactdn"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN', GETPOST("contactdn"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_NAME',GETPOST("fieldname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FIRSTNAME',GETPOST("fieldfirstname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE',GETPOST("fieldhomephone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_NAME', GETPOST("fieldname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FIRSTNAME', GETPOST("fieldfirstname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COMPANY', GETPOST("fieldcompany"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MAIL', GETPOST("fieldmail"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE', GETPOST("fieldphone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE', GETPOST("fieldhomephone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE', GETPOST("fieldmobile"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE', GETPOST("fieldskype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX', GETPOST("fieldfax"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS', GETPOST("fieldaddress"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP', GETPOST("fieldzip"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -94,10 +94,10 @@ if ($action == 'setvalue' && $user->admin) $form=new Form($db); -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -264,7 +264,7 @@ $key=$conf->global->LDAP_KEY_CONTACTS; $dn=$conf->global->LDAP_CONTACT_DN; $objectclass=$conf->global->LDAP_CONTACT_OBJECT_CLASS; -show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); +show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); if (function_exists("ldap_connect")) @@ -285,35 +285,35 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 43f66147123..450fec88ad0 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -39,7 +39,7 @@ $langs->loadLangs(array("admin","errors")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* @@ -51,19 +51,19 @@ if ($action == 'setvalue' && $user->admin) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',GETPOST("group"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_DN', GETPOST("group"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS',GETPOST("fieldgroupmembers"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -83,10 +83,10 @@ if ($action == 'setvalue' && $user->admin) * View */ -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -192,7 +192,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') $dn=$conf->global->LDAP_GROUP_DN; $objectclass=$conf->global->LDAP_GROUP_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -213,40 +213,40 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); // Get a gid number for objectclass PosixGroup - if (in_array('posixGroup',$info['objectclass'])) { + if (in_array('posixGroup', $info['objectclass'])) { $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS'); } $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 48d2aace5d7..94c9a32d9e0 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('admin', 'errors')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -51,45 +51,45 @@ if ($action == 'setvalue' && $user->admin) $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FILTER',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN', GETPOST("user"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FILTER', GETPOST("filterconnection"), 'chaine', 0, '', $conf->entity)) $error++; // Members - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN',GETPOST("fieldlogin"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN_SAMBA',GETPOST("fieldloginsamba"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD',GETPOST("fieldpassword"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD_CRYPTED',GETPOST("fieldpasswordcrypted"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NAME',GETPOST("fieldname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FIRSTNAME',GETPOST("fieldfirstname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO',GETPOST("fieldphoneperso"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NOTE_PUBLIC',GETPOST("fieldnotepublic"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_BIRTHDATE',GETPOST("fieldbirthdate"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_STATUS',GETPOST("fieldstatus"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN', GETPOST("fieldlogin"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN_SAMBA', GETPOST("fieldloginsamba"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD', GETPOST("fieldpassword"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD_CRYPTED', GETPOST("fieldpasswordcrypted"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NAME', GETPOST("fieldname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FIRSTNAME', GETPOST("fieldfirstname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MAIL', GETPOST("fieldmail"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE', GETPOST("fieldphone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO', GETPOST("fieldphoneperso"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE', GETPOST("fieldmobile"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE', GETPOST("fieldskype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX', GETPOST("fieldfax"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COMPANY', GETPOST("fieldcompany"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS', GETPOST("fieldaddress"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP', GETPOST("fieldzip"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NOTE_PUBLIC', GETPOST("fieldnotepublic"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_BIRTHDATE', GETPOST("fieldbirthdate"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_STATUS', GETPOST("fieldstatus"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"), 'chaine', 0, '', $conf->entity)) $error++; // Subscriptions - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT',GETPOST("fieldfirstsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT', GETPOST("fieldfirstsubscriptionamount"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -111,10 +111,10 @@ if ($action == 'setvalue' && $user->admin) $form=new Form($db); -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -387,7 +387,7 @@ if (! empty($conf->global->LDAP_MEMBER_ACTIVE)) $dn=$conf->global->LDAP_MEMBER_DN; $objectclass=$conf->global->LDAP_MEMBER_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -408,35 +408,35 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index b07bf0b1484..94d1355dd67 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('admin', 'errors')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* @@ -51,18 +51,18 @@ if ($action == 'setvalue' && $user->admin) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_DN',GETPOST("membertype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_DN', GETPOST("membertype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS',GETPOST("fieldmembertypemembers"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS', GETPOST("fieldmembertypemembers"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS_TYPES',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS_TYPES', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -82,10 +82,10 @@ if ($action == 'setvalue' && $user->admin) * View */ -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -182,7 +182,7 @@ if ($conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1') $dn=$conf->global->LDAP_MEMBER_TYPE_DN; $objectclass=$conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -203,40 +203,40 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); // Get a gid number for objectclass PosixGroup - if (in_array('posixGroup',$info['objectclass'])) { + if (in_array('posixGroup', $info['objectclass'])) { $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_MEMBERS_TYPES'); } $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 124bec14f6d..4148d81f438 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('admin', 'errors')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -50,35 +50,35 @@ if ($action == 'setvalue' && $user->admin) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_USER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN',GETPOST("fieldlogin"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN_SAMBA',GETPOST("fieldloginsamba"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD',GETPOST("fieldpassword"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD_CRYPTED',GETPOST("fieldpasswordcrypted"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',GETPOST("fieldname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',GETPOST("fieldfirstname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE',GETPOST("fieldtitle"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_USER_DN', GETPOST("user"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION', GETPOST("filterconnection"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN', GETPOST("fieldlogin"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN_SAMBA', GETPOST("fieldloginsamba"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD', GETPOST("fieldpassword"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD_CRYPTED', GETPOST("fieldpasswordcrypted"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME', GETPOST("fieldname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME', GETPOST("fieldfirstname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL', GETPOST("fieldmail"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE', GETPOST("fieldphone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE', GETPOST("fieldmobile"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE', GETPOST("fieldskype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX', GETPOST("fieldfax"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY', GETPOST("fieldcompany"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS', GETPOST("fieldaddress"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP', GETPOST("fieldzip"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_SID', GETPOST("fieldsid"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE', GETPOST("fieldtitle"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_USERS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_USERS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -100,10 +100,10 @@ if ($action == 'setvalue' && $user->admin) $form=new Form($db); -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -323,7 +323,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') $dn=$conf->global->LDAP_USER_DN; $objectclass=$conf->global->LDAP_USER_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') { @@ -332,7 +332,7 @@ elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') $key=$conf->global->LDAP_KEY_USERS; $dn=$conf->global->LDAP_USER_DN; $objectclass=$conf->global->LDAP_USER_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -355,35 +355,35 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } @@ -454,17 +454,17 @@ if (function_exists("ldap_connect")) print "search: *
\n"; print "userDN: ".$conf->global->LDAP_USER_DN."
\n"; print "useridentifier: ".$conf->global->LDAP_KEY_USERS."
\n"; - print "required_fields: ".implode(',',$required_fields)."
\n"; + print "required_fields: ".implode(',', $required_fields)."
\n"; print "=> ".count($liste)." records
\n"; print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index ad41d7bd945..a43f86d0e28 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -31,7 +31,7 @@ $langs->loadLangs(array('companies', 'products', 'admin')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); if ($action == 'update') { @@ -42,7 +42,7 @@ if ($action == 'update') || $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC) { $error++; - setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), null, 'errors'); + setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden", $MAXDEC), null, 'errors'); } if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0 @@ -56,7 +56,7 @@ if ($action == 'update') if ($_POST["MAIN_ROUNDING_RULE_TOT"]) { - if ($_POST["MAIN_ROUNDING_RULE_TOT"] * pow(10,$_POST["MAIN_MAX_DECIMALS_TOT"]) < 1) + if ($_POST["MAIN_ROUNDING_RULE_TOT"] * pow(10, $_POST["MAIN_MAX_DECIMALS_TOT"]) < 1) { $langs->load("errors"); $error++; @@ -66,11 +66,11 @@ if ($action == 'update') if (! $error) { - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"], 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -87,7 +87,7 @@ $form=new Form($db); llxHeader(); -print load_fiche_titre($langs->trans("LimitsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup'); print $langs->trans("LimitsDesc")."
\n"; @@ -106,12 +106,12 @@ if ($action == 'edit') print ''; print ''; @@ -119,7 +119,7 @@ if ($action == 'edit') print ''; print '
'.$langs->trans("Parameter").''; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 98ab10a988e..fc55b27d7e1 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -34,7 +34,7 @@ accessforbidden(); // Load translation files required by the page $langs->loadLangs(array("admin","errors")); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -47,13 +47,13 @@ if ($action == 'set') if (! $gimcdf && ! file_exists($gimcdf)) { - setEventMessages($langs->trans("ErrorFileNotFound",$gimcdf), null, 'errors'); + setEventMessages($langs->trans("ErrorFileNotFound", $gimcdf), null, 'errors'); $error++; } if (! $error) { - $res = dolibarr_set_const($db,"GEOIPMAXMIND_COUNTRY_DATAFILE",$gimcdf,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "GEOIPMAXMIND_COUNTRY_DATAFILE", $gimcdf, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) @@ -77,14 +77,14 @@ $form=new Form($db); llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("GeoIPMaxmindSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("GeoIPMaxmindSetup"), $linkback, 'title_setup'); print '
'; $version=''; $geoip=''; if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE)) { - $geoip=new DolGeoIP('country',$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE); + $geoip=new DolGeoIP('country', $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE); //if ($geoip->error) print dol_htmloutput_errors($geoip->errorlabel,'',1); if ($geoip->gi == 'NOGI') $geointernal=true; else $geointernal=false; @@ -126,21 +126,21 @@ print '
'; print $langs->trans("NoteOnPathLocation").'
'; $url1='http://www.maxmind.com/en/city?rId=awstats'; -print $langs->trans("YouCanDownloadFreeDatFileTo",''.$url1.''); +print $langs->trans("YouCanDownloadFreeDatFileTo", ''.$url1.''); print '
'; $url2='http://www.maxmind.com/en/city?rId=awstats'; -print $langs->trans("YouCanDownloadAdvancedDatFileTo",''.$url2.''); +print $langs->trans("YouCanDownloadAdvancedDatFileTo", ''.$url2.''); if ($geoip) { print '

'; - print '
'.$langs->trans("TestGeoIPResult",$ip).':'; + print '
'.$langs->trans("TestGeoIPResult", $ip).':'; $ip='24.24.24.24'; print '
'.$ip.' -> '; - $result=dol_print_ip($ip,1); + $result=dol_print_ip($ip, 1); if ($result) print $result; else print $langs->trans("Error"); @@ -158,14 +158,14 @@ if ($geoip) if ($isip == 1) { print '
'.$ip.' -> '; - $result=dol_print_ip($ip,1); + $result=dol_print_ip($ip, 1); if ($result) print $result; else print $langs->trans("Error"); } else { print '
'.$ip.' -> '; - $result=dol_print_ip($ip,1); + $result=dol_print_ip($ip, 1); if ($result) print $result; else print $langs->trans("NotAPublicIp"); } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 62fe6631a60..d67451812c6 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -35,10 +35,10 @@ $langs->loadLangs(array("admin", "errors", "holiday")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='contract'; if (empty($conf->global->HOLIDAY_ADDON)) @@ -55,9 +55,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst = GETPOST('maskconstholidaty','alpha'); - $maskvalue = GETPOST('maskholiday','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst = GETPOST('maskconstholidaty', 'alpha'); + $maskvalue = GETPOST('maskholiday', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -73,17 +73,17 @@ if ($action == 'updateMask') elseif ($action == 'specimen') // For contract { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $holiday = new Holiday($db); $holiday->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/holiday/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/holiday/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -98,7 +98,7 @@ elseif ($action == 'specimen') // For contract $module = new $classname($db); - if ($module->write_file($holiday,$langs) > 0) + if ($module->write_file($holiday, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf"); return; @@ -127,14 +127,14 @@ elseif ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->HOLIDAY_ADDON_PDF == "$value") dolibarr_del_const($db, 'HOLIDAY_ADDON_PDF',$conf->entity); + if ($conf->global->HOLIDAY_ADDON_PDF == "$value") dolibarr_del_const($db, 'HOLIDAY_ADDON_PDF', $conf->entity); } } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -154,16 +154,16 @@ elseif ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "HOLIDAY_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'set_other') { - $freetext= GETPOST('HOLIDAY_FREE_TEXT','none'); // No alpha here, we want exact string - $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('HOLIDAY_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK','alpha'); - $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha'); + $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res1 > 0 || ! $res2 > 0) $error++; @@ -182,14 +182,14 @@ elseif ($action == 'set_other') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("HolidaySetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup'); $head=holiday_admin_prepare_head(); @@ -199,7 +199,7 @@ dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday'); * Holiday Numbering model */ -print load_fiche_titre($langs->trans("HolidaysNumberingModules"),'',''); +print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', ''); print ''; print ''; @@ -245,7 +245,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -253,12 +253,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -269,11 +269,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$holiday); + $nextval=$module->getNextValue($mysoc, $holiday); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -282,7 +282,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -305,7 +305,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) * Documents models for Holidays */ -print load_fiche_titre($langs->trans("TemplatePDFHolidays"),'',''); +print load_fiche_titre($langs->trans("TemplatePDFHolidays"), '', ''); // Defined model definition table $def = array(); @@ -363,7 +363,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -383,7 +383,7 @@ foreach ($dirmodels as $reldir) print ''; @@ -392,14 +392,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -407,11 +407,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -423,26 +423,26 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -468,7 +468,7 @@ print ''; print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->HOLIDAY_ADDON == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->HOLIDAY_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'contract').''; + print ''.img_object($langs->trans("Preview"), 'contract').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -492,7 +492,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''."\n"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 84ce38f9757..d903c592bfe 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -38,10 +38,10 @@ $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', if (! $user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminihm'; // To manage different context of search +$action = GETPOST('action', 'aZ09'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'adminihm'; // To manage different context of search -if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); +if (! defined("MAIN_MOTD")) define("MAIN_MOTD", ""); @@ -50,10 +50,10 @@ if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if (GETPOST('cancel','alpha')) +if (GETPOST('cancel', 'alpha')) { $action=''; } @@ -64,7 +64,7 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND; dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND",$conf->entity); + dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND", $conf->entity); $mysoc->logo=''; /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; @@ -80,56 +80,56 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); - else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val,'chaine',0,'',$conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array())))); + else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val,'chaine',0,'',$conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array())))); + else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val, 'chaine', 0, '', $conf->entity); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val, 'chaine', 0, '', $conf->entity); if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); @@ -137,26 +137,26 @@ if ($action == 'update') if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { - if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) + if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -168,17 +168,17 @@ if ($action == 'update') { dol_mkdir($dirforimage); } - $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); if ($result > 0) { - dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity); } - elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) + elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); - $tmparray=explode(':',$result); - setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); + $tmparray=explode(':', $result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } else { @@ -209,13 +209,13 @@ if ($action == 'update') */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $form=new Form($db); $formother=new FormOther($db); $formadmin=new FormAdmin($db); -print load_fiche_titre($langs->trans("GUISetup"),'','title_setup'); +print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup'); print $langs->trans("DisplayDesc")."
\n"; print "
\n"; @@ -247,7 +247,7 @@ if ($action == 'edit') // Edit // Multilingual GUI print ''; print ''; print ''; @@ -255,7 +255,7 @@ if ($action == 'edit') // Edit print '
'.$langs->trans("Parameter").'
'.$langs->trans("EnableMultilangInterface").''; - print $form->selectyesno('MAIN_MULTILANGS',$conf->global->MAIN_MULTILANGS,1); + print $form->selectyesno('MAIN_MULTILANGS', $conf->global->MAIN_MULTILANGS, 1); print ' 

'."\n"; // Themes and themes options - show_theme(null,1); + show_theme(null, 1); print '
'; // Other @@ -285,14 +285,14 @@ if ($action == 'edit') // Edit // Disable javascript and ajax print '
'.$langs->trans("DisableJavascript").''; - print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1); + print $form->selectyesno('main_disable_javascript', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); print ' 
'.$langs->trans("WeekStartOnDay").''; - print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0); + print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'), 'MAIN_START_WEEK', 0); print ' 
'.$langs->trans("ButtonHideUnauthorized").''; - print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1); + print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0, 1); print ' 
'.$langs->trans("EnableShowLogo").''; - print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1); + print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1); print ' 
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; - print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); + print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); print ' 
'.$langs->trans("DisableLinkToHelp",$pictohelp).''; - print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1); + print '
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; + print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0, 1); print ' 
'.$langs->trans("DisableLinkToHelpCenter").''; - print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1); + print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0, 1); print ' 
'; - if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''),$conf->global->MAIN_LANG_DEFAULT),1); + if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''), $conf->global->MAIN_LANG_DEFAULT), 1); print '
'.$langs->trans("ButtonHideUnauthorized").''; - print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1); + print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0), 1); print '
'.$langs->trans("DisableLinkToHelp",$pictohelp).''; - print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); + print '
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; + print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0), 1); print '
'.$langs->trans("DisableLinkToHelpCenter").''; - print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1); + print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0), 1); print '
'.$langs->trans("LDAPDnSynchroActiveExample"); if ($conf->global->LDAP_SYNCHRO_ACTIVE && ! $conf->global->LDAP_USER_DN) { @@ -140,7 +140,7 @@ if (! empty($conf->societe->enabled)) $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); - print $form->selectarray('activecontact',$arraylist,$conf->global->LDAP_CONTACT_ACTIVE); + print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE); print ''.$langs->trans("LDAPDnContactActiveExample").'
'.$langs->trans("LDAPDnMemberActiveExample").'
'.$langs->trans("LDAPDnMemberTypeActiveExample").'
 
'.$langs->trans("Version").''; $arraylist=array(); $arraylist['3']='Version 3'; $arraylist['2']='Version 2'; -print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION',$arraylist,$conf->global->LDAP_SERVER_PROTOCOLVERSION); +print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION); print ''.$langs->trans("LDAPServerProtocolVersion").'
'.$langs->trans("LDAPServerUseTLS").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("Yes"); -print $form->selectarray('usetls',$arraylist,$conf->global->LDAP_SERVER_USE_TLS); +print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS); print ''.$langs->trans("LDAPServerUseTLSExample").'
'; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; - print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; @@ -138,12 +138,12 @@ else print ''; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.''; print ''; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.''; @@ -151,7 +151,7 @@ else print ''; - print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.''; print ''; @@ -176,22 +176,22 @@ else // Always show vat rates with vat 0 $s=2/7;$qty=1;$vat=0; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0,0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=1;$vat=0; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0,0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=2;$vat=0; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; @@ -226,8 +226,8 @@ else for ($qty=1; $qty<=2; $qty++) { $s=10/3; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; @@ -241,15 +241,15 @@ else // were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule. $s=10/3;$qty=1;$vat=10; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=2;$vat=10; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index e49ef792700..d11d07c5f38 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -39,10 +39,10 @@ $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='delivery'; @@ -54,9 +54,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstdelivery=GETPOST('maskconstdelivery','alpha'); - $maskdelivery=GETPOST('maskdelivery','alpha'); - if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity); + $maskconstdelivery=GETPOST('maskconstdelivery', 'alpha'); + $maskdelivery=GETPOST('maskdelivery', 'alpha'); + if ($maskconstdelivery) $res = dolibarr_set_const($db, $maskconstdelivery, $maskdelivery, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -72,8 +72,8 @@ if ($action == 'updateMask') if ($action == 'set_DELIVERY_FREE_TEXT') { - $free=GETPOST('DELIVERY_FREE_TEXT','none'); // No alpha here, we want exact string - $res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity); + $free=GETPOST('DELIVERY_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT", $free, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -89,17 +89,17 @@ if ($action == 'set_DELIVERY_FREE_TEXT') if ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $sending = new Livraison($db); $sending->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -114,7 +114,7 @@ if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($sending,$langs) > 0) + if ($module->write_file($sending, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); return; @@ -142,13 +142,13 @@ if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity); + if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity); } } if ($action == 'setdoc') { - if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -168,7 +168,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -176,14 +176,14 @@ if ($action == 'setmod') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",""); +llxHeader("", ""); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; $head = expedition_admin_prepare_head(); @@ -192,7 +192,7 @@ dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending'); // Delivery numbering model -print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"),'',''); +print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', ''); print ''; print ''; @@ -238,7 +238,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; @@ -262,11 +262,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$livraison); + $nextval=$module->getNextValue($mysoc, $livraison); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -275,7 +275,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -294,7 +294,7 @@ print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); @@ -248,11 +248,11 @@ foreach ($dirmodels as $reldir) print '
'; if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; * Documents Models for delivery */ print '
'; -print load_fiche_titre($langs->trans("DeliveryOrderModel"),'',''); +print load_fiche_titre($langs->trans("DeliveryOrderModel"), '', ''); // Defini tableau def de modele $type="delivery"; @@ -352,7 +352,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { @@ -373,7 +373,7 @@ foreach ($dirmodels as $reldir) print ''; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''; @@ -382,14 +382,14 @@ foreach ($dirmodels as $reldir) { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -397,11 +397,11 @@ foreach ($dirmodels as $reldir) print ""; if ($conf->global->LIVRAISON_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -409,20 +409,20 @@ foreach ($dirmodels as $reldir) $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'sending').''; + print ''.img_object($langs->trans("Preview"), 'sending').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -440,7 +440,7 @@ print ''; * Autres Options */ print "
"; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; @@ -468,7 +468,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; // Force e-mail recipient @@ -273,7 +273,7 @@ if ($action == 'edit') //Add user to select destinaries list print ''; // Separator @@ -285,14 +285,14 @@ if ($action == 'edit') // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE',$listofmethods,$conf->global->MAIN_MAIL_SENDMODE); + print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE); } else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -310,7 +310,7 @@ if ($action == 'edit') $mainserver = (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:''); $smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver); + else print $langs->trans("MAIN_MAIL_SMTP_SERVER", $smtpserver); print ''; @@ -395,7 +395,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -407,7 +407,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS)?$conf->global->MAIN_MAIL_EMAIL_TLS:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (! empty($conf->global->MAIN_MAIL_EMAIL_TLS)?$conf->global->MAIN_MAIL_EMAIL_TLS:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -420,7 +420,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -433,7 +433,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED',(! empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED)?$conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (! empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED)?$conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -459,7 +459,7 @@ if ($action == 'edit') print ''; // From - print ''; + print ''; print ''; @@ -553,7 +553,7 @@ else } else { - print ''; + print ''; } // Port @@ -563,7 +563,7 @@ else } else { - print ''; + print ''; } // SMTPS ID @@ -575,7 +575,7 @@ else // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS @@ -640,7 +640,7 @@ else print ''; // From - print ''; + print ''; print ''; @@ -785,12 +785,12 @@ else print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mail = new CMailFile('','','',''); - $result=$mail->check_server_port($server,$port); - if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'
'; + $mail = new CMailFile('', '', '', ''); + $result=$mail->check_server_port($server, $port); + if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; else { - $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port); + $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { $errormsg .= ' - '.$mail->error; @@ -848,7 +848,7 @@ else $formmail->clear_attached_files(); } - print $formmail->get_form('addfile','removefile'); + print $formmail->get_form('addfile', 'removefile'); dol_fiche_end(); } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index b8a4a85026b..4ce8d8c0b72 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors')); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); if (! $user->admin) accessforbidden(); @@ -61,13 +61,13 @@ complete_substitutions_array($substitutionarrayfortest, $langs); if ($action == 'update' && empty($_POST["cancel"])) { // Send mode parameters - dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"), 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -95,8 +95,8 @@ if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtm */ $linuxlike=1; -if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; -if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^win/i', PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i', PHP_OS)) $linuxlike=0; if (empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING)) $conf->global->MAIN_MAIL_SENDMODE_EMAILING='default'; $port=! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:ini_get('smtp_port'); @@ -106,9 +106,9 @@ if (! $server) $server='127.0.0.1'; $wikihelp='EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup'); $head = email_admin_prepare_head(); @@ -235,14 +235,14 @@ if ($action == 'edit') // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING',$listofmethods,$conf->global->MAIN_MAIL_SENDMODE_EMAILING); + print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); } else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -261,7 +261,7 @@ if ($action == 'edit') $mainserver = (! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:''); $smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver); + else print $langs->trans("MAIN_MAIL_SMTP_SERVER", $smtpserver); print ''; @@ -346,7 +346,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -359,7 +359,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (! empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -373,7 +373,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -418,7 +418,7 @@ else } else { - print ''; + print ''; } // Port @@ -428,7 +428,7 @@ else } else { - print ''; + print ''; } // SMTPS ID @@ -440,7 +440,7 @@ else // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS @@ -535,12 +535,12 @@ else print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mail = new CMailFile('','','',''); - $result=$mail->check_server_port($server,$port); - if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'
'; + $mail = new CMailFile('', '', '', ''); + $result=$mail->check_server_port($server, $port); + if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; else { - $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port); + $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { $errormsg .= ' - '.$mail->error; @@ -595,7 +595,7 @@ else $formmail->clear_attached_files(); } - print $formmail->get_form('addfile','removefile'); + print $formmail->get_form('addfile', 'removefile'); dol_fiche_end(); } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index a5cb2d8b396..c5112396404 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -32,23 +32,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","mails","languages")); -$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'emailsenderprofilelist'; // To manage different context of search -$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'emailsenderprofilelist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('id','int'); +$id = GETPOST('id', 'int'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. @@ -76,11 +76,11 @@ if ($user->societe_id > 0) } // Initialize array of search criterias -$search_all=trim(GETPOST("search_all",'alpha')); +$search_all=trim(GETPOST("search_all", 'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } // List of fields to search into when doing a "search in all" @@ -113,8 +113,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -126,7 +126,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { foreach($object->fields as $key => $val) { @@ -135,8 +135,8 @@ if (empty($reshook)) $toselect=''; $search_array_options=array(); } - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') - || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation } @@ -171,7 +171,7 @@ $titre=$langs->trans("EMailsSetup"); $linkback=''; $titlepicto='title_setup'; -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); $head = email_admin_prepare_head(); @@ -190,7 +190,7 @@ foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->att $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/','', $sql); +$sql=preg_replace('/, $/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")"; @@ -222,7 +222,7 @@ $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // $sql.=$hookmanager->resPrint; */ -$sql.=$db->order($sortfield,$sortorder); +$sql.=$db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; @@ -381,7 +381,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print ''."\n"; @@ -389,7 +389,7 @@ print ''."\n"; $needToFetchEachLine=0; foreach ($extrafields->attribute_computed as $key => $val) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object } @@ -496,7 +496,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); @@ -506,13 +506,13 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb // Show list of available documents $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + $urlsource.=str_replace('&', '&', $param); $filedir=$diroutputmassaction; $genallowed=$user->rights->monmodule->read; $delallowed=$user->rights->monmodule->create; - print $formfile->showdocuments('massfilesarea_monmodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); + print $formfile->showdocuments('massfilesarea_monmodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } dol_fiche_end(); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 844fe093315..24e5b55d47d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,31 +45,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","mails","languages")); -$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; -$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$id = GETPOST('id','int'); -$rowid = GETPOST('rowid','alpha'); -$search_label=GETPOST('search_label','alpha'); -$search_type_template=GETPOST('search_type_template','alpha'); -$search_lang=GETPOST('search_lang','alpha'); -$search_fk_user=GETPOST('search_fk_user','intcomma'); -$search_topic=GETPOST('search_topic','alpha'); +$id = GETPOST('id', 'int'); +$rowid = GETPOST('rowid', 'alpha'); +$search_label=GETPOST('search_label', 'alpha'); +$search_type_template=GETPOST('search_type_template', 'alpha'); +$search_lang=GETPOST('search_lang', 'alpha'); +$search_fk_user=GETPOST('search_fk_user', 'intcomma'); +$search_topic=GETPOST('search_topic', 'alpha'); if (! empty($user->socid)) accessforbidden(); $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); -$listoffset=GETPOST('listoffset','alpha'); -$listlimit =GETPOST('listlimit','alpha')>0?GETPOST('listlimit','alpha'):1000; +$listoffset=GETPOST('listoffset', 'alpha'); +$listlimit =GETPOST('listlimit', 'alpha')>0?GETPOST('listlimit', 'alpha'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; @@ -169,7 +169,7 @@ if ($conf->projet->enabled) $elementList['project']=$langs->trans('Ma $elementList['user']=$langs->trans('MailToUser'); $parameters=array('elementList'=>$elementList); -$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { foreach ($hookmanager->resArray as $item => $value) { $elementList[$item] = $value; @@ -189,17 +189,17 @@ $id = 25; * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_label=''; $search_type_template=''; @@ -211,12 +211,12 @@ if (empty($reshook)) } // Actions add or modify an entry into a dictionary - if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) + if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; @@ -227,7 +227,7 @@ if (empty($reshook)) if ($value == 'content') continue; if ($value == 'content_lines') continue; - if (GETPOST('actionmodify','alpha') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; + if (GETPOST('actionmodify', 'alpha') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position') { @@ -405,7 +405,7 @@ $titre=$langs->trans("EMailsSetup"); $linkback=''; $titlepicto='title_setup'; -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); $head = email_admin_prepare_head(); @@ -414,7 +414,7 @@ dol_fiche_head($head, 'templates', '', -1); // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -438,16 +438,16 @@ if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_u if ($search_topic) $sql.=natural_search('topic', $search_topic); // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; -$sql.=$db->order($sortfield,$sortorder); -$sql.=$db->plimit($listlimit+1,$offset); +$sql.=$db->order($sortfield, $sortorder); +$sql.=$db->plimit($listlimit+1, $offset); //print $sql; -$fieldlist=explode(',',$tabfield[$id]); +$fieldlist=explode(',', $tabfield[$id]); // Form to add a new line print ''; print ''; -print ''; +print ''; print '
'; print '
'; diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index 31144581564..a7bd8929cad 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -68,10 +68,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Receivings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php index 32000c67642..50f34f9d133 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/livraisondet_extrafields.php @@ -69,10 +69,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Receivings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 20e0b59199a..56d80c2e7d7 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -80,7 +80,7 @@ $form = new Form($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ConfigLoan'), $linkback, 'title_setup'); print ''; print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index d5b866d9d20..d10e0e9a497 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -32,7 +32,7 @@ $langs->loadLangs(array("admin", "mails")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); @@ -44,21 +44,21 @@ if ($action == 'setvalue') { $db->begin(); - $mailfrom = GETPOST('MAILING_EMAIL_FROM','alpha'); - $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha'); - $checkread = GETPOST('value','alpha'); - $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY','alpha'); + $mailfrom = GETPOST('MAILING_EMAIL_FROM', 'alpha'); + $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha'); + $checkread = GETPOST('value', 'alpha'); + $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); $mailingdelay = GETPOST('MAILING_DELAY', 'int'); - $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO", $mailerror, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db, "MAILING_DELAY",$mailingdelay,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_DELAY", $mailingdelay, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; // Create temporary encryption key if nedded - $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) @@ -78,10 +78,10 @@ if ($action == 'setvalue') * View */ -llxHeader('',$langs->trans("MailingSetup")); +llxHeader('', $langs->trans("MailingSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MailingSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup'); if (! empty($conf->use_javascript_ajax)) { diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index dc0673cca2d..517ec9b9dc5 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -40,7 +40,7 @@ if (! $user->admin) accessforbidden(); $type=array('yesno','texte','chaine'); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); $testsubscribeemail = GETPOST("testsubscribeemail"); $testunsubscribeemail = GETPOST("testunsubscribeemail"); @@ -57,7 +57,7 @@ if ($action == 'update' || $action == 'add') $constvalue=$_POST["constvalue"][$key]; $consttype=$_POST["consttype"][$key]; $constnote=$_POST["constnote"][$key]; - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + $res=dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); if (! $res > 0) $error++; } @@ -98,7 +98,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if (! isValidEmail($email)) { $langs->load("errors"); - setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); + setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); } else { @@ -117,7 +117,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); + setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } else { @@ -130,7 +130,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); + setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } else { @@ -147,11 +147,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con $help_url=''; -llxHeader('',$langs->trans("MailmanSpipSetup"),$help_url); +llxHeader('', $langs->trans("MailmanSpipSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MailmanSpipSetup"), $linkback, 'title_setup'); $head = mailmanspip_admin_prepare_head(); @@ -164,7 +164,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); - $link.=img_picto($langs->trans("Activated"),'switch_on'); + $link.=img_picto($langs->trans("Activated"), 'switch_on'); $link.=''; // Edition des varibales globales $constantes=array( @@ -174,7 +174,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) 'ADHERENT_MAILMAN_LISTS' ); - print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + print load_fiche_titre($langs->trans('MailmanTitle'), $link, ''); print '
'; @@ -199,7 +199,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) }); '; - form_constantes($constantes,2); + form_constantes($constantes, 2); print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; @@ -216,9 +216,9 @@ else $link=''; //$link.=img_$langs->trans("Activate") - $link.=img_picto($langs->trans("Disabled"),'switch_off'); + $link.=img_picto($langs->trans("Disabled"), 'switch_off'); $link.=''; - print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + print load_fiche_titre($langs->trans('MailmanTitle'), $link, ''); dol_fiche_end(); } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index d7eb804fa4d..d74f10ca58c 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "errors")); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); if (! $user->admin) accessforbidden(); @@ -84,7 +84,7 @@ if ($action == 'update' && empty($_POST["cancel"])) // Content parameters dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'), 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -112,8 +112,8 @@ if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtm */ $linuxlike=1; -if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; -if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^win/i', PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i', PHP_OS)) $linuxlike=0; if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail'; $port=! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:ini_get('smtp_port'); @@ -123,9 +123,9 @@ if (! $server) $server='127.0.0.1'; $wikihelp='EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup'); $head = email_admin_prepare_head(); @@ -262,7 +262,7 @@ if ($action == 'edit') // Disable print '
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; - print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1); + print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', $conf->global->MAIN_DISABLE_ALL_MAILS, 1); print '
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''; - print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT',$conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT,1); + print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', $conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT, 1); print '
'; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -323,7 +323,7 @@ if ($action == 'edit') { $text = ! empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -342,7 +342,7 @@ if ($action == 'edit') $mainport = (! empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ''); $smtpport = ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_PORT",$smtpport); + else print $langs->trans("MAIN_MAIL_SMTP_PORT", $smtpport); print ''; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -355,7 +355,7 @@ if ($action == 'edit') { $text = (! empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -375,7 +375,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); print ''; } print '
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print '
'; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -274,7 +274,7 @@ if ($action == 'edit') { $text = ! empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -294,7 +294,7 @@ if ($action == 'edit') $mainport = (! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); $smtpport = ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_PORT",$smtpport); + else print $langs->trans("MAIN_MAIL_SMTP_PORT", $smtpport); print ''; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -307,7 +307,7 @@ if ($action == 'edit') { $text = (! empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -327,7 +327,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print ''; } print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'; @@ -478,7 +478,7 @@ foreach ($fieldlist as $field => $value) if ($valuetoshow != '') { print ''; print '"; print ''; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 781f1fd380b..8d8bf531443 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -21,7 +21,7 @@ * \brief Page to activate/disable all modules */ -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array('errors', 'admin')); $mode=GETPOST('mode', 'alpha'); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); if (empty($mode)) $mode='desc'; @@ -55,7 +55,7 @@ if (! $user->admin) $form = new Form($db); $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$help_url); +llxHeader('', $langs->trans("Setup"), $help_url); print ''."\n".''."\n"; diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 24f87678505..dfe189f2a74 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -46,14 +46,14 @@ $diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societeaccount'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all",'alpha')); +$search_all=trim(GETPOST("search_all", 'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } if (empty($action) && empty($id) && empty($ref)) $action='view'; @@ -76,7 +76,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -85,7 +85,7 @@ if (empty($reshook)) $permissiontoadd = $user->rights->website->write; $permissiontodelete = $user->rights->website->delete; - $backurlforlist = dol_buildpath('/website/websiteaccount_list.php',1); + $backurlforlist = dol_buildpath('/website/websiteaccount_list.php', 1); // Actions cancel, add, update or delete include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -108,7 +108,7 @@ if (empty($reshook)) $form=new Form($db); $formfile=new FormFile($db); -llxHeader('','WebsiteAccount',''); +llxHeader('', 'WebsiteAccount', ''); // Example : Adding jquery code print '
'; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; elseif (! empty($tabhelp[$id][$value])) { if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click @@ -593,7 +593,7 @@ print '
'; print ''; print ''; -print ''; +print ''; print '
'; print ''; @@ -616,7 +616,7 @@ if ($resql) $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder); if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); - if (GETPOST('from','alpha')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha')); + if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.urlencode(GETPOST('from', 'alpha')); // There is several pages if ($num > $listlimit) @@ -724,11 +724,11 @@ if ($resql) $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields - if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldList($fieldlist, $obj, $tabname[$id], 'edit'); print ''; print ''; // Perms print ''; print '
'; @@ -801,7 +801,7 @@ if ($resql) $tmpaction = 'view'; $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 6037304350a..f18b09b7d05 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -27,8 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; -$action=GETPOST('action','aZ09'); -$cancel=GETPOST('cancel','alpha'); +$action=GETPOST('action', 'aZ09'); +$cancel=GETPOST('cancel', 'alpha'); // Load translation files required by the page $langs->loadLangs(array("companies","products","admin","users","other")); @@ -38,7 +38,7 @@ if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); -$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $dirstandard[]=$dirmenu.'standard'; @@ -64,24 +64,24 @@ if ($action == 'update' && ! $cancel) { $_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer - dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD', 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE', 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD', 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE', 'alpha'), 'chaine', 0, '', $conf->entity); // Define list of menu handlers to initialize $listofmenuhandler=array(); - $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_STANDARD','alpha'))]=1; - $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_STANDARD','alpha'))]=1; - if (GETPOST('MAIN_MENU_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_SMARTPHONE','alpha'))]=1; - if (GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'))]=1; + $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENU_STANDARD', 'alpha'))]=1; + $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENUFRONT_STANDARD', 'alpha'))]=1; + if (GETPOST('MAIN_MENU_SMARTPHONE', 'alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENU_SMARTPHONE', 'alpha'))]=1; + if (GETPOST('MAIN_MENUFRONT_SMARTPHONE', 'alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENUFRONT_SMARTPHONE', 'alpha'))]=1; // Initialize menu handlers foreach ($listofmenuhandler as $key => $val) { // Load sql init_menu_handler.sql file - $dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); + $dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $file='init_menu_'.$key.'.sql'; @@ -92,7 +92,7 @@ if ($action == 'update' && ! $cancel) { $db->begin(); - $result=run_sql($fullpath,1,'',1,$key,'none'); + $result=run_sql($fullpath, 1, '', 1, $key, 'none'); if ($result > 0) { $db->commit(); @@ -126,9 +126,9 @@ $form=new Form($db); $formadmin=new FormAdmin($db); $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; @@ -167,10 +167,10 @@ if ($action == 'edit') print ''; print ''; print ''; print ''; print ''; @@ -187,10 +187,10 @@ if ($action == 'edit') // Menu smartphone print ''; print ''; print ''; print ''; @@ -202,21 +202,21 @@ else print '
'.$langs->trans("Menu").''; - print $form->textwithpicto($langs->trans("InternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); print ''; - print $form->textwithpicto($langs->trans("ExternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; - $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); + $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); print ''; - $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled'); + $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled'); print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; @@ -225,19 +225,19 @@ else print ''; print ''; print ''; print ''; print ''; print ''; @@ -388,10 +388,10 @@ if ($action == 'create') print ''; // Title - print ''; + print ''; // URL - print ''; + print ''; // Langs print ''; @@ -406,10 +406,10 @@ if ($action == 'create') print ''; // Enabled - print ''; + print ''; // Perms - print ''; + print ''; print '
'.$langs->trans("Menu").''; - print $form->textwithpicto($langs->trans("InternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); print ''; - print $form->textwithpicto($langs->trans("ExternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); print '
'.$langs->trans("DefaultMenuManager").''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED)); print $filelib; print ''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED)); print $filelib; print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); print $filelib; if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED) - || (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE))) + || (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE))) { print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme")); } print ''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)); print $filelib; - if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) - || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE))) + if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) + || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE))) { print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme")); } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index a4ff73b52bd..9e9d5cad8f1 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -35,21 +35,21 @@ if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); -$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $dirstandard[]=$dirmenu.'standard'; $dirsmartphone[]=$dirmenu.'smartphone'; } -$action=GETPOST('action','aZ09'); +$action=GETPOST('action', 'aZ09'); $menu_handler_top=$conf->global->MAIN_MENU_STANDARD; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; -$menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top); -$menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top); -$menu_handler_smartphone=preg_replace('/_backoffice.php/i','',$menu_handler_smartphone); -$menu_handler_smartphone=preg_replace('/_frontoffice.php/i','',$menu_handler_smartphone); +$menu_handler_top=preg_replace('/_backoffice.php/i', '', $menu_handler_top); +$menu_handler_top=preg_replace('/_frontoffice.php/i', '', $menu_handler_top); +$menu_handler_smartphone=preg_replace('/_backoffice.php/i', '', $menu_handler_smartphone); +$menu_handler_smartphone=preg_replace('/_frontoffice.php/i', '', $menu_handler_smartphone); $menu_handler=$menu_handler_top; @@ -69,16 +69,16 @@ if ($action == 'update') $leftmenu=''; $mainmenu=''; if (! empty($_POST['menuIdParent']) && ! is_numeric($_POST['menuIdParent'])) { - $tmp=explode('&',$_POST['menuIdParent']); + $tmp=explode('&', $_POST['menuIdParent']); foreach($tmp as $s) { - if (preg_match('/fk_mainmenu=/',$s)) + if (preg_match('/fk_mainmenu=/', $s)) { - $mainmenu=preg_replace('/fk_mainmenu=/','',$s); + $mainmenu=preg_replace('/fk_mainmenu=/', '', $s); } - if (preg_match('/fk_leftmenu=/',$s)) + if (preg_match('/fk_leftmenu=/', $s)) { - $leftmenu=preg_replace('/fk_leftmenu=/','',$s); + $leftmenu=preg_replace('/fk_leftmenu=/', '', $s); } } } @@ -89,21 +89,21 @@ if ($action == 'update') { $menu->titre=GETPOST('titre', 'alpha'); $menu->leftmenu=GETPOST('leftmenu', 'aZ09'); - $menu->url=GETPOST('url','alpha'); - $menu->langs=GETPOST('langs','alpha'); - $menu->position=GETPOST('position','int'); - $menu->enabled=GETPOST('enabled','alpha'); - $menu->perms=GETPOST('perms','alpha'); - $menu->target=GETPOST('target','alpha'); - $menu->user=GETPOST('user','alpha'); - $menu->mainmenu=GETPOST('propertymainmenu','alpha'); - if (is_numeric(GETPOST('menuIdParent','alpha'))) + $menu->url=GETPOST('url', 'alpha'); + $menu->langs=GETPOST('langs', 'alpha'); + $menu->position=GETPOST('position', 'int'); + $menu->enabled=GETPOST('enabled', 'alpha'); + $menu->perms=GETPOST('perms', 'alpha'); + $menu->target=GETPOST('target', 'alpha'); + $menu->user=GETPOST('user', 'alpha'); + $menu->mainmenu=GETPOST('propertymainmenu', 'alpha'); + if (is_numeric(GETPOST('menuIdParent', 'alpha'))) { - $menu->fk_menu=GETPOST('menuIdParent','alpha'); + $menu->fk_menu=GETPOST('menuIdParent', 'alpha'); } else { - if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0; + if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu=0; else $menu->fk_menu=-1; $menu->fk_mainmenu=$mainmenu; $menu->fk_leftmenu=$leftmenu; @@ -144,18 +144,18 @@ if ($action == 'add') } $leftmenu=''; $mainmenu=''; - if (GETPOST('menuId','int') && ! is_numeric(GETPOST('menuId','int'))) + if (GETPOST('menuId', 'int') && ! is_numeric(GETPOST('menuId', 'int'))) { - $tmp=explode('&',GETPOST('menuId','int')); + $tmp=explode('&', GETPOST('menuId', 'int')); foreach($tmp as $s) { - if (preg_match('/fk_mainmenu=/',$s)) + if (preg_match('/fk_mainmenu=/', $s)) { - $mainmenu=preg_replace('/fk_mainmenu=/','',$s); + $mainmenu=preg_replace('/fk_mainmenu=/', '', $s); } - if (preg_match('/fk_leftmenu=/',$s)) + if (preg_match('/fk_leftmenu=/', $s)) { - $leftmenu=preg_replace('/fk_leftmenu=/','',$s); + $leftmenu=preg_replace('/fk_leftmenu=/', '', $s); } } } @@ -203,33 +203,33 @@ if ($action == 'add') if (! $error) { $menu = new Menubase($db); - $menu->menu_handler=preg_replace('/_menu$/','',GETPOST('menu_handler','aZ09')); - $menu->type=GETPOST('type','alpha'); - $menu->titre=GETPOST('titre','alpha'); - $menu->url=GETPOST('url','alpha'); - $menu->langs=GETPOST('langs','alpha'); - $menu->position=GETPOST('position','int'); - $menu->enabled=GETPOST('enabled','alpha'); - $menu->perms=GETPOST('perms','alpha'); - $menu->target=GETPOST('target','alpha'); - $menu->user=GETPOST('user','alpha'); - $menu->mainmenu=GETPOST('propertymainmenu','alpha'); - if (is_numeric(GETPOST('menuId','int'))) + $menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); + $menu->type=GETPOST('type', 'alpha'); + $menu->titre=GETPOST('titre', 'alpha'); + $menu->url=GETPOST('url', 'alpha'); + $menu->langs=GETPOST('langs', 'alpha'); + $menu->position=GETPOST('position', 'int'); + $menu->enabled=GETPOST('enabled', 'alpha'); + $menu->perms=GETPOST('perms', 'alpha'); + $menu->target=GETPOST('target', 'alpha'); + $menu->user=GETPOST('user', 'alpha'); + $menu->mainmenu=GETPOST('propertymainmenu', 'alpha'); + if (is_numeric(GETPOST('menuId', 'int'))) { - $menu->fk_menu=GETPOST('menuId','int'); + $menu->fk_menu=GETPOST('menuId', 'int'); } else { - if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0; - else $menu->fk_menu=-1; - $menu->fk_mainmenu=$mainmenu; - $menu->fk_leftmenu=$leftmenu; + if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu=0; + else $menu->fk_menu=-1; + $menu->fk_mainmenu=$mainmenu; + $menu->fk_leftmenu=$leftmenu; } $result=$menu->create($user); if ($result > 0) { - header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler','aZ09')); + header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09')); exit; } else @@ -275,7 +275,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') $form=new Form($db); $formadmin=new FormAdmin($db); -llxHeader('',$langs->trans("Menu")); +llxHeader('', $langs->trans("Menu")); if ($action == 'create') @@ -304,7 +304,7 @@ if ($action == 'create') }); '; - print load_fiche_titre($langs->trans("NewMenu"),'','title_setup'); + print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup'); print ''; print ''; @@ -336,7 +336,7 @@ if ($action == 'create') // Handler print '
'.$langs->trans('MenuHandler').''; - $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/',$menu_handler)?'':'_menu'),'menu_handler',array_merge($dirstandard,$dirsmartphone)); + $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler)?'':'_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone)); print ''.$langs->trans('DetailMenuHandler').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('DetailTarget').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'; @@ -426,7 +426,7 @@ if ($action == 'create') } elseif ($action == 'edit') { - print load_fiche_titre($langs->trans("ModifMenu"),'','title_setup'); + print load_fiche_titre($langs->trans("ModifMenu"), '', 'title_setup'); print '
'; print ''; @@ -514,12 +514,12 @@ elseif ($action == 'edit') // Enabled print '
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); - if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')'; + if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled, 1)).')'; print '
'.$langs->trans('Rights').''.$langs->trans('DetailRight'); - if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')'; + if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms, 1)).')'; print '
'; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index a7a11068256..dc3b715fc21 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -34,29 +34,29 @@ if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); -$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $dirstandard[]=$dirmenu.'standard'; $dirsmartphone[]=$dirmenu.'smartphone'; } -$action=GETPOST('action','alpha'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'alpha'); +$confirm=GETPOST('confirm', 'alpha'); $menu_handler_top=$conf->global->MAIN_MENU_STANDARD; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; -$menu_handler_top=preg_replace('/(_backoffice\.php|_menu\.php)/i','',$menu_handler_top); -$menu_handler_top=preg_replace('/(_frontoffice\.php|_menu\.php)/i','',$menu_handler_top); -$menu_handler_smartphone=preg_replace('/(_backoffice\.php|_menu\.php)/i','',$menu_handler_smartphone); -$menu_handler_smartphone=preg_replace('/(_frontoffice\.php|_menu\.php)/i','',$menu_handler_smartphone); +$menu_handler_top=preg_replace('/(_backoffice\.php|_menu\.php)/i', '', $menu_handler_top); +$menu_handler_top=preg_replace('/(_frontoffice\.php|_menu\.php)/i', '', $menu_handler_top); +$menu_handler_smartphone=preg_replace('/(_backoffice\.php|_menu\.php)/i', '', $menu_handler_smartphone); +$menu_handler_smartphone=preg_replace('/(_frontoffice\.php|_menu\.php)/i', '', $menu_handler_smartphone); $menu_handler=$menu_handler_top; if (GETPOST("handler_origine")) $menu_handler=GETPOST("handler_origine"); if (GETPOST("menu_handler")) $menu_handler=GETPOST("menu_handler"); -$menu_handler_to_search=preg_replace('/(_backoffice|_frontoffice|_menu)?(\.php)?/i','',$menu_handler); +$menu_handler_to_search=preg_replace('/(_backoffice|_frontoffice|_menu)?(\.php)?/i', '', $menu_handler); /* @@ -71,7 +71,7 @@ if ($action == 'up') // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE m.rowid = ".GETPOST("menuId","int"); + $sql.= " WHERE m.rowid = ".GETPOST("menuId", "int"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -89,7 +89,7 @@ if ($action == 'up') // Menu before $sql = "SELECT m.rowid, m.position"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId","int")."))"; + $sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId", "int")."))"; $sql.= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql.= " AND m.entity = ".$conf->entity; $sql.= " AND m.type = '".$db->escape($current['type'])."'"; @@ -127,7 +127,7 @@ elseif ($action == 'down') // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE m.rowid = ".GETPOST("menuId","int"); + $sql.= " WHERE m.rowid = ".GETPOST("menuId", "int"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -145,7 +145,7 @@ elseif ($action == 'down') // Menu after $sql = "SELECT m.rowid, m.position"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId","int")."))"; + $sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId", "int")."))"; $sql.= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql.= " AND m.entity = ".$conf->entity; $sql.= " AND m.type = '".$db->escape($current['type'])."'"; @@ -180,7 +180,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; - $sql.= " WHERE rowid = ".GETPOST('menuId','int'); + $sql.= " WHERE rowid = ".GETPOST('menuId', 'int'); $resql=$db->query($sql); if ($resql) { @@ -211,10 +211,10 @@ $formadmin=new FormAdmin($db); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); -llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss); +llxHeader('', $langs->trans("Menus"), '', '', 0, 0, $arrayofjs, $arrayofcss); -print load_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; @@ -245,18 +245,18 @@ if ($action == 'delete') { $sql = "SELECT m.titre"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE m.rowid = ".GETPOST('menuId','int'); + $sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int'); $result = $db->query($sql); $obj = $db->fetch_object($result); - print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId','int'),$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete"); + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->titre), "confirm_delete"); } print ''; print ''; print $langs->trans("MenuHandler").': '; -print $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/',$menu_handler)?'':'_menu'),'menu_handler',array_merge($dirstandard,$dirsmartphone)); +print $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler)?'':'_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone)); print '   '; print ''; @@ -266,8 +266,8 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; @@ -327,17 +327,17 @@ if ($conf->use_javascript_ajax) 'entry'=>'
'.$langs->trans("TreeMenuPersonalized").'
'. '   '.$titre.''. ''. - ''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. + ''.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").''. + ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''. '
', - 'buttons'=>''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. + '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").'' + ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").'' ); $i++; } diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index d85218dbd5a..cda216a452b 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -29,7 +29,7 @@ $langs->loadLangs(array("user","other","admin")); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); /* @@ -38,13 +38,13 @@ $action=GETPOST('action','alpha'); if ($action == 'activate_hidemenu') { - dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; } elseif ($action == 'disable_hidemenu') { - dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity); + dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; } @@ -54,9 +54,9 @@ elseif ($action == 'disable_hidemenu') * View */ -llxHeader('',$langs->trans("Setup")); +llxHeader('', $langs->trans("Setup")); -print load_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; @@ -93,11 +93,11 @@ print '
'.$langs->trans("HideUnauthorizedMenu").''; if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "