Merge remote-tracking branch 'origin/clean_phpstan_action' into clean_phpstan_action
This commit is contained in:
commit
e6e063ac8a
754 changed files with 5362 additions and 4824 deletions
2
.github/workflows/phpstan.yml
vendored
2
.github/workflows/phpstan.yml
vendored
|
|
@ -52,7 +52,7 @@ jobs:
|
|||
run: cd ./tmp && ls -al
|
||||
- name: Run PHPSTAN
|
||||
run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -c phpstan_action.neon | cs2pr --graceful-warnings
|
||||
continue-on-error: true
|
||||
# continue-on-error: true
|
||||
- name: "Save phpstan cache"
|
||||
uses: actions/cache/save@v3
|
||||
if: always()
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ PHP-Iban 4.1.1 LGPL-3+ Yes
|
|||
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
|
||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||
PrestaShop-WS-Lib 94feb5f OSL-3.0 No Library providing API client for Prestashop.
|
||||
PSR/Logs 1.0 MIT License Yes Library for logs (used by DebugBar)
|
||||
PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet)
|
||||
Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ NEW: use account address in sepa mandate (#23642)
|
|||
NEW: VAT rate - Add entity
|
||||
NEW: webportal site account
|
||||
NEW: When an user unset the batch management of products, transformation of each batch stock mouvement in global stock mouvement
|
||||
FIX: #25828 wrong odt style naming
|
||||
|
||||
SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
|
||||
SEC: Add action confirm_... as sensitive to need a CSRF token
|
||||
|
|
@ -199,6 +200,7 @@ QUAL: Standardize code and look and feel for dictionaries
|
|||
QUAL: Standardize code. Renamed ID of user properties into ->user_xxx_id
|
||||
QUAL: Use dol_clone with parameter 2 for ->oldcopy
|
||||
QUAL: use switch case instead of if elseif statements for actions
|
||||
QUAL: Better respect of REST API RFC.
|
||||
|
||||
NEW: [Add hook in user bank page]
|
||||
NEW: #19501 Add two hooks in dolreceiptprinter.php (#26439)
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ int main(int argc, char **argv)
|
|||
//----------------
|
||||
int noarg,curseurarg,help=0,invalide=0;
|
||||
char option;
|
||||
char *endptr;
|
||||
|
||||
for (noarg=1;noarg<argc;noarg++) {
|
||||
if (((argv[noarg][0])=='/') || ((argv[noarg][0])=='-')) {
|
||||
|
|
@ -261,7 +262,7 @@ for (noarg=1;noarg<argc;noarg++) {
|
|||
if (strlen(argv[noarg]) < 3) { ++noarg; curseurarg=0; }
|
||||
switch (option) {
|
||||
case 's': strncpy(Host,argv[noarg]+curseurarg,sizeof(Host)); break;
|
||||
case 'p': Port=atoi(argv[noarg]+curseurarg); break; // Get port from "-p80" (curseurarg = 2) or "-p 80" (curseurarg = 0)
|
||||
case 'p': Port=strtol(argv[noarg] + curseurarg, &endptr, 10); break; // Get port from "-p80" (curseurarg = 2) or "-p 80" (curseurarg = 0)
|
||||
case '?': help=-1;break; // Help
|
||||
case 'h': help=-1;break; // Help
|
||||
case 'v': help=-1;break; // Help
|
||||
|
|
@ -270,6 +271,20 @@ for (noarg=1;noarg<argc;noarg++) {
|
|||
}
|
||||
}
|
||||
|
||||
// Check for conversion errors
|
||||
if (*endptr != '\0') {
|
||||
// Handle error: Invalid input format
|
||||
printf("Invalid port number format\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// Check for overflow
|
||||
if (Port < 0 || Port > INT_MAX) {
|
||||
// Handle error: Port number out of range
|
||||
printf("Port number out of range\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
help=!(Port > 0);
|
||||
|
||||
// Show usage
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
if (!defined("NOLOGIN")) {
|
||||
define("NOLOGIN", '1');
|
||||
}
|
||||
if (!defined("NOSESSION")) {
|
||||
define("NOSESSION", '1');
|
||||
}
|
||||
if (!defined("NOHTTPSREDIRECT")) {
|
||||
define("NOHTTPSREDIRECT", '1');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,14 +66,12 @@ NUSOAP:
|
|||
TCPDF:
|
||||
------
|
||||
* Replace in tcpdf.php:
|
||||
|
||||
if (isset($this->imagekeys)) {
|
||||
foreach($this->imagekeys as $file) {
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
with
|
||||
|
||||
if (isset($this->imagekeys)) {
|
||||
foreach($this->imagekeys as $file) {
|
||||
// DOL CHANGE If we keep this, source image files are physically destroyed
|
||||
|
|
@ -81,8 +79,7 @@ with
|
|||
}
|
||||
}
|
||||
|
||||
* Replace in tcpdf.php
|
||||
|
||||
* Replace in tcpdf.php:
|
||||
$preserve = array(
|
||||
'file_id',
|
||||
'internal_encoding',
|
||||
|
|
@ -90,9 +87,7 @@ with
|
|||
'bufferlen',
|
||||
'buffer',
|
||||
'cached_files',
|
||||
|
||||
with
|
||||
|
||||
$preserve = array(
|
||||
'file_id',
|
||||
'internal_encoding',
|
||||
|
|
@ -103,14 +98,11 @@ with
|
|||
// @CHANGE DOL
|
||||
'imagekeys',
|
||||
|
||||
* Replace in tcpdf.php
|
||||
|
||||
* Replace in tcpdf.php:
|
||||
if (!@TCPDF_STATIC::file_exists($file)) {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
with
|
||||
|
||||
if (!@TCPDF_STATIC::file_exists($file)) {
|
||||
// DOL CHANGE If we keep this, the image is not visible on pages after the first one.
|
||||
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
|
||||
|
|
@ -121,12 +113,9 @@ with
|
|||
}
|
||||
}
|
||||
|
||||
* Replace in tcpdf.php
|
||||
|
||||
* Replace in tcpdf.php:
|
||||
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
|
||||
with
|
||||
|
||||
// @CHANGE LDR Add support for src="file://..." links
|
||||
if (strpos($imgsrc, 'file://') === 0) {
|
||||
$imgsrc = str_replace('file://', '/', $imgsrc);
|
||||
|
|
@ -143,12 +132,9 @@ with
|
|||
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace:
|
||||
if (strpos($filename, '://') === false) {
|
||||
|
||||
with
|
||||
|
||||
if (strpos($filename, '//') === 0) {
|
||||
// Share folder on a (windows) server
|
||||
// e.g.: "//[MyServerName]/[MySharedFolder]/"
|
||||
|
|
@ -157,17 +143,22 @@ with
|
|||
}
|
||||
elseif (strpos($filename, '://') === false)
|
||||
|
||||
* To avoid to have QRcode changed because generated with a random mask, replace
|
||||
define('QR_FIND_FROM_RANDOM', 2);
|
||||
* To avoid to have QRcode changed because generated with a random mask, replace:
|
||||
define('QR_FIND_FROM_RANDOM', 2);
|
||||
with
|
||||
define('QR_FIND_FROM_RANDOM', false);
|
||||
define('QR_FIND_FROM_RANDOM', false);
|
||||
|
||||
* Change line:
|
||||
imagesetpixel($imgalpha, $xpx, $ypx, $alpha);
|
||||
into
|
||||
imagesetpixel($imgalpha, $xpx, $ypx, (int) $alpha);
|
||||
|
||||
* Removed useless directories ("examples", "tools")
|
||||
|
||||
* Optionnaly, removed all fonts except
|
||||
dejavusans* (used by greek, arab, persan, romanian, turkish),
|
||||
freemono* (russian),
|
||||
cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
|
||||
* Optionnaly, removed all fonts except
|
||||
dejavusans* (used by greek, arab, persan, romanian, turkish),
|
||||
freemono* (russian),
|
||||
cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
|
||||
helvetica* (all other languages),
|
||||
zapfdingbats.php (for special chars like form checkboxes)
|
||||
|
||||
|
|
@ -179,15 +170,15 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
|||
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
|
||||
of the function, replace:
|
||||
|
||||
$roman = '';
|
||||
$roman = '';
|
||||
|
||||
with:
|
||||
with:
|
||||
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
|
||||
* Add this at begin of tcpdf_autoconfig.php
|
||||
|
||||
|
|
@ -222,7 +213,7 @@ with:
|
|||
|
||||
* Fix syntax error by replacing
|
||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
|
||||
with
|
||||
with
|
||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
||||
|
||||
* Fix php fatal error on php 8.0 on tcpdi.php
|
||||
|
|
@ -313,6 +304,24 @@ RESTLER:
|
|||
empty($value[0]) ? null :
|
||||
empty($value[1]) ? null :
|
||||
|
||||
* Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it. For this replace code
|
||||
|
||||
if (false !== $file = $b::$loader[1]($className) && $this->exists($className, $b::$loader[1])) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
with:
|
||||
|
||||
//avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader
|
||||
//in case of multiple autoloader systems
|
||||
if(property_exists($b, $loader[1])) {
|
||||
if (false !== $file = $b::$loader[1]($className)
|
||||
&& $this->exists($className, $b::$loader[1])) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+With swagger 2 provided into /explorer:
|
||||
----------------------------------------
|
||||
|
||||
|
|
@ -326,16 +335,15 @@ PARSEDOWN
|
|||
* Add support of css by adding in Parsedown.php:
|
||||
|
||||
// @CHANGE LDR
|
||||
'class' => $Link['element']['attributes']['class']
|
||||
'class' => $Link['element']['attributes']['class']
|
||||
|
||||
...
|
||||
|
||||
|
||||
// @CHANGE LDR
|
||||
if (preg_match('/{([^}]+)}/', $remainder, $matches2))
|
||||
{
|
||||
$Element['attributes']['class'] = $matches2[1];
|
||||
$remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
|
||||
}
|
||||
if (preg_match('/{([^}]+)}/', $remainder, $matches2)) {
|
||||
$Element['attributes']['class'] = $matches2[1];
|
||||
$remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
|
||||
}
|
||||
|
||||
|
||||
// @CHANGE LDR
|
||||
|
|
@ -368,7 +376,7 @@ Add into Class Google of file OAuth2/Service/Google:
|
|||
}
|
||||
$this->approvalPrompt = $prompt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
JEDITABLE.JS
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ $user->rights->propal->creer=1;
|
|||
$user->rights->propal->propal_advance->validate=1;
|
||||
|
||||
|
||||
if (!empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/" . getDolGlobalString('PROPALE_ADDON').".php")) {
|
||||
if (getDolGlobalString('PROPALE_ADDON') && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/" . getDolGlobalString('PROPALE_ADDON').".php")) {
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/" . getDolGlobalString('PROPALE_ADDON').".php";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
|||
$object->fournisseur = $fields[8];
|
||||
|
||||
$object->name = $fields[13] ? trim($fields[13]) : $fields[0];
|
||||
$object->name_alias = $fields[0]!=$fields[13] ? trim($fields[0]) : '';
|
||||
$object->name_alias = $fields[0] != $fields[13] ? trim($fields[0]) : '';
|
||||
|
||||
$object->address = trim($fields[14]);
|
||||
$object->zip = trim($fields[15]);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -245,6 +245,16 @@ export list="
|
|||
--ignore-table=$base.llx_c_ticketsup_category
|
||||
--ignore-table=$base.llx_c_ticketsup_severity
|
||||
--ignore-table=$base.llx_c_ticketsup_type
|
||||
--ignore-table=$base.llx_cabinetmed_c_banques
|
||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||
--ignore-table=$base.llx_cabinetmed_cons_extrafields
|
||||
--ignore-table=$base.llx_cabinetmed_diaglec
|
||||
--ignore-table=$base.llx_cabinetmed_examaut
|
||||
--ignore-table=$base.llx_cabinetmed_exambio
|
||||
--ignore-table=$base.llx_cabinetmed_examenprescrit
|
||||
--ignore-table=$base.llx_cabinetmed_motifcons
|
||||
--ignore-table=$base.llx_cabinetmed_patient
|
||||
--ignore-table=$base.llx_cabinetmed_societe
|
||||
--ignore-table=$base.llx_congespayes
|
||||
--ignore-table=$base.llx_congespayes_config
|
||||
--ignore-table=$base.llx_congespayes_events
|
||||
|
|
@ -328,6 +338,8 @@ export list="
|
|||
--ignore-table=$base.tmp_llx_accouting_account
|
||||
--ignore-table=$base.tmp_llx_product_batch
|
||||
--ignore-table=$base.tmp_llx_product_batch2
|
||||
--ignore-table=$base.tmp_tmp
|
||||
--ignore-table=$base.tmp_user
|
||||
"
|
||||
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
|
||||
mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ $html .= '<section class="chapter" id="linesofcode">'."\n";
|
|||
$html .= '<h2>Lines of code</h2>'."\n";
|
||||
|
||||
$html .= '<div class="div-table-responsive">'."\n";
|
||||
$html .= '<div class="boxallwidth">'."\n";
|
||||
$html .= '<table class="centpercent">';
|
||||
$html .= '<tr class="loc">';
|
||||
$html .= '<th class="left">Language</th>';
|
||||
|
|
@ -363,19 +364,25 @@ $html .= '<td></td>';
|
|||
$html .= '</tr>';
|
||||
$html .= '</table>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '</section>'."\n";
|
||||
|
||||
$html .= '<section class="chapter" id="projectvalue">'."\n";
|
||||
$html .= '<h2>Project value</h2><br>'."\n";
|
||||
|
||||
$html .= '<div class="boxallwidth">'."\n";
|
||||
$html .= '<div class="box inline-box back1">';
|
||||
$html .= 'COCOMO (Basic organic model) value:<br>';
|
||||
$html .= 'COCOMO value<br><span class="small">(Basic organic model)</span><br>';
|
||||
$html .= '<b>$'.formatNumber((empty($arraycocomo['proj']['currency']) ? 0 : $arraycocomo['proj']['currency']) + (empty($arraycocomo['dep']['currency']) ? 0 : $arraycocomo['dep']['currency']), 2).'</b>';
|
||||
$html .= '</div>';
|
||||
$html .= '<div class="box inline-box back2">';
|
||||
$html .= 'COCOMO (Basic organic model) effort<br>';
|
||||
$html .= 'COCOMO effort<br><span class="small">(Basic organic model)</span><br>';
|
||||
$html .= '<b>'.formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']);
|
||||
$html .= ' monthes people</b><br>';
|
||||
$html .= ' monthes people</b>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '</section>'."\n";
|
||||
|
||||
$tmp = '';
|
||||
|
|
@ -392,12 +399,16 @@ foreach ($output_arrtd as $line) {
|
|||
|
||||
$html .= '<section class="chapter" id="technicaldebt">'."\n";
|
||||
$html .= '<h2>Technical debt <span class="opacitymedium">(PHPStan level '.$phpstanlevel.' -> '.$nblines.' warnings)</span></h2><br>'."\n";
|
||||
|
||||
$html .= '<div class="div-table-responsive">'."\n";
|
||||
$html .= '<div class="boxallwidth">'."\n";
|
||||
$html .= '<table class="list_technical_debt">'."\n";
|
||||
$html .= '<tr><td>File</td><td>Line</td><td>Type</td></tr>'."\n";
|
||||
$html .= $tmp;
|
||||
$html .= '</table>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '</section>'."\n";
|
||||
|
||||
$html .= '
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Count number of different contributors and number of commits for a given year.
|
||||
# Can be used for statistics (for example to generate the inforgraphy of the year)
|
||||
#
|
||||
|
||||
if [ "x$1" = "x" ]; then
|
||||
echo "Usage: $0 YEAR"
|
||||
echo "Usage: $0 YEARSTART [YEAREND]"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
@ -12,10 +13,15 @@ fi
|
|||
FROM=$1-01-01
|
||||
TO=$1-12-31
|
||||
|
||||
echo "Number of contributors for the year"
|
||||
echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l"
|
||||
git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l
|
||||
if [ "x$2" != "x" ]; then
|
||||
TO=$2-12-31
|
||||
fi
|
||||
|
||||
echo "--- Number of contributors for the year"
|
||||
echo "git log --since $FROM --before $TO | grep ^Author | awk -F'<' '{ print $1 }' | iconv -f UTF-8 -t ASCII//TRANSLIT | sort -u -f -i -b | wc -l"
|
||||
git log --since $FROM --before $TO | grep '^Author' | awk -F"<" '{ print $1 }' | iconv -f UTF-8 -t ASCII//TRANSLIT | sort -u -f -i -b | wc -l
|
||||
|
||||
|
||||
echo "Number of commit for the year"
|
||||
git log --pretty='format:%cd' --date=format:'%Y' | uniq -c | awk '{print "Year: "$2", commits: "$1}' | grep "Year: $1"
|
||||
echo "--- Number of commit for the year"
|
||||
echo "git log --pretty='format:%cd' --date=format:'%Y' | sort | uniq -c | awk '{ if (\$2 >= '"$1"') { print \"Year: \"\$2\", commits: \"\$1 } }'"
|
||||
git log --pretty='format:%cd' --date=format:'%Y' | sort | uniq -c | awk '{ if ($2 >= '$1') { print "Year: "$2", commits: "$1 } }'
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
use Rector\Set\ValueObject\LevelSetList;
|
||||
use Rector\Set\ValueObject\SetList;
|
||||
|
||||
return static function (RectorConfig $rectorConfig): void {
|
||||
$rectorConfig->phpVersion(PhpVersion::PHP_71);
|
||||
|
|
@ -26,6 +27,8 @@ return static function (RectorConfig $rectorConfig): void {
|
|||
$rectorConfig->skip([
|
||||
'**/includes/**',
|
||||
'**/custom/**',
|
||||
'**/vendor/**',
|
||||
'**/rector/**', // Disable this line to test the "test.php" file.
|
||||
__DIR__ . '/../../../htdocs/custom/',
|
||||
__DIR__ . '/../../../htdocs/install/doctemplates/*'
|
||||
]);
|
||||
|
|
@ -39,15 +42,33 @@ return static function (RectorConfig $rectorConfig): void {
|
|||
//$rectorConfig->rule(Rector\Php72\Rector\FuncCall\GetClassOnNullRector::class);
|
||||
//$rectorConfig->rule(Rector\Php72\Rector\Assign\ListEachRector::class);
|
||||
//$rectorConfig->rule(Rector\Php72\Rector\FuncCall\ParseStrWithResultArgumentRector::class);
|
||||
//$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class);
|
||||
//$rectorConfig->rule(Rector\Php72\Rector\FuncCall\StringifyDefineRector::class);
|
||||
|
||||
//$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class);
|
||||
|
||||
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class);
|
||||
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector::class);
|
||||
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
|
||||
//$rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class);
|
||||
$rectorConfig->rule(Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class);
|
||||
|
||||
$rectorConfig->rule(Dolibarr\Rector\Renaming\GlobalToFunction::class);
|
||||
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
|
||||
$rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyGlobalToFunction::class);
|
||||
|
||||
// Add all predefined rules to migrate to up to php 71
|
||||
// $rectorConfig->sets([
|
||||
// LevelSetList::UP_TO_PHP_71
|
||||
// ]);
|
||||
// Add all predefined rules to migrate to up to php 71.
|
||||
// Warning this break tab spacing of arrays on several lines
|
||||
/*$rectorConfig->sets([
|
||||
LevelSetList::UP_TO_PHP_70
|
||||
]);*/
|
||||
// Add predefined rules for a given version only
|
||||
//$rectorConfig->import(SetList::PHP_70);
|
||||
//$rectorConfig->import(SetList::PHP_71);
|
||||
//$rectorConfig->import(SetList::PHP_72);
|
||||
//$rectorConfig->import(SetList::PHP_73);
|
||||
//$rectorConfig->import(SetList::PHP_74);
|
||||
//$rectorConfig->import(SetList::PHP_80);
|
||||
//$rectorConfig->import(SetList::PHP_81);
|
||||
//$rectorConfig->import(SetList::PHP_82);
|
||||
//$rectorConfig->import(SetList::PHP_83);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ namespace Dolibarr\Rector\Renaming;
|
|||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr\ArrayItem;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
|
||||
use PhpParser\Node\Expr\BinaryOp\Concat;
|
||||
use PhpParser\Node\Expr\BinaryOp\Equal;
|
||||
|
|
@ -12,6 +14,7 @@ use PhpParser\Node\Expr\BooleanNot;
|
|||
use PhpParser\Node\Expr\Empty_;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
|
|
@ -72,7 +75,7 @@ class GlobalToFunction extends AbstractRector
|
|||
*/
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
return [FuncCall::class, Equal::class, NotEqual::class, Greater::class, GreaterOrEqual::class, Smaller::class, SmallerOrEqual::class, NotIdentical::class, BooleanAnd::class, Concat::class, ArrayDimFetch::class];
|
||||
return [Assign::class, FuncCall::class, MethodCall::class, Equal::class, NotEqual::class, Greater::class, GreaterOrEqual::class, Smaller::class, SmallerOrEqual::class, NotIdentical::class, BooleanAnd::class, Concat::class, ArrayItem::class, ArrayDimFetch::class];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -84,6 +87,39 @@ class GlobalToFunction extends AbstractRector
|
|||
*/
|
||||
public function refactor(Node $node)
|
||||
{
|
||||
if ($node instanceof Node\Expr\Assign) {
|
||||
if (!isset($node->var)) {
|
||||
return;
|
||||
}
|
||||
if ($this->isGlobalVar($node->expr)) {
|
||||
$constName = $this->getConstName($node->expr);
|
||||
if (empty($constName)) {
|
||||
return;
|
||||
}
|
||||
$node->expr = new FuncCall(
|
||||
new Name('getDolGlobalString'),
|
||||
[new Arg($constName)]
|
||||
);
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
if ($node instanceof Node\Expr\ArrayItem) {
|
||||
if (!isset($node->key)) {
|
||||
return;
|
||||
}
|
||||
if ($this->isGlobalVar($node->value)) {
|
||||
$constName = $this->getConstName($node->value);
|
||||
if (empty($constName)) {
|
||||
return;
|
||||
}
|
||||
$node->value = new FuncCall(
|
||||
new Name('getDolGlobalString'),
|
||||
[new Arg($constName)]
|
||||
);
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
|
||||
if ($node instanceof Node\Expr\ArrayDimFetch) {
|
||||
if (!isset($node->dim)) {
|
||||
return;
|
||||
|
|
@ -103,8 +139,9 @@ class GlobalToFunction extends AbstractRector
|
|||
|
||||
if ($node instanceof FuncCall) {
|
||||
$tmpfunctionname = $this->getName($node);
|
||||
// If function is ok(we must avoid a lot of cases like isset, empty)
|
||||
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'make_substitutions', 'min', 'max', 'explode'))) {
|
||||
// If function is ok. We must avoid a lot of cases like isset(), empty()
|
||||
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'dol_hash', 'explode', 'is_numeric', 'length_accountg', 'length_accounta', 'make_substitutions', 'min', 'max', 'trunc', 'urlencode', 'yn'))) {
|
||||
//print "tmpfunctionname=".$tmpfunctionname."\n";
|
||||
$args = $node->getArgs();
|
||||
$nbofparam = count($args);
|
||||
|
||||
|
|
@ -130,6 +167,37 @@ class GlobalToFunction extends AbstractRector
|
|||
return $node;
|
||||
}
|
||||
|
||||
if ($node instanceof MethodCall) {
|
||||
$tmpmethodname = $this->getName($node->name);
|
||||
// If function is ok. We must avoid a lot of cases
|
||||
if (in_array($tmpmethodname, array('fetch', 'idate', 'sanitize', 'select_language', 'trans'))) {
|
||||
//print "tmpmethodname=".$tmpmethodname."\n";
|
||||
$expr = $node->var;
|
||||
$args = $node->getArgs();
|
||||
$nbofparam = count($args);
|
||||
|
||||
if ($nbofparam >= 1) {
|
||||
$tmpargs = $args;
|
||||
foreach ($args as $key => $arg) { // only 1 element in this array
|
||||
//var_dump($key);
|
||||
//var_dump($arg->value);exit;
|
||||
if ($this->isGlobalVar($arg->value)) {
|
||||
$constName = $this->getConstName($arg->value);
|
||||
if (empty($constName)) {
|
||||
return;
|
||||
}
|
||||
$a = new FuncCall(new Name('getDolGlobalString'), [new Arg($constName)]);
|
||||
$tmpargs[$key] = new Arg($a);
|
||||
|
||||
$r = new MethodCall($expr, $tmpmethodname, $tmpargs);
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
|
||||
if ($node instanceof Concat) {
|
||||
if ($this->isGlobalVar($node->left)) {
|
||||
$constName = $this->getConstName($node->left);
|
||||
|
|
|
|||
|
|
@ -1,156 +0,0 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/tools/spider.php
|
||||
* \brief Script to spider Dolibarr app.
|
||||
*
|
||||
* To use it:
|
||||
* - Disable module "bookmark"
|
||||
* - Exclude param optioncss, token, sortfield, sortorder
|
||||
*/
|
||||
|
||||
$crawledLinks = array();
|
||||
const MAX_DEPTH = 2;
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url URL
|
||||
* @param string $depth Depth
|
||||
* @return string String
|
||||
*/
|
||||
function followLink($url, $depth = 0)
|
||||
{
|
||||
global $crawledLinks;
|
||||
$crawling = array();
|
||||
if ($depth > MAX_DEPTH) {
|
||||
echo "<div style='color:red;'>The Crawler is giving up!</div>";
|
||||
return;
|
||||
}
|
||||
$options = array(
|
||||
'http' => array(
|
||||
'method' => "GET",
|
||||
'user-agent' => "gfgBot/0.1\n"
|
||||
)
|
||||
);
|
||||
$context = stream_context_create($options);
|
||||
$doc = new DomDocument();
|
||||
@$doc->loadHTML(file_get_contents($url, false, $context));
|
||||
$links = $doc->getElementsByTagName('a');
|
||||
$pageTitle = getDocTitle($doc, $url);
|
||||
$metaData = getDocMetaData($doc);
|
||||
foreach ($links as $i) {
|
||||
$link = $i->getAttribute('href');
|
||||
if (ignoreLink($link)) {
|
||||
continue;
|
||||
}
|
||||
$link = convertLink($url, $link);
|
||||
if (!in_array($link, $crawledLinks)) {
|
||||
$crawledLinks[] = $link;
|
||||
$crawling[] = $link;
|
||||
insertIntoDatabase($link, $pageTitle, $metaData, $depth);
|
||||
}
|
||||
}
|
||||
foreach ($crawling as $crawlURL) {
|
||||
followLink($crawlURL, $depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $site Site
|
||||
* @param string $path Path
|
||||
* @return string String
|
||||
*/
|
||||
function convertLink($site, $path)
|
||||
{
|
||||
if (substr_compare($path, "//", 0, 2) == 0) {
|
||||
return parse_url($site)['scheme'].$path;
|
||||
} elseif (substr_compare($path, "http://", 0, 7) == 0
|
||||
or substr_compare($path, "https://", 0, 8) == 0
|
||||
or substr_compare($path, "www.", 0, 4) == 0
|
||||
) {
|
||||
return $path;
|
||||
} else {
|
||||
return $site.'/'.$path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url URL
|
||||
* @return boolean
|
||||
*/
|
||||
function ignoreLink($url)
|
||||
{
|
||||
return $url[0] == "#" or substr($url, 0, 11) == "javascript:";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $link URL
|
||||
* @param string $title Title
|
||||
* @param string $metaData Array
|
||||
* @param int $depth Depth
|
||||
* @return void
|
||||
*/
|
||||
function insertIntoDatabase($link, $title, &$metaData, $depth)
|
||||
{
|
||||
//global $crawledLinks;
|
||||
|
||||
echo "Inserting new record {URL= ".$link.", Title = '$title', Description = '".$metaData['description']."', Keywords = ' ".$metaData['keywords']."'}<br/><br/><br/>";
|
||||
|
||||
//²$crawledLinks[]=$link;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $doc Doc
|
||||
* @param string $url URL
|
||||
* @return string URL/Title
|
||||
*/
|
||||
function getDocTitle(&$doc, $url)
|
||||
{
|
||||
$titleNodes = $doc->getElementsByTagName('title');
|
||||
if (count($titleNodes) == 0 or !isset($titleNodes[0]->nodeValue)) {
|
||||
return $url;
|
||||
}
|
||||
$title = str_replace('', '\n', $titleNodes[0]->nodeValue);
|
||||
return (strlen($title) < 1) ? $url : $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $doc Doc
|
||||
* @return array Array
|
||||
*/
|
||||
function getDocMetaData(&$doc)
|
||||
{
|
||||
$metaData = array();
|
||||
$metaNodes = $doc->getElementsByTagName('meta');
|
||||
foreach ($metaNodes as $node) {
|
||||
$metaData[$node->getAttribute("name")] = $node->getAttribute("content");
|
||||
}
|
||||
if (!isset($metaData['description'])) {
|
||||
$metaData['description'] = 'No Description Available';
|
||||
}
|
||||
if (!isset($metaData['keywords'])) {
|
||||
$metaData['keywords'] = '';
|
||||
}
|
||||
return array(
|
||||
'keywords' => str_replace('', '\n', $metaData['keywords']),
|
||||
'description' => str_replace('', '\n', $metaData['description'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
followLink("http://localhost/dolibarr_dev/htdocs");
|
||||
|
|
@ -240,7 +240,7 @@ class autoTranslator
|
|||
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=mb_convert_encoding($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)), 'ISO-8859-1');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -740,7 +740,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
function fieldListAccountModel($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $langs, $db;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -958,7 +958,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
global $form, $mysoc;
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
function fieldListJournal($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
global $form, $mysoc;
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
|
||||
$filename = 'balance';
|
||||
$type_export = 'balance';
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ if ($cancel) {
|
|||
if ($action == "confirm_update") {
|
||||
$error = 0;
|
||||
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
|
||||
if (((float) $debit != 0.0) && ((float) $credit != 0.0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$action = 'update';
|
||||
|
|
@ -130,12 +130,12 @@ if ($action == "confirm_update") {
|
|||
$object->debit = $debit;
|
||||
$object->credit = $credit;
|
||||
|
||||
if (floatval($debit) != 0.0) {
|
||||
if ((float) $debit != 0.0) {
|
||||
$object->montant = $debit; // deprecated
|
||||
$object->amount = $debit;
|
||||
$object->sens = 'D';
|
||||
}
|
||||
if (floatval($credit) != 0.0) {
|
||||
if ((float) $credit != 0.0) {
|
||||
$object->montant = $credit; // deprecated
|
||||
$object->amount = $credit;
|
||||
$object->sens = 'C';
|
||||
|
|
@ -159,7 +159,7 @@ if ($action == "confirm_update") {
|
|||
} elseif ($action == "add") {
|
||||
$error = 0;
|
||||
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
|
||||
if (((float) $debit != 0.0) && ((float) $credit != 0.0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$action = '';
|
||||
|
|
@ -189,13 +189,13 @@ if ($action == "confirm_update") {
|
|||
$object->fk_doc = GETPOSTINT('fk_doc');
|
||||
$object->fk_docdet = GETPOSTINT('fk_docdet');
|
||||
|
||||
if (floatval($debit) != 0.0) {
|
||||
if ((float) $debit != 0.0) {
|
||||
$object->montant = $debit; // deprecated
|
||||
$object->amount = $debit;
|
||||
$object->sens = 'D';
|
||||
}
|
||||
|
||||
if (floatval($credit) != 0.0) {
|
||||
if ((float) $credit != 0.0) {
|
||||
$object->montant = $credit; // deprecated
|
||||
$object->amount = $credit;
|
||||
$object->sens = 'C';
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
|||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
|||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
|
|||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||
*/
|
||||
class AccountancyExport
|
||||
{
|
||||
// Type of export. Used into $conf->global->ACCOUNTING_EXPORT_MODELCSV
|
||||
// Types of export.
|
||||
public static $EXPORT_TYPE_CONFIGURABLE = 1; // CSV
|
||||
public static $EXPORT_TYPE_AGIRIS = 10;
|
||||
public static $EXPORT_TYPE_EBP = 15;
|
||||
|
|
@ -102,8 +102,8 @@ class AccountancyExport
|
|||
global $conf, $hookmanager;
|
||||
|
||||
$this->db = $db;
|
||||
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$this->end_line = !getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? "\n" : (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n");
|
||||
$this->separator = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
$this->end_line = getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n") : "\n";
|
||||
|
||||
$hookmanager->initHooks(array('accountancyexport'));
|
||||
}
|
||||
|
|
@ -201,9 +201,9 @@ class AccountancyExport
|
|||
'param' => array(
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => array(
|
||||
'label' => $langs->trans('Modelcsv_configurable'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => !getDolGlobalString('ACCOUNTING_EXPORT_FORMAT') ? 'txt' : $conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => !getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV') ? ',' : $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => !getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? 1 : $conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_FORMAT' => getDolGlobalString('ACCOUNTING_EXPORT_FORMAT', 'txt'),
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV', ','),
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE', 1),
|
||||
'ACCOUNTING_EXPORT_DATE' => getDolGlobalString('ACCOUNTING_EXPORT_DATE', '%Y-%m-%d'),
|
||||
),
|
||||
self::$EXPORT_TYPE_CEGID => array(
|
||||
|
|
@ -829,7 +829,7 @@ class AccountancyExport
|
|||
* @param array $objectLines data
|
||||
* @param resource $exportFile [=null] File resource to export or print if null
|
||||
* @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name']
|
||||
* @param bool $withAttachment [=0] Not add files or 1 to have attached in an archive
|
||||
* @param int $withAttachment [=0] Not add files or 1 to have attached in an archive
|
||||
* @return array Archive file list : array of ['path', 'name']
|
||||
*/
|
||||
public function exportQuadratus($objectLines, $exportFile = null, $archiveFileList = array(), $withAttachment = 0)
|
||||
|
|
@ -839,8 +839,6 @@ class AccountancyExport
|
|||
$end_line = "\r\n";
|
||||
|
||||
// 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 ($objectLines as $line) {
|
||||
// Clean some data
|
||||
$line->doc_ref = dol_string_unaccent($line->doc_ref);
|
||||
|
|
@ -871,11 +869,11 @@ class AccountancyExport
|
|||
if ($line->doc_type == 'customer_invoice') {
|
||||
$tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 7));
|
||||
$tab['filler'] = str_repeat(' ', 52);
|
||||
$tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8);
|
||||
$tab['coll_compte'] = str_pad(self::trunc(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), 8), 8);
|
||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||
$tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 7));
|
||||
$tab['filler'] = str_repeat(' ', 52);
|
||||
$tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8);
|
||||
$tab['coll_compte'] = str_pad(self::trunc(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), 8), 8);
|
||||
} else {
|
||||
$tab['filler'] = str_repeat(' ', 59);
|
||||
$tab['coll_compte'] = str_pad(' ', 8);
|
||||
|
|
@ -938,7 +936,6 @@ class AccountancyExport
|
|||
|
||||
// Force date format : %d%m%y
|
||||
if (!empty($line->date_lim_reglement)) {
|
||||
//$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy
|
||||
} else {
|
||||
$tab['date_echeance'] = '000000';
|
||||
|
|
@ -1061,10 +1058,6 @@ class AccountancyExport
|
|||
$end_line = "\r\n";
|
||||
$index = 1;
|
||||
|
||||
//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
|
||||
|
||||
// Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
|
|
@ -1109,7 +1102,6 @@ class AccountancyExport
|
|||
$tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
if (!empty($line->date_lim_reglement)) {
|
||||
//$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, '%d%m%Y');
|
||||
} else {
|
||||
$tab['date_echeance'] = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
|
|
@ -1276,7 +1268,7 @@ class AccountancyExport
|
|||
$separator = $this->separator;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date_document = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$date_document = dol_print_date($line->doc_date, getDolGlobalString('ACCOUNTING_EXPORT_DATE'));
|
||||
|
||||
$tab = array();
|
||||
// export configurable
|
||||
|
|
@ -1309,7 +1301,7 @@ class AccountancyExport
|
|||
* @param array $objectLines data
|
||||
* @param resource $exportFile [=null] File resource to export or print if null
|
||||
* @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name']
|
||||
* @param bool $withAttachment [=0] Not add files or 1 to have attached in an archive
|
||||
* @param int $withAttachment [=0] Not add files or 1 to have attached in an archive
|
||||
* @return array Archive file list : array of ['path', 'name']
|
||||
*/
|
||||
public function exportFEC($objectLines, $exportFile = null, $archiveFileList = array(), $withAttachment = 0)
|
||||
|
|
@ -1520,7 +1512,7 @@ class AccountancyExport
|
|||
* @param array $objectLines data
|
||||
* @param resource $exportFile [=null] File resource to export or print if null
|
||||
* @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name']
|
||||
* @param bool $withAttachment [=0] Not add files or 1 to have attached in an archive
|
||||
* @param int $withAttachment [=0] Not add files or 1 to have attached in an archive
|
||||
* @return array Archive file list : array of ['path', 'name']
|
||||
*/
|
||||
public function exportFEC2($objectLines, $exportFile = null, $archiveFileList = array(), $withAttachment = 0)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class AccountancyImport
|
|||
public function cleanAmount(&$arrayrecord, $listfields, $record_key)
|
||||
{
|
||||
$value_trim = trim($arrayrecord[$record_key]['val']);
|
||||
return floatval($value_trim);
|
||||
return (float) $value_trim;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,8 +98,8 @@ class AccountancyImport
|
|||
$debit_index = $field_index_list['debit'];
|
||||
$credit_index = $field_index_list['credit'];
|
||||
|
||||
$debit = floatval($arrayrecord[$debit_index]['val']);
|
||||
$credit = floatval($arrayrecord[$credit_index]['val']);
|
||||
$debit = (float) $arrayrecord[$debit_index]['val'];
|
||||
$credit = (float) $arrayrecord[$credit_index]['val'];
|
||||
if (!empty($debit)) {
|
||||
$amount = $debit;
|
||||
} else {
|
||||
|
|
@ -127,7 +127,7 @@ class AccountancyImport
|
|||
if (isset($field_index_list['debit'])) {
|
||||
$debit_index = $field_index_list['debit'];
|
||||
|
||||
$debit = floatval($arrayrecord[$debit_index]['val']);
|
||||
$debit = (float) $arrayrecord[$debit_index]['val'];
|
||||
if (!empty($debit)) {
|
||||
$sens = 'D';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -878,9 +878,9 @@ class AccountingAccount extends CommonObject
|
|||
if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) {
|
||||
$accountdeposittoventilated = new self($this->db);
|
||||
if ($type == 'customer') {
|
||||
$result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
$result = $accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 1);
|
||||
} elseif ($type == 'supplier') {
|
||||
$result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1);
|
||||
$result = $accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 1);
|
||||
}
|
||||
if (isset($result) && $result < 0) {
|
||||
return -1;
|
||||
|
|
@ -901,9 +901,9 @@ class AccountingAccount extends CommonObject
|
|||
if ($facture->type == $facture::TYPE_CREDIT_NOTE && $invoiceSource->type == $facture::TYPE_DEPOSIT) {
|
||||
$accountdeposittoventilated = new self($this->db);
|
||||
if ($type == 'customer') {
|
||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
$accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 1);
|
||||
} elseif ($type == 'supplier') {
|
||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1);
|
||||
$accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 1);
|
||||
}
|
||||
$code_l = $accountdeposittoventilated->ref;
|
||||
$code_p = '';
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ class AccountingJournal extends CommonObject
|
|||
}
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'";
|
||||
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) . "'";
|
||||
}
|
||||
$sql .= " ORDER BY ad.depreciation_date";
|
||||
|
||||
|
|
@ -616,12 +616,12 @@ class AccountingJournal extends CommonObject
|
|||
$disposal_date = $pre_data_info['disposal']['date'];
|
||||
|
||||
if ((!($date_start && $date_end) || ($date_start <= $disposal_date && $disposal_date <= $date_end)) &&
|
||||
(!getDolGlobalString('ACCOUNTING_DATE_START_BINDING') || $conf->global->ACCOUNTING_DATE_START_BINDING <= $disposal_date)
|
||||
(!getDolGlobalString('ACCOUNTING_DATE_START_BINDING') || getDolGlobalInt('ACCOUNTING_DATE_START_BINDING') <= $disposal_date)
|
||||
) {
|
||||
$disposal_amount = $pre_data_info['disposal']['amount'];
|
||||
$disposal_subject_to_vat = $pre_data_info['disposal']['subject_to_vat'];
|
||||
$disposal_date_formatted = dol_print_date($disposal_date, 'day');
|
||||
$disposal_vat = getDolGlobalInt('ASSET_DISPOSAL_VAT') > 0 ? $conf->global->ASSET_DISPOSAL_VAT : 20;
|
||||
$disposal_vat = getDolGlobalInt('ASSET_DISPOSAL_VAT') > 0 ? getDolGlobalInt('ASSET_DISPOSAL_VAT') : 20;
|
||||
|
||||
// Get accountancy codes
|
||||
//---------------------------
|
||||
|
|
@ -930,7 +930,7 @@ class AccountingJournal extends CommonObject
|
|||
global $conf, $langs, $hookmanager;
|
||||
|
||||
if (empty($sep)) {
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
}
|
||||
$out = '';
|
||||
|
||||
|
|
@ -1015,7 +1015,7 @@ class AccountingJournal extends CommonObject
|
|||
'found' => true,
|
||||
'label' => $accountingaccount->label,
|
||||
'code_formatted_1' => length_accounta(html_entity_decode($account)),
|
||||
'label_formatted_1' => utf8_decode(dol_trunc($accountingaccount->label, 32)),
|
||||
'label_formatted_1' => mb_convert_encoding(dol_trunc($accountingaccount->label, 32), 'ISO-8859-1'),
|
||||
'label_formatted_2' => dol_trunc($accountingaccount->label, 32),
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2124,7 +2124,7 @@ class BookKeeping extends CommonObject
|
|||
* @param array $event Event options
|
||||
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
|
||||
* @param int $select_out Set value returned by select 0=rowid (default), 1=account_number
|
||||
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||
* @param string $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ if ($action == 'validatehistory') {
|
|||
$sql .= " AND l.product_type <= 2";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
if ($validatemonth && $validateyear) {
|
||||
$sql .= dolSqlDateFilter('f.datef', 0, $validatemonth, $validateyear);
|
||||
|
|
@ -329,7 +329,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -337,7 +337,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -357,7 +357,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -371,7 +371,7 @@ $sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
|
|||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql .= " AND fd.product_type <= 2";
|
||||
|
|
@ -405,27 +405,27 @@ if ($resql) {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
$startmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$startmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if ($startmonth > 12) {
|
||||
$startmonth -= 12;
|
||||
}
|
||||
$startyear = ($startmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + 11;
|
||||
$startyear = ($startmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$endmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + 11;
|
||||
if ($endmonth > 12) {
|
||||
$endmonth -= 12;
|
||||
}
|
||||
$endyear = ($endmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endyear = ($endmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_date_startday=1&search_date_startmonth='.((int) $startmonth).'&search_date_startyear='.((int) $startyear).'&search_date_endday=&search_date_endmonth='.((int) $endmonth).'&search_date_endyear='.((int) $endyear), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -466,7 +466,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -474,7 +474,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -494,7 +494,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -508,7 +508,7 @@ $sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
|
|||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
|
|
@ -551,11 +551,11 @@ if ($resql) {
|
|||
print '</td>';
|
||||
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -590,7 +590,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -600,7 +600,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
|
||||
$sql = "SELECT '".$db->escape($langs->trans("TotalVente"))."' AS total,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -613,7 +613,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
|
|
@ -650,7 +650,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -662,7 +662,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
// With old situation invoice setup
|
||||
$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -684,7 +684,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
} else {
|
||||
$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -710,7 +710,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
|||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -506,7 +506,7 @@ if ($result) {
|
|||
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -76,11 +76,11 @@ $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
|||
|
||||
// Define begin binding date
|
||||
if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$search_date_start = $db->idate($conf->global->ACCOUNTING_DATE_START_BINDING);
|
||||
$search_date_start = $db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'));
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -660,7 +660,7 @@ if ($result) {
|
|||
// Description of line
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facture_static_det->desc);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -212,7 +212,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -233,7 +233,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
|
|||
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
|
|
@ -271,27 +271,27 @@ if ($resql) {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
$startmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$startmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if ($startmonth > 12) {
|
||||
$startmonth -= 12;
|
||||
}
|
||||
$startyear = ($startmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + 11;
|
||||
$startyear = ($startmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$endmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + 11;
|
||||
if ($endmonth > 12) {
|
||||
$endmonth -= 12;
|
||||
}
|
||||
$endyear = ($endmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endyear = ($endmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_date_startday=1&search_date_startmonth='.((int) $startmonth).'&search_date_startyear='.((int) $startyear).'&search_date_endday=&search_date_endmonth='.((int) $endmonth).'&search_date_endyear='.((int) $endyear), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -333,7 +333,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -344,7 +344,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -358,7 +358,7 @@ $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
|
|||
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
|
|
@ -421,7 +421,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -431,7 +431,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
|
||||
$sql = "SELECT '".$db->escape($langs->trans("TotalExpenseReport"))."' AS label,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -444,7 +444,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_s
|
|||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -414,7 +414,7 @@ if ($result) {
|
|||
// Fees description -- Can be null
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -69,11 +69,11 @@ $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_en
|
|||
|
||||
// Define begin binding date
|
||||
if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$search_date_start = $db->idate($conf->global->ACCOUNTING_DATE_START_BINDING);
|
||||
$search_date_start = $db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'));
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -489,7 +489,7 @@ if ($result) {
|
|||
// Fees description -- Can be null
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -607,16 +607,16 @@ if (!$error && $action == 'writebookkeeping') {
|
|||
$now = dol_now();
|
||||
|
||||
$accountingaccountcustomer = new AccountingAccount($db);
|
||||
$accountingaccountcustomer->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||
$accountingaccountcustomer->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), true);
|
||||
|
||||
$accountingaccountsupplier = new AccountingAccount($db);
|
||||
$accountingaccountsupplier->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||
$accountingaccountsupplier->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), true);
|
||||
|
||||
$accountingaccountpayment = new AccountingAccount($db);
|
||||
$accountingaccountpayment->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||
$accountingaccountpayment->fetch(null, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true);
|
||||
|
||||
$accountingaccountsuspense = new AccountingAccount($db);
|
||||
$accountingaccountsuspense->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE, true);
|
||||
$accountingaccountsuspense->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'), true);
|
||||
|
||||
$error = 0;
|
||||
foreach ($tabpay as $key => $val) { // $key is rowid into llx_bank
|
||||
|
|
@ -736,23 +736,23 @@ if (!$error && $action == 'writebookkeeping') {
|
|||
$lettering = true;
|
||||
$bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
|
||||
$bookkeeping->label_compte = $accountingaccountcustomer->label;
|
||||
} elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||
$lettering = true;
|
||||
$bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
|
||||
$bookkeeping->label_compte = $accountingaccountsupplier->label;
|
||||
} elseif ($tabtype[$key] == 'payment_expensereport') {
|
||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$bookkeeping->label_compte = $accountingaccountpayment->label;
|
||||
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$bookkeeping->label_compte = $accountingaccountpayment->label;
|
||||
} elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||
$bookkeeping->subledger_account = '';
|
||||
|
|
@ -801,7 +801,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||
// Temporary account
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE');
|
||||
$bookkeeping->label_compte = $accountingaccountsuspense->label;
|
||||
}
|
||||
}
|
||||
|
|
@ -1305,7 +1305,7 @@ if (empty($action) || $action == 'view') {
|
|||
if (!getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') || getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') == '-1') {
|
||||
$accounttoshow = '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||
} else {
|
||||
$accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
$accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'))).'</span>'; // We will use a waiting account
|
||||
}
|
||||
} else {
|
||||
// We will refuse writing
|
||||
|
|
@ -1396,18 +1396,13 @@ if (empty($action) || $action == 'view') {
|
|||
{
|
||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||
}
|
||||
else */ print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
else */
|
||||
print length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'));
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
/*if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||
}
|
||||
else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
*/
|
||||
print "</td>";
|
||||
print "<td>".$reflabel."</td>";
|
||||
print "<td>".dol_escape_htmltag($reflabel)."</td>";
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ if ($date_start && $date_end) {
|
|||
}
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already') {
|
||||
|
|
@ -162,8 +162,8 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
// Variables
|
||||
$account_salary = (getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined';
|
||||
$account_vat = (getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT')) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined';
|
||||
$account_salary = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', 'NotDefined');
|
||||
$account_vat = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
|
|
@ -247,7 +247,7 @@ if ($action == 'writebookkeeping' && !$error) {
|
|||
$error = 0;
|
||||
|
||||
$accountingaccountexpense = new AccountingAccount($db);
|
||||
$accountingaccountexpense->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||
$accountingaccountexpense->fetch(null, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true);
|
||||
|
||||
foreach ($taber as $key => $val) { // Loop on each expense report
|
||||
$errorforline = 0;
|
||||
|
|
@ -279,7 +279,7 @@ if ($action == 'writebookkeeping' && !$error) {
|
|||
$bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$bookkeeping->label_compte = $accountingaccountexpense->label;
|
||||
|
||||
$bookkeeping->label_operation = $tabuser[$key]['name'];
|
||||
|
|
@ -488,7 +488,7 @@ $userstatic = new User($db);
|
|||
|
||||
// Export
|
||||
if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
|
||||
$filename = 'journal';
|
||||
$type_export = 'journal';
|
||||
|
|
@ -726,7 +726,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
$accountoshow = length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'));
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -808,12 +808,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
@ -829,12 +829,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '""'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($accountingaccount->label, 32)).'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($accountingaccount->label, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$val["refsuppliersologest"].' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
@ -881,12 +881,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '""'.$sep;
|
||||
print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$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.'"';
|
||||
|
|
@ -901,12 +901,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
|
|||
|
|
@ -869,12 +869,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY')).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty").'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty").'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
@ -888,12 +888,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
@ -909,12 +909,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '""'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($accountingaccount->label, 32)).'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($accountingaccount->label, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
@ -938,12 +938,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '""'.$sep;
|
||||
print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$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.'"';
|
||||
|
|
@ -958,12 +958,12 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
|||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 32), 'ISO-8859-1').'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '""'.$sep;
|
||||
print '"'.$langs->trans("RevenueStamp").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("RevenueStamp").'"'.$sep;
|
||||
print '"'.mb_convert_encoding(dol_trunc($companystatic->name, 16), 'ISO-8859-1').' - '.$invoicestatic->ref.' - '.$langs->trans("RevenueStamp").'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ if ($action == 'validatehistory') {
|
|||
$sql .= " AND l.product_type <= 2";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
if ($validatemonth && $validateyear) {
|
||||
$sql .= dolSqlDateFilter('f.datef', 0, $validatemonth, $validateyear);
|
||||
|
|
@ -322,7 +322,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -330,7 +330,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -350,7 +350,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@ $sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
|
|||
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND ff.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
|
|
@ -393,27 +393,27 @@ if ($resql) {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
$startmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$startmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if ($startmonth > 12) {
|
||||
$startmonth -= 12;
|
||||
}
|
||||
$startyear = ($startmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + 11;
|
||||
$startyear = ($startmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$endmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + 11;
|
||||
if ($endmonth > 12) {
|
||||
$endmonth -= 12;
|
||||
}
|
||||
$endyear = ($endmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endyear = ($endmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_date_startday=1&search_date_startmonth='.((int) $startmonth).'&search_date_startyear='.((int) $startyear).'&search_date_endday=&search_date_endmonth='.((int) $endmonth).'&search_date_endyear='.((int) $endyear), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -454,7 +454,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -462,7 +462,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -482,7 +482,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -496,7 +496,7 @@ $sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
|
|||
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND ff.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
|
|
@ -566,7 +566,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -576,7 +576,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
|
||||
$sql = "SELECT '".$db->escape($langs->trans("CAHTF"))."' AS label,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -589,7 +589,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
$sql .= " AND ff.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
|||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -536,7 +536,7 @@ if ($result) {
|
|||
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
|||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -119,7 +119,7 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
|||
|
||||
// Define begin binding date
|
||||
if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$search_date_start = $db->idate($conf->global->ACCOUNTING_DATE_START_BINDING);
|
||||
$search_date_start = $db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -687,7 +687,7 @@ if ($result) {
|
|||
// Description of line
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facturefourn_static_det->desc, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facturefourn_static_det->desc);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -280,35 +280,35 @@ class Adherent extends CommonObject
|
|||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => 1, 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 12, 'index' => 1),
|
||||
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => 1, 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 12, 'index' => 1),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
||||
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30, 'showoncombobox'=>1),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox'=>1),
|
||||
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => -1, 'position' => 40),
|
||||
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 250),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox'=>1),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox'=>1),
|
||||
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => 1, 'position' => 40),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 55),
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MorPhy', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'showoncombobox'=>2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => -1, 'position' => 70),
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox'=>2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70),
|
||||
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
|
||||
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85),
|
||||
'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90),
|
||||
'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95),
|
||||
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => -1, 'position' => 100),
|
||||
'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 105),
|
||||
'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => 1, 'position' => 95),
|
||||
'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115),
|
||||
'phone_perso' => array('type' => 'varchar(30)', 'label' => 'Phone perso', 'enabled' => 1, 'visible' => -1, 'position' => 120),
|
||||
'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'Phone mobile', 'enabled' => 1, 'visible' => -1, 'position' => 125),
|
||||
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 126),
|
||||
'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>127),
|
||||
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 128),
|
||||
'birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'visible' => -1, 'position' => 130),
|
||||
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 132),
|
||||
'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135),
|
||||
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145),
|
||||
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 150),
|
||||
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 150),
|
||||
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=> 153),
|
||||
'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
|
||||
'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160),
|
||||
|
|
@ -319,8 +319,7 @@ class Adherent extends CommonObject
|
|||
'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user mod', 'enabled' => 1, 'visible' => -1, 'position' => 185),
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190),
|
||||
'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500,
|
||||
'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')),
|
||||
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805)
|
||||
);
|
||||
|
|
@ -352,7 +351,7 @@ class Adherent extends CommonObject
|
|||
{
|
||||
$this->db = $db;
|
||||
$this->statut = self::STATUS_DRAFT;
|
||||
$this->status = $this->statut;
|
||||
$this->status = self::STATUS_DRAFT;
|
||||
// l'adherent n'est pas public par defaut
|
||||
$this->public = 0;
|
||||
// les champs optionnels sont vides
|
||||
|
|
@ -416,7 +415,7 @@ class Adherent extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
dol_syslog('send_an_email msgishtml='.$msgishtml);
|
||||
dol_syslog('sendEmail msgishtml='.$msgishtml);
|
||||
|
||||
$texttosend = $this->makeSubstitution($text);
|
||||
$subjecttosend = $this->makeSubstitution($subject);
|
||||
|
|
@ -708,7 +707,7 @@ class Adherent extends CommonObject
|
|||
*/
|
||||
public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
global $langs, $hookmanager;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
|
@ -1361,7 +1360,7 @@ class Adherent extends CommonObject
|
|||
* @param bool $fetch_subscriptions To load member subscriptions
|
||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||
*/
|
||||
public function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
|
||||
public function fetch($rowid, $ref = '', $fk_soc = 0, $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -1413,7 +1412,7 @@ class Adherent extends CommonObject
|
|||
|
||||
$this->civility_id = $obj->civility_code; // Bad. Kept for backard compatibility
|
||||
$this->civility_code = $obj->civility_code;
|
||||
$this->civility = $obj->civility_code ? ($langs->trans("Civility".$obj->civility_code) != ("Civility".$obj->civility_code) ? $langs->trans("Civility".$obj->civility_code) : $obj->civility_code) : '';
|
||||
$this->civility = $obj->civility_code ? ($langs->trans("Civility".$obj->civility_code) != "Civility".$obj->civility_code ? $langs->trans("Civility".$obj->civility_code) : $obj->civility_code) : '';
|
||||
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->lastname = $obj->lastname;
|
||||
|
|
@ -1679,7 +1678,7 @@ class Adherent extends CommonObject
|
|||
* @param string $num_chq Numero cheque (if Id bank account provided)
|
||||
* @param string $emetteur_nom Name of cheque writer
|
||||
* @param string $emetteur_banque Name of bank of cheque
|
||||
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
|
||||
* @param int $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
|
||||
* @param string $ext_payment_id External id of payment (for example Stripe charge id)
|
||||
* @param string $ext_payment_site Name of external paymentmode (for example 'stripe')
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
|
|
@ -1818,7 +1817,7 @@ class Adherent extends CommonObject
|
|||
// Add line to draft invoice
|
||||
$idprodsubscription = 0;
|
||||
if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled("product") || isModEnabled("service"))) {
|
||||
$idprodsubscription = $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS;
|
||||
$idprodsubscription = getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
||||
}
|
||||
|
||||
$vattouse = 0;
|
||||
|
|
@ -2045,8 +2044,6 @@ class Adherent extends CommonObject
|
|||
*/
|
||||
public function exclude($user)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Check parameters
|
||||
|
|
@ -2093,7 +2090,7 @@ class Adherent extends CommonObject
|
|||
public function add_to_abo()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
$mailmanspip = new MailmanSpip($this->db);
|
||||
|
|
@ -2172,7 +2169,7 @@ class Adherent extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) {
|
||||
if (getDolGlobalString('ADHERENT_USE_SPIP') && isModEnabled('mailmanspip')) {
|
||||
$result = $mailmanspip->del_to_spip($this);
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $mailmanspip->error;
|
||||
|
|
@ -2601,7 +2598,7 @@ class Adherent extends CommonObject
|
|||
if ($this->model_pdf) {
|
||||
$modele = $this->model_pdf;
|
||||
} elseif (getDolGlobalString('ADHERENT_ADDON_PDF')) {
|
||||
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
||||
$modele = getDolGlobalString('ADHERENT_ADDON_PDF');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2700,7 +2697,7 @@ class Adherent extends CommonObject
|
|||
$dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]."," . getDolGlobalString('LDAP_MEMBER_DN');
|
||||
}
|
||||
if ($mode == 1) {
|
||||
$dn = $conf->global->LDAP_MEMBER_DN;
|
||||
$dn = getDolGlobalString('LDAP_MEMBER_DN');
|
||||
}
|
||||
if ($mode == 2) {
|
||||
$dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')];
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class AdherentStats extends Stats
|
|||
);
|
||||
$totalrow = 0;
|
||||
foreach ($MembersCountArray[$objp->fk_adherent_type] as $key=>$nb) {
|
||||
if ($key!='label') {
|
||||
if ($key != 'label') {
|
||||
$totalrow += $nb;
|
||||
$totalstatus[$key] += $nb;
|
||||
}
|
||||
|
|
@ -311,7 +311,7 @@ class AdherentStats extends Stats
|
|||
);
|
||||
$totalrow = 0;
|
||||
foreach ($MembersCountArray[$objp->fk_categorie] as $key=>$nb) {
|
||||
if ($key!='label') {
|
||||
if ($key != 'label') {
|
||||
$totalrow += $nb;
|
||||
$totalstatus[$key] += $nb;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,9 +271,6 @@ class Members extends DolibarrApi
|
|||
} else {
|
||||
throw new RestException(503, 'Error when retrieve member list : '.$this->db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
throw new RestException(404, 'No member found');
|
||||
}
|
||||
|
||||
return $obj_ret;
|
||||
}
|
||||
|
|
@ -543,10 +540,6 @@ class Members extends DolibarrApi
|
|||
|
||||
$result = $categories->getListForItem($id, 'member', $sortfield, $sortorder, $limit, $page);
|
||||
|
||||
if (empty($result)) {
|
||||
throw new RestException(404, 'No category found');
|
||||
}
|
||||
|
||||
if ($result < 0) {
|
||||
throw new RestException(503, 'Error when retrieve category list : '.$categories->error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,9 +136,6 @@ class MembersTypes extends DolibarrApi
|
|||
} else {
|
||||
throw new RestException(503, 'Error when retrieve member type list : '.$this->db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
throw new RestException(404, 'No member type found');
|
||||
}
|
||||
|
||||
return $obj_ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,9 +133,6 @@ class Subscriptions extends DolibarrApi
|
|||
} else {
|
||||
throw new RestException(503, 'Error when retrieve subscription list : '.$this->db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
throw new RestException(404, 'No Subscription found');
|
||||
}
|
||||
|
||||
return $obj_ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,91 +0,0 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/adherents/htpasswd.php
|
||||
* \ingroup member
|
||||
* \brief Export page htpasswd of the membership file
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
|
||||
$status = GETPOST('status', 'int');
|
||||
$cotis = GETPOST('cotis', 'int');
|
||||
|
||||
$sortfield = GETPOST('sortfield', 'alphanohtml');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('adherent')) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->hasRight('adherent', 'export')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if (empty($sortorder)) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if (empty($sortfield)) {
|
||||
$sortfield = "d.login";
|
||||
}
|
||||
|
||||
$sql = "SELECT d.login, d.pass, d.datefin";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
|
||||
$sql .= " WHERE d.statut = ".((int) $status);
|
||||
if ($cotis == 1) {
|
||||
$sql .= " AND datefin > '".$db->idate($now)."'";
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
//$sql.=$db->plimit($conf->liste_limit, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$param = '';
|
||||
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());
|
||||
print $objp->login.":".$htpass."<br>\n";
|
||||
$i++;
|
||||
}
|
||||
print "<hr>\n";
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
@ -150,32 +150,57 @@ $arrayfields = array(
|
|||
'd.lastname'=>array('label'=>"Lastname", 'checked'=>1),
|
||||
'd.firstname'=>array('label'=>"Firstname", 'checked'=>1),
|
||||
'd.gender'=>array('label'=>"Gender", 'checked'=>0),
|
||||
'd.company'=>array('label'=>"Company", 'checked'=>1),
|
||||
'd.company'=>array('label'=>"Company", 'checked'=>1, 'position'=>70),
|
||||
'd.login'=>array('label'=>"Login", 'checked'=>1),
|
||||
'd.morphy'=>array('label'=>"MemberNature", 'checked'=>1),
|
||||
't.libelle'=>array('label'=>"Type", 'checked'=>1),
|
||||
'd.email'=>array('label'=>"Email", 'checked'=>1),
|
||||
't.libelle'=>array('label'=>"Type", 'checked'=>1, 'position'=>55),
|
||||
'd.address'=>array('label'=>"Address", 'checked'=>0),
|
||||
'd.zip'=>array('label'=>"Zip", 'checked'=>0),
|
||||
'd.town'=>array('label'=>"Town", 'checked'=>0),
|
||||
'd.phone'=>array('label'=>"Phone", 'checked'=>0),
|
||||
'd.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0),
|
||||
'd.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>0),
|
||||
'state.nom'=>array('label'=>"State", 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||
'd.email'=>array('label'=>"Email", 'checked'=>1),
|
||||
'state.nom'=>array('label'=>"State", 'checked'=>0, 'position'=>90),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>95),
|
||||
/*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0),
|
||||
'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/
|
||||
'd.datefin'=>array('label'=>"EndSubscription", 'checked'=>1, 'position'=>500),
|
||||
'd.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
'd.birth'=>array('label'=>"Birthday", 'checked'=>0, 'position'=>500),
|
||||
'd.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
'd.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
||||
'd.datefin'=>array('label'=>"EndSubscription"),
|
||||
'd.datec'=>array('label'=>"DateCreation"),
|
||||
'd.birth'=>array('label'=>"Birthday"),
|
||||
'd.tms'=>array('label'=>"DateModificationShort"),
|
||||
'd.statut'=>array('label'=>"Status"),
|
||||
'd.import_key'=>array('label'=>"ImportId"),
|
||||
);
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
|
||||
|
||||
// Complete array of fields for columns
|
||||
$tableprefix = 'd';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (!array_key_exists($tableprefix.'.'.$key, $arrayfields)) { // Discard record not into $arrayfields
|
||||
continue;
|
||||
}
|
||||
// If $val['visible']==0, then we never show the field
|
||||
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>dol_eval($val['enabled'], 1),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
//var_dump($arrayfields);exit;
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent');
|
||||
|
||||
|
|
@ -1102,6 +1127,8 @@ while ($i < $imaxinloop) {
|
|||
}
|
||||
$memberstatic->company = $companyname;
|
||||
|
||||
$object = $memberstatic;
|
||||
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti
|
|||
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
|
||||
$labeltouse = getDolGlobalString('ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION');
|
||||
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
|
@ -869,7 +869,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
|
|||
print "\n\n<!-- Form add subscription -->\n";
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
//var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE));
|
||||
//var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly);
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$(".bankswitchclass, .bankswitchclass2").'.(($bankdirect || $bankviainvoice) ? 'show()' : 'hide()').';
|
||||
|
|
@ -1061,7 +1061,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
|
|||
}
|
||||
if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product') || isModEnabled('service'))) {
|
||||
$prodtmp = new Product($db);
|
||||
$result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
$result = $prodtmp->fetch(getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodtmp->error, 'errors');
|
||||
}
|
||||
|
|
@ -1091,7 +1091,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
|
|||
}
|
||||
if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product')|| isModEnabled('service'))) {
|
||||
$prodtmp = new Product($db);
|
||||
$result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
$result = $prodtmp->fetch(getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodtmp->error, 'errors');
|
||||
}
|
||||
|
|
@ -1158,7 +1158,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
|
|||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
|
||||
$labeltouse = getDolGlobalString('ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION');
|
||||
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ $action = GETPOST('action', 'alpha');
|
|||
if (!getDolGlobalString('AGENDA_EXT_NB')) {
|
||||
$conf->global->AGENDA_EXT_NB = 5;
|
||||
}
|
||||
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
|
||||
$MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
|
||||
|
||||
// List of available colors
|
||||
$colorlist = array('BECEDD', 'DDBECE', 'BFDDBE', 'F598B4', 'F68654', 'CBF654', 'A4A4A5');
|
||||
|
|
@ -161,7 +161,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
|
|||
if (!getDolGlobalString('AGENDA_EXT_NB')) {
|
||||
$conf->global->AGENDA_EXT_NB = 5;
|
||||
}
|
||||
$MAXAGENDA = !getDolGlobalString('AGENDA_EXT_NB') ? 5 : $conf->global->AGENDA_EXT_NB;
|
||||
$MAXAGENDA = getDolGlobalInt('AGENDA_EXT_NB', 5);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
|
|
|||
|
|
@ -177,37 +177,37 @@ $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
|||
// Show message
|
||||
$message = '';
|
||||
|
||||
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank" rel="noopener noreferrer">';
|
||||
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'" target="_blank" rel="noopener noreferrer">';
|
||||
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : 'KEYNOTDEFINED').'</a>';
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
|
||||
$message .= '<div class="urllink">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'">';
|
||||
if (getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) {
|
||||
$message .= ' <a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">'.img_picto('', 'download').'</a>';
|
||||
$message .= ' <a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'">'.img_picto('', 'download').'</a>';
|
||||
}
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('onlinepaymenturl1');
|
||||
$message .= '<br>';
|
||||
|
||||
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank" rel="noopener noreferrer">';
|
||||
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'" target="_blank" rel="noopener noreferrer">';
|
||||
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : 'KEYNOTDEFINED').'</a>';
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
|
||||
$message .= '<div class="urllink">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'">';
|
||||
if (getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) {
|
||||
$message .= ' <a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">'.img_picto('', 'download').'</a>';
|
||||
$message .= ' <a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'">'.img_picto('', 'download').'</a>';
|
||||
}
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('onlinepaymenturl2');
|
||||
$message .= '<br>';
|
||||
|
||||
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank" rel="noopener noreferrer">';
|
||||
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'" target="_blank" rel="noopener noreferrer">';
|
||||
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : 'KEYNOTDEFINED').'</a>';
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
|
||||
$message .= '<div class="urllink">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'">';
|
||||
if (getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) {
|
||||
$message .= ' <a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">'.img_picto('', 'download').'</a>';
|
||||
$message .= ' <a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...').'">'.img_picto('', 'download').'</a>';
|
||||
}
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('onlinepaymenturl3');
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ foreach ($dirbarcode as $reldir) {
|
|||
$handle = @opendir($newdir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') {
|
||||
if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') {
|
||||
if (is_readable($newdir.$file)) {
|
||||
if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) {
|
||||
$filebis = $reg[1];
|
||||
|
|
@ -445,7 +445,7 @@ if (!isset($_SERVER['WINDIR'])) {
|
|||
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
|
||||
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
||||
$langs->load("errors");
|
||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';
|
||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS')) {
|
||||
$filebis = $file;
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = preg_replace('/\.php$/', '', $file);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ $list = array(
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$accounting_mode = !getDolGlobalString('ACCOUNTING_MODE') ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
|
||||
$accounting_mode = getDolGlobalString('ACCOUNTING_MODE', 'RECETTES-DEPENSES');
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ if ($action == 'updateMask') {
|
|||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == "allowonlinesign") {
|
||||
if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 0, 'int', $conf->entity)) {
|
||||
if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 'int', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
|
|
@ -512,7 +512,7 @@ print '</td></tr>'."\n";
|
|||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("HideClosedServiceByDefault").'</td>';
|
||||
print '<td class="right">';
|
||||
print $form->selectyesno("activate_hideClosedServiceByDefault", (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') ? $conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT : 0), 1);
|
||||
print $form->selectyesno("activate_hideClosedServiceByDefault", getDolGlobalInt('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT', 0), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -317,19 +317,19 @@ if (!getDolGlobalString('MAIN_DISABLE_METEO') || getDolGlobalInt('MAIN_DISABLE_M
|
|||
//if (!empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP;
|
||||
$level0 = $offset;
|
||||
if (getDolGlobalString('MAIN_METEO_LEVEL0')) {
|
||||
$level0 = $conf->global->MAIN_METEO_LEVEL0;
|
||||
$level0 = getDolGlobalString('MAIN_METEO_LEVEL0');
|
||||
}
|
||||
$level1 = $offset + $cursor;
|
||||
if (getDolGlobalString('MAIN_METEO_LEVEL1')) {
|
||||
$level1 = $conf->global->MAIN_METEO_LEVEL1;
|
||||
$level1 = getDolGlobalString('MAIN_METEO_LEVEL1');
|
||||
}
|
||||
$level2 = $offset + 2 * $cursor;
|
||||
if (getDolGlobalString('MAIN_METEO_LEVEL2')) {
|
||||
$level2 = $conf->global->MAIN_METEO_LEVEL2;
|
||||
$level2 = getDolGlobalString('MAIN_METEO_LEVEL2');
|
||||
}
|
||||
$level3 = $offset + 3 * $cursor;
|
||||
if (getDolGlobalString('MAIN_METEO_LEVEL3')) {
|
||||
$level3 = $conf->global->MAIN_METEO_LEVEL3;
|
||||
$level3 = getDolGlobalString('MAIN_METEO_LEVEL3');
|
||||
}
|
||||
$text = '';
|
||||
$options = 'class="valignmiddle" height="60px"';
|
||||
|
|
|
|||
|
|
@ -2540,7 +2540,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return string '' or value of entity into table
|
||||
*/
|
||||
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $conf, $langs, $db, $mysoc;
|
||||
global $form;
|
||||
|
|
@ -2597,7 +2597,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||
print '</td>';
|
||||
} elseif ($value == 'lang') {
|
||||
print '<td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
|
||||
print $formadmin->select_language(getDolGlobalString('MAIN_LANG_DEFAULT'), 'lang');
|
||||
print '</td>';
|
||||
} elseif (in_array($value, array('element', 'source'))) { // Example: the type and source of the element (for contact types)
|
||||
$tmparray = array();
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ $quality = GETPOST('quality', 'alpha');
|
|||
try {
|
||||
$url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV') . '/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality;
|
||||
$api = new PrestaShopWebservice(
|
||||
$conf->global->MAIN_MODULE_DOLISTORE_API_SRV,
|
||||
$conf->global->MAIN_MODULE_DOLISTORE_API_KEY,
|
||||
getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'),
|
||||
getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY'),
|
||||
$dolistore->debug_api
|
||||
);
|
||||
//echo $url;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
* 2007-2022 PrestaShop SA and Contributors
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
|
|
@ -18,10 +18,10 @@
|
|||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2022 PrestaShop SA
|
||||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* PrestaShop Webservice Library
|
||||
* @package PrestaShopWebservice
|
||||
*/
|
||||
|
|
@ -31,10 +31,11 @@
|
|||
*/
|
||||
class PrestaShopWebservice
|
||||
{
|
||||
|
||||
/** @var string Shop URL */
|
||||
protected $url;
|
||||
|
||||
/** @var string Authentification key */
|
||||
/** @var string Authentication key */
|
||||
protected $key;
|
||||
|
||||
/** @var boolean is debug activated */
|
||||
|
|
@ -43,36 +44,40 @@ class PrestaShopWebservice
|
|||
/** @var string PS version */
|
||||
protected $version;
|
||||
|
||||
/** @var string compatible min version of PrestaShop Webservice */
|
||||
const PSCOMPATIBLEVERSIONMIN = '1.4.0.0';
|
||||
/** @var string compatible max version of PrestaShop Webservice */
|
||||
const PSCOMPATIBLEVERSIONMAX = '1.7.99.99';
|
||||
|
||||
/** @var string Minimal version of PrestaShop to use with this library */
|
||||
const PS_COMPATIBLE_VERSIONS_MIN = '1.4.0.0';
|
||||
/** @var string Maximal version of PrestaShop to use with this library */
|
||||
const PS_COMPATIBLE_VERSIONS_MAX = '8.1.1';
|
||||
|
||||
/**
|
||||
* PrestaShopWebservice constructor. Throw an exception when CURL is not installed/activated
|
||||
* <code>
|
||||
* <?php
|
||||
* require_once './PrestaShopWebservice.php';
|
||||
* require_once('./PrestaShopWebservice.php');
|
||||
* try
|
||||
* {
|
||||
* $ws = new PrestaShopWebservice('http://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
||||
* // Now we have a webservice object to play with
|
||||
* $ws = new PrestaShopWebservice('https://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
||||
* // Now we have a webservice object to play with
|
||||
* }
|
||||
* catch (PrestaShopWebserviceException $ex)
|
||||
* {
|
||||
* echo 'Error : '.$ex->getMessage();
|
||||
* echo 'Error : '.$ex->getMessage();
|
||||
* }
|
||||
* ?>
|
||||
* </code>
|
||||
*
|
||||
* @param string $url Root URL for the shop
|
||||
* @param string $key Authentification key
|
||||
* @param string $key Authentication key
|
||||
* @param mixed $debug Debug mode Activated (true) or deactivated (false)
|
||||
*
|
||||
* @throws PrestaShopWebserviceException if curl is not loaded
|
||||
*/
|
||||
public function __construct($url, $key, $debug = true)
|
||||
{
|
||||
if (!extension_loaded('curl')) {
|
||||
throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library');
|
||||
throw new PrestaShopWebserviceException(
|
||||
'Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library'
|
||||
);
|
||||
}
|
||||
$this->url = $url;
|
||||
$this->key = $key;
|
||||
|
|
@ -82,51 +87,92 @@ class PrestaShopWebservice
|
|||
|
||||
/**
|
||||
* Take the status code and throw an exception if the server didn't return 200 or 201 code
|
||||
* <p>Unique parameter must take : <br><br>
|
||||
* 'status_code' => Status code of an HTTP return<br>
|
||||
* 'response' => CURL response
|
||||
* </p>
|
||||
*
|
||||
* @param array $request Response elements of CURL request
|
||||
*
|
||||
* @param int $status_code Status code of an HTTP return
|
||||
* @return void
|
||||
* @throws PrestaShopWebserviceException if HTTP status code is not 200 or 201
|
||||
*/
|
||||
protected function checkStatusCode($status_code)
|
||||
protected function checkStatusCode($request)
|
||||
{
|
||||
$error_label = 'This call to PrestaShop Web Services failed and returned an HTTP status of %d. That means: %s.';
|
||||
switch ($status_code) {
|
||||
switch ($request['status_code']) {
|
||||
case 200:
|
||||
case 201:
|
||||
break;
|
||||
case 204:
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'No content'));
|
||||
$error_message = 'No content';
|
||||
break;
|
||||
case 400:
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Bad Request'));
|
||||
$error_message = 'Bad Request';
|
||||
break;
|
||||
case 401:
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Unauthorized'));
|
||||
$error_message = 'Unauthorized';
|
||||
break;
|
||||
case 404:
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Not Found'));
|
||||
$error_message = 'Not Found';
|
||||
break;
|
||||
case 405:
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Method Not Allowed'));
|
||||
$error_message = 'Method Not Allowed';
|
||||
break;
|
||||
case 500:
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Internal Server Error'));
|
||||
$error_message = 'Internal Server Error';
|
||||
break;
|
||||
default:
|
||||
throw new PrestaShopWebserviceException('This call to PrestaShop Web Services returned an unexpected HTTP status of:'.$status_code);
|
||||
throw new PrestaShopWebserviceException(
|
||||
'This call to PrestaShop Web Services returned an unexpected HTTP status of:' . $request['status_code']
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($error_message)) {
|
||||
$response = $this->parseXML($request['response']);
|
||||
$errors = $response->children()->children();
|
||||
if ($errors && count($errors) > 0) {
|
||||
foreach ($errors as $error) {
|
||||
$error_message.= ' - (Code ' . $error->code . '): ' . $error->message;
|
||||
}
|
||||
}
|
||||
$error_label = 'This call to PrestaShop Web Services failed and returned an HTTP status of %d. That means: %s.';
|
||||
throw new PrestaShopWebserviceException(sprintf($error_label, $request['status_code'], $error_message));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a CURL request to PrestaShop Webservice. Can throw exception.
|
||||
*
|
||||
* @param string $url Resource name
|
||||
* @param mixed $curl_params CURL parameters (sent to curl_set_opt)
|
||||
* @return array status_code, response
|
||||
* Provides default parameters for the curl connection(s)
|
||||
* @return array Default parameters for curl connection(s)
|
||||
*/
|
||||
public function executeRequest($url, $curl_params = array())
|
||||
protected function getCurlDefaultParams()
|
||||
{
|
||||
$defaultParams = array(
|
||||
CURLOPT_HEADER => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLINFO_HEADER_OUT => true,
|
||||
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
|
||||
CURLOPT_USERPWD => $this->key.':',
|
||||
CURLOPT_HTTPHEADER => array('Expect:')
|
||||
CURLOPT_USERPWD => $this->key . ':',
|
||||
CURLOPT_HTTPHEADER => array('Expect:'),
|
||||
//CURLOPT_SSL_VERIFYPEER => false, // reminder, in dev environment sometimes self-signed certificates are used
|
||||
//CURLOPT_CAINFO => "PATH2CAINFO", // ssl certificate chain checking
|
||||
//CURLOPT_CAPATH => "PATH2CAPATH",
|
||||
);
|
||||
return $defaultParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a CURL request to PrestaShop Webservice. Can throw exception.
|
||||
*
|
||||
* @param string $url Resource name
|
||||
* @param mixed $curl_params CURL parameters (sent to curl_set_opt)
|
||||
*
|
||||
* @return array status_code, response, header
|
||||
*
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
protected function executeRequest($url, $curl_params = array())
|
||||
{
|
||||
$defaultParams = $this->getCurlDefaultParams();
|
||||
|
||||
dol_syslog("curl_init url=".$url);
|
||||
$session = curl_init($url);
|
||||
|
|
@ -151,7 +197,7 @@ class PrestaShopWebservice
|
|||
|
||||
$index = strpos($response, "\r\n\r\n");
|
||||
if ($index === false && $curl_params[CURLOPT_CUSTOMREQUEST] != 'HEAD') {
|
||||
throw new PrestaShopWebserviceException('Bad HTTP response');
|
||||
throw new PrestaShopWebserviceException('Bad HTTP response ' . $response . curl_error($session));
|
||||
}
|
||||
|
||||
$header = substr($response, 0, $index);
|
||||
|
|
@ -170,10 +216,13 @@ class PrestaShopWebservice
|
|||
|
||||
if (array_key_exists('PSWS-Version', $headerArray)) {
|
||||
$this->version = $headerArray['PSWS-Version'];
|
||||
if (version_compare(PrestaShopWebservice::PSCOMPATIBLEVERSIONMIN, $headerArray['PSWS-Version']) == 1 ||
|
||||
version_compare(PrestaShopWebservice::PSCOMPATIBLEVERSIONMAX, $headerArray['PSWS-Version']) == -1
|
||||
if (
|
||||
version_compare(PrestaShopWebservice::PS_COMPATIBLE_VERSIONS_MIN, $headerArray['PSWS-Version']) == 1 ||
|
||||
version_compare(PrestaShopWebservice::PS_COMPATIBLE_VERSIONS_MAX, $headerArray['PSWS-Version']) == -1
|
||||
) {
|
||||
throw new PrestaShopWebserviceException('This library is not compatible with this version of PrestaShop. Please upgrade/downgrade this library');
|
||||
throw new PrestaShopWebserviceException(
|
||||
'This library is not compatible with this version of PrestaShop. Please upgrade/downgrade this library'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +232,7 @@ class PrestaShopWebservice
|
|||
}
|
||||
$status_code = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||
if ($status_code === 0) {
|
||||
throw new PrestaShopWebserviceException('CURL Error: '.curl_error($session));
|
||||
throw new PrestaShopWebserviceException('CURL Error: ' . curl_error($session));
|
||||
}
|
||||
curl_close($session);
|
||||
if ($this->debug) {
|
||||
|
|
@ -200,19 +249,27 @@ class PrestaShopWebservice
|
|||
/**
|
||||
* Output debug info
|
||||
*
|
||||
* @param string $title Title
|
||||
* @param string $content Content
|
||||
* @return void
|
||||
* @param string $title Title
|
||||
* @param string $content Content
|
||||
* @return void
|
||||
*/
|
||||
public function printDebug($title, $content)
|
||||
{
|
||||
echo '<div style="display:table;background:#CCC;font-size:8pt;padding:7px"><h6 style="font-size:9pt;margin:0">'.dol_escape_htmltag($title).'</h6><pre>'.dol_escape_htmltag($content).'</pre></div>';
|
||||
if (php_sapi_name() == 'cli') {
|
||||
echo $title . PHP_EOL . $content;
|
||||
} else {
|
||||
echo '<div style="display:table;background:#CCC;font-size:8pt;padding:7px"><h6 style="font-size:9pt;margin:0">'
|
||||
. $title
|
||||
. '</h6><pre>'
|
||||
. htmlentities($content)
|
||||
. '</pre></div>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return version
|
||||
*
|
||||
* @return string Version
|
||||
* @return string Version
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
|
|
@ -222,9 +279,9 @@ class PrestaShopWebservice
|
|||
/**
|
||||
* Load XML from string. Can throw exception
|
||||
*
|
||||
* @param string $response String from a CURL response
|
||||
* @return SimpleXMLElement|boolean status_code, response
|
||||
* @param string $response String from a CURL response
|
||||
*
|
||||
* @return SimpleXMLElement status_code, response
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
protected function parseXML($response)
|
||||
|
|
@ -232,16 +289,17 @@ class PrestaShopWebservice
|
|||
if ($response != '') {
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors(true);
|
||||
libxml_disable_entity_loader(true); // Avoid load of external entities (security problem). Required only if LIBXML_VERSION < 20900
|
||||
|
||||
if (!function_exists('simplexml_load_string')) {
|
||||
throw new PrestaShopWebserviceException('Method simplexml_load_string not available. Your PHP does not support xml.');
|
||||
if (LIBXML_VERSION < 20900) {
|
||||
// Avoid load of external entities (security problem).
|
||||
// Required only if LIBXML_VERSION < 20900
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
|
||||
$xml = simplexml_load_string(trim($response), 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
if (libxml_get_errors()) {
|
||||
$msg = var_export(libxml_get_errors(), true);
|
||||
libxml_clear_errors();
|
||||
throw new PrestaShopWebserviceException('HTTP XML response is not parsable: '.$msg);
|
||||
throw new PrestaShopWebserviceException('HTTP XML response is not parsable: ' . $msg);
|
||||
}
|
||||
return $xml;
|
||||
} else {
|
||||
|
|
@ -256,62 +314,62 @@ class PrestaShopWebservice
|
|||
* 'postXml' => Full XML string to add resource<br><br>
|
||||
* Examples are given in the tutorial</p>
|
||||
*
|
||||
* @param array $options Options
|
||||
* @return SimpleXMLElement|boolean status_code, response
|
||||
* @param array $options Options
|
||||
*
|
||||
* @return SimpleXMLElement status_code, response
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
public function add($options)
|
||||
{
|
||||
$xml = '';
|
||||
$url = '';
|
||||
|
||||
if (isset($options['resource'], $options['postXml']) || isset($options['url'], $options['postXml'])) {
|
||||
$url = (isset($options['resource']) ? $this->url.'/api/'.$options['resource'] : $options['url']);
|
||||
$url = (isset($options['resource']) ? $this->url . '/api/' . $options['resource'] : $options['url']);
|
||||
$xml = $options['postXml'];
|
||||
if (isset($options['id_shop'])) {
|
||||
$url .= '&id_shop='.$options['id_shop'];
|
||||
$url .= '&id_shop=' . $options['id_shop'];
|
||||
}
|
||||
if (isset($options['id_group_shop'])) {
|
||||
$url .= '&id_group_shop='.$options['id_group_shop'];
|
||||
$url .= '&id_group_shop=' . $options['id_group_shop'];
|
||||
}
|
||||
} else {
|
||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||
}
|
||||
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml));
|
||||
|
||||
$this->checkStatusCode($request['status_code']);
|
||||
$this->checkStatusCode($request);
|
||||
return $this->parseXML($request['response']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve (GET) a resource
|
||||
* <p>Unique parameter must take : <br><br>
|
||||
* 'url' => Full URL for a GET request of Webservice (ex: http://mystore.com/api/customers/1/)<br>
|
||||
* 'url' => Full URL for a GET request of Webservice (ex: https://mystore.com/api/customers/1/)<br>
|
||||
* OR<br>
|
||||
* 'resource' => Resource name,<br>
|
||||
* 'id' => ID of a resource you want to get<br><br>
|
||||
* </p>
|
||||
* <code>
|
||||
* <?php
|
||||
* require_once './PrestaShopWebservice.php';
|
||||
* require_once('./PrestaShopWebservice.php');
|
||||
* try
|
||||
* {
|
||||
* $ws = new PrestaShopWebservice('http://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
||||
* $ws = new PrestaShopWebservice('https://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
||||
* $xml = $ws->get(array('resource' => 'orders', 'id' => 1));
|
||||
* // Here in $xml, a SimpleXMLElement object you can parse
|
||||
* // Here in $xml, a SimpleXMLElement object you can parse
|
||||
* foreach ($xml->children()->children() as $attName => $attValue)
|
||||
* echo $attName.' = '.$attValue.'<br>';
|
||||
* echo $attName.' = '.$attValue.'<br>';
|
||||
* }
|
||||
* catch (PrestaShopWebserviceException $ex)
|
||||
* {
|
||||
* echo 'Error : '.$ex->getMessage();
|
||||
* echo 'Error : '.$ex->getMessage();
|
||||
* }
|
||||
* ?>
|
||||
* </code>
|
||||
* @param array $options Array representing resource to get.
|
||||
* @return SimpleXMLElement|boolean status_code, response
|
||||
*
|
||||
* @param array $options Array representing resource to get.
|
||||
*
|
||||
* @return SimpleXMLElement status_code, response
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
public function get($options)
|
||||
|
|
@ -319,15 +377,13 @@ class PrestaShopWebservice
|
|||
if (isset($options['url'])) {
|
||||
$url = $options['url'];
|
||||
} elseif (isset($options['resource'])) {
|
||||
$url = $this->url.'/api/'.$options['resource'];
|
||||
$url = $this->url . '/api/' . $options['resource'];
|
||||
$url_params = array();
|
||||
if (isset($options['id'])) {
|
||||
$url .= '/'.$options['id'];
|
||||
$url .= '/' . $options['id'];
|
||||
}
|
||||
|
||||
// @CHANGE LDR
|
||||
//$params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop');
|
||||
$params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop', 'date');
|
||||
$params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop', 'schema', 'language', 'date', 'price');
|
||||
foreach ($params as $p) {
|
||||
foreach ($options as $k => $o) {
|
||||
if (strpos($k, $p) !== false) {
|
||||
|
|
@ -336,23 +392,25 @@ class PrestaShopWebservice
|
|||
}
|
||||
}
|
||||
if (count($url_params) > 0) {
|
||||
$url .= '?'.http_build_query($url_params);
|
||||
$url .= '?' . http_build_query($url_params);
|
||||
}
|
||||
} else {
|
||||
throw new PrestaShopWebserviceException('Bad parameters given ');
|
||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||
}
|
||||
|
||||
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
||||
$this->checkStatusCode($request['status_code']); // check the response validity
|
||||
|
||||
$this->checkStatusCode($request);// check the response validity
|
||||
|
||||
return $this->parseXML($request['response']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Head method (HEAD) a resource
|
||||
*
|
||||
* @param array $options Array representing resource for head request.
|
||||
* @return SimpleXMLElement status_code, response
|
||||
* @param array $options Array representing resource for head request.
|
||||
*
|
||||
* @return SimpleXMLElement status_code, response
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
public function head($options)
|
||||
|
|
@ -360,10 +418,10 @@ class PrestaShopWebservice
|
|||
if (isset($options['url'])) {
|
||||
$url = $options['url'];
|
||||
} elseif (isset($options['resource'])) {
|
||||
$url = $this->url.'/api/'.$options['resource'];
|
||||
$url = $this->url . '/api/' . $options['resource'];
|
||||
$url_params = array();
|
||||
if (isset($options['id'])) {
|
||||
$url .= '/'.$options['id'];
|
||||
$url .= '/' . $options['id'];
|
||||
}
|
||||
|
||||
$params = array('filter', 'display', 'sort', 'limit');
|
||||
|
|
@ -375,15 +433,16 @@ class PrestaShopWebservice
|
|||
}
|
||||
}
|
||||
if (count($url_params) > 0) {
|
||||
$url .= '?'.http_build_query($url_params);
|
||||
$url .= '?' . http_build_query($url_params);
|
||||
}
|
||||
} else {
|
||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||
}
|
||||
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true));
|
||||
$this->checkStatusCode($request['status_code']); // check the response validity
|
||||
$this->checkStatusCode($request);// check the response validity
|
||||
return $request['header'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit (PUT) a resource
|
||||
* <p>Unique parameter must take : <br><br>
|
||||
|
|
@ -392,9 +451,9 @@ class PrestaShopWebservice
|
|||
* 'putXml' => Modified XML string of a resource<br><br>
|
||||
* Examples are given in the tutorial</p>
|
||||
*
|
||||
* @param array $options Array representing resource to edit.
|
||||
* @return SimpleXMLElement|boolean status_code, response
|
||||
* @param array $options Array representing resource to edit.
|
||||
*
|
||||
* @return SimpleXMLElement
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
public function edit($options)
|
||||
|
|
@ -403,22 +462,74 @@ class PrestaShopWebservice
|
|||
if (isset($options['url'])) {
|
||||
$url = $options['url'];
|
||||
} elseif ((isset($options['resource'], $options['id']) || isset($options['url'])) && $options['putXml']) {
|
||||
$url = (isset($options['url']) ? $options['url'] : $this->url.'/api/'.$options['resource'].'/'.$options['id']);
|
||||
$url = (isset($options['url']) ? $options['url'] :
|
||||
$this->url . '/api/' . $options['resource'] . '/' . $options['id']);
|
||||
$xml = $options['putXml'];
|
||||
if (isset($options['id_shop'])) {
|
||||
$url .= '&id_shop='.$options['id_shop'];
|
||||
$url .= '&id_shop=' . $options['id_shop'];
|
||||
}
|
||||
if (isset($options['id_group_shop'])) {
|
||||
$url .= '&id_group_shop='.$options['id_group_shop'];
|
||||
$url .= '&id_group_shop=' . $options['id_group_shop'];
|
||||
}
|
||||
} else {
|
||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||
}
|
||||
|
||||
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml));
|
||||
$this->checkStatusCode($request['status_code']); // check the response validity
|
||||
$this->checkStatusCode($request);// check the response validity
|
||||
return $this->parseXML($request['response']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete (DELETE) a resource.
|
||||
* Unique parameter must take : <br><br>
|
||||
* 'resource' => Resource name<br>
|
||||
* 'id' => ID or array which contains IDs of a resource(s) you want to delete<br><br>
|
||||
* <code>
|
||||
* <?php
|
||||
* require_once('./PrestaShopWebservice.php');
|
||||
* try
|
||||
* {
|
||||
* $ws = new PrestaShopWebservice('https://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
||||
* $xml = $ws->delete(array('resource' => 'orders', 'id' => 1));
|
||||
* // Following code will not be executed if an exception is thrown.
|
||||
* echo 'Successfully deleted.';
|
||||
* }
|
||||
* catch (PrestaShopWebserviceException $ex)
|
||||
* {
|
||||
* echo 'Error : '.$ex->getMessage();
|
||||
* }
|
||||
* ?>
|
||||
* </code>
|
||||
*
|
||||
* @param array $options Array representing resource to delete.
|
||||
*
|
||||
* @return bool
|
||||
* @throws PrestaShopWebserviceException
|
||||
*/
|
||||
public function delete($options)
|
||||
{
|
||||
if (isset($options['url'])) {
|
||||
$url = $options['url'];
|
||||
} elseif (isset($options['resource']) && isset($options['id'])) {
|
||||
$url = (is_array($options['id']))
|
||||
? $this->url . '/api/' . $options['resource'] . '/?id=[' . implode(',', $options['id']) . ']'
|
||||
: $this->url . '/api/' . $options['resource'] . '/' . $options['id'];
|
||||
} else {
|
||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||
}
|
||||
|
||||
if (isset($options['id_shop'])) {
|
||||
$url .= '&id_shop=' . $options['id_shop'];
|
||||
}
|
||||
if (isset($options['id_group_shop'])) {
|
||||
$url .= '&id_group_shop=' . $options['id_group_shop'];
|
||||
}
|
||||
|
||||
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE'));
|
||||
$this->checkStatusCode($request);// check the response validity
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
53
htdocs/admin/dolistore/class/PS_WS_LIB-LICENSE.md
Normal file
53
htdocs/admin/dolistore/class/PS_WS_LIB-LICENSE.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Open Software License v. 3.0 (OSL-3.0)
|
||||
|
||||
This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
|
||||
|
||||
Licensed under the Open Software License version 3.0
|
||||
|
||||
1) **Grant of Copyright License.** Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
|
||||
|
||||
a) to reproduce the Original Work in copies, either alone or as part of a collective work;
|
||||
|
||||
b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
|
||||
|
||||
c) to distribute or communicate copies of the Original Work and Derivative Works to the public, _with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License_;
|
||||
|
||||
d) to perform the Original Work publicly; and
|
||||
|
||||
e) to display the Original Work publicly.
|
||||
|
||||
2) **Grant** of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
|
||||
|
||||
3) **Grant** of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
|
||||
|
||||
4) **Exclusions From License Grant.** Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2\. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
|
||||
|
||||
5) **External Deployment.** The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
|
||||
|
||||
6) **Attribution Rights.** You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
|
||||
|
||||
7) **Warranty of Provenance and Disclaimer of Warranty.** Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
|
||||
|
||||
8) **Limitation of Liability.** Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
|
||||
|
||||
9) **Acceptance and Termination.** If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
|
||||
|
||||
10) **Termination for Patent Action.** This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
|
||||
|
||||
11) **Jurisdiction, Venue and Governing Law.** Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
|
||||
|
||||
12) **Attorneys' Fees.** In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
|
||||
|
||||
13) **Miscellaneous.** If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
|
||||
|
||||
14) **Definition of "You" in This License.** "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
15) **Right to Use.** You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
|
||||
|
||||
16) **Modification of This License.** This License is Copyright (c) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here\>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
|
||||
|
||||
[A brief explanation of this license is available][0].
|
||||
|
||||
|
||||
[0]: http://rosenlaw.com/OSL3.0-explained.htm
|
||||
|
||||
12
htdocs/admin/dolistore/class/README.md
Normal file
12
htdocs/admin/dolistore/class/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# PrestaShop-webservice-lib
|
||||
|
||||
Source updated from:
|
||||
|
||||
https://github.com/PrestaShop/PrestaShop-webservice-lib/blob/master/PSWebServiceLibrary.php
|
||||
|
||||
## Compatibility analysis
|
||||
|
||||
https://www.gnu.org/licenses/license-list.html#OSL
|
||||
|
||||
|
||||
|
||||
|
|
@ -86,9 +86,9 @@ class Dolistore
|
|||
global $conf;
|
||||
|
||||
try {
|
||||
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
|
||||
$this->api = new PrestaShopWebservice(getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'), getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY'), $this->debug_api);
|
||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
|
||||
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
|
||||
// conf MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
|
||||
|
||||
// Here we set the option array for the Webservice : we want categories resources
|
||||
$opt = array();
|
||||
|
|
@ -136,9 +136,9 @@ class Dolistore
|
|||
}
|
||||
|
||||
try {
|
||||
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
|
||||
$this->api = new PrestaShopWebservice(getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'), getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY'), $this->debug_api);
|
||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
|
||||
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
|
||||
// conf MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
|
||||
|
||||
// Here we set the option array for the Webservice : we want products resources
|
||||
$opt = array();
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -279,7 +279,7 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ foreach ($eventstolog as $key => $arr) {
|
|||
print '<td>'.$arr['id'].'</td>';
|
||||
print '<td class="center">';
|
||||
$key = 'MAIN_LOGEVENTS_'.$arr['id'];
|
||||
$value = empty($conf->global->$key) ? '' : $conf->global->$key;
|
||||
$value = getDolGlobalString($key);
|
||||
print '<input class="oddeven checkforselect" type="checkbox" name="'.$key.'" value="1"'.($value ? ' checked' : '').'>';
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ if ($resql) {
|
|||
//print "x".$idrss;
|
||||
|
||||
$rssparser = new RssParser($db);
|
||||
$result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp);
|
||||
$result = $rssparser->parser(getDolGlobalString($keyrssurl), 5, 300, $conf->externalrss->dir_temp);
|
||||
|
||||
print "<br>";
|
||||
print '<form name="externalrssconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS')) {
|
||||
$filebis = $file;
|
||||
$classname = preg_replace('/\.php$/', '', $file);
|
||||
// For compatibility
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ if (empty($conf->use_javascript_ajax)) {
|
|||
}
|
||||
print '</td>';
|
||||
print '<td class="center centpercent width100">';
|
||||
$value = (isset($conf->global->$constante) ? $conf->global->$constante : 0);
|
||||
$value = getDolGlobalInt($constante, 0);
|
||||
if ($value == 0) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=enable_'.strtolower($const).'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} elseif ($value == 1) {
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ if ($action == 'update') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'HRMTEST_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -549,7 +549,7 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token' . $constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled('product') || isModEnabled('service')) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ if ($mode == 'other') {
|
|||
// Default language
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print img_picto('', 'language', 'class="pictofixedwidth"');
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
|
||||
print $formadmin->select_language(getDolGlobalString('MAIN_LANG_DEFAULT'), 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
|
||||
//print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'KNOWLEDGEMANAGEMENT_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,11 +289,11 @@ if (function_exists("ldap_connect")) {
|
|||
if (getDolGlobalString('LDAP_ADMIN_DN') && getDolGlobalString('LDAP_ADMIN_PASS')) {
|
||||
if ($result == 2) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<span class="ok">'.$langs->trans("LDAPBindOK", $ldap->connectedServer, getDolGlobalString('LDAP_SERVER_PORT'), $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPBindOK", $ldap->connectedServer, getDolGlobalString('LDAP_SERVER_PORT'), getDolGlobalString('LDAP_ADMIN_DN'), preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||
print '<br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<span class="error">'.$langs->trans("LDAPBindKO", $ldap->connectedServer, getDolGlobalString('LDAP_SERVER_PORT'), $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||
print '<span class="error">'.$langs->trans("LDAPBindKO", $ldap->connectedServer, getDolGlobalString('LDAP_SERVER_PORT'), getDolGlobalString('LDAP_ADMIN_DN'), preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||
print '<br>';
|
||||
print $langs->trans("Error").' '.$ldap->error;
|
||||
print '<br>';
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
@ -285,9 +285,9 @@ print '</form>';
|
|||
*/
|
||||
$butlabel = $langs->trans("LDAPTestSynchroContact");
|
||||
$testlabel = 'test';
|
||||
$key = $conf->global->LDAP_KEY_CONTACTS;
|
||||
$dn = $conf->global->LDAP_CONTACT_DN;
|
||||
$objectclass = $conf->global->LDAP_CONTACT_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_CONTACTS');
|
||||
$dn = getDolGlobalString('LDAP_CONTACT_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_CONTACT_OBJECT_CLASS');
|
||||
|
||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_GROUPS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_MEMBERS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
@ -436,9 +436,9 @@ print '</form>';
|
|||
if (getDolGlobalString('LDAP_MEMBER_ACTIVE')) {
|
||||
$butlabel = $langs->trans("LDAPTestSynchroMember");
|
||||
$testlabel = 'testmember';
|
||||
$key = $conf->global->LDAP_KEY_MEMBERS;
|
||||
$dn = $conf->global->LDAP_MEMBER_DN;
|
||||
$objectclass = $conf->global->LDAP_MEMBER_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_MEMBERS');
|
||||
$dn = getDolGlobalString('LDAP_MEMBER_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_MEMBER_OBJECT_CLASS');
|
||||
|
||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_MEMBERS_TYPES', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
@ -192,9 +192,9 @@ print '</form>';
|
|||
if (getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE') === Ldap::SYNCHRO_DOLIBARR_TO_LDAP) {
|
||||
$butlabel = $langs->trans("LDAPTestSynchroMemberType");
|
||||
$testlabel = 'testmembertype';
|
||||
$key = $conf->global->LDAP_KEY_MEMBERS_TYPES;
|
||||
$dn = $conf->global->LDAP_MEMBER_TYPE_DN;
|
||||
$objectclass = $conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_MEMBERS_TYPES');
|
||||
$dn = getDolGlobalString('LDAP_MEMBER_TYPE_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_MEMBER_TYPE_OBJECT_CLASS');
|
||||
|
||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_USERS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -726,7 +726,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_TLS);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
@ -743,7 +743,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
@ -760,7 +760,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
||||
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
@ -996,25 +996,26 @@ if ($action == 'edit') {
|
|||
if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') {
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD')) {
|
||||
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD'));
|
||||
} else {
|
||||
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) {
|
||||
// List of IP show as record to add in SPF if we use the mail method
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) {
|
||||
// List of IP show as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
|
||||
// TODO Add a key to allow to show the IP/name of server detected dynamically
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMail2", getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS'));
|
||||
}
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
|
||||
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD'));
|
||||
}
|
||||
}
|
||||
// Test SPF email company
|
||||
$companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL');
|
||||
$dnsinfo = false;
|
||||
if (!empty($companyemail) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
|
||||
|
|
@ -1031,6 +1032,27 @@ if ($action == 'edit') {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Test SPF default automatic email from
|
||||
$defaultnoreplyemail = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
if ($defaultnoreplyemail != $companyemail) { // We show if email differs
|
||||
$dnsinfo = false;
|
||||
if (!empty($defaultnoreplyemail) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
|
||||
$arrayofemailparts = explode('@', $defaultnoreplyemail);
|
||||
if (count($arrayofemailparts) == 2) {
|
||||
$domain = $arrayofemailparts[1];
|
||||
$dnsinfo = dns_get_record($domain, DNS_TXT);
|
||||
}
|
||||
}
|
||||
if (!empty($dnsinfo) && is_array($dnsinfo)) {
|
||||
foreach ($dnsinfo as $info) {
|
||||
if (strpos($info['txt'], 'v=spf') !== false) {
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $defaultnoreplyemail, $info['txt']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($text) {
|
||||
print info_admin($text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
@ -598,7 +598,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1354,7 +1354,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $langs, $user, $db;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||
if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_TLS_TICKET);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
@ -575,7 +575,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||
if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) {
|
||||
if (function_exists('openssl_open')) {
|
||||
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_TICKET);
|
||||
print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET'));
|
||||
} else {
|
||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ foreach ($dirmenus as $dirmenu) {
|
|||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$menu_handler_top = $conf->global->MAIN_MENU_STANDARD;
|
||||
$menu_handler_smartphone = $conf->global->MAIN_MENU_SMARTPHONE;
|
||||
$menu_handler_top = getDolGlobalString('MAIN_MENU_STANDARD');
|
||||
$menu_handler_smartphone = getDolGlobalString('MAIN_MENU_SMARTPHONE');
|
||||
$menu_handler_top = preg_replace('/_backoffice.php/i', '', $menu_handler_top);
|
||||
$menu_handler_top = preg_replace('/_frontoffice.php/i', '', $menu_handler_top);
|
||||
$menu_handler_smartphone = preg_replace('/_backoffice.php/i', '', $menu_handler_smartphone);
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
$deschelp .= '<div class="info hideonsmartphone">'.$desc."<br></div>\n";
|
||||
}
|
||||
if (getDolGlobalString('MAIN_SETUP_MODULES_INFO')) { // Show a custom message
|
||||
$deschelp .= '<div class="info">'.$langs->trans($conf->global->MAIN_SETUP_MODULES_INFO)."<br></div>\n";
|
||||
$deschelp .= '<div class="info">'.$langs->trans(getDolGlobalString('MAIN_SETUP_MODULES_INFO'))."<br></div>\n";
|
||||
}
|
||||
if ($deschelp) {
|
||||
$deschelp .= '<br>';
|
||||
|
|
@ -851,7 +851,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
}
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (!empty($conf->global->$const_name)) { // If module is already activated
|
||||
if (getDolGlobalString($const_name)) { // If module is already activated
|
||||
// Set $codeenabledisable
|
||||
$disableSetup = 0;
|
||||
if (!empty($arrayofwarnings[$modName])) {
|
||||
|
|
@ -1143,9 +1143,9 @@ if ($mode == 'marketplace') {
|
|||
print $nextlink;
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '</div></div>';
|
||||
print '<div class="clearboth"></div>'; ?>
|
||||
print '<div class="clearboth"></div>';
|
||||
?>
|
||||
|
||||
<div id="category-tree-left">
|
||||
<ul class="tree">
|
||||
|
|
@ -1242,7 +1242,7 @@ if ($mode == 'deploy') {
|
|||
|
||||
print $langs->trans("YouCanSubmitFile").'<br><br>';
|
||||
|
||||
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
||||
$max = getDolGlobalString('MAIN_UPLOAD_DOC'); // In Kb
|
||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||
}
|
||||
|
||||
$param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
|
||||
$value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ? GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : $conf->global->$param;
|
||||
$value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ? GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : getDolGlobalString($param);
|
||||
|
||||
$s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||
$arrayemail = explode(',', $value);
|
||||
|
|
@ -464,7 +464,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||
$showwarning++;
|
||||
}
|
||||
}
|
||||
if ((!empty($conf->global->$param)) && $showwarning) {
|
||||
if (getDolGlobalString($param) && $showwarning) {
|
||||
$s .= ' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||
}
|
||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS')) {
|
||||
$filebis = $file;
|
||||
$classname = preg_replace('/\.php$/', '', $file);
|
||||
// For compatibility
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ for ($i = 1; $i <= 6; $i++) {
|
|||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff($keyforconstant);
|
||||
} else {
|
||||
print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant) ? $conf->global->$keyforconstant : 0, 1, $noCountryCode);
|
||||
print $form->selectyesno($keyforconstant, getDolGlobalString($keyforconstant, 0), 1, $noCountryCode);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ if ($result) {
|
|||
}
|
||||
|
||||
// Break found, it's a new module to catch
|
||||
if (isset($obj->module) && ($oldmod <> $obj->module)) {
|
||||
if (isset($obj->module) && ($oldmod != $obj->module)) {
|
||||
$oldmod = $obj->module;
|
||||
|
||||
// Break detected, we get objMod
|
||||
|
|
@ -248,7 +248,7 @@ if ($result) {
|
|||
}
|
||||
|
||||
// Permission and tick
|
||||
$permlabel = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label)));
|
||||
$permlabel = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($langs->trans("PermissionAdvanced".$obj->id) != "PermissionAdvanced".$obj->id) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != "Permission".$obj->id) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label)));
|
||||
print '<td>';
|
||||
print $permlabel;
|
||||
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* \file htdocs/admin/security.php
|
||||
* \ingroup setup
|
||||
* \brief Page de configuration du module securite
|
||||
* \brief Page of setup of security
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) {
|
||||
if (!is_dir($dir.$file) || (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS')) {
|
||||
$filebis = $file;
|
||||
$classname = preg_replace('/\.php$/', '', $file);
|
||||
// For compatibility
|
||||
|
|
|
|||
|
|
@ -226,14 +226,16 @@ foreach ($syslogModules as $moduleName) {
|
|||
|
||||
print '<td class="nowrap">';
|
||||
$setuparray = $module->configure();
|
||||
|
||||
if ($setuparray) {
|
||||
foreach ($setuparray as $option) {
|
||||
$tmpoption = $option['constant'];
|
||||
$value = '';
|
||||
if (!empty($tmpoption)) {
|
||||
if (GETPOSTISSET($tmpoption)) {
|
||||
$value = GETPOST($tmpoption);
|
||||
} elseif (!empty($conf->global->$tmpoption)) {
|
||||
$value = $conf->global->$tmpoption;
|
||||
} else {
|
||||
$value = getDolGlobalString($tmpoption);
|
||||
}
|
||||
} else {
|
||||
$value = (isset($option['default']) ? $option['default'] : '');
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ if ($action == 'getlastversion') {
|
|||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
if (LIBXML_VERSION < 20900) {
|
||||
// Avoid load of external entities (security problem).
|
||||
// Required only if LIBXML_VERSION < 20900
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
|
||||
|
|
@ -81,12 +87,12 @@ print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").' ('.$langs->tr
|
|||
if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
|
||||
// Compare version with last install database version (upgrades never occured)
|
||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) {
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_INSTALL));
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_INSTALL')));
|
||||
}
|
||||
} else {
|
||||
// Compare version with last upgrade database version
|
||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) {
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +194,7 @@ print '<br>';
|
|||
|
||||
|
||||
// Shmop
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
|
||||
if (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
|
||||
$shmoparray = dol_listshmop();
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
|
@ -254,7 +260,7 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
|
|||
}
|
||||
$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
|
||||
$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(!getDolGlobalString('MAIN_SERVER_TZ') ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ);
|
||||
$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.getDolGlobalString('MAIN_SERVER_TZ', $langs->trans("NotDefined"));
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
|
||||
$a = getServerTimeZoneInt('now');
|
||||
$b = getServerTimeZoneInt('winter');
|
||||
|
|
@ -299,7 +305,7 @@ if (empty($tmp)) {
|
|||
$tmp = 'utf-8'; // By default for other
|
||||
}
|
||||
if (getDolGlobalString('MAIN_FILESYSTEM_ENCODING')) {
|
||||
$tmp = $conf->global->MAIN_FILESYSTEM_ENCODING;
|
||||
$tmp = getDolGlobalString('MAIN_FILESYSTEM_ENCODING');
|
||||
}
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
|
||||
|
|
|
|||
|
|
@ -61,12 +61,12 @@ print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionProgram").'</
|
|||
if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
|
||||
// Compare version with last install database version (upgrades never occured)
|
||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) {
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_INSTALL));
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_INSTALL')));
|
||||
}
|
||||
} else {
|
||||
// Compare version with last upgrade database version
|
||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) {
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
|
||||
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')));
|
||||
}
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
|
@ -89,7 +89,7 @@ if (!preg_match('/\.zip$/i', $xmlfile) && dol_is_file($xmlfile.'.zip')) {
|
|||
// Remote file to compare to
|
||||
$xmlremote = GETPOST('xmlremote', 'alphanohtml');
|
||||
if (empty($xmlremote) && getDolGlobalString('MAIN_FILECHECK_URL')) {
|
||||
$xmlremote = $conf->global->MAIN_FILECHECK_URL;
|
||||
$xmlremote = getDolGlobalString('MAIN_FILECHECK_URL');
|
||||
}
|
||||
$param = 'MAIN_FILECHECK_URL_'.DOL_VERSION;
|
||||
if (empty($xmlremote) && getDolGlobalString($param)) {
|
||||
|
|
@ -176,6 +176,12 @@ if (GETPOST('target') == 'remote') {
|
|||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."xmlfileend";
|
||||
if (LIBXML_VERSION < 20900) {
|
||||
// Avoid load of external entities (security problem).
|
||||
// Required only if LIBXML_VERSION < 20900
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ if ($resql) {
|
|||
if (!getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT');
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT'));
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
|
||||
|
|
@ -516,7 +516,7 @@ if ($resql) {
|
|||
if (!getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT');
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'));
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
|
||||
|
|
@ -537,7 +537,7 @@ if ($resql) {
|
|||
if (!getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT')) {
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT');
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'));
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts"));
|
||||
|
|
@ -558,7 +558,7 @@ if ($resql) {
|
|||
if (!getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT');
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT'));
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects"));
|
||||
|
|
@ -585,7 +585,7 @@ if ($resql) {
|
|||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
|
||||
print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', $conf->global->PRODUCT_DONOTSEARCH_ANYWHERE);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE'));
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
|
||||
|
|
@ -608,7 +608,7 @@ if ($resql) {
|
|||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
|
||||
print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', $conf->global->COMPANY_DONOTSEARCH_ANYWHERE);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE'));
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include')
|
|||
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
|
||||
print "<strong>PHP disable_functions</strong> = ";
|
||||
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
|
||||
$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
|
||||
$arrayoffunctionstodisable = explode(',', 'dl,apache_note,apache_setenv,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,show_source,virtual');
|
||||
//$arrayoffunctionstodisable[] = 'stream_wrapper_restore';
|
||||
//$arrayoffunctionstodisable[] = 'stream_wrapper_register';
|
||||
if ($execmethod == 1) {
|
||||
|
|
@ -740,6 +740,11 @@ print '<br>';
|
|||
print '<strong>MAIN_SECURITY_FORCERP</strong> = '.getDolGlobalString('MAIN_SECURITY_FORCERP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"same-origin\" so browser doesn't send any referrer when going into another web site domain)</span><br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_SECURITY_FORCE_ACCESS_CONTROL_ALLOW_ORIGIN</strong> = '.getDolGlobalString('MAIN_SECURITY_FORCE_ACCESS_CONTROL_ALLOW_ORIGIN', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Recommended").": 1)</span><br>";
|
||||
print '<br>';
|
||||
|
||||
// For websites
|
||||
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCECSPRO</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCECSPRO', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>');
|
||||
print ' <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")</span><br>";
|
||||
print '<br>';
|
||||
|
|
@ -757,6 +762,7 @@ print '<br>';
|
|||
print '<strong>WEBSITE_MAIN_SECURITY_FORCEPP</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Example").": \"camera: (); microphone: ();\")</span><br>";
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||
if (!getDolGlobalString('SYSTEMTOOLS_MYSQLDUMP')) {
|
||||
$fullpathofmysqldump = $db->getPathOfDump();
|
||||
} else {
|
||||
$fullpathofmysqldump = $conf->global->SYSTEMTOOLS_MYSQLDUMP;
|
||||
$fullpathofmysqldump = getDolGlobalString('SYSTEMTOOLS_MYSQLDUMP');
|
||||
}
|
||||
print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'">';
|
||||
print '</fieldset>';
|
||||
|
|
@ -281,7 +281,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||
|
||||
$execmethod = 0;
|
||||
if (getDolGlobalString('MAIN_EXEC_USE_POPEN')) {
|
||||
$execmethod = $conf->global->MAIN_EXEC_USE_POPEN;
|
||||
$execmethod = getDolGlobalString('MAIN_EXEC_USE_POPEN');
|
||||
}
|
||||
if (empty($execmethod)) {
|
||||
$execmethod = 1;
|
||||
|
|
@ -409,7 +409,7 @@ if (in_array($type, array('pgsql'))) {
|
|||
if (!getDolGlobalString('SYSTEMTOOLS_POSTGRESQLDUMP')) {
|
||||
$fullpathofpgdump = $db->getPathOfDump();
|
||||
} else {
|
||||
$fullpathofpgdump = $conf->global->SYSTEMTOOLS_POSTGRESQLDUMP;
|
||||
$fullpathofpgdump = getDolGlobalString('SYSTEMTOOLS_POSTGRESQLDUMP');
|
||||
}
|
||||
print '<br>';
|
||||
print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" />';
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@ if ($action == 'getlastversion') {
|
|||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
if (LIBXML_VERSION < 20900) {
|
||||
// Avoid load of external entities (security problem).
|
||||
// Required only if LIBXML_VERSION < 20900
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$sfurl = 'xml_not_available';
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -447,7 +447,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $file) {
|
||||
if (getDolGlobalString($constforvar) == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||
|
|
@ -589,7 +589,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
// Default
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $name) {
|
||||
if (getDolGlobalString($constforvar) == $name) {
|
||||
//print img_picto($langs->trans("Default"), 'on');
|
||||
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
function fieldListWebsites($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
global $form;
|
||||
|
|
@ -700,7 +700,7 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||
|
||||
if ($fieldlist[$field] == 'lang') {
|
||||
print '<td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
|
||||
print $formadmin->select_language(getDolGlobalString('MAIN_LANG_DEFAULT'), 'lang');
|
||||
print '</td>';
|
||||
} elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldname)) {
|
||||
print '<td><input type="text" class="flat" value="'.(!empty($obj->$fieldname) ? $obj->$fieldname : '').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ foreach ($workflowcodes as $key => $params) {
|
|||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff($key);
|
||||
} else {
|
||||
if (!empty($conf->global->$key)) {
|
||||
if (getDolGlobalString($key)) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=del'.$key.'&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ if ($action == 'updateMask') {
|
|||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue