Merge remote-tracking branch 'upstream/develop' into psr2squizwhite

This commit is contained in:
Frédéric FRANCE
2019-02-03 22:41:57 +01:00
1546 changed files with 29438 additions and 33304 deletions

View File

@@ -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]

View File

@@ -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,8 +66,7 @@ while ($i < $argc)
$i++;
}
if (empty($release))
{
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;
@@ -81,39 +76,29 @@ $savrelease = $release;
// If release is auto, we take current version
$tmpver=explode('-', $release, 2);
if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable')
{
if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') {
$release=DOL_VERSION;
if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1];
}
if (empty($includecustom))
{
if (empty($includecustom)) {
$tmpverbis=explode('-', $release, 2);
if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable')
{
if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto')
{
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
{
} else {
$tmpverter=explode('-', DOL_VERSION, 2);
if ($tmpverter[0] != $tmpverbis[0])
{
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))
{
} 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, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
foreach ($includeconstants as $countrycode => $tmp)
{
foreach ($includeconstants as $countrycode => $tmp) {
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
foreach($tmp as $constname => $constvalue)
{
foreach($tmp as $constname => $constvalue) {
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
$checksumconcat[]=$valueforchecksum;
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");
@@ -191,7 +172,7 @@ fputs($fp, '</dolibarr_htdocs_dir>'."\n");
asort($checksumconcat); // Sort list of checksum
//var_dump($checksumconcat);
fputs($fp, '<dolibarr_htdocs_dir_checksum>'."\n");
fputs($fp, md5(join(',',$checksumconcat))."\n");
fputs($fp, md5(join(',', $checksumconcat))."\n");
fputs($fp, '</dolibarr_htdocs_dir_checksum>'."\n");
@@ -233,7 +214,7 @@ fputs($fp, '</dolibarr_script_dir>'."\n");
asort($checksumconcat); // Sort list of checksum
fputs($fp, '<dolibarr_script_dir_checksum>'."\n");
fputs($fp, md5(join(',',$checksumconcat))."\n");
fputs($fp, md5(join(',', $checksumconcat))."\n");
fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
fputs($fp, '</checksum_list>'."\n");

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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 --------------------

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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";

View File

@@ -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);
}
}

View File

@@ -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++)
{

View File

@@ -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";

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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';

View File

@@ -112,9 +112,6 @@
<rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity>
</rule>
@@ -192,6 +189,9 @@
</rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
@@ -434,5 +434,5 @@
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
</ruleset>

View File

@@ -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<br>\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.<br>\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 . "<br>\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('/&#39;/i','\'',$rep);
$rep=preg_replace('/SSSSS/i', '%s', $rep);
$rep=preg_replace('/NNNNN/i', '\n\n', $rep);
$rep=preg_replace('/&#39;/i', '\'', $rep);
//print "OK ".join('',$src_texts).' => '.$rep."\n";

View File

@@ -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";

View File

@@ -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."<br>\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]:"");

View File

@@ -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";

View File

@@ -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 '</tr>';
print '<tr class="liste_titre">';
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 "</tr>\n";
$accountstatic = new AccountingAccount($db);

View File

@@ -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 "<br>\n";
@@ -468,7 +468,7 @@ print "<br>\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 '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -507,7 +507,7 @@ if ($id)
$alabelisused=0;
$var=false;
$fieldlist=explode(',',$tabfield[$id]);
$fieldlist=explode(',', $tabfield[$id]);
// Line for title
print '<tr class="liste_titre">';
@@ -525,18 +525,21 @@ if ($id)
if ($id != 25) $valuetoshow.="*";
}
if ($fieldlist[$field]=='country') {
if (in_array('region_id',$fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input
if (in_array('region_id', $fieldlist)) { print '<td>&nbsp;</td>'; 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 '<td align="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
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 '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (! empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {
print $valuetoshow;
}
print '</td>';
}
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 '<td colspan="3" class="right">';
@@ -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 '<td colspan="3" class="right"><a name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'">&nbsp;</a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
@@ -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 '<td>';
//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 '<td>';
@@ -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 '</td>';
}

View File

@@ -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 '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
print '<td>';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type','alpha'):$object->pcg_type).'">';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type', 'alpha'):$object->pcg_type).'">';
print '</td></tr>';
// Chart of acounts subtype
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
print '<td>';
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$object->pcg_subtype).'">';
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype', 'alpha'):$object->pcg_subtype).'">';
print '</td></tr>';
print '</table>';
@@ -317,13 +317,13 @@ elseif ($id > 0 || $ref) {
// Chart of accounts type
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
print '<td>';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type','alpha'):$object->pcg_type).'">';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type', 'alpha'):$object->pcg_type).'">';
print '</td></tr>';
// Chart of accounts subtype
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
print '<td>';
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$object->pcg_subtype).'">';
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype', 'alpha'):$object->pcg_subtype).'">';
print '</td></tr>';
print '</table>';

View File

@@ -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 '<tr class="oddeven">';
print '<td>' . length_accountg($cpt->account_number) . '</td>';
print '<td>' . $cpt->label . '</td>';

View File

@@ -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 '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
@@ -457,7 +457,7 @@ if ($id)
{
$alabelisused=0;
$fieldlist=explode(',',$tabfield[$id]);
$fieldlist=explode(',', $tabfield[$id]);
// Line for title
print '<tr class="liste_titre">';
@@ -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 '<td align="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
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 '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
else print $valuetoshow;
print '</td>';
}
@@ -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 '<td colspan="4" class="right">';
@@ -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 '<td></td>';
print '<td></td>';
@@ -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 '<td>';
@@ -854,7 +854,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
}
elseif ($fieldlist[$field] == 'category_type') {
print '<td>';
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 '</td>';
}
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {

View File

@@ -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)) {

View File

@@ -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 "</tr>\n";
$num = count($main_option);
if ($num) {
foreach ( $main_option as $key ) {
foreach ($main_option as $key) {
print '<tr class="oddeven value">';
@@ -256,7 +256,7 @@ if ($num2) {
print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>';
print "</tr>\n";
foreach ( $model_option as $key) {
foreach ($model_option as $key) {
print '<tr class="oddeven value">';
// Param

View File

@@ -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 = '';

View File

@@ -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')
{

View File

@@ -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);

View File

@@ -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 '</td>';
print '<td>';
print '<input type="text" name="pcgType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$accounting->pcg_type).'">';
print '<input type="text" name="pcgType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype', 'alpha'):$accounting->pcg_type).'">';
print '</td>';
print '<td>';
print '<input type="text" name="pcgSubType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$accounting->pcg_subtype).'">';
print '<input type="text" name="pcgSubType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype', 'alpha'):$accounting->pcg_subtype).'">';
print '</td>';
// Colonne choix ligne a ventiler

View File

@@ -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')).'<br>';
}*/
}
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 '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
@@ -419,7 +419,7 @@ if ($id)
{
$alabelisused=0;
$fieldlist=explode(',',$tabfield[$id]);
$fieldlist=explode(',', $tabfield[$id]);
// Line for title
print '<tr class="liste_titre">';
@@ -440,8 +440,8 @@ if ($id)
if ($valuetoshow != '')
{
print '<td align="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
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 '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
else print $valuetoshow;
print '</td>';
}
@@ -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 '<td colspan="4" class="right">';
@@ -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 '<td align="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">';
@@ -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 '<td>';
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 '</td>';
}
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {

View File

@@ -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);

View File

@@ -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 = '';

View File

@@ -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;

View File

@@ -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 '<tr>';
print '<td class="fieldrequired">' . $langs->trans("Codejournal") . '</td>';
print '<td>' . $formaccounting->select_journal($journal_code,'code_journal',0,0,1,1) . '</td>';
print '<td>' . $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1) . '</td>';
print '</tr>';
print '<tr>';
@@ -436,7 +436,7 @@ if ($action == 'create')
print $langs->trans('Docdate');
print '</td>';
if ($action != 'editdate')
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='. $object->piece_num .'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'),1).'</a></td>';
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='. $object->piece_num .'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdate') {
@@ -459,7 +459,7 @@ if ($action == 'create')
print $langs->trans('Codejournal');
print '</td>';
if ($action != 'editjournal')
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$object->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</a></td>';
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$object->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editjournal') {
@@ -467,7 +467,7 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="action" value="setjournal">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
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 '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>';
} else {
@@ -482,7 +482,7 @@ if ($action == 'create')
print $langs->trans('Piece');
print '</td>';
if ($action != 'editdocref')
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$object->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</a></td>';
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$object->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editdocref') {
@@ -638,7 +638,7 @@ if ($action == 'create')
print '</td>';
} else {
$accountingaccount->fetch(null, $line->numero_compte, true);
print '<td>' . $accountingaccount->getNomUrl(0,1,1,'',0) . '</td>';
print '<td>' . $accountingaccount->getNomUrl(0, 1, 1, '', 0) . '</td>';
print '<td>' . length_accounta($line->subledger_account) . '</td>';
print '<td>' . $line->label_operation. '</td>';
print '<td class="right">' . price($line->debit) . '</td>';

View File

@@ -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 "</tr>\n";
@@ -640,7 +640,7 @@ if ($num > 0)
print '<td>';
$object->id = $line->id;
$object->piece_num = $line->piece_num;
print $object->getNomUrl(1,'',0,'',1);
print $object->getNomUrl(1, '', 0, '', 1);
print '</td>';
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 '<td align="center">' . $journaltoshow . '</td>';
if (! $i) $totalarray['nbfield']++;
}

View File

@@ -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 '<td class="right">' . ($line->credit ? price($line->credit) : '') . '</td>';
$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 '<td align="center">' . $journaltoshow . '</td>';
print '<td align="center">';

View File

@@ -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);

View File

@@ -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 "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
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 "</tr>\n";

View File

@@ -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);
}

View File

@@ -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');

View File

@@ -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');
}
}
}

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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');
/*

View File

@@ -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 '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
$formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
@@ -380,7 +380,7 @@ if ($result) {
print '<td class="tdoverflowonsmartphone">';
$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 '</td>';
print '<td class="right">' . price($objp->total_ht) . '</td>';

View File

@@ -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 '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
$formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
@@ -494,7 +494,7 @@ if ($result) {
print '<td class="tdoverflowonsmartphone">';
$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 '</td>';
print '<td class="right">';

View File

@@ -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');

View File

@@ -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 '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
$formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
@@ -316,7 +316,7 @@ if ($result) {
print '<td>';
$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 '</td>';
print '<td class="right">' . price($objp->total_ht) . '</td>';

View File

@@ -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 '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
$formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
@@ -373,7 +373,7 @@ if ($result) {
print '<td>';
$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 '</td>';
print '<td class="right">';

View File

@@ -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") . '<br>';
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
@@ -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 = '';

View File

@@ -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 '<tr class="oddeven">';
print "<td><!-- Thirdparty --></td>";
print "<td>" . $date . "</td>";
@@ -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 '<tr class="oddeven">';
print "<td><!-- VAT --></td>";
@@ -661,7 +661,7 @@ if (empty($action) || $action == 'view') {
// Subledger account
print "<td>";
print '</td>';
print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:'');
print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:'');
print "</td>";
print '<td class="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print '<td class="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";

View File

@@ -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 '<tr class="oddeven">';
print "<td><!-- Thirdparty --></td>";
@@ -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 '<tr class="oddeven">';
print "<td><!-- VAT --></td>";
@@ -956,7 +956,7 @@ if (empty($action) || $action == 'view') {
print "<td>";
print '</td>';
print "<td>";
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 "</td>";
print '<td class="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print '<td class="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
@@ -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 '<tr class="oddeven">';
print "<td><!-- VAT counterpart NPR --></td>";

View File

@@ -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 '<tr class="oddeven">';
print "<td><!-- VAT --></td>";
@@ -893,7 +893,7 @@ if (empty($action) || $action == 'view') {
// Subledger account
print "<td>";
print '</td>';
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:'');
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:'');
print "</td>";
print '<td class="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
print '<td class="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";

View File

@@ -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');

View File

@@ -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 '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
$formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
@@ -393,7 +393,7 @@ if ($result) {
print '<td>';
$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 '</td>';
print '<td class="right">' . price($objp->total_ht) . '</td>';

View File

@@ -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 '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
$formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
@@ -488,7 +488,7 @@ if ($result) {
print '<td>';
$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 '</td>';
print '<td class="right">';

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateall">';
print load_fiche_titre($langs->trans("MemberMainOptions"),'','');
print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
@@ -167,12 +167,12 @@ print "</td></tr>\n";
// Mail required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
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 "</td></tr>\n";
// Send mail information is on by default
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
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 "</td></tr>\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 '<td>';
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 '</td>';
print "</tr>\n";
@@ -199,7 +199,7 @@ if ($conf->facture->enabled)
else
{
print '<td class="right">';
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name"));
print '</td>';
}
print "</tr>\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").'<br>';
$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
@@ -254,7 +254,7 @@ print '<br>';
*/
$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").'<br>';
$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
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();

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
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();

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
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();

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
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.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=1'.$param.'">';
$enabledisablehtml.=img_picto($langs->trans("Disabled"),'switch_off');
$enabledisablehtml.=img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml.='</a>';
}
else
{
// Button on, click to disable
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=0'.$param.'">';
$enabledisablehtml.=img_picto($langs->trans("Activated"),'switch_on');
$enabledisablehtml.=img_picto($langs->trans("Activated"), 'switch_on');
$enabledisablehtml.='</a>';
}
print $enabledisablehtml;
@@ -193,7 +193,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
print '<tr class="oddeven" id="tredit"><td>';
print $langs->trans("CanEditAmount");
print '</td><td class="right">';
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 "</td></tr>\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 "</td></tr>\n";
print '</table>';
@@ -226,7 +226,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
print img_picto('', 'object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
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

View File

@@ -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&eacute;rents|ES:M&oacute;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);
}
}

View File

@@ -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');
}
}

View File

@@ -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);
}
}

View File

@@ -30,11 +30,11 @@ if (empty($conf) || ! is_object($conf))
<?php
print load_fiche_titre($this->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']; ?>

View File

@@ -33,17 +33,17 @@ $contact = $GLOBALS['objcanvas']->control->object;
<?php
print load_fiche_titre($this->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'];
?>
<br>
<form method="post" name="formmember" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST('id','int'); ?>">
<form method="post" name="formmember" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST('id', 'int'); ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="id" value="<?php echo GETPOST('id','int'); ?>">
<input type="hidden" name="id" value="<?php echo GETPOST('id', 'int'); ?>">
<input type="hidden" name="action" value="update">
<input type="hidden" name="adherentid" value="<?php echo $this->control->tpl['id']; ?>">
<input type="hidden" name="old_name" value="<?php echo $this->control->tpl['name']; ?>">

View File

@@ -32,7 +32,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
<?php echo $this->control->tpl['showhead']; ?>
<?php
dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']);
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
?>
<?php if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?>

View File

@@ -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&eacute;rents|ES:M&oacute;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 '<font class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</font>';
}
@@ -939,23 +939,23 @@ else
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td class="fieldrequired">'.$langs->trans("Nature")."</td><td>\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 "</td>\n";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOST('societe','alpha')?GETPOST('societe','alpha'):$object->societe).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOST('societe', 'alpha')?GETPOST('societe', 'alpha'):$object->societe).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
print $formcompany->select_civility(GETPOST('civility_id','int')?GETPOST('civility_id','int'):$object->civility_id,'civility_id').'</td>';
print $formcompany->select_civility(GETPOST('civility_id', 'int')?GETPOST('civility_id', 'int'):$object->civility_id, 'civility_id').'</td>';
print '</tr>';
// Lastname
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="minwidth300" maxlength="50" value="'.(GETPOST('lastname','alpha')?GETPOST('lastname','alpha'):$object->lastname).'"></td>';
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="minwidth300" maxlength="50" value="'.(GETPOST('lastname', 'alpha')?GETPOST('lastname', 'alpha'):$object->lastname).'"></td>';
print '</tr>';
// Firstname
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="minwidth300" maxlength="50" value="'.(GETPOST('firstname','alpha')?GETPOST('firstname','alpha'):$object->firstname).'"></td>';
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="minwidth300" maxlength="50" value="'.(GETPOST('firstname', 'alpha')?GETPOST('firstname', 'alpha'):$object->firstname).'"></td>';
print '</tr>';
// Gender
@@ -966,25 +966,25 @@ else
print '</td></tr>';
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOST('member_email','alpha')?GETPOST('member_email','alpha'):$object->email).'"></td></tr>';
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOST('member_email', 'alpha')?GETPOST('member_email', 'alpha'):$object->email).'"></td></tr>';
// Address
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alphanohtml')?GETPOST('address','alphanohtml'):$object->address).'</textarea>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address', 'alphanohtml')?GETPOST('address', 'alphanohtml'):$object->address).'</textarea>';
print '</td></tr>';
// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
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 '</td></tr>';
// Country
$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id;
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
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 '</td></tr>';
// State
@@ -993,7 +993,7 @@ else
print '<tr><td>'.$langs->trans('State').'</td><td>';
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 '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOST('phone','alpha')?GETPOST('phone','alpha'):$object->phone).'"></td></tr>';
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOST('phone', 'alpha')?GETPOST('phone', 'alpha'):$object->phone).'"></td></tr>';
// Personal phone
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOST('phone_perso','alpha')?GETPOST('phone_perso','alpha'):$object->phone_perso).'"></td></tr>';
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOST('phone_perso', 'alpha')?GETPOST('phone_perso', 'alpha'):$object->phone_perso).'"></td></tr>';
// Mobile phone
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile', 'alpha')?GETPOST('phone_mobile', 'alpha'):$object->phone_mobile).'"></td></tr>';
// Skype
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="member_skype" size="40" value="'.(GETPOST('member_skype','alpha')?GETPOST('member_skype','alpha'):$object->skype).'"></td></tr>';
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="member_skype" size="40" value="'.(GETPOST('member_skype', 'alpha')?GETPOST('member_skype', 'alpha'):$object->skype).'"></td></tr>';
}
// Twitter
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("Twitter").'</td><td><input type="text" name="member_twitter" size="40" value="'.(GETPOST('member_twitter','alpha')?GETPOST('member_twitter','alpha'):$object->twitter).'"></td></tr>';
print '<tr><td>'.$langs->trans("Twitter").'</td><td><input type="text" name="member_twitter" size="40" value="'.(GETPOST('member_twitter', 'alpha')?GETPOST('member_twitter', 'alpha'):$object->twitter).'"></td></tr>';
}
// Facebook
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="member_facebook" size="40" value="'.(GETPOST('member_facebook','alpha')?GETPOST('member_facebook','alpha'):$object->facebook).'"></td></tr>';
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="member_facebook" size="40" value="'.(GETPOST('member_facebook', 'alpha')?GETPOST('member_facebook', 'alpha'):$object->facebook).'"></td></tr>';
}
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
print "</td></tr>\n";
// Public profil
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
print $form->selectyesno("public",$object->public,1);
print $form->selectyesno("public", $object->public, 1);
print "</td></tr>\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 '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(isset($_POST["login"])?GETPOST("login", 'alpha', 2):$object->login).'"></td></tr>';
}
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(isset($_POST["pass"])?GETPOST("pass", '', 2):$object->pass).'"></td></tr>';
}
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale");
print '<tr><td><span class="fieldrequired">'.$langs->trans("Nature").'</span></td><td>';
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 "</td></tr>";
// Type
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
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 "</td></tr>";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(isset($_POST["societe"])?GETPOST("societe", '', 2):$object->societe).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
@@ -1200,11 +1200,11 @@ else
print '</tr>';
// Lastname
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="minwidth300" maxlength="50" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="minwidth300" maxlength="50" value="'.(isset($_POST["lastname"])?GETPOST("lastname", '', 2):$object->lastname).'"></td>';
print '</tr>';
// Firstname
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="minwidth300" maxlength="50" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="minwidth300" maxlength="50" value="'.(isset($_POST["firstname"])?GETPOST("firstname", '', 3):$object->firstname).'"></td>';
print '</tr>';
// Gender
@@ -1217,7 +1217,7 @@ else
// Photo
print '<tr><td>'.$langs->trans("Photo").'</td>';
print '<td class="hideonsmartphone" valign="middle">';
print $form->showphoto('memberphoto',$object)."\n";
print $form->showphoto('memberphoto', $object)."\n";
if ($caneditfieldmember)
{
if ($object->photo) print "<br>\n";
@@ -1230,32 +1230,32 @@ else
print '</td></tr>';
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"])?GETPOST("member_email",'',2):$object->email).'"></td></tr>';
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"])?GETPOST("member_email", '', 2):$object->email).'"></td></tr>';
// Address
print '<tr><td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.'">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.'">'.(isset($_POST["address"])?GETPOST("address", '', 2):$object->address).'</textarea>';
print '</td></tr>';
// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
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 '</td></tr>';
// 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 '<tr><td>'.$langs->trans('Country').'</td><td>';
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 '</td></tr>';
// State
if (empty($conf->global->MEMBER_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td>';
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 '</td></tr>';
}
@@ -1288,12 +1288,12 @@ else
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
print "</td></tr>\n";
// Public profil
print "<tr><td>".$langs->trans("Public")."</td><td>\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 "</td></tr>\n";
// Categories
@@ -1335,7 +1335,7 @@ else
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">';
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 '</td></tr>';
@@ -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.="<br>";
$helpcontent.='<b>'.$langs->trans("Content").'</b>:<br>';
$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.="<br>";
$helpcontent.='<b>'.$langs->trans("Content").'</b>:<br>';
$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 '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$object->pass);
if ($object->pass) print preg_replace('/./i','*',$object->pass);
print '<tr><td>'.$langs->trans("Password").'</td><td>'.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 '</td></tr>';
}
@@ -1637,7 +1637,7 @@ else
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
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 '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
print $form->select_company($object->fk_soc,'socid','',1);
print $form->select_company($object->fk_soc, 'socid', '', 1);
print '</td>';
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
@@ -1701,13 +1701,13 @@ else
print '</td><td colspan="2" class="valeur">';
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 '<table class="border tableforfield tableforfield" width="100%">';
// Birthday
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
// Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';

View File

@@ -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 '<br>';
@@ -256,7 +256,7 @@ print '<br>';
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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="foruserid" value="all">';
print '<input type="hidden" name="mode" value="card">';
@@ -274,7 +274,7 @@ print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc"
print '</form>';
print '<br>';
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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="mode" value="cardlogin">';
print '<input type="hidden" name="action" value="builddoc">';
@@ -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 '<br>'.$langs->trans("Login").': <input size="10" type="text" name="foruserlogin" value="'.GETPOST('foruserlogin').'">';
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
print '</form>';
print '<br>';
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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="mode" value="label">';
print '<input type="hidden" name="action" value="builddoc">';
@@ -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 '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
print '</form>';
print '<br>';

View File

@@ -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.='<div class="inline-block nopadding valignmiddle'.((! isset($this->statut) || $this->statut)?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">';
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.='</div>';
}
$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 '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'),'statut1');
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'),'statut4');
if (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
}
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.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 '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActive").' </span>'.img_picto($langs->trans('MemberStatusActive'),'statut1');
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLate").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaid").' </span>'.img_picto($langs->trans('MemberStatusPaid'),'statut4');
if (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActive").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLate").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaid").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
}
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.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&amp;statut=1&amp;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);

View File

@@ -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 = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$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);
}

View File

@@ -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);
}

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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';
}

View File

@@ -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&eacute;rents|ES:M&oacute;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 '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
//Total taille
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.dol_print_size($totalsize,1,1).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.dol_print_size($totalsize, 1, 1).'</td></tr>';
print '</table>';

View File

@@ -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 "<hr>\n";
while ($i < $num)
{
$objp = $db->fetch_object($result);
$htpass=crypt($objp->pass,makesalt());
$htpass=crypt($objp->pass, makesalt());
print $objp->login.":".$htpass."<br>\n";
$i++;
}

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $langs->trans("Members"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;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 "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
print "<td class=\"right\">".$Number[$key]."</td>";
print "<td class=\"right\">".price($value)."</td>";
print "<td class=\"right\">".price(price2num($value/$Number[$key],'MT'))."</td>";
print "<td class=\"right\">".price(price2num($value/$Number[$key], 'MT'))."</td>";
print "</tr>\n";
}
@@ -268,7 +268,7 @@ print '<tr class="liste_total">';
print '<td>'.$langs->trans("Total").'</td>';
print "<td class=\"right\">".$numb."</td>";
print '<td class="right">'.price($tot)."</td>";
print "<td class=\"right\">".price(price2num($numb>0?($tot/$numb):0,'MT'))."</td>";
print "<td class=\"right\">".price(price2num($numb>0?($tot/$numb):0, 'MT'))."</td>";
print "</tr>\n";
print "</table></div>";
print "<br>\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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<th colspan="4">'.$langs->trans("LastMembersModified",$max).'</th></tr>';
print '<th colspan="4">'.$langs->trans("LastMembersModified", $max).'</th></tr>';
$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 '<td>'.$staticmember->getNomUrl(1,32).'</td>';
print '<td>'.$statictype->getNomUrl(1,32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem),'dayhour').'</td>';
print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
print '<td>'.$staticmember->getNomUrl(1, 32).'</td>';
print '<td>'.$statictype->getNomUrl(1, 32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription=='yes'?1:0), $db->jdate($obj->date_end_subscription), 5).'</td>';
print '</tr>';
$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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<th colspan="5">'.$langs->trans("LastSubscriptionsModified",$max).'</th></tr>';
print '<th colspan="5">'.$langs->trans("LastSubscriptionsModified", $max).'</th></tr>';
$num = $db->num_rows($resql);
if ($num)
@@ -383,11 +383,11 @@ if ($resql)
}
$staticmember->ref=$staticmember->getFullName($langs);
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td>'.$staticmember->getNomUrl(1,32,'subscription').'</td>';
print '<td>'.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).'</td>';
print '<td>'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>';
print '<td>'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
print '<td class="right">'.price($obj->subscription).'</td>';
//print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec),'dayhour').'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec), 'dayhour').'</td>';
print '</tr>';
$i++;
}
@@ -416,18 +416,18 @@ foreach ($AdherentType as $key => $adhtype)
{
print '<tr class="oddeven">';
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
print '<td class="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).'</td>';
print '<td class="right">'.(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).'</td>';
print '<td class="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).'</td>';
print '<td class="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).'</td>';
print '<td class="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="right">'.(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).'</td>';
print '<td class="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'</td>';
print '<td class="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'</td>';
print "</tr>\n";
}
print '<tr class="liste_total">';
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
print '<td class="liste_total" class="right">'.$SommeA.' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).'</td>';
print '<td class="liste_total" class="right">'.$SommeB.' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).'</td>';
print '<td class="liste_total" class="right">'.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).'</td>';
print '<td class="liste_total" class="right">'.$SommeD.' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).'</td>';
print '<td class="liste_total" class="right">'.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="liste_total" class="right">'.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="liste_total" class="right">'.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'</td>';
print '<td class="liste_total" class="right">'.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'</td>';
print '</tr>';
print "</table>\n";

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;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

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;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 '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'</div>';
}
// Filter on categories
@@ -401,11 +401,11 @@ if (! empty($conf->categorie->enabled))
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$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.='</div>';
}
$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 '<td class="liste_titre" align="center">';
print $form->select_country($search_country,'search_country','',0,'maxwidth100');
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth100');
print '</td>';
}
// 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 '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
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 "</tr>\n";
$i = 0;
@@ -716,7 +716,7 @@ while ($i < min($num, $limit))
$membertypestatic->id=$obj->type_id;
$membertypestatic->label=$obj->type;
print '<td class="nowrap">';
print $membertypestatic->getNomUrl(1,32);
print $membertypestatic->getNomUrl(1, 32);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
@@ -754,7 +754,7 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['country.code_iso']['checked']))
{
print '<td align="center">';
$tmparray=getCountry($obj->country,'all');
$tmparray=getCountry($obj->country, 'all');
print $tmparray['label'];
print '</td>';
if (! $i) $totalarray['nbfield']++;
@@ -786,7 +786,7 @@ while ($i < min($num, $limit))
// EMail
if (! empty($arrayfields['d.email']['checked']))
{
print "<td>".dol_print_email($obj->email,0,0,1)."</td>\n";
print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n";
}
// End of subscription date
$datefin=$db->jdate($obj->datefin);
@@ -795,7 +795,7 @@ while ($i < min($num, $limit))
if ($datefin)
{
print '<td align="center" class="nowrap">';
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 '<td class="nowrap right">';
print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,5);
print $memberstatic->LibStatut($obj->statut, $obj->subscription, $datefin, 5);
print '</td>';
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 "</table>\n";

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros";
llxHeader("",$title,$helpurl);
llxHeader("", $title, $helpurl);
$form = new Form($db);

View File

@@ -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 '<tr class="oddeven">';
print '<td>'.$memberstatic->getmorphylib($val['label']).'</td>';
print '<td class="right">'.$val['nb'].'</td>';
print '<td align="center">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
print '<td align="center">'.dol_print_date($val['lastdate'], 'dayhour').'</td>';
print '</tr>';
$oldyear=$year;
}

View File

@@ -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 '<td>'.$val['label'].'</td>';
if ($label2) print '<td align="center">'.$val['label2'].'</td>';
print '<td class="right">'.$val['nb'].'</td>';
print '<td align="center">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
print '<td align="center">'.dol_print_date($val['lastdate'], 'dayhour').'</td>';
print '</tr>';
$oldyear=$year;
}

View File

@@ -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 '</a>';
print '</td>';
print '<td class="right">'.$val['nb'].'</td>';
print '<td class="right">'.price(price2num($val['total'],'MT'),1).'</td>';
print '<td class="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
print '</tr>';
$oldyear=$year;
}

View File

@@ -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&eacute;rents|ES:M&oacute;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 '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$object->pass);
print '<tr><td>'.$langs->trans("Password").'</td><td>'.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 '</td></tr>';
}
@@ -521,7 +521,7 @@ if ($rowid > 0)
print '<table class="border tableforfield" width="100%">';
// Birthday
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
// Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
@@ -543,7 +543,7 @@ if ($rowid > 0)
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
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 '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty");
print '</td>';
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2" class="valeur">';
if ($action == 'editthirdparty')
@@ -582,7 +582,7 @@ if ($rowid > 0)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
print $form->select_company($object->fk_soc,'socid','',1);
print $form->select_company($object->fk_soc, 'socid', '', 1);
print '</td>';
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
@@ -613,7 +613,7 @@ if ($rowid > 0)
print '<td class="right">';
if ($user->rights->user->user->creer)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
}
print '</td>';
}
@@ -621,13 +621,13 @@ if ($rowid > 0)
print '</td><td colspan="2" class="valeur">';
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 '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre">';
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 '<td align="center">'.$langs->trans("DateCreation").'</td>';
print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
@@ -713,9 +713,9 @@ if ($rowid > 0)
print '<tr class="oddeven">';
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($objp->datec),'dayhour')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datec), 'dayhour')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh), 'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datef), 'day')."</td>\n";
print '<td class="right">'.price($objp->subscription).'</td>';
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 '<td class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>';
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 '<tr><td>'.$langs->trans("Label").'</td>';
print '<td><input name="label" type="text" size="32" value="';
if (empty($conf->global->MEMBER_NO_DEFAULT_LABEL)) print $langs->trans("Subscription").' '.dol_print_date(($datefrom?$datefrom:time()),"%Y");
if (empty($conf->global->MEMBER_NO_DEFAULT_LABEL)) print $langs->trans("Subscription").' '.dol_print_date(($datefrom?$datefrom:time()), "%Y");
print '"></td></tr>';
// Complementary action
@@ -983,7 +983,7 @@ if ($rowid > 0)
print $langs->trans("CreateDolibarrThirdParty");
print '</a>)';
}
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 '</a>)';
}
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 '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("FinancialAccount").'</td><td>';
$form->select_comptes(GETPOST('accountid'),'accountid',0,'',1);
$form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 1);
print "</td></tr>\n";
// Payment mode
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements(GETPOST('operation'),'operation','',2);
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2);
print "</td></tr>\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='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail','alpha')?' checked':(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>';
$tmp='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail', 'alpha')?' checked':(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>';
$helpcontent='';
$helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
$helpcontent.='<b>'.$langs->trans("MailRecipient").'</b>: '.$object->email.'<br>'."\n";

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $langs->trans("SubscriptionCard"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;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 '<tr>';
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1,0,'subscription').'</td>';
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
print '</tr>';
// 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']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text=$langs->trans("ConfirmDeleteSubscription");
if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='<br>'.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 '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
@@ -324,7 +324,7 @@ if ($rowid && $action != 'edit')
// Member
$adh->ref=$adh->getFullName($langs);
print '<tr>';
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1,0,'subscription').'</td>';
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
print '</tr>';
// Date record
@@ -334,12 +334,12 @@ if ($rowid && $action != 'edit')
// Date subscription
print '<tr>';
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh,'day').'</td>';
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh, 'day').'</td>';
print '</tr>';
// Date end subscription
print '<tr>';
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur">'.dol_print_date($object->datef,'day').'</td>';
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur">'.dol_print_date($object->datef, 'day').'</td>';
print '</tr>';
// 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
{

View File

@@ -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');

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $langs->trans("ListOfSubscriptions"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;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 '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'</div>';
}
$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 "</tr>\n";
print '<tr class="liste_titre">';
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 "</tr>\n";
@@ -506,7 +506,7 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['t.libelle']['checked']))
{
print '<td>';
print dol_trunc($obj->note,128);
print dol_trunc($obj->note, 128);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
@@ -529,13 +529,13 @@ while ($i < min($num, $limit))
// Date start
if (! empty($arrayfields['d.date_start']['checked']))
{
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh), 'day')."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Date end
if (! empty($arrayfields['d.date_end']['checked']))
{
print '<td align="center">'.dol_print_date($db->jdate($obj->datef),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datef), 'day')."</td>\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 "</table>";

View File

@@ -45,7 +45,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td><?php echo $langs->trans("Subscription"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td>
<td align="center"></td>
<td align="center"><?php echo dol_print_date($objectlink->dateh,'day'); ?></td>
<td align="center"><?php echo dol_print_date($objectlink->dateh, 'day'); ?></td>
<td class="right"><?php
if ($user->rights->adherent->lire) {
$total = $total + $objectlink->amount;

View File

@@ -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&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;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 '<td align="center">'.yn($objp->vote).'</td>';
print '<td align="center">';
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 '</td>';
if ($user->rights->adherent->configurer)
@@ -331,15 +328,15 @@ if ($action == 'create')
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
print '<tr><td>'.$langs->trans("Status").'</td><td>';
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 '</td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print $form->selectyesno("subscription",1,1);
print $form->selectyesno("subscription", 1, 1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
print $form->selectyesno("vote",0,1);
print $form->selectyesno("vote", 0, 1);
print '</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
@@ -347,17 +344,17 @@ if ($action == 'create')
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
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 '</td></tr>';
// 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 '<tbody>';
print "</table>\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 '<tr><td class="titlefield">'.$langs->trans("Status").'</td><td>';
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 '</tr>';
@@ -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 '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'" size="12"></td>';
print '<br>';
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 "</tr>\n";
print '<tr class="liste_titre">';
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 "</tr>\n";
while ($i < $num && $i < $conf->liste_limit)
@@ -634,11 +631,11 @@ if ($rowid > 0)
print '<tr class="oddeven">';
if ($objp->societe != '')
{
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n";
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).'</a></td>'."\n";
}
else
{
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).'</a></td>'."\n";
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 32).'</a></td>'."\n";
}
// Login
@@ -656,11 +653,11 @@ if ($rowid > 0)
print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
// EMail
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
print "<td>".dol_print_email($objp->email, 0, 0, 1)."</td>\n";
// Statut
print '<td class="nowrap">';
print $adh->LibStatut($objp->statut,$objp->subscription,$datefin,2);
print $adh->LibStatut($objp->statut, $objp->subscription, $datefin, 2);
print "</td>";
// Date end subscription
@@ -669,11 +666,11 @@ if ($rowid > 0)
print '<td align="center" class="nowrap">';
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 '</td>';
}
@@ -701,7 +698,7 @@ if ($rowid > 0)
print '&nbsp;';
if ($user->rights->adherent->supprimer)
{
print '<a href="card.php?rowid='.$objp->rowid.'&action=resign">'.img_picto($langs->trans("Resiliate"),'disable.png').'</a>';
print '<a href="card.php?rowid='.$objp->rowid.'&action=resign">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
}
print "</td>";
@@ -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
@@ -756,11 +753,11 @@ if ($rowid > 0)
print '</td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print $form->selectyesno("subscription",$object->subscription,1);
print $form->selectyesno("subscription", $object->subscription, 1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
print $form->selectyesno("vote",$object->vote,1);
print $form->selectyesno("vote", $object->vote, 1);
print '</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
@@ -768,17 +765,17 @@ if ($rowid > 0)
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
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 "</td></tr>";
// 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 '</table>';
@@ -800,7 +797,7 @@ if ($rowid > 0)
$value = $adht->array_options["options_" . $key];
}
print '<tr><td width="30%">'.$label.'</td><td>';
print $extrafields->showInputField($key,$value);
print $extrafields->showInputField($key, $value);
print "</td></tr>\n";
}
print '</table><br><br>';

View File

@@ -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

View File

@@ -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 '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom", 'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
// Address
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address",'nohtml')) . '</textarea></td></tr>'."\n";
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address", 'nohtml')) . '</textarea></td></tr>'."\n";
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode",'alpha')) . '"></td></tr>'."\n";
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode", 'alpha')) . '"></td></tr>'."\n";
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town",'nohtml')) . '"></td></tr>'."\n";
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town", 'nohtml')) . '"></td></tr>'."\n";
// Country
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
//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 '</td></tr>'."\n";
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
@@ -158,11 +158,11 @@ if ($action == 'edit' || $action == 'updateedit')
// Code
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code", 'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
// Note
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note','none') ? GETPOST('note','none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note', 'none') ? GETPOST('note', 'none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
print '</td></tr>';
print '</table>';
@@ -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 '</td></tr>';
if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>';
else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>';
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 '&nbsp;';
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE,$mysoc->country_code) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX,$mysoc->country_code) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL,0,0,0,80) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB,'_blank',80) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("AccountantFileNumber").'</td><td>' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '</td></tr>';

View File

@@ -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='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -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 '<tr class="oddeven">';
print '<td>'.$trigger['code'].'</td>';

Some files were not shown because too many files have changed in this diff Show More