Merge branch 'develop' into patch-2
This commit is contained in:
commit
301d7134b3
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
open_collective: dolibarr
|
open_collective: dolibarr
|
||||||
custom: https://wiki.dolibarr.org/index.php/Subscribe
|
custom: https://wiki.dolibarr.org/index.php/Subscribe
|
||||||
# github: [eldy]
|
github: [eldy]
|
||||||
24
.tx/config
24
.tx/config
@ -170,12 +170,6 @@ source_file = htdocs/langs/en_US/hrm.lang
|
|||||||
source_lang = en_US
|
source_lang = en_US
|
||||||
type = MOZILLAPROPERTIES
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
[dolibarr.intracommreport]
|
|
||||||
file_filter = htdocs/langs/<lang>/intracommreport.lang
|
|
||||||
source_file = htdocs/langs/en_US/intracommreport.lang
|
|
||||||
source_lang = en_US
|
|
||||||
type = MOZILLAPROPERTIES
|
|
||||||
|
|
||||||
[dolibarr.install]
|
[dolibarr.install]
|
||||||
file_filter = htdocs/langs/<lang>/install.lang
|
file_filter = htdocs/langs/<lang>/install.lang
|
||||||
source_file = htdocs/langs/en_US/install.lang
|
source_file = htdocs/langs/en_US/install.lang
|
||||||
@ -188,6 +182,12 @@ source_file = htdocs/langs/en_US/interventions.lang
|
|||||||
source_lang = en_US
|
source_lang = en_US
|
||||||
type = MOZILLAPROPERTIES
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
|
[dolibarr.intracommreport]
|
||||||
|
file_filter = htdocs/langs/<lang>/intracommreport.lang
|
||||||
|
source_file = htdocs/langs/en_US/intracommreport.lang
|
||||||
|
source_lang = en_US
|
||||||
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
[dolibarr.knowledgemanagement]
|
[dolibarr.knowledgemanagement]
|
||||||
file_filter = htdocs/langs/<lang>/knowledgemanagement.lang
|
file_filter = htdocs/langs/<lang>/knowledgemanagement.lang
|
||||||
source_file = htdocs/langs/en_US/knowledgemanagement.lang
|
source_file = htdocs/langs/en_US/knowledgemanagement.lang
|
||||||
@ -392,18 +392,18 @@ source_file = htdocs/langs/en_US/stripe.lang
|
|||||||
source_lang = en_US
|
source_lang = en_US
|
||||||
type = MOZILLAPROPERTIES
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
[dolibarr.suppliers]
|
|
||||||
file_filter = htdocs/langs/<lang>/suppliers.lang
|
|
||||||
source_file = htdocs/langs/en_US/suppliers.lang
|
|
||||||
source_lang = en_US
|
|
||||||
type = MOZILLAPROPERTIES
|
|
||||||
|
|
||||||
[dolibarr.supplier_proposal]
|
[dolibarr.supplier_proposal]
|
||||||
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
|
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
|
||||||
source_file = htdocs/langs/en_US/supplier_proposal.lang
|
source_file = htdocs/langs/en_US/supplier_proposal.lang
|
||||||
source_lang = en_US
|
source_lang = en_US
|
||||||
type = MOZILLAPROPERTIES
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
|
[dolibarr.suppliers]
|
||||||
|
file_filter = htdocs/langs/<lang>/suppliers.lang
|
||||||
|
source_file = htdocs/langs/en_US/suppliers.lang
|
||||||
|
source_lang = en_US
|
||||||
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
[dolibarr.ticket]
|
[dolibarr.ticket]
|
||||||
file_filter = htdocs/langs/<lang>/ticket.lang
|
file_filter = htdocs/langs/<lang>/ticket.lang
|
||||||
source_file = htdocs/langs/en_US/ticket.lang
|
source_file = htdocs/langs/en_US/ticket.lang
|
||||||
|
|||||||
42
ChangeLog
42
ChangeLog
@ -2,6 +2,45 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
***** ChangeLog for 14.0.1 compared to 14.0.0 *****
|
||||||
|
|
||||||
|
FIX: $conf->task used but it does not exist, use $conf->projet instead
|
||||||
|
FIX: #18181
|
||||||
|
FIX: #18212 : Add url field
|
||||||
|
FIX: #18267
|
||||||
|
FIX: #18289 #18294
|
||||||
|
FIX: #18341 lang not loaded
|
||||||
|
FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice
|
||||||
|
FIX: #18399 Fix shipment validation email template override.
|
||||||
|
FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT)
|
||||||
|
FIX: Accountancy - Rules to delete & modify transaction not applied in ledger & subledger
|
||||||
|
FIX: Accountancy - Search date on journal
|
||||||
|
FIX: Accountancy - SQL error on select journal on journal
|
||||||
|
FIX: Accountancy - SQL error when insert a manuel transaction
|
||||||
|
FIX: add include missing file '/core/actions_dellink.inc.php' in project card
|
||||||
|
FIX: avoid to have link to create bookmark on page to create bookmark
|
||||||
|
FIX: bad approver shown on holiday once approved
|
||||||
|
FIX: bad closing div on error message
|
||||||
|
FIX: cannot add time spentd when column ref is not displayed
|
||||||
|
FIX: Can't remove a permission of a group
|
||||||
|
FIX: Can't set cost price when product is not on purchase
|
||||||
|
FIX: compatibility postgresql
|
||||||
|
FIX: filter on status Draft in modulebuilder
|
||||||
|
FIX: holiday card: hooks uninitialized
|
||||||
|
FIX: Invoice - Missing button to reopen an abandoned situation invoice
|
||||||
|
FIX: Link of download main doc on vat list
|
||||||
|
FIX: look and field v14
|
||||||
|
FIX: Missing column Date validation in ledger & subledger
|
||||||
|
FIX: on admin/pdf.php (with javascript enabled) if you set some boolean confs then click on "save", all boolean values are reset
|
||||||
|
FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref)
|
||||||
|
FIX: postgresql filter select search extrafield
|
||||||
|
FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object
|
||||||
|
FIX: show info of company into user dropdown
|
||||||
|
FIX: totalDayAll hours in tasks
|
||||||
|
FIX: update product lot
|
||||||
|
FIX: using Tulip, deposit mask was not saved
|
||||||
|
FIX: #yogosha6907
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
||||||
|
|
||||||
@ -12,6 +51,9 @@ WARNING:
|
|||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
||||||
|
* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
||||||
|
|
||||||
|
|||||||
@ -48,17 +48,16 @@ $includecustom=0;
|
|||||||
$includeconstants=array();
|
$includeconstants=array();
|
||||||
|
|
||||||
if (empty($argv[1])) {
|
if (empty($argv[1])) {
|
||||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
|
||||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_str($argv[1]);
|
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($i < $argc) {
|
while ($i < $argc) {
|
||||||
if (! empty($argv[$i])) {
|
if (! empty($argv[$i])) {
|
||||||
parse_str($argv[$i]);
|
parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ...
|
||||||
}
|
}
|
||||||
if (preg_match('/includeconstant=/', $argv[$i])) {
|
if (preg_match('/includeconstant=/', $argv[$i])) {
|
||||||
$tmp=explode(':', $includeconstant, 3); // $includeconstant has been set with previous parse_str()
|
$tmp=explode(':', $includeconstant, 3); // $includeconstant has been set with previous parse_str()
|
||||||
@ -125,8 +124,8 @@ print "\n";
|
|||||||
|
|
||||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||||
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
print 'Delete current files '.$outputdir.'/filelist*.xml*'."\n";
|
||||||
dol_delete_file($outputdir.'/filelist*.xml', 0, 1, 1);
|
dol_delete_file($outputdir.'/filelist*.xml*', 0, 1, 1);
|
||||||
|
|
||||||
$checksumconcat=array();
|
$checksumconcat=array();
|
||||||
|
|
||||||
@ -237,6 +236,14 @@ fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
|
|||||||
fputs($fp, '</checksum_list>'."\n");
|
fputs($fp, '</checksum_list>'."\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
if (empty($buildzip)) {
|
||||||
print "File ".$outputfile." generated\n";
|
print "File ".$outputfile." generated\n";
|
||||||
|
} else {
|
||||||
|
$result = dol_compress_file($outputfile, $outputfile.'.zip');
|
||||||
|
if ($result > 0) {
|
||||||
|
dol_delete_file($outputfile);
|
||||||
|
print "File ".$outputfile.".zip generated\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|||||||
@ -1,234 +0,0 @@
|
|||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*
|
|
||||||
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file dev/initdata/import-dbf.php
|
|
||||||
* \brief Script example to create a table from a large DBF file (openoffice)
|
|
||||||
* To purge data, you can have a look at purge-data.php
|
|
||||||
*/
|
|
||||||
// Test si mode batch
|
|
||||||
$sapi_type = php_sapi_name();
|
|
||||||
$script_file = basename(__FILE__);
|
|
||||||
|
|
||||||
$path = dirname(__FILE__) . '/';
|
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recupere root dolibarr
|
|
||||||
$path = dirname($_SERVER["PHP_SELF"]);
|
|
||||||
require $path . "./../htdocs/master.inc.php";
|
|
||||||
require $path . "/includes/dbase.class.php";
|
|
||||||
|
|
||||||
// Global variables
|
|
||||||
$version = DOL_VERSION;
|
|
||||||
$confirmed = 1;
|
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main
|
|
||||||
*/
|
|
||||||
|
|
||||||
@set_time_limit(0);
|
|
||||||
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
|
|
||||||
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
|
|
||||||
|
|
||||||
|
|
||||||
$filepath = $argv[1];
|
|
||||||
$filepatherr = $filepath . '.err';
|
|
||||||
$startchar = empty($argv[2]) ? 0 : (int) $argv[2];
|
|
||||||
$deleteTable = empty($argv[3]) ? 1 : 0;
|
|
||||||
$startlinenb = empty($argv[3]) ? 1 : (int) $argv[3];
|
|
||||||
$endlinenb = empty($argv[4]) ? 0 : (int) $argv[4];
|
|
||||||
|
|
||||||
if (empty($filepath)) {
|
|
||||||
print "Usage: php $script_file myfilepath.dbf [removeChatColumnName] [startlinenb] [endlinenb]\n";
|
|
||||||
print "Example: php $script_file myfilepath.dbf 0 2 1002\n";
|
|
||||||
print "\n";
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
if (!file_exists($filepath)) {
|
|
||||||
print "Error: File " . $filepath . " not found.\n";
|
|
||||||
print "\n";
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$ret = $user->fetch('', 'admin');
|
|
||||||
if (!$ret > 0) {
|
|
||||||
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
$user->getrights();
|
|
||||||
|
|
||||||
// Ask confirmation
|
|
||||||
if (!$confirmed) {
|
|
||||||
print "Hit Enter to continue or CTRL+C to stop...\n";
|
|
||||||
$input = trim(fgets(STDIN));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open input and output files
|
|
||||||
$fhandle = dbase_open($filepath, 0);
|
|
||||||
if (!$fhandle) {
|
|
||||||
print 'Error: Failed to open file ' . $filepath . "\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
$fhandleerr = fopen($filepatherr, 'w');
|
|
||||||
if (!$fhandleerr) {
|
|
||||||
print 'Error: Failed to open file ' . $filepatherr . "\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$langs->setDefaultLang($defaultlang);
|
|
||||||
|
|
||||||
$record_numbers = dbase_numrecords($fhandle);
|
|
||||||
$table_name = substr(basename($filepath), 0, strpos(basename($filepath), '.'));
|
|
||||||
print 'Info: ' . $record_numbers . " lines in file \n";
|
|
||||||
$header = dbase_get_header_info($fhandle);
|
|
||||||
if ($deleteTable) {
|
|
||||||
$db->query("DROP TABLE IF EXISTS `$table_name`");
|
|
||||||
}
|
|
||||||
$sqlCreate = "CREATE TABLE IF NOT EXISTS `$table_name` ( `id` INT(11) NOT NULL AUTO_INCREMENT ";
|
|
||||||
$fieldArray = array("`id`");
|
|
||||||
foreach ($header as $value) {
|
|
||||||
$fieldName = substr(str_replace('_', '', $value['name']), $startchar);
|
|
||||||
$fieldArray[] = "`$fieldName`";
|
|
||||||
$sqlCreate .= ", `" . $fieldName . "` VARCHAR({$value['length']}) NULL DEFAULT NULL ";
|
|
||||||
}
|
|
||||||
$sqlCreate .= ", PRIMARY KEY (`id`)) ENGINE = InnoDB";
|
|
||||||
$resql = $db->query($sqlCreate);
|
|
||||||
if ($resql !== false) {
|
|
||||||
print "Table $table_name created\n";
|
|
||||||
} else {
|
|
||||||
var_dump($db->errno());
|
|
||||||
print "Impossible : " . $sqlCreate . "\n";
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
$nboflines++;
|
|
||||||
|
|
||||||
$fields = implode(',', $fieldArray);
|
|
||||||
//var_dump($fieldArray);die();
|
|
||||||
$maxLength = 0;
|
|
||||||
for ($i = 1; $i <= $record_numbers; $i++) {
|
|
||||||
if ($startlinenb && $i < $startlinenb) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($endlinenb && $i > $endlinenb) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$row = dbase_get_record_with_names($fhandle, $i);
|
|
||||||
if ($row === false || (isset($row["deleted"]) && $row["deleted"] == '1')) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$sqlInsert = "INSERT INTO `$table_name`($fields) VALUES (null,";
|
|
||||||
array_shift($row); // remove delete column
|
|
||||||
foreach ($row as $value) {
|
|
||||||
$sqlInsert .= "'" . $db->escape(utf8_encode($value)) . "', ";
|
|
||||||
}
|
|
||||||
replaceable_echo(implode("\t", $row));
|
|
||||||
$sqlInsert = rtrim($sqlInsert, ', ');
|
|
||||||
$sqlInsert .= ")";
|
|
||||||
$resql = $db->query($sqlInsert);
|
|
||||||
if ($resql === false) {
|
|
||||||
print "Impossible : " . $sqlInsert . "\n";
|
|
||||||
var_dump($row, $db->errno());
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
// $fields = (object) $row;
|
|
||||||
// var_dump($fields);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
die();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// commit or rollback
|
|
||||||
print "Nb of lines qualified: " . $nboflines . "\n";
|
|
||||||
print "Nb of errors: " . $error . "\n";
|
|
||||||
if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) {
|
|
||||||
print "Rollback any changes.\n";
|
|
||||||
$db->rollback();
|
|
||||||
} else {
|
|
||||||
print "Commit all changes.\n";
|
|
||||||
$db->commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->close();
|
|
||||||
fclose($fhandle);
|
|
||||||
fclose($fhandleerr);
|
|
||||||
|
|
||||||
exit($error);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* replaceable_echo
|
|
||||||
*
|
|
||||||
* @param string $message Message
|
|
||||||
* @param int $force_clear_lines Force clear messages
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function replaceable_echo($message, $force_clear_lines = null)
|
|
||||||
{
|
|
||||||
static $last_lines = 0;
|
|
||||||
|
|
||||||
if (!is_null($force_clear_lines)) {
|
|
||||||
$last_lines = $force_clear_lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
$toss = array();
|
|
||||||
$status = 0;
|
|
||||||
$term_width = exec('tput cols', $toss, $status);
|
|
||||||
if ($status) {
|
|
||||||
$term_width = 64; // Arbitrary fall-back term width.
|
|
||||||
}
|
|
||||||
|
|
||||||
$line_count = 0;
|
|
||||||
foreach (explode("\n", $message) as $line) {
|
|
||||||
$line_count += count(str_split($line, $term_width));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Erasure MAGIC: Clear as many lines as the last output had.
|
|
||||||
for ($i = 0; $i < $last_lines; $i++) {
|
|
||||||
// Return to the beginning of the line
|
|
||||||
echo "\r";
|
|
||||||
// Erase to the end of the line
|
|
||||||
echo "\033[K";
|
|
||||||
// Move cursor Up a line
|
|
||||||
echo "\033[1A";
|
|
||||||
// Return to the beginning of the line
|
|
||||||
echo "\r";
|
|
||||||
// Erase to the end of the line
|
|
||||||
echo "\033[K";
|
|
||||||
// Return to the beginning of the line
|
|
||||||
echo "\r";
|
|
||||||
// Can be consolodated into
|
|
||||||
// echo "\r\033[K\033[1A\r\033[K\r";
|
|
||||||
}
|
|
||||||
|
|
||||||
$last_lines = $line_count;
|
|
||||||
|
|
||||||
echo $message . "\n";
|
|
||||||
}
|
|
||||||
@ -1,248 +0,0 @@
|
|||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*
|
|
||||||
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file dev/initdata/import-product.php
|
|
||||||
* \brief Script example to insert products from a csv file.
|
|
||||||
* To purge data, you can have a look at purge-data.php
|
|
||||||
*/
|
|
||||||
// Test si mode batch
|
|
||||||
$sapi_type = php_sapi_name();
|
|
||||||
$script_file = basename(__FILE__);
|
|
||||||
$path = dirname(__FILE__) . '/';
|
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recupere root dolibarr
|
|
||||||
$path = preg_replace('/importdb-products.php/i', '', $_SERVER["PHP_SELF"]);
|
|
||||||
require $path . "../../htdocs/master.inc.php";
|
|
||||||
require $path . "includes/dbase.class.php";
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
|
||||||
|
|
||||||
//$delimiter = ',';
|
|
||||||
//$enclosure = '"';
|
|
||||||
//$linelength = 10000;
|
|
||||||
//$escape = '/';
|
|
||||||
// Global variables
|
|
||||||
$version = DOL_VERSION;
|
|
||||||
$confirmed = 1;
|
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
$tvas = [
|
|
||||||
'1' => "20.00",
|
|
||||||
'2' => "5.50",
|
|
||||||
'3' => "0.00",
|
|
||||||
'4' => "20.60",
|
|
||||||
'5' => "19.60",
|
|
||||||
];
|
|
||||||
$tvasD = [
|
|
||||||
'1' => "20",
|
|
||||||
'2' => "5.5",
|
|
||||||
'3' => "0",
|
|
||||||
'4' => "20",
|
|
||||||
'5' => "20",
|
|
||||||
];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main
|
|
||||||
*/
|
|
||||||
|
|
||||||
@set_time_limit(0);
|
|
||||||
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
|
|
||||||
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
|
|
||||||
|
|
||||||
$table = $argv[1];
|
|
||||||
|
|
||||||
if (empty($argv[1])) {
|
|
||||||
print "Error: Which table ?\n";
|
|
||||||
print "\n";
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$ret = $user->fetch('', 'admin');
|
|
||||||
if (!$ret > 0) {
|
|
||||||
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT * FROM `$table` WHERE 1";
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
while ($fields = $db->fetch_array($resql)) {
|
|
||||||
$errorrecord = 0;
|
|
||||||
if ($fields === false) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$nboflines++;
|
|
||||||
|
|
||||||
$produit = new Product($db);
|
|
||||||
$produit->type = 0;
|
|
||||||
$produit->status = 1;
|
|
||||||
$produit->ref = trim($fields['REF']);
|
|
||||||
if ($produit->ref == '') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
print "Process line nb " . $j . ", ref " . $produit->ref;
|
|
||||||
$produit->label = trim($fields['LIBELLE']);
|
|
||||||
if ($produit->label == '') {
|
|
||||||
$produit->label = $produit->ref;
|
|
||||||
}
|
|
||||||
if (empty($produit->label)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//$produit->description = trim($fields[4] . "\n" . ($fields[5] ? $fields[5] . ' x ' . $fields[6] . ' x ' . $fields[7] : ''));
|
|
||||||
// $produit->volume = price2num($fields[8]);
|
|
||||||
// $produit->volume_unit = 0;
|
|
||||||
$produit->weight = price2num($fields['MASSE']);
|
|
||||||
$produit->weight_units = 0; // -3 = g
|
|
||||||
//$produit->customcode = $fields[10];
|
|
||||||
$produit->barcode = str_pad($fields['CODE'], 12, "0", STR_PAD_LEFT);
|
|
||||||
$produit->barcode_type = '2';
|
|
||||||
$produit->import_key = $fields['CODE'];
|
|
||||||
|
|
||||||
$produit->status = 1;
|
|
||||||
$produit->status_buy = 1;
|
|
||||||
|
|
||||||
$produit->finished = 1;
|
|
||||||
|
|
||||||
// $produit->multiprices[0] = price2num($fields['TARIF0']);
|
|
||||||
// $produit->multiprices[1] = price2num($fields['TARIF1']);
|
|
||||||
// $produit->multiprices[2] = price2num($fields['TARIF2']);
|
|
||||||
// $produit->multiprices[3] = price2num($fields['TARIF3']);
|
|
||||||
// $produit->multiprices[4] = price2num($fields['TARIF4']);
|
|
||||||
// $produit->multiprices[5] = price2num($fields['TARIF5']);
|
|
||||||
// $produit->multiprices[6] = price2num($fields['TARIF6']);
|
|
||||||
// $produit->multiprices[7] = price2num($fields['TARIF7']);
|
|
||||||
// $produit->multiprices[8] = price2num($fields['TARIF8']);
|
|
||||||
// $produit->multiprices[9] = price2num($fields['TARIF9']);
|
|
||||||
// $produit->price_min = null;
|
|
||||||
// $produit->price_min_ttc = null;
|
|
||||||
// $produit->price = price2num($fields[11]);
|
|
||||||
// $produit->price_ttc = price2num($fields[12]);
|
|
||||||
// $produit->price_base_type = 'TTC';
|
|
||||||
// $produit->tva_tx = price2num($fields[13]);
|
|
||||||
$produit->tva_tx = (int) ($tvas[$fields['CODTVA']]);
|
|
||||||
$produit->tva_npr = 0;
|
|
||||||
// $produit->cost_price = price2num($fields[16]);
|
|
||||||
//compta
|
|
||||||
|
|
||||||
$produit->accountancy_code_buy = trim($fields['COMACH']);
|
|
||||||
$produit->accountancy_code_sell = trim($fields['COMVEN']);
|
|
||||||
// $produit->accountancy_code_sell_intra=trim($fields['COMVEN']);
|
|
||||||
// $produit->accountancy_code_sell_export=trim($fields['COMVEN']);
|
|
||||||
// Extrafields
|
|
||||||
// $produit->array_options['options_ecotaxdeee'] = price2num($fields[17]);
|
|
||||||
|
|
||||||
$produit->seuil_stock_alerte = $fields['STALERTE'];
|
|
||||||
$ret = $produit->create($user, 0);
|
|
||||||
if ($ret < 0) {
|
|
||||||
print " - Error in create result code = " . $ret . " - " . $produit->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
} else {
|
|
||||||
print " - Creation OK with ref " . $produit->ref . " - id = " . $ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
dol_syslog("Add prices");
|
|
||||||
|
|
||||||
// If we use price level, insert price for each level
|
|
||||||
if (!$errorrecord && 1) {
|
|
||||||
//$ret1 = $produit->updatePrice($produit->price_ttc, $produit->price_base_type, $user, $produit->tva_tx, $produit->price_min, 1, $produit->tva_npr, 0, 0, array());
|
|
||||||
$ret1 = false;
|
|
||||||
for ($i = 0; $i < 10; $i++) {
|
|
||||||
if ($fields['TARIF' . ($i)] == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$ret1 = $ret1 || $produit->updatePrice(price2num($fields['TARIF' . ($i)]), 'HT', $user, $produit->tva_tx, $produit->price_min, $i + 1, $produit->tva_npr, 0, 0, array()) < 0;
|
|
||||||
}
|
|
||||||
if ($ret1) {
|
|
||||||
print " - Error in updatePrice result " . $produit->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
} else {
|
|
||||||
print " - updatePrice OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// dol_syslog("Add multilangs");
|
|
||||||
// Add alternative languages
|
|
||||||
// if (!$errorrecord && 1) {
|
|
||||||
// $produit->multilangs['fr_FR'] = array('label' => $produit->label, 'description' => $produit->description, 'note' => $produit->note_private);
|
|
||||||
// $produit->multilangs['en_US'] = array('label' => $fields[3], 'description' => $produit->description, 'note' => $produit->note_private);
|
|
||||||
//
|
|
||||||
// $ret = $produit->setMultiLangs($user);
|
|
||||||
// if ($ret < 0) {
|
|
||||||
// print " - Error in setMultiLangs result code = " . $ret . " - " . $produit->errorsToString();
|
|
||||||
// $errorrecord++;
|
|
||||||
// } else {
|
|
||||||
// print " - setMultiLangs OK";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
dol_syslog("Add stocks");
|
|
||||||
// stocks
|
|
||||||
if (!$errorrecord && $fields['STOCK'] != 0) {
|
|
||||||
$rets = $produit->correct_stock($user, 1, $fields['STOCK'], 0, 'Stock importé');
|
|
||||||
if ($rets < 0) {
|
|
||||||
print " - Error in correct_stock result " . $produit->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
} else {
|
|
||||||
print " - correct_stock OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//update date créa
|
|
||||||
if (!$errorrecord) {
|
|
||||||
$date = substr($fields['DATCREA'], 0, 4) . '-' . substr($fields['DATCREA'], 4, 2) . '-' . substr($fields['DATCREA'], 6, 2);
|
|
||||||
$retd = $db->query("UPDATE `llx_product` SET `datec` = '$date 00:00:00' WHERE `llx_product`.`rowid` = $produit->id");
|
|
||||||
if ($retd < 1) {
|
|
||||||
print " - Error in update date créa result " . $produit->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
} else {
|
|
||||||
print " - update date créa OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "\n";
|
|
||||||
|
|
||||||
if ($errorrecord) {
|
|
||||||
print( 'Error on record nb ' . $i . " - " . $produit->errorsToString() . "\n");
|
|
||||||
var_dump($db);
|
|
||||||
die();
|
|
||||||
$error++; // $errorrecord will be reset
|
|
||||||
}
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
die("error : $sql");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// commit or rollback
|
|
||||||
print "Nb of lines qualified: " . $nboflines . "\n";
|
|
||||||
print "Nb of errors: " . $error . "\n";
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
exit($error);
|
|
||||||
@ -1,365 +0,0 @@
|
|||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*
|
|
||||||
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file dev/initdata/import-product.php
|
|
||||||
* \brief Script example to insert products from a csv file.
|
|
||||||
* To purge data, you can have a look at purge-data.php
|
|
||||||
*/
|
|
||||||
// Test si mode batch
|
|
||||||
$sapi_type = php_sapi_name();
|
|
||||||
$script_file = basename(__FILE__);
|
|
||||||
$path = dirname(__FILE__) . '/';
|
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recupere root dolibarr
|
|
||||||
$path = preg_replace('/importdb-thirdparties.php/i', '', $_SERVER["PHP_SELF"]);
|
|
||||||
require $path . "../../htdocs/master.inc.php";
|
|
||||||
require $path . "includes/dbase.class.php";
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
|
||||||
|
|
||||||
//$delimiter = ',';
|
|
||||||
//$enclosure = '"';
|
|
||||||
//$linelength = 10000;
|
|
||||||
//$escape = '/';
|
|
||||||
// Global variables
|
|
||||||
$version = DOL_VERSION;
|
|
||||||
$confirmed = 1;
|
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
$civilPrivate = array("MLLE",
|
|
||||||
"MM",
|
|
||||||
"MM/MADAME",
|
|
||||||
"MME",
|
|
||||||
"MME.",
|
|
||||||
"MME²",
|
|
||||||
"MMONSIEUR",
|
|
||||||
"MMR",
|
|
||||||
"MOBNSIEUR",
|
|
||||||
"MOMSIEUR",
|
|
||||||
"MON SIEUR",
|
|
||||||
"MONDIAL",
|
|
||||||
"MONIEUR",
|
|
||||||
"MONJSIEUR",
|
|
||||||
"MONNSIEUR",
|
|
||||||
"MONRIEUR",
|
|
||||||
"MONS",
|
|
||||||
"MONSIEÕR",
|
|
||||||
"MONSIER",
|
|
||||||
"MONSIERU",
|
|
||||||
"MONSIEU",
|
|
||||||
"monsieue",
|
|
||||||
"MONSIEUR",
|
|
||||||
"Monsieur \"",
|
|
||||||
"MONSIEUR \"",
|
|
||||||
"MONSIEUR E",
|
|
||||||
"MONSIEUR DENIS",
|
|
||||||
"MONSIEUR ET MME",
|
|
||||||
"MONSIEUR!",
|
|
||||||
"MONSIEUR.",
|
|
||||||
"MONSIEUR.MADAME",
|
|
||||||
"MONSIEUR3",
|
|
||||||
"MONSIEURN",
|
|
||||||
"MONSIEURT",
|
|
||||||
"MONSIEUR£",
|
|
||||||
"MONSIEYR",
|
|
||||||
"Monsigur",
|
|
||||||
"MONSIIEUR",
|
|
||||||
"MONSIUER",
|
|
||||||
"MONSIZEUR",
|
|
||||||
"MOPNSIEUR",
|
|
||||||
"MOSIEUR",
|
|
||||||
"MR",
|
|
||||||
"Mr Mme",
|
|
||||||
"Mr - MME",
|
|
||||||
"MR BLANC",
|
|
||||||
"MR ET MME",
|
|
||||||
"mr mm",
|
|
||||||
"MR OU MME",
|
|
||||||
"Mr.",
|
|
||||||
"MR/MME",
|
|
||||||
"MRME",
|
|
||||||
"MRR",
|
|
||||||
"Mrs",
|
|
||||||
"Mademoiselle",
|
|
||||||
"MADAOME",
|
|
||||||
"madamme",
|
|
||||||
"MADAME",
|
|
||||||
"M0NSIEUR",
|
|
||||||
"M.et Madame",
|
|
||||||
"M. ET MR",
|
|
||||||
"M.",
|
|
||||||
"M%",
|
|
||||||
"M MME",
|
|
||||||
"M ET MME",
|
|
||||||
"M",
|
|
||||||
"M CROCE",
|
|
||||||
"M DIEVART",
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main
|
|
||||||
*/
|
|
||||||
|
|
||||||
@set_time_limit(0);
|
|
||||||
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
|
|
||||||
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
|
|
||||||
|
|
||||||
$table = $argv[1];
|
|
||||||
|
|
||||||
if (empty($argv[1])) {
|
|
||||||
print "Error: Quelle table ?\n";
|
|
||||||
print "\n";
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$ret = $user->fetch('', 'admin');
|
|
||||||
if (!$ret > 0) {
|
|
||||||
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT * FROM `$table` WHERE 1 "; //ORDER BY REMISE DESC,`LCIVIL` DESC";
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
//$db->begin();
|
|
||||||
if ($resql) {
|
|
||||||
while ($fields = $db->fetch_array($resql)) {
|
|
||||||
$i++;
|
|
||||||
$errorrecord = 0;
|
|
||||||
|
|
||||||
if ($startlinenb && $i < $startlinenb) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($endlinenb && $i > $endlinenb) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$nboflines++;
|
|
||||||
|
|
||||||
$object = new Societe($db);
|
|
||||||
$object->import_key = $fields['CODE'];
|
|
||||||
$object->state = 1;
|
|
||||||
$object->client = 3;
|
|
||||||
$object->fournisseur = 0;
|
|
||||||
|
|
||||||
$object->name = $fields['FCIVIL'] . ' ' . $fields['FNOM'];
|
|
||||||
//$object->name_alias = $fields[0] != $fields[13] ? trim($fields[0]) : '';
|
|
||||||
|
|
||||||
$date = $fields['DATCREA'] ? $fields['DATCREA'] : ($fields['DATMOD'] ? $fields['DATMOD'] : '20200101');
|
|
||||||
$object->code_client = 'CU' . substr($date, 2, 2) . substr($date, 4, 2) . '-' . str_pad(substr($fields['CODE'], 0, 5), 5, "0", STR_PAD_LEFT);
|
|
||||||
|
|
||||||
|
|
||||||
$object->address = trim($fields['FADR1']);
|
|
||||||
if ($fields['FADR2']) {
|
|
||||||
$object->address .= "\n" . trim($fields['FADR2']);
|
|
||||||
}
|
|
||||||
if ($fields['FADR3']) {
|
|
||||||
$object->address .= "\n" . trim($fields['FADR3']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$object->zip = trim($fields['FPOSTE']);
|
|
||||||
$object->town = trim($fields['FVILLE']);
|
|
||||||
if ($fields['FPAYS']) {
|
|
||||||
$object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid');
|
|
||||||
} else {
|
|
||||||
$object->country_id = 1;
|
|
||||||
}
|
|
||||||
$object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']);
|
|
||||||
$object->phone = substr($object->phone, 0, 20);
|
|
||||||
$object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']);
|
|
||||||
$object->fax = substr($object->fax, 0, 20);
|
|
||||||
$object->email = trim($fields['FMAIL']);
|
|
||||||
// $object->idprof2 = trim($fields[29]);
|
|
||||||
$object->tva_intra = str_replace(['.', ' '], '', $fields['TVAINTRA']);
|
|
||||||
$object->tva_intra = substr($object->tva_intra, 0, 20);
|
|
||||||
$object->default_lang = 'fr_FR';
|
|
||||||
|
|
||||||
$object->cond_reglement_id = dol_getIdFromCode($db, 'PT_ORDER', 'c_payment_term', 'code', 'rowid', 1);
|
|
||||||
$object->multicurrency_code = 'EUR';
|
|
||||||
|
|
||||||
if ($fields['REMISE'] != '0.00') {
|
|
||||||
$object->remise_percent = abs($fields['REMISE']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// $object->code_client = $fields[9];
|
|
||||||
// $object->code_fournisseur = $fields[10];
|
|
||||||
|
|
||||||
|
|
||||||
if ($fields['FCIVIL']) {
|
|
||||||
$labeltype = in_array($fields['FCIVIL'], $civilPrivate) ? 'TE_PRIVATE' : 'TE_SMALL';
|
|
||||||
$object->typent_id = dol_getIdFromCode($db, $labeltype, 'c_typent', 'code');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set price level
|
|
||||||
$object->price_level = $fields['TARIF'] + 1;
|
|
||||||
// if ($labeltype == 'Revendeur')
|
|
||||||
// $object->price_level = 2;
|
|
||||||
|
|
||||||
print "Process line nb " . $i . ", code " . $fields['CODE'] . ", name " . $object->name;
|
|
||||||
|
|
||||||
|
|
||||||
// Extrafields
|
|
||||||
$object->array_options['options_banque'] = $fields['BANQUE'];
|
|
||||||
$object->array_options['options_banque2'] = $fields['BANQUE2'];
|
|
||||||
$object->array_options['options_banquevalid'] = $fields['VALID'];
|
|
||||||
|
|
||||||
if (!$errorrecord) {
|
|
||||||
$ret = $object->create($user);
|
|
||||||
if ($ret < 0) {
|
|
||||||
print " - Error in create result code = " . $ret . " - " . $object->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
var_dump($object->code_client, $db);
|
|
||||||
die();
|
|
||||||
} else {
|
|
||||||
print " - Creation OK with name " . $object->name . " - id = " . $ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$errorrecord) {
|
|
||||||
dol_syslog("Set price level");
|
|
||||||
$object->set_price_level($object->price_level, $user);
|
|
||||||
}
|
|
||||||
if (!$errorrecord && @$object->remise_percent) {
|
|
||||||
dol_syslog("Set remise client");
|
|
||||||
$object->set_remise_client($object->remise_percent, 'Importé', $user);
|
|
||||||
}
|
|
||||||
|
|
||||||
dol_syslog("Add contact");
|
|
||||||
// Insert an invoice contact if there is an invoice email != standard email
|
|
||||||
if (!$errorrecord && ($fields['LCIVIL'] || $fields['LNOM'])) {
|
|
||||||
$madame = array("MADAME",
|
|
||||||
"MADEMOISELLE",
|
|
||||||
"MELLE",
|
|
||||||
"MLLE",
|
|
||||||
"MM",
|
|
||||||
"Mme",
|
|
||||||
"MNE",
|
|
||||||
);
|
|
||||||
$monsieur = array("M",
|
|
||||||
"M ET MME",
|
|
||||||
"M MME",
|
|
||||||
"M.",
|
|
||||||
"M. MME",
|
|
||||||
"M. OU Mme",
|
|
||||||
"M.ou Madame",
|
|
||||||
"MONSEUR",
|
|
||||||
"MONSIER",
|
|
||||||
"MONSIEU",
|
|
||||||
"MONSIEUR",
|
|
||||||
"monsieur:mme",
|
|
||||||
"MONSIEUR¨",
|
|
||||||
"MONSIEZUR",
|
|
||||||
"MONSIUER",
|
|
||||||
"MONSKIEUR",
|
|
||||||
"MR",
|
|
||||||
);
|
|
||||||
$ret1 = $ret2 = 0;
|
|
||||||
|
|
||||||
$contact = new Contact($db);
|
|
||||||
if (in_array($fields['LCIVIL'], $madame)) {
|
|
||||||
// une dame
|
|
||||||
$contact->civility_id = 'MME';
|
|
||||||
$contact->lastname = $fields['LNOM'];
|
|
||||||
} elseif (in_array($fields['LCIVIL'], $monsieur)) {
|
|
||||||
// un monsieur
|
|
||||||
$contact->civility_id = 'MR';
|
|
||||||
$contact->lastname = $fields['LNOM'];
|
|
||||||
} elseif (in_array($fields['LCIVIL'], ['DOCTEUR'])) {
|
|
||||||
// un monsieur
|
|
||||||
$contact->civility_id = 'DR';
|
|
||||||
$contact->lastname = $fields['LNOM'];
|
|
||||||
} else {
|
|
||||||
// un a rattraper
|
|
||||||
$contact->lastname = $fields['LCIVIL'] . " " . $fields['LNOM'];
|
|
||||||
}
|
|
||||||
$contact->address = trim($fields['LADR1']);
|
|
||||||
if ($fields['LADR2']) {
|
|
||||||
$contact->address .= "\n" . trim($fields['LADR2']);
|
|
||||||
}
|
|
||||||
if ($fields['LADR3']) {
|
|
||||||
$contact->address .= "\n" . trim($fields['LADR3']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$contact->zip = trim($fields['LPOSTE']);
|
|
||||||
$contact->town = trim($fields['LVILLE']);
|
|
||||||
if ($fields['FPAYS']) {
|
|
||||||
$contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid');
|
|
||||||
} else {
|
|
||||||
$contact->country_id = 1;
|
|
||||||
}
|
|
||||||
$contact->email = $fields['LMAIL'];
|
|
||||||
$contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']);
|
|
||||||
$contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']);
|
|
||||||
$contact->socid = $object->id;
|
|
||||||
|
|
||||||
$ret1 = $contact->create($user);
|
|
||||||
if ($ret1 > 0) {
|
|
||||||
//$ret2=$contact->add_contact($object->id, 'BILLING');
|
|
||||||
}
|
|
||||||
if ($ret1 < 0 || $ret2 < 0) {
|
|
||||||
print " - Error in create contact result code = " . $ret1 . " " . $ret2 . " - " . $contact->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
} else {
|
|
||||||
print " - create contact OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//update date créa
|
|
||||||
if (!$errorrecord) {
|
|
||||||
$datec = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2);
|
|
||||||
$retd = $db->query("UPDATE `llx_societe` SET `datec` = '$datec 00:00:00' WHERE `rowid` = $object->id");
|
|
||||||
if ($retd < 1) {
|
|
||||||
print " - Error in update date créa result " . $object->errorsToString();
|
|
||||||
$errorrecord++;
|
|
||||||
} else {
|
|
||||||
print " - update date créa OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "\n";
|
|
||||||
|
|
||||||
if ($errorrecord) {
|
|
||||||
print( 'Error on record nb ' . $i . " - " . $object->errorsToString() . "\n");
|
|
||||||
var_dump($db, $object, $contact);
|
|
||||||
// $db->rollback();
|
|
||||||
die();
|
|
||||||
$error++; // $errorrecord will be reset
|
|
||||||
}
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
die("error : $sql");
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->commit();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// commit or rollback
|
|
||||||
print "Nb of lines qualified: " . $nboflines . "\n";
|
|
||||||
print "Nb of errors: " . $error . "\n";
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
exit($error);
|
|
||||||
@ -1,599 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* \file dev/initdata/dbf/includes/dbase.class.php
|
|
||||||
* \ingroup dev
|
|
||||||
* \brief Class to manage DBF databases
|
|
||||||
*/
|
|
||||||
|
|
||||||
// source : https://github.com/donfbecker/php-dbase
|
|
||||||
|
|
||||||
define('DBASE_RDONLY', 0);
|
|
||||||
define('DBASE_WRONLY', 1);
|
|
||||||
define('DBASE_RDWR', 2);
|
|
||||||
define('DBASE_TYPE_DBASE', 0);
|
|
||||||
define('DBASE_TYPE_FOXPRO', 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class for DBase
|
|
||||||
*/
|
|
||||||
class DBase
|
|
||||||
{
|
|
||||||
private $fd;
|
|
||||||
private $headerLength = 0;
|
|
||||||
private $fields = array();
|
|
||||||
private $fieldCount = 0;
|
|
||||||
private $recordLength = 0;
|
|
||||||
private $recordCount = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* resource dbase_open
|
|
||||||
* @param string $filename filename
|
|
||||||
* @param int $mode mode
|
|
||||||
* @return DBase
|
|
||||||
*/
|
|
||||||
public static function open($filename, $mode)
|
|
||||||
{
|
|
||||||
if (!file_exists($filename)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$modes = array('r', 'w', 'r+');
|
|
||||||
$mode = $modes[$mode];
|
|
||||||
$fd = fopen($filename, $mode);
|
|
||||||
if (!$fd) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return new DBase($fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* resource dbase_create
|
|
||||||
* @param string $filename filename
|
|
||||||
* @param array $fields fields
|
|
||||||
* @param int $type DBASE_TYPE_DBASE
|
|
||||||
* @return DBase
|
|
||||||
*/
|
|
||||||
public static function create($filename, $fields, $type = DBASE_TYPE_DBASE)
|
|
||||||
{
|
|
||||||
if (file_exists($filename)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$fd = fopen($filename, 'c+');
|
|
||||||
if (!$fd) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Byte 0 (1 byte): Valid dBASE for DOS file; bits 0-2 indicate version number, bit 3
|
|
||||||
// indicates the presence of a dBASE for DOS memo file, bits 4-6 indicate the
|
|
||||||
// presence of a SQL table, bit 7 indicates the presence of any memo file
|
|
||||||
// (either dBASE m PLUS or dBASE for DOS)
|
|
||||||
self::putChar8($fd, 5);
|
|
||||||
// Byte 1-3 (3 bytes): Date of last update; formatted as YYMMDD
|
|
||||||
self::putChar8($fd, date('Y') - 1900);
|
|
||||||
self::putChar8($fd, date('m'));
|
|
||||||
self::putChar8($fd, date('d'));
|
|
||||||
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
|
|
||||||
self::putInt32($fd, 0);
|
|
||||||
// Byte 8-9 (16-bit number): Number of bytes in the header.
|
|
||||||
self::putInt16($fd, 32 + (32 * count($fields)) + 1);
|
|
||||||
// Byte 10-11 (16-bit number): Number of bytes in record.
|
|
||||||
// Make sure the include the byte for deleted flag
|
|
||||||
$len = 1;
|
|
||||||
foreach ($fields as &$field) {
|
|
||||||
$len += self::length($field);
|
|
||||||
}
|
|
||||||
self::putInt16($fd, $len);
|
|
||||||
// Byte 12-13 (2 bytes): Reserved, 0 filled.
|
|
||||||
self::putInt16($fd, 0);
|
|
||||||
// Byte 14 (1 byte): Flag indicating incomplete transaction
|
|
||||||
// The ISMARKEDO function checks this flag. BEGIN TRANSACTION sets it to 1, END TRANSACTION and ROLLBACK reset it to 0.
|
|
||||||
self::putChar8($fd, 0);
|
|
||||||
// Byte 15 (1 byte): Encryption flag. If this flag is set to 1, the message Database encrypted appears. Changing this flag to 0 removes the message, but does not decrypt the file.
|
|
||||||
self::putChar8($fd, 0);
|
|
||||||
// Byte 16-27 (12 bytes): Reserved for dBASE for DOS in a multi-user environment
|
|
||||||
self::putInt32($fd, 0);
|
|
||||||
self::putInt32($fd, 0);
|
|
||||||
self::putInt32($fd, 0);
|
|
||||||
// Byte 28 (1 byte): Production .mdx file flag; 0x01 if there is a production .mdx file, 0x00 if not
|
|
||||||
self::putChar8($fd, 0);
|
|
||||||
// Byte 29 (1 byte): Language driver ID
|
|
||||||
// (no clue what this is)
|
|
||||||
self::putChar8($fd, 0);
|
|
||||||
// Byte 30-31 (2 bytes): Reserved, 0 filled.
|
|
||||||
self::putInt16($fd, 0);
|
|
||||||
// Byte 32 - n (32 bytes each): Field descriptor array
|
|
||||||
foreach ($fields as &$field) {
|
|
||||||
self::putString($fd, $field[0], 11); // Byte 0 - 10 (11 bytes): Field name in ASCII (zero-filled)
|
|
||||||
self::putString($fd, $field[1], 1); // Byte 11 (1 byte): Field type in ASCII (C, D, F, L, M, or N)
|
|
||||||
self::putInt32($fd, 0); // Byte 12 - 15 (4 bytes): Reserved
|
|
||||||
self::putChar8($fd, self::length($field)); // Byte 16 (1 byte): Field length in binary. The maximum length of a field is 254 (0xFE).
|
|
||||||
self::putChar8($fd, $field[3]); // Byte 17 (1 byte): Field decimal count in binary
|
|
||||||
self::putInt16($fd, 0); // Byte 18 - 19 (2 bytes): Work area ID
|
|
||||||
self::putChar8($fd, 0); // Byte 20 (1 byte): Example (??)
|
|
||||||
self::putInt32($fd, 0); // Byte 21 - 30 (10 bytes): Reserved
|
|
||||||
self::putInt32($fd, 0);
|
|
||||||
self::putInt16($fd, 0);
|
|
||||||
self::putChar8($fd, 0); // Byte 31 (1 byte): Production MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not
|
|
||||||
}
|
|
||||||
// Byte n + 1 (1 byte): 0x0D as the field descriptor array terminator
|
|
||||||
self::putChar8($fd, 0x0D);
|
|
||||||
return new DBase($fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create DBase instance
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
private function __construct($fd)
|
|
||||||
{
|
|
||||||
$this->fd = $fd;
|
|
||||||
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
|
|
||||||
fseek($this->fd, 4, SEEK_SET);
|
|
||||||
$this->recordCount = self::getInt32($fd);
|
|
||||||
// Byte 8-9 (16-bit number): Number of bytes in the header.
|
|
||||||
fseek($this->fd, 8, SEEK_SET);
|
|
||||||
$this->headerLength = self::getInt16($fd);
|
|
||||||
// Number of fields is (headerLength - 33) / 32)
|
|
||||||
$this->fieldCount = ($this->headerLength - 33) / 32;
|
|
||||||
// Byte 10-11 (16-bit number): Number of bytes in record.
|
|
||||||
fseek($this->fd, 10, SEEK_SET);
|
|
||||||
$this->recordLength = self::getInt16($fd);
|
|
||||||
// Byte 32 - n (32 bytes each): Field descriptor array
|
|
||||||
fseek($fd, 32, SEEK_SET);
|
|
||||||
for ($i = 0; $i < $this->fieldCount; $i++) {
|
|
||||||
$data = fread($this->fd, 32);
|
|
||||||
$field = array_map('trim', unpack('a11name/a1type/c4/c1length/c1precision/s1workid/c1example/c10/c1production', $data));
|
|
||||||
$this->fields[] = $field;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_close
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function close()
|
|
||||||
{
|
|
||||||
fclose($this->fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* dbase_get_header_info
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function get_header_info()
|
|
||||||
{
|
|
||||||
// phpcs:disable
|
|
||||||
return $this->fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_numfields
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function numfields()
|
|
||||||
{
|
|
||||||
return $this->fieldCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_numrecords
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function numrecords()
|
|
||||||
{
|
|
||||||
return $this->recordCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* dbase_add_record
|
|
||||||
* @param array $record record
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function add_record($record)
|
|
||||||
{
|
|
||||||
// phpcs:enable
|
|
||||||
if (count($record) != $this->fieldCount) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Seek to end of file, minus the end of file marker
|
|
||||||
fseek($this->fd, 0, SEEK_END);
|
|
||||||
// Put the deleted flag
|
|
||||||
self::putChar8($this->fd, 0x20);
|
|
||||||
// Put the record
|
|
||||||
if (!$this->putRecord($record)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Update the record count
|
|
||||||
fseek($this->fd, 4);
|
|
||||||
self::putInt32($this->fd, ++$this->recordCount);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* dbase_replace_record
|
|
||||||
* @param array $record record
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function replace_record($record, $record_number)
|
|
||||||
{
|
|
||||||
// phpcs:enable
|
|
||||||
if (count($record) != $this->fieldCount) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Skip to the record location, plus the 1 byte for the deleted flag
|
|
||||||
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)) + 1);
|
|
||||||
return $this->putRecord($record);
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* dbase_delete_record
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function delete_record($record_number)
|
|
||||||
{
|
|
||||||
// phpcs:enable
|
|
||||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
|
|
||||||
self::putChar8($this->fd, 0x2A);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* dbase_get_record
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function get_record($record_number)
|
|
||||||
{
|
|
||||||
// phpcs:enable
|
|
||||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
|
|
||||||
$record = array(
|
|
||||||
'deleted' => self::getChar8($this->fd) == 0x2A ? 1 : 0
|
|
||||||
);
|
|
||||||
foreach ($this->fields as $i => &$field) {
|
|
||||||
$value = trim(fread($this->fd, $field['length']));
|
|
||||||
if ($field['type'] == 'L') {
|
|
||||||
$value = strtolower($value);
|
|
||||||
if ($value == 't' || $value == 'y') {
|
|
||||||
$value = true;
|
|
||||||
} elseif ($value == 'f' || $value == 'n') {
|
|
||||||
$value = false;
|
|
||||||
} else {
|
|
||||||
$value = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$record[$i] = $value;
|
|
||||||
}
|
|
||||||
return $record;
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* dbase_get_record_with_names
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function get_record_with_names($record_number)
|
|
||||||
{
|
|
||||||
// phpcs:enable
|
|
||||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$record = $this->get_record($record_number);
|
|
||||||
foreach ($this->fields as $i => &$field) {
|
|
||||||
$record[$field['name']] = $record[$i];
|
|
||||||
unset($record[$i]);
|
|
||||||
}
|
|
||||||
return $record;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_pack
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function pack()
|
|
||||||
{
|
|
||||||
$in_offset = $out_offset = $this->headerLength;
|
|
||||||
$new_count = 0;
|
|
||||||
$rec_count = $this->recordCount;
|
|
||||||
while ($rec_count > 0) {
|
|
||||||
fseek($this->fd, $in_offset, SEEK_SET);
|
|
||||||
$record = fread($this->fd, $this->recordLength);
|
|
||||||
$deleted = substr($record, 0, 1);
|
|
||||||
if ($deleted != '*') {
|
|
||||||
fseek($this->fd, $out_offset, SEEK_SET);
|
|
||||||
fwrite($this->fd, $record);
|
|
||||||
$out_offset += $this->recordLength;
|
|
||||||
$new_count++;
|
|
||||||
}
|
|
||||||
$in_offset += $this->recordLength;
|
|
||||||
$rec_count--;
|
|
||||||
}
|
|
||||||
ftruncate($this->fd, $out_offset);
|
|
||||||
// Update the record count
|
|
||||||
fseek($this->fd, 4);
|
|
||||||
self::putInt32($this->fd, $new_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A few utilitiy functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $field field
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
private static function length($field)
|
|
||||||
{
|
|
||||||
switch ($field[1]) {
|
|
||||||
case 'D': // Date: Numbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
|
|
||||||
return 8;
|
|
||||||
case 'T': // DateTime (YYYYMMDDhhmmss.uuu) (FoxPro)
|
|
||||||
return 18;
|
|
||||||
case 'M': // Memo (ignored): All ASCII characters (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
|
|
||||||
case 'N': // Number: -.0123456789 (right justified, padded with whitespaces)
|
|
||||||
case 'F': // Float: -.0123456789 (right justified, padded with whitespaces)
|
|
||||||
case 'C': // String: All ASCII characters (padded with whitespaces up to the field's length)
|
|
||||||
return $field[2];
|
|
||||||
case 'L': // Boolean: YyNnTtFf? (? when not initialized)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Functions for reading and writing bytes
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getChar8
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
private static function getChar8($fd)
|
|
||||||
{
|
|
||||||
return ord(fread($fd, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* putChar8
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @param mixed $value value
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private static function putChar8($fd, $value)
|
|
||||||
{
|
|
||||||
return fwrite($fd, chr($value));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getInt16
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @param int $n n
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private static function getInt16($fd, $n = 1)
|
|
||||||
{
|
|
||||||
$data = fread($fd, 2 * $n);
|
|
||||||
$i = unpack("S$n", $data);
|
|
||||||
if ($n == 1) {
|
|
||||||
return (int) $i[1];
|
|
||||||
} else {
|
|
||||||
return array_merge($i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* putInt16
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @param mixed $value value
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private static function putInt16($fd, $value)
|
|
||||||
{
|
|
||||||
return fwrite($fd, pack('S', $value));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getInt32
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @param int $n n
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private static function getInt32($fd, $n = 1)
|
|
||||||
{
|
|
||||||
$data = fread($fd, 4 * $n);
|
|
||||||
$i = unpack("L$n", $data);
|
|
||||||
if ($n == 1) {
|
|
||||||
return (int) $i[1];
|
|
||||||
} else {
|
|
||||||
return array_merge($i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* putint32
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @param mixed $value value
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private static function putInt32($fd, $value)
|
|
||||||
{
|
|
||||||
return fwrite($fd, pack('L', $value));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* putString
|
|
||||||
* @param mixed $fd file descriptor
|
|
||||||
* @param mixed $value value
|
|
||||||
* @param int $length length
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private static function putString($fd, $value, $length = 254)
|
|
||||||
{
|
|
||||||
$ret = fwrite($fd, pack('A' . $length, $value));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* putRecord
|
|
||||||
* @param mixed $record record
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function putRecord($record)
|
|
||||||
{
|
|
||||||
foreach ($this->fields as $i => &$field) {
|
|
||||||
$value = $record[$i];
|
|
||||||
// Number types are right aligned with spaces
|
|
||||||
if ($field['type'] == 'N' || $field['type'] == 'F' && strlen($value) < $field['length']) {
|
|
||||||
$value = str_repeat(' ', $field['length'] - strlen($value)) . $value;
|
|
||||||
}
|
|
||||||
self::putString($this->fd, $value, $field['length']);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!function_exists('dbase_open')) {
|
|
||||||
/**
|
|
||||||
* dbase_open
|
|
||||||
* @param string $filename filename
|
|
||||||
* @param int $mode mode
|
|
||||||
* @return DBase
|
|
||||||
*/
|
|
||||||
function dbase_open($filename, $mode)
|
|
||||||
{
|
|
||||||
return DBase::open($filename, $mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_create
|
|
||||||
* @param string $filename filename
|
|
||||||
* @param array $fields fields
|
|
||||||
* @param int $type type
|
|
||||||
* @return DBase
|
|
||||||
*/
|
|
||||||
function dbase_create($filename, $fields, $type = DBASE_TYPE_DBASE)
|
|
||||||
{
|
|
||||||
return DBase::create($filename, $fields, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_close
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_close($dbase_identifier)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_get_header_info
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function dbase_get_header_info($dbase_identifier)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->get_header_info();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_numfields
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
function dbase_numfields($dbase_identifier)
|
|
||||||
{
|
|
||||||
$dbase_identifier->numfields();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_numrecords
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
function dbase_numrecords($dbase_identifier)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->numrecords();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_add_record
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @param array $record record
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_add_record($dbase_identifier, $record)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->add_record($record);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_delete_record
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_delete_record($dbase_identifier, $record_number)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->delete_record($record_number);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_replace_record
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @param array $record record
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_replace_record($dbase_identifier, $record, $record_number)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->replace_record($record, $record_number);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_get_record
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_get_record($dbase_identifier, $record_number)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->get_record($record_number);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_get_record_with_names
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @param int $record_number record number
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_get_record_with_names($dbase_identifier, $record_number)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->get_record_with_names($record_number);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbase_pack
|
|
||||||
* @param Resource $dbase_identifier dbase identifier
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function dbase_pack($dbase_identifier)
|
|
||||||
{
|
|
||||||
return $dbase_identifier->pack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -50,6 +50,10 @@ then
|
|||||||
then
|
then
|
||||||
aaupper="SA"
|
aaupper="SA"
|
||||||
fi
|
fi
|
||||||
|
if [ $bb = "IQ" ]
|
||||||
|
then
|
||||||
|
aaupper="SA"
|
||||||
|
fi
|
||||||
|
|
||||||
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
||||||
|
|
||||||
@ -57,7 +61,12 @@ then
|
|||||||
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
||||||
then
|
then
|
||||||
reflang="htdocs/langs/"$aa"_"$aaupper
|
reflang="htdocs/langs/"$aa"_"$aaupper
|
||||||
if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ]
|
echo $reflang" "$aa"_"$bb != $aa"_"$aaupper
|
||||||
|
|
||||||
|
# If $reflang is a main language to use to sanitize the alternative file
|
||||||
|
if [ -d $reflang ]
|
||||||
|
then
|
||||||
|
if [ $aa"_"$bb != $aa"_"$aaupper ]
|
||||||
then
|
then
|
||||||
echo "***** Search original into "$reflang
|
echo "***** Search original into "$reflang
|
||||||
echo $dirshort is an alternative language of $reflang
|
echo $dirshort is an alternative language of $reflang
|
||||||
@ -75,5 +84,6 @@ then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done;
|
done;
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -177,7 +177,7 @@ foreach ($filesToProcess as $fileToProcess) {
|
|||||||
|
|
||||||
|
|
||||||
// Start reading and parsing English
|
// Start reading and parsing English
|
||||||
|
$aEnglish = array();
|
||||||
if ($handle = fopen($lEnglishFile, 'r')) {
|
if ($handle = fopen($lEnglishFile, 'r')) {
|
||||||
print "Read English File $lEnglishFile:\n";
|
print "Read English File $lEnglishFile:\n";
|
||||||
$cnt = 0;
|
$cnt = 0;
|
||||||
@ -246,6 +246,9 @@ foreach ($filesToProcess as $fileToProcess) {
|
|||||||
|
|
||||||
fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n");
|
fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n");
|
||||||
|
|
||||||
|
$fileFirstFound = array();
|
||||||
|
$lineFirstFound = array();
|
||||||
|
|
||||||
$cnt = 0;
|
$cnt = 0;
|
||||||
while (($line = fgets($handle)) !== false) {
|
while (($line = fgets($handle)) !== false) {
|
||||||
$cnt++;
|
$cnt++;
|
||||||
@ -299,6 +302,7 @@ foreach ($filesToProcess as $fileToProcess) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// String exists in both files and value into alternative language differs from main language but also from english files
|
// String exists in both files and value into alternative language differs from main language but also from english files
|
||||||
|
// so we keep it.
|
||||||
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
|
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
|
||||||
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|
||||||
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)
|
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)
|
||||||
|
|||||||
@ -553,16 +553,16 @@ if ($id) {
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = '&id='.$id;
|
$param = '&id='.urlencode($id);
|
||||||
if ($search_country_id > 0) {
|
if ($search_country_id > 0) {
|
||||||
$param .= '&search_country_id='.$search_country_id;
|
$param .= '&search_country_id='.urlencode($search_country_id);
|
||||||
}
|
}
|
||||||
$paramwithsearch = $param;
|
$paramwithsearch = $param;
|
||||||
if ($sortorder) {
|
if ($sortorder) {
|
||||||
$paramwithsearch .= '&sortorder='.$sortorder;
|
$paramwithsearch .= '&sortorder='.urlencode($sortorder);
|
||||||
}
|
}
|
||||||
if ($sortfield) {
|
if ($sortfield) {
|
||||||
$paramwithsearch .= '&sortfield='.$sortfield;
|
$paramwithsearch .= '&sortfield='.urlencode($sortfield);
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is several pages
|
// There is several pages
|
||||||
|
|||||||
@ -257,7 +257,20 @@ if ($action == 'create') {
|
|||||||
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
|
// autosuggest from existing account types if found
|
||||||
|
print '<datalist id="pcg_type_datalist">';
|
||||||
|
$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
|
||||||
|
$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
|
||||||
|
$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
|
||||||
|
$sql .= ' LIMIT 50000'; // just as a sanity check
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</datalist>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
@ -320,7 +333,20 @@ if ($action == 'create') {
|
|||||||
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
|
// autosuggest from existing account types if found
|
||||||
|
print '<datalist id="pcg_type_datalist">';
|
||||||
|
$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
|
||||||
|
$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
|
||||||
|
$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
|
||||||
|
$sql .= ' LIMIT 50000'; // just as a sanity check
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</datalist>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
@ -335,11 +361,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -580,7 +580,7 @@ if ($resql) {
|
|||||||
|
|
||||||
$param = '&id='.$id;
|
$param = '&id='.$id;
|
||||||
if ($search_country_id > 0) {
|
if ($search_country_id > 0) {
|
||||||
$param .= '&search_country_id='.$search_country_id;
|
$param .= '&search_country_id='.urlencode($search_country_id);
|
||||||
}
|
}
|
||||||
$paramwithsearch = $param;
|
$paramwithsearch = $param;
|
||||||
if ($sortorder) {
|
if ($sortorder) {
|
||||||
|
|||||||
@ -242,11 +242,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -512,7 +512,7 @@ if ($id) {
|
|||||||
|
|
||||||
$param = '&id='.$id;
|
$param = '&id='.$id;
|
||||||
if ($search_country_id > 0) {
|
if ($search_country_id > 0) {
|
||||||
$param .= '&search_country_id='.$search_country_id;
|
$param .= '&search_country_id='.urlencode($search_country_id);
|
||||||
}
|
}
|
||||||
$paramwithsearch = $param;
|
$paramwithsearch = $param;
|
||||||
if ($sortorder) {
|
if ($sortorder) {
|
||||||
|
|||||||
@ -198,7 +198,7 @@ if ($action == 'update') {
|
|||||||
$sql .= " WHERE rowid = ".((int) $productid);
|
$sql .= " WHERE rowid = ".((int) $productid);
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog("/accountancy/admin/productaccount.php sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$ok++;
|
$ok++;
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -329,7 +329,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
dol_syslog("/accountancy/admin/productaccount.php:: sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|||||||
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
$langs->loadLangs(array("accountancy", "compta"));
|
$langs->loadLangs(array("accountancy", "compta"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ09');
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
@ -120,19 +121,19 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||||||
$filter = array();
|
$filter = array();
|
||||||
if (!empty($search_date_start)) {
|
if (!empty($search_date_start)) {
|
||||||
$filter['t.doc_date>='] = $search_date_start;
|
$filter['t.doc_date>='] = $search_date_start;
|
||||||
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int').'&date_startday='.GETPOST('date_startday', 'int').'&date_startyear='.GETPOST('date_startyear', 'int');
|
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int').'&date_startday='.GETPOST('date_startday', 'int').'&date_startyear='.GETPOST('date_startyear', 'int');
|
||||||
}
|
}
|
||||||
if (!empty($search_date_end)) {
|
if (!empty($search_date_end)) {
|
||||||
$filter['t.doc_date<='] = $search_date_end;
|
$filter['t.doc_date<='] = $search_date_end;
|
||||||
$param .= '&date_endmonth='.GETPOST('date_endmonth', 'int').'&date_endday='.GETPOST('date_endday', 'int').'&date_endyear='.GETPOST('date_endyear', 'int');
|
$param .= '&date_endmonth='.GETPOST('date_endmonth', 'int').'&date_endday='.GETPOST('date_endday', 'int').'&date_endyear='.GETPOST('date_endyear', 'int');
|
||||||
}
|
}
|
||||||
if (!empty($search_accountancy_code_start)) {
|
if (!empty($search_accountancy_code_start)) {
|
||||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||||
$param .= '&search_accountancy_code_start='.$search_accountancy_code_start;
|
$param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
|
||||||
}
|
}
|
||||||
if (!empty($search_accountancy_code_end)) {
|
if (!empty($search_accountancy_code_end)) {
|
||||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||||
$param .= '&search_accountancy_code_end='.$search_accountancy_code_end;
|
$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
|
||||||
}
|
}
|
||||||
if (!empty($search_ledger_code)) {
|
if (!empty($search_ledger_code)) {
|
||||||
$filter['t.code_journal'] = $search_ledger_code;
|
$filter['t.code_journal'] = $search_ledger_code;
|
||||||
|
|||||||
@ -530,25 +530,25 @@ $sqlwhere = array();
|
|||||||
if (count($filter) > 0) {
|
if (count($filter) > 0) {
|
||||||
foreach ($filter as $key => $value) {
|
foreach ($filter as $key => $value) {
|
||||||
if ($key == 't.doc_date') {
|
if ($key == 't.doc_date') {
|
||||||
$sqlwhere[] = $key.'=\''.$db->idate($value).'\'';
|
$sqlwhere[] = $key."='".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
||||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=') {
|
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=') {
|
||||||
$sqlwhere[] = $key.'\''.$db->escape($value).'\'';
|
$sqlwhere[] = $key."'".$db->escape($value)."'";
|
||||||
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
||||||
$sqlwhere[] = $key.'='.$value;
|
$sqlwhere[] = $key.'='.((int) $value);
|
||||||
} elseif ($key == 't.numero_compte') {
|
} elseif ($key == 't.numero_compte') {
|
||||||
$sqlwhere[] = $key.' LIKE \''.$db->escape($value).'%\'';
|
$sqlwhere[] = $key." LIKE '".$db->escape($value)."%'";
|
||||||
} elseif ($key == 't.subledger_account') {
|
} elseif ($key == 't.subledger_account') {
|
||||||
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
||||||
} elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') {
|
} elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') {
|
||||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.tms>=' || $key == 't.tms<=') {
|
} elseif ($key == 't.tms>=' || $key == 't.tms<=') {
|
||||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||||
} elseif ($key == 't.reconciled_option') {
|
} elseif ($key == 't.reconciled_option') {
|
||||||
@ -612,7 +612,7 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -433,7 +433,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
|
|
||||||
$this->lines_display = array();
|
$this->lines_display = array();
|
||||||
|
|
||||||
dol_syslog(__METHOD__." sql=".$sql, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
@ -632,7 +632,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
$sql .= " WHERE aa.rowid = ".((int) $cpt_id);
|
$sql .= " WHERE aa.rowid = ".((int) $cpt_id);
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(__METHOD__." sql=".$sql, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -1307,7 +1307,9 @@ class AccountancyExport
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : LD Compta version 10 & higher
|
* Export format : LD Compta version 10 & higher
|
||||||
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
|
* Last review for this format : 08-15-2021 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||||
|
*
|
||||||
|
* Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
|
||||||
*
|
*
|
||||||
* @param array $objectLines data
|
* @param array $objectLines data
|
||||||
*
|
*
|
||||||
@ -1470,14 +1472,14 @@ class AccountancyExport
|
|||||||
print $date_lim_reglement.$separator;
|
print $date_lim_reglement.$separator;
|
||||||
// CNPI
|
// CNPI
|
||||||
if ($line->doc_type == 'supplier_invoice') {
|
if ($line->doc_type == 'supplier_invoice') {
|
||||||
if (($line->debit - $line->credit) > 0) {
|
if (($line->amount) < 0) { // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign.
|
||||||
$nature_piece = 'AF';
|
$nature_piece = 'AF';
|
||||||
} else {
|
} else {
|
||||||
$nature_piece = 'FF';
|
$nature_piece = 'FF';
|
||||||
}
|
}
|
||||||
} elseif ($line->doc_type == 'customer_invoice') {
|
} elseif ($line->doc_type == 'customer_invoice') {
|
||||||
if (($line->debit - $line->credit) < 0) {
|
if (($line->amount) < 0) {
|
||||||
$nature_piece = 'AC';
|
$nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign.
|
||||||
} else {
|
} else {
|
||||||
$nature_piece = 'FC';
|
$nature_piece = 'FC';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class AccountancySystem
|
|||||||
$sql .= " a.pcg_version = '".$this->db->escape($ref)."'";
|
$sql .= " a.pcg_version = '".$this->db->escape($ref)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
@ -143,9 +143,9 @@ class AccountancySystem
|
|||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_system";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_system";
|
||||||
$sql .= " (date_creation, fk_user_author, numero, label)";
|
$sql .= " (date_creation, fk_user_author, numero, label)";
|
||||||
$sql .= " VALUES ('".$this->db->idate($now)."',".$user->id.",'".$this->db->escape($this->numero)."','".$this->db->escape($this->label)."')";
|
$sql .= " VALUES ('".$this->db->idate($now)."',".((int) $user->id).",'".$this->db->escape($this->numero)."','".$this->db->escape($this->label)."')";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_system");
|
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_system");
|
||||||
|
|||||||
@ -150,7 +150,7 @@ class AccountingAccount extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->next_prev_filter = 'fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS.')'; // Used to add a filter in Form::showrefnav method
|
$this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS).")"; // Used to add a filter in Form::showrefnav method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -185,7 +185,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'";
|
$sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
@ -289,7 +289,7 @@ class AccountingAccount extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -352,7 +352,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= " , reconcilable = ".(int) $this->reconcilable;
|
$sql .= " , reconcilable = ".(int) $this->reconcilable;
|
||||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -374,12 +374,12 @@ class AccountingAccount extends CommonObject
|
|||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$sql = "(SELECT fk_code_ventilation FROM ".MAIN_DB_PREFIX."facturedet";
|
$sql = "(SELECT fk_code_ventilation FROM ".MAIN_DB_PREFIX."facturedet";
|
||||||
$sql .= " WHERE fk_code_ventilation=".$this->id.")";
|
$sql .= " WHERE fk_code_ventilation=".((int) $this->id).")";
|
||||||
$sql .= "UNION";
|
$sql .= "UNION";
|
||||||
$sql .= " (SELECT fk_code_ventilation FROM ".MAIN_DB_PREFIX."facture_fourn_det";
|
$sql .= " (SELECT fk_code_ventilation FROM ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||||
$sql .= " WHERE fk_code_ventilation=".$this->id.")";
|
$sql .= " WHERE fk_code_ventilation=".((int) $this->id).")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::checkUsage sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::checkUsage", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
@ -604,7 +604,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= "SET ".$fieldtouse." = '0'";
|
$sql .= "SET ".$fieldtouse." = '0'";
|
||||||
$sql .= " WHERE rowid = ".((int) $id);
|
$sql .= " WHERE rowid = ".((int) $id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -642,7 +642,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= " SET ".$fieldtouse." = '1'";
|
$sql .= " SET ".$fieldtouse." = '1'";
|
||||||
$sql .= " WHERE rowid = ".((int) $id);
|
$sql .= " WHERE rowid = ".((int) $id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::account_activate ".$fieldtouse, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|||||||
@ -113,7 +113,7 @@ class AccountingJournal extends CommonObject
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
@ -170,18 +170,18 @@ class AccountingJournal extends CommonObject
|
|||||||
$sql .= ' WHERE 1 = 1';
|
$sql .= ' WHERE 1 = 1';
|
||||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
$sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere);
|
$sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($sortfield)) {
|
if (!empty($sortfield)) {
|
||||||
$sql .= $this->db->order($sortfield, $sortorder);
|
$sql .= $this->db->order($sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$sql .= ' '.$this->db->plimit($limit + 1, $offset);
|
$sql .= $this->db->plimit($limit + 1, $offset);
|
||||||
}
|
}
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|||||||
@ -297,7 +297,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
|
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
|
||||||
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
||||||
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
|
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
|
||||||
$sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines
|
$sql .= " AND fk_docdet = ".((int) $this->fk_docdet); // This field can be 0 if record is for several lines
|
||||||
}
|
}
|
||||||
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
|
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
|
||||||
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
|
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
|
||||||
@ -390,7 +390,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= ", '".$this->db->idate($now)."'";
|
$sql .= ", '".$this->db->idate($now)."'";
|
||||||
$sql .= ", '".$this->db->escape($this->code_journal)."'";
|
$sql .= ", '".$this->db->escape($this->code_journal)."'";
|
||||||
$sql .= ", ".(!empty($this->journal_label) ? ("'".$this->db->escape($this->journal_label)."'") : "NULL");
|
$sql .= ", ".(!empty($this->journal_label) ? ("'".$this->db->escape($this->journal_label)."'") : "NULL");
|
||||||
$sql .= ", ".$this->db->escape($this->piece_num);
|
$sql .= ", ".((int) $this->piece_num);
|
||||||
$sql .= ", ".(!isset($this->entity) ? $conf->entity : $this->entity);
|
$sql .= ", ".(!isset($this->entity) ? $conf->entity : $this->entity);
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= ' '.(!isset($this->credit) ? 'NULL' : $this->credit).',';
|
$sql .= ' '.(!isset($this->credit) ? 'NULL' : $this->credit).',';
|
||||||
$sql .= ' '.(!isset($this->montant) ? 'NULL' : $this->montant).',';
|
$sql .= ' '.(!isset($this->montant) ? 'NULL' : $this->montant).',';
|
||||||
$sql .= ' '.(!isset($this->sens) ? 'NULL' : "'".$this->db->escape($this->sens)."'").',';
|
$sql .= ' '.(!isset($this->sens) ? 'NULL' : "'".$this->db->escape($this->sens)."'").',';
|
||||||
$sql .= ' '.$user->id.',';
|
$sql .= ' '.((int) $user->id).',';
|
||||||
$sql .= ' '."'".$this->db->idate($now)."',";
|
$sql .= ' '."'".$this->db->idate($now)."',";
|
||||||
$sql .= ' '.(empty($this->code_journal) ? 'NULL' : "'".$this->db->escape($this->code_journal)."'").',';
|
$sql .= ' '.(empty($this->code_journal) ? 'NULL' : "'".$this->db->escape($this->code_journal)."'").',';
|
||||||
$sql .= ' '.(empty($this->journal_label) ? 'NULL' : "'".$this->db->escape($this->journal_label)."'").',';
|
$sql .= ' '.(empty($this->journal_label) ? 'NULL' : "'".$this->db->escape($this->journal_label)."'").',';
|
||||||
@ -729,7 +729,10 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " t.journal_label,";
|
$sql .= " t.journal_label,";
|
||||||
$sql .= " t.piece_num,";
|
$sql .= " t.piece_num,";
|
||||||
$sql .= " t.date_creation,";
|
$sql .= " t.date_creation,";
|
||||||
|
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
|
||||||
|
if ($mode != "_tmp") {
|
||||||
$sql .= " t.date_export,";
|
$sql .= " t.date_export,";
|
||||||
|
}
|
||||||
$sql .= " t.date_validated as date_validation";
|
$sql .= " t.date_validated as date_validation";
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
|
||||||
$sql .= ' WHERE 1 = 1';
|
$sql .= ' WHERE 1 = 1';
|
||||||
@ -880,7 +883,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= ' WHERE 1 = 1';
|
$sql .= ' WHERE 1 = 1';
|
||||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
$sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere);
|
$sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere);
|
||||||
}
|
}
|
||||||
// Affichage par compte comptable
|
// Affichage par compte comptable
|
||||||
if (!empty($option)) {
|
if (!empty($option)) {
|
||||||
@ -891,10 +894,10 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($sortfield)) {
|
if (!empty($sortfield)) {
|
||||||
$sql .= ', '.$sortfield.' '.$sortorder;
|
$sql .= ", ".$sortfield." ".$sortorder;
|
||||||
}
|
}
|
||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$sql .= ' '.$this->db->plimit($limit + 1, $offset);
|
$sql .= $this->db->plimit($limit + 1, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1024,6 +1027,12 @@ class BookKeeping extends CommonObject
|
|||||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||||
|
} elseif ($key == 't.code_journal' && !empty($value)) {
|
||||||
|
if (is_array($value)) {
|
||||||
|
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
||||||
|
} else {
|
||||||
|
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
||||||
}
|
}
|
||||||
@ -1034,13 +1043,13 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " AND t.date_export IS NULL";
|
$sql .= " AND t.date_export IS NULL";
|
||||||
}
|
}
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
$sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere);
|
$sql .= ' AND '.implode(" ".$filtermode." ", $sqlwhere);
|
||||||
}
|
}
|
||||||
if (!empty($sortfield)) {
|
if (!empty($sortfield)) {
|
||||||
$sql .= $this->db->order($sortfield, $sortorder);
|
$sql .= $this->db->order($sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$sql .= ' '.$this->db->plimit($limit + 1, $offset);
|
$sql .= $this->db->plimit($limit + 1, $offset);
|
||||||
}
|
}
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
@ -1128,17 +1137,17 @@ class BookKeeping extends CommonObject
|
|||||||
if (count($filter) > 0) {
|
if (count($filter) > 0) {
|
||||||
foreach ($filter as $key => $value) {
|
foreach ($filter as $key => $value) {
|
||||||
if ($key == 't.doc_date') {
|
if ($key == 't.doc_date') {
|
||||||
$sqlwhere[] = $key.'=\''.$this->db->idate($value).'\'';
|
$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
|
||||||
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
||||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
$sqlwhere[] = $key."'".$this->db->idate($value)."'";
|
||||||
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
|
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
|
||||||
$sqlwhere[] = $key.'\''.$this->db->escape($value).'\'';
|
$sqlwhere[] = $key."'".$this->db->escape($value)."'";
|
||||||
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
||||||
$sqlwhere[] = $key.'='.$value;
|
$sqlwhere[] = $key." = ".((int) $value);
|
||||||
} elseif ($key == 't.subledger_account' || $key == 't.numero_compte') {
|
} elseif ($key == 't.subledger_account' || $key == 't.numero_compte') {
|
||||||
$sqlwhere[] = $key.' LIKE \''.$this->db->escape($value).'%\'';
|
$sqlwhere[] = $key." LIKE '".$this->db->escape($value)."%'";
|
||||||
} elseif ($key == 't.subledger_label') {
|
} elseif ($key == 't.subledger_label') {
|
||||||
$sqlwhere[] = $key.' LIKE \''.$this->db->escape($value).'%\'';
|
$sqlwhere[] = $key." LIKE '".$this->db->escape($value)."%'";
|
||||||
} elseif ($key == 't.code_journal' && !empty($value)) {
|
} elseif ($key == 't.code_journal' && !empty($value)) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
||||||
@ -1146,13 +1155,13 @@ class BookKeeping extends CommonObject
|
|||||||
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
|
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql .= ' WHERE entity IN ('.getEntity('accountancy').')';
|
$sql .= ' WHERE entity IN ('.getEntity('accountancy').')';
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
$sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere);
|
$sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= ' GROUP BY t.numero_compte';
|
$sql .= ' GROUP BY t.numero_compte';
|
||||||
@ -1161,7 +1170,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= $this->db->order($sortfield, $sortorder);
|
$sql .= $this->db->order($sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$sql .= ' '.$this->db->plimit($limit + 1, $offset);
|
$sql .= $this->db->plimit($limit + 1, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1338,8 +1347,9 @@ class BookKeeping extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||||
$sql .= ' SET '.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'");
|
$sql .= " SET ".$field." = ".(is_numeric($value) ? ((float) $value) : "'".$this->db->escape($value)."'");
|
||||||
$sql .= " WHERE piece_num = '".$this->db->escape($piece_num)."'";
|
$sql .= " WHERE piece_num = ".((int) $piece_num);
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
@ -1622,9 +1632,13 @@ class BookKeeping extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
|
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
|
||||||
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
|
$sql .= " date_creation, tms as date_modification, date_validated as date_validation";
|
||||||
|
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
|
||||||
|
if ($mode != "_tmp") {
|
||||||
|
$sql .= ", date_export";
|
||||||
|
}
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||||
$sql .= " WHERE piece_num = ".$piecenum;
|
$sql .= " WHERE piece_num = ".((int) $piecenum);
|
||||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -1665,7 +1679,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
$sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||||
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
|
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."getNextNumMvt sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."getNextNumMvt", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -1699,9 +1713,13 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
|
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
|
||||||
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
|
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
|
||||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
|
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
|
||||||
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
|
$sql .= " date_creation, tms as date_modification, date_validated as date_validation";
|
||||||
|
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
|
||||||
|
if ($mode != "_tmp") {
|
||||||
|
$sql .= ", date_export";
|
||||||
|
}
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||||
$sql .= " WHERE piece_num = ".$piecenum;
|
$sql .= " WHERE piece_num = ".((int) $piecenum);
|
||||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -1841,7 +1859,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= ' SELECT doc_date, doc_type,';
|
$sql .= ' SELECT doc_date, doc_type,';
|
||||||
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
|
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
|
||||||
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
||||||
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.$next_piecenum.", '".$this->db->idate($now)."'";
|
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'";
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num);
|
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
@ -2000,7 +2018,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
|
$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
|
||||||
$sql .= " AND aa.entity IN (".getEntity('accountancy').")";
|
$sql .= " AND aa.entity IN (".getEntity('accountancy').")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::select_account sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = '';
|
$obj = '';
|
||||||
@ -2040,7 +2058,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
|
||||||
$sql .= " WHERE aa.entity IN (".getEntity('accountancy').")";
|
$sql .= " WHERE aa.entity IN (".getEntity('accountancy').")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::select_account sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = '';
|
$obj = '';
|
||||||
|
|||||||
@ -279,7 +279,7 @@ class Lettering extends BookKeeping
|
|||||||
$sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND date_validated IS NULL ";
|
$sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND date_validated IS NULL ";
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -95,7 +95,7 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting-
|
|||||||
$sql .= " AND doc_date >= '" . $db->idate($date_start) . "'";
|
$sql .= " AND doc_date >= '" . $db->idate($date_start) . "'";
|
||||||
$sql .= " AND doc_date <= '" . $db->idate($date_end) . "'";
|
$sql .= " AND doc_date <= '" . $db->idate($date_end) . "'";
|
||||||
|
|
||||||
dol_syslog("/accountancy/closure/index.php :: Function validate_movement_confirm Specify movements as validated sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/closure/index.php :: Function validate_movement_confirm Specify movements as validated", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -189,7 +189,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(b.doc_date)='.$j, '1', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " COUNT(b.rowid) as total";
|
$sql .= " COUNT(b.rowid) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
|
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
|
||||||
@ -198,7 +198,7 @@ $sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
|
|||||||
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
|
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
|
||||||
$sql .= " AND date_validated IS NULL";
|
$sql .= " AND date_validated IS NULL";
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/closure/index.php sql='.$sql, LOG_DEBUG);
|
dol_syslog('htdocs/accountancy/closure/index.php', LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|||||||
@ -117,7 +117,7 @@ if (!empty($id)) {
|
|||||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = ".((int) $id);
|
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = ".((int) $id);
|
||||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("/accounting/customer/card.php sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accounting/customer/card.php", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@ -85,8 +85,8 @@ if ($action == 'clean' || $action == 'validatehistory') {
|
|||||||
$sql1 .= ' (SELECT accnt.rowid ';
|
$sql1 .= ' (SELECT accnt.rowid ';
|
||||||
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
||||||
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
||||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity.')';
|
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')';
|
||||||
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture WHERE entity = '.$conf->entity.')';
|
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture WHERE entity = '.((int) $conf->entity).')';
|
||||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||||
@ -110,13 +110,13 @@ if ($action == 'validatehistory') {
|
|||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . ((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.$conf->entity;
|
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . ((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity);
|
||||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
|
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
|
||||||
} else {
|
} else {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . ((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.$conf->entity;
|
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . ((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity);
|
||||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||||
}*/
|
}*/
|
||||||
@ -283,7 +283,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$j, 'fd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j, "fd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(fd.total_ht) as total";
|
$sql .= " SUM(fd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
||||||
@ -306,7 +306,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|||||||
}
|
}
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php sql='.$sql, LOG_DEBUG);
|
dol_syslog('htdocs/accountancy/customer/index.php', LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
@ -367,7 +367,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$j, 'fd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j, "fd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(fd.total_ht) as total";
|
$sql .= " SUM(fd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
||||||
@ -452,7 +452,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$j, 'fd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j, "fd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(fd.total_ht) as total";
|
$sql .= " SUM(fd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
||||||
@ -513,7 +513,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$j, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j, "(fd.total_ht-(fd.qty * fd.buy_price_ht))", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
||||||
|
|||||||
@ -188,7 +188,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
$accountventilated = new AccountingAccount($db);
|
$accountventilated = new AccountingAccount($db);
|
||||||
$accountventilated->fetch($monCompte, '', 1);
|
$accountventilated->fetch($monCompte, '', 1);
|
||||||
|
|
||||||
dol_syslog("accountancy/customer/list.php sql=".$sql, LOG_DEBUG);
|
dol_syslog("accountancy/customer/list.php", LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||||
$ok++;
|
$ok++;
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if (!empty($id)) {
|
|||||||
$sql .= " WHERE er.fk_statut > 0 AND erd.rowid = ".((int) $id);
|
$sql .= " WHERE er.fk_statut > 0 AND erd.rowid = ".((int) $id);
|
||||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("/accounting/expensereport/card.php sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accounting/expensereport/card.php", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@ -79,8 +79,8 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou
|
|||||||
$sql1 .= ' (SELECT accnt.rowid ';
|
$sql1 .= ' (SELECT accnt.rowid ';
|
||||||
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
||||||
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
||||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity.')';
|
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')';
|
||||||
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.$conf->entity.')';
|
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')';
|
||||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
@ -103,13 +103,13 @@ if ($action == 'validatehistory') {
|
|||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det";
|
||||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " FROM ".MAIN_DB_PREFIX."c_type_fees as t, ".MAIN_DB_PREFIX."accounting_account as accnt , ".MAIN_DB_PREFIX."accounting_system as syst";
|
$sql1 .= " FROM ".MAIN_DB_PREFIX."c_type_fees as t, ".MAIN_DB_PREFIX."accounting_account as accnt , ".MAIN_DB_PREFIX."accounting_system as syst";
|
||||||
$sql1 .= " WHERE ".MAIN_DB_PREFIX."expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.$conf->entity;
|
$sql1 .= " WHERE ".MAIN_DB_PREFIX."expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity);
|
||||||
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
|
||||||
$sql1 .= " AND ".MAIN_DB_PREFIX."expensereport_det.fk_code_ventilation = 0";
|
$sql1 .= " AND ".MAIN_DB_PREFIX."expensereport_det.fk_code_ventilation = 0";
|
||||||
} else {
|
} else {
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd, ".MAIN_DB_PREFIX."c_type_fees as t, ".MAIN_DB_PREFIX."accounting_account as accnt , ".MAIN_DB_PREFIX."accounting_system as syst";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd, ".MAIN_DB_PREFIX."c_type_fees as t, ".MAIN_DB_PREFIX."accounting_account as accnt , ".MAIN_DB_PREFIX."accounting_system as syst";
|
||||||
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.$conf->entity;
|
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity);
|
||||||
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
|
||||||
$sql1 .= " AND erd.fk_code_ventilation = 0";
|
$sql1 .= " AND erd.fk_code_ventilation = 0";
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(er.date_debut)='.$j, 'erd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(er.date_debut)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(erd.total_ht) as total";
|
$sql .= " SUM(erd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
||||||
@ -251,7 +251,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(er.date_debut)='.$j, 'erd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(er.date_debut)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
||||||
@ -330,7 +330,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(er.date_create)='.$j, 'erd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(er.date_create)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(erd.total_ht) as total";
|
$sql .= " SUM(erd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
||||||
|
|||||||
@ -159,7 +159,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
$accountventilated = new AccountingAccount($db);
|
$accountventilated = new AccountingAccount($db);
|
||||||
$accountventilated->fetch($monCompte, '', 1);
|
$accountventilated->fetch($monCompte, '', 1);
|
||||||
|
|
||||||
dol_syslog('accountancy/expensereport/list.php:: sql='.$sql, LOG_DEBUG);
|
dol_syslog('accountancy/expensereport/list.php', LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$msg .= '<div><span style="color:green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
$msg .= '<div><span style="color:green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||||
$ok++;
|
$ok++;
|
||||||
|
|||||||
@ -367,7 +367,7 @@ if ($result) {
|
|||||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id";
|
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id";
|
||||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid";
|
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid";
|
||||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'";
|
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'";
|
||||||
$sqlmid .= " WHERE bkurl.fk_bank=".$obj->rowid;
|
$sqlmid .= " WHERE bkurl.fk_bank = ".((int) $obj->rowid);
|
||||||
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG);
|
||||||
$resultmid = $db->query($sqlmid);
|
$resultmid = $db->query($sqlmid);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -627,7 +627,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -648,7 +648,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.$val["refsologest"].'"'.$sep;
|
print '"'.$val["refsologest"].'"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||||
@ -717,9 +717,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.$date.'"'.$sep;
|
print '"'.$date.'"'.$sep;
|
||||||
print '"'.$val["refsologest"].'"'.$sep;
|
print '"'.$val["refsologest"].'"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
||||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||||
@ -894,7 +894,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -609,7 +609,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.$val["ref"].'"'.$sep;
|
print '"'.$val["ref"].'"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER.'"'.$sep;
|
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||||
@ -834,7 +834,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -118,7 +118,7 @@ if (!empty($id)) {
|
|||||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = ".((int) $id);
|
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = ".((int) $id);
|
||||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("/accounting/supplier/card.php sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accounting/supplier/card.php", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@ -283,7 +283,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(ff.datef)='.$j, 'ffd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$j, "ffd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(ffd.total_ht) as total";
|
$sql .= " SUM(ffd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
|
||||||
@ -362,7 +362,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(ff.datef)='.$j, 'ffd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$j, "ffd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(ffd.total_ht) as total";
|
$sql .= " SUM(ffd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
|
||||||
@ -441,7 +441,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= " SUM(".$db->ifsql('MONTH(ff.datef)='.$j, 'ffd.total_ht', '0').") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
|
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$j, "ffd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM(ffd.total_ht) as total";
|
$sql .= " SUM(ffd.total_ht) as total";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
|
||||||
|
|||||||
@ -193,7 +193,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
$accountventilated = new AccountingAccount($db);
|
$accountventilated = new AccountingAccount($db);
|
||||||
$accountventilated->fetch($monCompte, '', 1);
|
$accountventilated->fetch($monCompte, '', 1);
|
||||||
|
|
||||||
dol_syslog('accountancy/supplier/list.php sql='.$sql, LOG_DEBUG);
|
dol_syslog('accountancy/supplier/list.php', LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||||
$ok++;
|
$ok++;
|
||||||
|
|||||||
@ -535,7 +535,7 @@ if (empty($reshook)) {
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
||||||
}
|
}
|
||||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && !isValidEMail($email)) {
|
if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && !isValidEMail($email)) {
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');
|
setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');
|
||||||
@ -1032,7 +1032,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// EMail
|
// EMail
|
||||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
|
print '<tr><td>'.(!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? '<span class="fieldrequired">' : '').$langs->trans("EMail").(!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? '</span>' : '').'</td>';
|
||||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $object->email).'"></td></tr>';
|
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $object->email).'"></td></tr>';
|
||||||
|
|
||||||
// Website
|
// Website
|
||||||
@ -1121,15 +1121,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("AddMember");
|
||||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
|
|
||||||
print ' ';
|
|
||||||
if (!empty($backtopage)) {
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
} else {
|
|
||||||
print '<input type="button" class="button button-cancel" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
}
|
}
|
||||||
@ -1396,11 +1388,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@ -1821,8 +1809,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
$result = $company->fetch($object->socid);
|
$result = $company->fetch($object->socid);
|
||||||
print $company->getNomUrl(1);
|
print $company->getNomUrl(1);
|
||||||
|
|
||||||
|
// Show link to invoices
|
||||||
|
$tmparray = $company->getOutstandingBills('customer');
|
||||||
|
if (!empty($tmparray['refs'])) {
|
||||||
|
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").': '.count($tmparray['refs']);
|
||||||
|
// TODO Add alert if warning on at least one invoice late
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("NoThirdPartyAssociatedToMember");
|
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -2002,8 +1998,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
// Generated documents
|
// Generated documents
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
//$filename = 'tmp_cards.php';
|
//$filename = 'tmp_cards.php';
|
||||||
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
||||||
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'member');
|
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
$genallowed = $user->rights->adherent->lire;
|
$genallowed = $user->rights->adherent->lire;
|
||||||
$delallowed = $user->rights->adherent->creer;
|
$delallowed = $user->rights->adherent->creer;
|
||||||
|
|||||||
@ -73,7 +73,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||||
|
|||||||
@ -774,7 +774,7 @@ class Adherent extends CommonObject
|
|||||||
// Remove links to user and replace with new one
|
// Remove links to user and replace with new one
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
dol_syslog(get_class($this)."::update update link to user");
|
dol_syslog(get_class($this)."::update update link to user");
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL WHERE fk_member = ".$this->id;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL WHERE fk_member = ".((int) $this->id);
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
@ -784,7 +784,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
// If there is a user linked to this member
|
// If there is a user linked to this member
|
||||||
if ($this->user_id > 0) {
|
if ($this->user_id > 0) {
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = ".$this->id." WHERE rowid = ".$this->user_id;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = ".((int) $this->id)." WHERE rowid = ".((int) $this->user_id);
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
@ -926,7 +926,7 @@ class Adherent extends CommonObject
|
|||||||
// Search for last subscription id and end date
|
// Search for last subscription id and end date
|
||||||
$sql = "SELECT rowid, datec as dateop, dateadh as datedeb, datef as datefin";
|
$sql = "SELECT rowid, datec as dateop, dateadh as datedeb, datef as datefin";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."subscription";
|
$sql .= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||||
$sql .= " WHERE fk_adherent=".$this->id;
|
$sql .= " WHERE fk_adherent = ".((int) $this->id);
|
||||||
$sql .= " ORDER by dateadh DESC"; // Sort by start subscription date
|
$sql .= " ORDER by dateadh DESC"; // Sort by start subscription date
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
|
||||||
@ -939,7 +939,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql .= " datefin=".($datefin != '' ? "'".$this->db->idate($datefin)."'" : "null");
|
$sql .= " datefin=".($datefin != '' ? "'".$this->db->idate($datefin)."'" : "null");
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1100,7 +1100,7 @@ class Adherent extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$sql .= ", pass = '".$this->db->escape($password_indatabase)."'";
|
$sql .= ", pass = '".$this->db->escape($password_indatabase)."'";
|
||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
//dol_syslog("Adherent::Password sql=hidden");
|
//dol_syslog("Adherent::Password sql=hidden");
|
||||||
dol_syslog(get_class($this)."::setPassword", LOG_DEBUG);
|
dol_syslog(get_class($this)."::setPassword", LOG_DEBUG);
|
||||||
@ -1223,7 +1223,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Add link to third party for current member
|
// Add link to third party for current member
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = ".($thirdpartyid > 0 ? $thirdpartyid : 'null');
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = ".($thirdpartyid > 0 ? $thirdpartyid : 'null');
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::setThirdPartyId", LOG_DEBUG);
|
dol_syslog(get_class($this)."::setThirdPartyId", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1465,7 +1465,7 @@ class Adherent extends CommonObject
|
|||||||
$sql .= " c.dateadh as dateh,";
|
$sql .= " c.dateadh as dateh,";
|
||||||
$sql .= " c.datef as datef";
|
$sql .= " c.datef as datef";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."subscription as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."subscription as c";
|
||||||
$sql .= " WHERE c.fk_adherent = ".$this->id;
|
$sql .= " WHERE c.fk_adherent = ".((int) $this->id);
|
||||||
$sql .= " ORDER BY c.dateadh";
|
$sql .= " ORDER BY c.dateadh";
|
||||||
dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG);
|
||||||
|
|
||||||
@ -1831,8 +1831,8 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
if (!$error && !empty($bank_line_id)) {
|
if (!$error && !empty($bank_line_id)) {
|
||||||
// Update fk_bank into subscription table
|
// Update fk_bank into subscription table
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'subscription SET fk_bank='.$bank_line_id;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'subscription SET fk_bank='.((int) $bank_line_id);
|
||||||
$sql .= ' WHERE rowid='.$subscriptionid;
|
$sql .= ' WHERE rowid='.((int) $subscriptionid);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
@ -1900,8 +1900,8 @@ class Adherent extends CommonObject
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql .= " statut = ".self::STATUS_VALIDATED;
|
$sql .= " statut = ".self::STATUS_VALIDATED;
|
||||||
$sql .= ", datevalid = '".$this->db->idate($now)."'";
|
$sql .= ", datevalid = '".$this->db->idate($now)."'";
|
||||||
$sql .= ", fk_user_valid=".$user->id;
|
$sql .= ", fk_user_valid = ".((int) $user->id);
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
|
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -1952,7 +1952,7 @@ class Adherent extends CommonObject
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql .= " statut = ".self::STATUS_RESILIATED;
|
$sql .= " statut = ".self::STATUS_RESILIATED;
|
||||||
$sql .= ", fk_user_valid=".$user->id;
|
$sql .= ", fk_user_valid=".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -2002,7 +2002,7 @@ class Adherent extends CommonObject
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql .= " statut = ".self::STATUS_EXCLUDED;
|
$sql .= " statut = ".self::STATUS_EXCLUDED;
|
||||||
$sql .= ", fk_user_valid=".$user->id;
|
$sql .= ", fk_user_valid=".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@ -142,7 +142,7 @@ class AdherentType extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT lang, label, description, email";
|
$sql = "SELECT lang, label, description, email";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
$sql .= " WHERE fk_type=".$this->id;
|
$sql .= " WHERE fk_type = ".((int) $this->id);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -181,7 +181,7 @@ class AdherentType extends CommonObject
|
|||||||
if ($key == $current_lang) {
|
if ($key == $current_lang) {
|
||||||
$sql = "SELECT rowid";
|
$sql = "SELECT rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
$sql .= " WHERE fk_type=".$this->id;
|
$sql .= " WHERE fk_type = ".((int) $this->id);
|
||||||
$sql .= " AND lang = '".$this->db->escape($key)."'";
|
$sql .= " AND lang = '".$this->db->escape($key)."'";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -191,11 +191,11 @@ class AdherentType extends CommonObject
|
|||||||
$sql2 .= " SET";
|
$sql2 .= " SET";
|
||||||
$sql2 .= " label = '".$this->db->escape($this->label)."',";
|
$sql2 .= " label = '".$this->db->escape($this->label)."',";
|
||||||
$sql2 .= " description = '".$this->db->escape($this->description)."'";
|
$sql2 .= " description = '".$this->db->escape($this->description)."'";
|
||||||
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
|
$sql2 .= " WHERE fk_type = ".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
|
||||||
} else {
|
} else {
|
||||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
|
$sql2 .= " VALUES(".((int) $this->id).",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
|
||||||
$sql2 .= " '".$this->db->escape($this->description)."'";
|
$sql2 .= " '".$this->db->escape($this->description)."'";
|
||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ class AdherentType extends CommonObject
|
|||||||
} elseif (isset($this->multilangs[$key])) {
|
} elseif (isset($this->multilangs[$key])) {
|
||||||
$sql = "SELECT rowid";
|
$sql = "SELECT rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
$sql .= " WHERE fk_type=".$this->id;
|
$sql .= " WHERE fk_type = ".((int) $this->id);
|
||||||
$sql .= " AND lang = '".$this->db->escape($key)."'";
|
$sql .= " AND lang = '".$this->db->escape($key)."'";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -217,7 +217,7 @@ class AdherentType extends CommonObject
|
|||||||
$sql2 .= " SET ";
|
$sql2 .= " SET ";
|
||||||
$sql2 .= " label = '".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
$sql2 .= " label = '".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||||
$sql2 .= " description = '".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
$sql2 .= " description = '".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||||
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
|
$sql2 .= " WHERE fk_type = ".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
|
||||||
} else {
|
} else {
|
||||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
@ -259,7 +259,7 @@ class AdherentType extends CommonObject
|
|||||||
public function delMultiLangs($langtodelete, $user)
|
public function delMultiLangs($langtodelete, $user)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||||
$sql .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($langtodelete)."'";
|
$sql .= " WHERE fk_type = ".((int) $this->id)." AND lang = '".$this->db->escape($langtodelete)."'";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::delMultiLangs', LOG_DEBUG);
|
dol_syslog(get_class($this).'::delMultiLangs', LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -584,7 +584,7 @@ class AdherentType extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return array of Member objects for member type this->id (or all if this->id not defined)
|
* Return array of Member objects for member type this->id (or all if this->id not defined)
|
||||||
*
|
*
|
||||||
* @param string $excludefilter Filter to exclude
|
* @param string $excludefilter Filter to exclude. This value must not come from a user input.
|
||||||
* @param int $mode 0=Return array of member instance
|
* @param int $mode 0=Return array of member instance
|
||||||
* 1=Return array of member instance without extra data
|
* 1=Return array of member instance without extra data
|
||||||
* 2=Return array of members id only
|
* 2=Return array of members id only
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class AdherentStats extends Stats
|
|||||||
|
|
||||||
$this->where .= " m.statut != -1";
|
$this->where .= " m.statut != -1";
|
||||||
$this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
|
$this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
|
||||||
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
|
||||||
if ($this->memberid) {
|
if ($this->memberid) {
|
||||||
$this->where .= " AND m.rowid = ".((int) $this->memberid);
|
$this->where .= " AND m.rowid = ".((int) $this->memberid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -275,7 +275,7 @@ class Subscription extends CommonObject
|
|||||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||||
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
|
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -204,7 +204,7 @@ if ($result > 0) {
|
|||||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>';
|
print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.dol_escape_htmltag($dn).' - search='.dol_escape_htmltag($search).')</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -323,7 +323,7 @@ $sql .= " state.code_departement as state_code, state.nom as state_name,";
|
|||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
|
|||||||
@ -209,7 +209,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
// Subscription informations
|
// Subscription informations
|
||||||
$datesubscription = 0;
|
$datesubscription = 0;
|
||||||
$datesubend = 0;
|
$datesubend = 0;
|
||||||
$paymentdate = 0;
|
$paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01
|
||||||
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
|
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
|
||||||
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if a payment is mandatory or not
|
// Check if a payment is mandatory or not
|
||||||
if (!$error && $adht->subscription) { // Member type need subscriptions
|
if ($adht->subscription) { // Member type need subscriptions
|
||||||
if (!is_numeric($amount)) {
|
if (!is_numeric($amount)) {
|
||||||
// If field is '' or not a numeric value
|
// If field is '' or not a numeric value
|
||||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
|
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
|
||||||
@ -268,28 +268,35 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$action = 'addsubscription';
|
$action = 'addsubscription';
|
||||||
} else {
|
} else {
|
||||||
|
// If an amount has been provided, we check also fields that becomes mandatory when amount is not null.
|
||||||
if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') {
|
if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') {
|
||||||
if (GETPOST("subscription")) {
|
if (GETPOST("subscription")) {
|
||||||
if (!GETPOST("label")) {
|
if (!GETPOST("label")) {
|
||||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
|
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
|
||||||
}
|
|
||||||
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
|
|
||||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
|
|
||||||
}
|
|
||||||
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) {
|
|
||||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (GETPOST("accountid")) {
|
|
||||||
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($errmsg) {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($errmsg, null, 'errors');
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
$action = 'addsubscription';
|
$action = 'addsubscription';
|
||||||
}
|
}
|
||||||
|
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
|
||||||
|
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
|
$error++;
|
||||||
|
$action = 'addsubscription';
|
||||||
|
}
|
||||||
|
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) {
|
||||||
|
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
|
$error++;
|
||||||
|
$action = 'addsubscription';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (GETPOST("accountid", 'int')) {
|
||||||
|
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
|
$error++;
|
||||||
|
$action = 'addsubscription';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -601,8 +608,16 @@ if ($rowid > 0) {
|
|||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
$result = $company->fetch($object->fk_soc);
|
$result = $company->fetch($object->fk_soc);
|
||||||
print $company->getNomUrl(1);
|
print $company->getNomUrl(1);
|
||||||
|
|
||||||
|
// Show link to invoices
|
||||||
|
$tmparray = $company->getOutstandingBills('customer');
|
||||||
|
if (!empty($tmparray['refs'])) {
|
||||||
|
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").': '.count($tmparray['refs']);
|
||||||
|
// TODO Add alert if warning on at least one invoice late
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("NoThirdPartyAssociatedToMember");
|
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -628,7 +643,7 @@ if ($rowid > 0) {
|
|||||||
if ($object->user_id) {
|
if ($object->user_id) {
|
||||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("NoDolibarrAccess");
|
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -970,17 +985,18 @@ if ($rowid > 0) {
|
|||||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
|
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>';
|
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'>';
|
||||||
|
print '<label for="none"> '.$langs->trans("None").'</label><br>';
|
||||||
// Add entry into bank accoun
|
// Add entry into bank accoun
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
|
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
|
||||||
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
|
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
|
||||||
}
|
}
|
||||||
// Add invoice with no payments
|
// Add invoice with no payments
|
||||||
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
||||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
|
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
|
||||||
//if (empty($object->fk_soc)) print ' disabled';
|
//if (empty($object->fk_soc)) print ' disabled';
|
||||||
print '> '.$langs->trans("MoreActionInvoiceOnly");
|
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
|
||||||
if ($object->fk_soc) {
|
if ($object->fk_soc) {
|
||||||
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
||||||
} else {
|
} else {
|
||||||
@ -1004,13 +1020,13 @@ if ($rowid > 0) {
|
|||||||
}
|
}
|
||||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '</label><br>';
|
||||||
}
|
}
|
||||||
// Add invoice with payments
|
// Add invoice with payments
|
||||||
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
||||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
|
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
|
||||||
//if (empty($object->fk_soc)) print ' disabled';
|
//if (empty($object->fk_soc)) print ' disabled';
|
||||||
print '> '.$langs->trans("MoreActionBankViaInvoice");
|
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
|
||||||
if ($object->fk_soc) {
|
if ($object->fk_soc) {
|
||||||
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
||||||
} else {
|
} else {
|
||||||
@ -1034,7 +1050,7 @@ if ($rowid > 0) {
|
|||||||
}
|
}
|
||||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '</label><br>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -245,11 +245,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input type="submit" class="button button-save" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|||||||
@ -381,12 +381,12 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor = new DolEditor('comment', $object->note, '', 200, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
|
$doleditor = new DolEditor('comment', $object->note, '', 200, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
|
$doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -399,9 +399,8 @@ if ($action == 'create') {
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans('Add').'">';
|
||||||
print ' ';
|
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
@ -814,12 +813,12 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
|
$doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
$doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
|
$doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
@ -830,11 +829,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -166,7 +166,7 @@ if ($result > 0) {
|
|||||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>';
|
print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.dol_escape_htmltag($dn).' - search='.dol_escape_htmltag($search).')</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ldap->unbind();
|
$ldap->unbind();
|
||||||
|
|||||||
@ -228,13 +228,7 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print $form->buttonsSaveCancel();
|
||||||
|
|
||||||
print '<div class="center">';
|
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} elseif ($action != 'create') {
|
} elseif ($action != 'create') {
|
||||||
@ -297,11 +291,7 @@ if ($action == 'create' && $user->rights->adherent->configurer) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -177,12 +177,7 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
//print ' ';
|
|
||||||
//print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
//print '<br>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -209,9 +209,7 @@ print '</div>';
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print "</div>";
|
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|||||||
@ -392,7 +392,7 @@ print '</table>';
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input class="button button-save" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -139,9 +139,7 @@ print '</table>';
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print "</div>";
|
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
@ -165,24 +163,27 @@ $urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal
|
|||||||
$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 .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
|
||||||
$message .= '<div class="urllink">';
|
$message .= '<div class="urllink">';
|
||||||
$message .= '<input type="text" id="onlinepaymenturl" 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($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||||
$message .= '</div>';
|
$message .= '</div>';
|
||||||
|
$message .= ajax_autoselect('onlinepaymenturl1');
|
||||||
$message .= '<br>';
|
$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">';
|
$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">';
|
||||||
$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 .= $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>';
|
||||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
|
||||||
$message .= '<div class="urllink">';
|
$message .= '<div class="urllink">';
|
||||||
$message .= '<input type="text" id="onlinepaymenturl" 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($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||||
$message .= '</div>';
|
$message .= '</div>';
|
||||||
|
$message .= ajax_autoselect('onlinepaymenturl2');
|
||||||
$message .= '<br>';
|
$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">';
|
$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">';
|
||||||
$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 .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
|
||||||
$message .= '<div class="urllink">';
|
$message .= '<div class="urllink">';
|
||||||
$message .= '<input type="text" id="onlinepaymenturl" 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($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||||
$message .= '</div>';
|
$message .= '</div>';
|
||||||
|
$message .= ajax_autoselect('onlinepaymenturl3');
|
||||||
$message .= '<br>';
|
$message .= '<br>';
|
||||||
|
|
||||||
print $message;
|
print $message;
|
||||||
|
|||||||
@ -499,9 +499,7 @@ print "</tr>\n";
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
$form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|||||||
@ -272,8 +272,7 @@ if ($resql) {
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax)) {
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|||||||
@ -473,9 +473,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVA
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'" name="Button"></div>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print "\n".'<!-- End Other Const -->'."\n";
|
print "\n".'<!-- End Other Const -->'."\n";
|
||||||
|
|||||||
@ -824,10 +824,7 @@ if ($mysoc->useRevenueStamp()) {
|
|||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<br><div class="center">';
|
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -135,9 +135,7 @@ print '</div>';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -468,9 +468,7 @@ print '</tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -448,8 +448,8 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE
|
|||||||
|
|
||||||
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print '<br><div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<br></form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print '<br><div class="tabsAction">';
|
print '<br><div class="tabsAction">';
|
||||||
print '<a class="butAction" href="delais.php?action=edit">'.$langs->trans("Modify").'</a></div>';
|
print '<a class="butAction" href="delais.php?action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class Dolistore
|
|||||||
|
|
||||||
try {
|
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($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
|
||||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
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->global->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
|
// Here we set the option array for the Webservice : we want categories resources
|
||||||
@ -134,7 +134,7 @@ class Dolistore
|
|||||||
|
|
||||||
try {
|
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($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
|
||||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
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->global->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
|
// Here we set the option array for the Webservice : we want products resources
|
||||||
|
|||||||
@ -276,11 +276,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Create");
|
||||||
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@ -309,9 +305,7 @@ if (($id || $ref) && $action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
print $form->buttonsSaveCancel();
|
||||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,12 +208,12 @@ $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("EmailCollector")
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$sql = 'SELECT ';
|
$sql = 'SELECT ';
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$sql .= 't.'.$key.', ';
|
$sql .= "t.".$key.", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -259,7 +259,7 @@ $sql .= $hookmanager->resPrint;
|
|||||||
$sql.= " GROUP BY ";
|
$sql.= " GROUP BY ";
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$sql.='t.'.$key.', ';
|
$sql .= "t.".$key.", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -298,11 +298,7 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -460,9 +460,7 @@ print '</td></tr>'."\n";
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -215,7 +215,7 @@ if (empty($conf->use_javascript_ajax)) {
|
|||||||
print $conf->global->FCKEDITOR_TEST;
|
print $conf->global->FCKEDITOR_TEST;
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
print '<br><div class="center"><input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'"></div>'."\n";
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<div id="divforlog"></div>';
|
print '<div id="divforlog"></div>';
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -556,10 +556,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<div class="center">';
|
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -43,12 +43,12 @@ if (!$user->admin) {
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
|
||||||
|
|
||||||
|
$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'language'; // 'language', 'template', 'login', 'other'
|
||||||
|
|
||||||
if (!defined("MAIN_MOTD")) {
|
if (!defined("MAIN_MOTD")) {
|
||||||
define("MAIN_MOTD", "");
|
define("MAIN_MOTD", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
@ -94,10 +94,15 @@ if ($action == 'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKG
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
if ($mode == 'language') {
|
||||||
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||||
//dolibarr_set_const($db, "MAIN_MULTILANGS", GETPOST("MAIN_MULTILANGS"), 'chaine', 0, '', $conf->entity);
|
//dolibarr_set_const($db, "MAIN_MULTILANGS", GETPOST("MAIN_MULTILANGS"), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($mode == 'template') {
|
||||||
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
/*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
|
/*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
|
||||||
@ -199,7 +204,9 @@ if ($action == 'update') {
|
|||||||
} else {
|
} else {
|
||||||
dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($mode == 'other') {
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
@ -216,10 +223,14 @@ if ($action == 'update') {
|
|||||||
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($mode == 'login') {
|
||||||
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
||||||
//dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
//dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
||||||
|
|
||||||
$varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/';
|
$varforimage = 'imagebackground';
|
||||||
|
$dirforimage = $conf->mycompany->dir_output . '/logos/';
|
||||||
if ($_FILES[$varforimage]["tmp_name"]) {
|
if ($_FILES[$varforimage]["tmp_name"]) {
|
||||||
$reg = array();
|
$reg = array();
|
||||||
if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) {
|
if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) {
|
||||||
@ -250,12 +261,11 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION["mainmenu"] = ""; // The menu manager may have changed
|
||||||
|
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".'&mode='.$mode.(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
|
||||||
$_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer
|
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,6 +284,7 @@ $formadmin = new FormAdmin($db);
|
|||||||
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
@ -282,14 +293,17 @@ print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="page_y" value="">';
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
print '<input type="hidden" id="mode" name="mode" value="'.dol_escape_htmltag($mode).'">';
|
||||||
|
|
||||||
|
$head = ihm_prepare_head();
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, $mode, '', -1, '');
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
print '<br>';
|
if ($mode == 'language') {
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||||
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Default language
|
// Default language
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||||
@ -307,30 +321,17 @@ print '</tr>';
|
|||||||
|
|
||||||
print '</table>' . "\n";
|
print '</table>' . "\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<br>';
|
if ($mode == 'template') {
|
||||||
print '<div class="center">';
|
|
||||||
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
// Themes and themes options
|
// Themes and themes options
|
||||||
showSkins(null, 1);
|
showSkins(null, 1);
|
||||||
print '<br>';
|
}
|
||||||
print '<div class="center">';
|
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
|
if ($mode == 'other') {
|
||||||
// Other
|
// Other
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
|
print '<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
|
||||||
print '<tr class="liste_titre"><th class="titlefieldmiddle">'.$langs->trans("Miscellaneous").'</th>';
|
|
||||||
print '<th></th>';
|
|
||||||
print '<th width="20"> </tg>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Disable javascript and ajax
|
// Disable javascript and ajax
|
||||||
print '<tr class="oddeven"><td>' . $langs->trans("DisableJavascript") . '</td><td>';
|
print '<tr class="oddeven"><td>' . $langs->trans("DisableJavascript") . '</td><td>';
|
||||||
@ -451,22 +452,12 @@ print '</td></tr>'."\n";
|
|||||||
|
|
||||||
print '</table>' . "\n";
|
print '</table>' . "\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<br>';
|
if ($mode == 'login') {
|
||||||
|
|
||||||
print '<div class="center">';
|
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||||
print '<tr class="liste_titre"><th class="titlefieldmiddle">'.$langs->trans("LoginPage").'</th>';
|
|
||||||
print '<th></th>';
|
|
||||||
print '<th width="20"> </th>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Hide helpcenter link on login page
|
// Hide helpcenter link on login page
|
||||||
print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
|
print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
|
||||||
@ -514,6 +505,7 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>' . "\n";
|
print '</table>' . "\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
|
|||||||
@ -108,9 +108,9 @@ $aCurrencies = array($conf->currency); // Default currency always first position
|
|||||||
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php';
|
||||||
|
|
||||||
$sql = 'SELECT rowid, code FROM '.MAIN_DB_PREFIX.'multicurrency';
|
$sql = "SELECT rowid, code FROM ".MAIN_DB_PREFIX."multicurrency";
|
||||||
$sql .= ' WHERE entity = '.$conf->entity;
|
$sql .= " WHERE entity = ".((int) $conf->entity);
|
||||||
$sql .= ' AND code != "'.$conf->currency.'"'; // Default currency always first position
|
$sql .= " AND code <> '".$db->escape($conf->currency)."'"; // Default currency always first position
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -536,11 +536,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -405,11 +405,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -226,12 +226,12 @@ print "<br>\n";
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$sql = 'SELECT ';
|
$sql = 'SELECT ';
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$sql .= 't.'.$key.', ';
|
$sql .= "t.".$key.", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -282,7 +282,7 @@ $sql .= $hookmanager->resPrint;
|
|||||||
$sql.= " GROUP BY "
|
$sql.= " GROUP BY "
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$sql.='t.'.$key.', ';
|
$sql .= "t.".$key.", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
@ -395,12 +395,8 @@ if ($action != 'create') {
|
|||||||
print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOST('active', 'int') : $object->active), 0, 0, 0, '', 1);
|
print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOST('active', 'int') : $object->active), 0, 0, 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
/*print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -428,12 +424,8 @@ if ($action != 'create') {
|
|||||||
print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOST('active', 'int'), 0);
|
print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOST('active', 'int'), 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
//print '</form>';
|
//print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -564,8 +564,8 @@ $sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, priv
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||||
$sql .= " WHERE entity IN (".getEntity('email_template').")";
|
$sql .= " WHERE entity IN (".getEntity('email_template').")";
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".$user->id."))"; // Show only public and private to me
|
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me
|
||||||
$sql .= " AND (active = 1 OR fk_user = ".$user->id.")"; // Show only active or owned by me
|
$sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_MULTILANGS)) {
|
if (empty($conf->global->MAIN_MULTILANGS)) {
|
||||||
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
|
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
|
||||||
|
|||||||
@ -380,11 +380,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -391,11 +391,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} elseif ($action == 'edit') {
|
} elseif ($action == 'edit') {
|
||||||
@ -516,12 +512,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
// Bouton
|
print $form->buttonsSaveCancel();
|
||||||
print '<div class="center">';
|
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -789,16 +789,16 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
if (!empty($objMod->config_page_url) && !$disableSetup) {
|
if (!empty($objMod->config_page_url) && !$disableSetup) {
|
||||||
$backtourlparam = '';
|
$backtourlparam = '';
|
||||||
if ($search_keyword != '') {
|
if ($search_keyword != '') {
|
||||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
|
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.urlencode($search_keyword); // No urlencode here, done later
|
||||||
}
|
}
|
||||||
if ($search_nature > -1) {
|
if ($search_nature > -1) {
|
||||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature; // No urlencode here, done later
|
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.urlencode($search_nature); // No urlencode here, done later
|
||||||
}
|
}
|
||||||
if ($search_version > -1) {
|
if ($search_version > -1) {
|
||||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version; // No urlencode here, done later
|
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.urlencode($search_version); // No urlencode here, done later
|
||||||
}
|
}
|
||||||
if ($search_status > -1) {
|
if ($search_status > -1) {
|
||||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status; // No urlencode here, done later
|
$backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.urlencode($search_status); // No urlencode here, done later
|
||||||
}
|
}
|
||||||
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $error = 0;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Action to update or add a constant
|
// Action to update or add a constant
|
||||||
if ($action == 'settemplates') {
|
if ($action == 'settemplates' && $user->admin) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
if (!$error && is_array($_POST)) {
|
if (!$error && is_array($_POST)) {
|
||||||
@ -192,7 +192,8 @@ print "</tr>\n";
|
|||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans("NotificationEMailFrom").'</td>';
|
print $langs->trans("NotificationEMailFrom").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input size="32" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">';
|
print img_picto('', 'email', 'class="pictofixedwidth"');
|
||||||
|
print '<input class="width300" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">';
|
||||||
if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
|
if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
|
||||||
print ' '.img_warning($langs->trans("ErrorBadEMail"));
|
print ' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||||
}
|
}
|
||||||
@ -200,7 +201,7 @@ print '</td>';
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
@ -270,9 +271,16 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$helptext = '';
|
$helptext = '';
|
||||||
form_constantes($constantes, 3, $helptext);
|
form_constantes($constantes, 3, $helptext, 'EmailTemplate');
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print '<div class="opacitymedium">';
|
||||||
|
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||||
|
if (!empty($conf->societe->enabled)) {
|
||||||
|
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||||
|
}
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
} else {
|
} else {
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -316,8 +324,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '<div class="opacitymedium">';
|
print '<div class="opacitymedium">';
|
||||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||||
@ -325,6 +331,7 @@ if (!empty($conf->societe->enabled)) {
|
|||||||
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
@ -335,6 +342,7 @@ print '<br><br>';
|
|||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setfixednotif">';
|
print '<input type="hidden" name="action" value="setfixednotif">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
|
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
|
||||||
|
|
||||||
@ -376,6 +384,12 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||||||
$elementLabel = $langs->trans('ExpenseReport');
|
$elementLabel = $langs->trans('ExpenseReport');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$labelfortrigger = 'AmountHT';
|
||||||
|
$codehasnotrigger = 0;
|
||||||
|
if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) {
|
||||||
|
$codehasnotrigger++;
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print img_picto('', $elementPicto, 'class="pictofixedwidth"');
|
print img_picto('', $elementPicto, 'class="pictofixedwidth"');
|
||||||
@ -384,6 +398,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||||||
print '<td>'.$notifiedevent['code'].'</td>';
|
print '<td>'.$notifiedevent['code'].'</td>';
|
||||||
print '<td><span class="opacitymedium">'.$label.'</span></td>';
|
print '<td><span class="opacitymedium">'.$label.'</span></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
$inputfieldalreadyshown = 0;
|
||||||
// Notification with threshold
|
// Notification with threshold
|
||||||
foreach ($conf->global as $key => $val) {
|
foreach ($conf->global as $key => $val) {
|
||||||
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
|
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
|
||||||
@ -407,24 +422,35 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||||||
}
|
}
|
||||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
$inputfieldalreadyshown++;
|
||||||
}
|
}
|
||||||
// New entry input fields
|
// New entry input fields
|
||||||
|
if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
|
||||||
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
// Notification with threshold
|
// Notification with threshold
|
||||||
|
$inputfieldalreadyshown = 0;
|
||||||
foreach ($conf->global as $key => $val) {
|
foreach ($conf->global as $key => $val) {
|
||||||
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
|
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
|
if (!$codehasnotrigger) {
|
||||||
|
print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
$inputfieldalreadyshown++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// New entry input fields
|
// New entry input fields
|
||||||
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
|
if (!$codehasnotrigger) {
|
||||||
|
print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -437,7 +463,7 @@ print '</table>';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -131,10 +131,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') {
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -273,11 +273,7 @@ print '</div>';
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<br>';
|
print $form->buttonsSaveCancel("Modify", '');
|
||||||
print '<div class="center">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
|
|
||||||
print '</div>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -114,7 +114,7 @@ if ($action == "set") {
|
|||||||
|
|
||||||
if ($action == "addnotif") {
|
if ($action == "addnotif") {
|
||||||
$bon = new BonPrelevement($db);
|
$bon = new BonPrelevement($db);
|
||||||
$bon->AddNotification($db, GETPOST('user', 'int'), $action);
|
$bon->addNotification($db, GETPOST('user', 'int'), $action);
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
@ -122,7 +122,7 @@ if ($action == "addnotif") {
|
|||||||
|
|
||||||
if ($action == "deletenotif") {
|
if ($action == "deletenotif") {
|
||||||
$bon = new BonPrelevement($db);
|
$bon = new BonPrelevement($db);
|
||||||
$bon->DeleteNotificationById(GETPOST('notif', 'int'));
|
$bon->deleteNotificationById(GETPOST('notif', 'int'));
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
@ -200,9 +200,8 @@ if (!$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS) {
|
|||||||
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" class="width50"></td>';
|
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" class="width50"></td>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,11 @@ if ($action == 'update') {
|
|||||||
if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||||
if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (GETPOSTISSET('MAIN_PDF_NO_SENDER_FRAME')) dolibarr_set_const($db, "MAIN_PDF_NO_SENDER_FRAME", GETPOST("MAIN_PDF_NO_SENDER_FRAME"), 'chaine', 0, '', $conf->entity);
|
||||||
|
if (GETPOSTISSET('MAIN_PDF_NO_RECIPENT_FRAME')) dolibarr_set_const($db, "MAIN_PDF_NO_RECIPENT_FRAME", GETPOST("MAIN_PDF_NO_RECIPENT_FRAME"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (GETPOSTISSET('MAIN_PDF_HIDE_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_HIDE_SENDER_NAME", GETPOST("MAIN_PDF_HIDE_SENDER_NAME"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||||
@ -89,6 +94,8 @@ if ($action == 'update') {
|
|||||||
if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
|
||||||
if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
|
||||||
|
if (GETPOSTISSET('MAIN_PDF_NO_CUSTOMER_CODE')) dolibarr_set_const($db, "MAIN_PDF_NO_CUSTOMER_CODE", GETPOST("MAIN_PDF_NO_CUSTOMER_CODE"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
|
||||||
@ -253,6 +260,55 @@ for ($i = 1; $i <= 6; $i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Borders on address frame
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_NO_SENDER_FRAME").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_PDF_NO_SENDER_FRAME');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("MAIN_PDF_NO_SENDER_FRAME", $arrval, $conf->global->MAIN_PDF_NO_SENDER_FRAME);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_NO_RECIPENT_FRAME").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_PDF_NO_RECIPENT_FRAME');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("MAIN_PDF_NO_RECIPENT_FRAME", $arrval, $conf->global->MAIN_PDF_NO_RECIPENT_FRAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show sender name
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_HIDE_SENDER_NAME").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_PDF_HIDE_SENDER_NAME');
|
||||||
|
} else {
|
||||||
|
print $form->selectyesno('MAIN_PDF_HIDE_SENDER_NAME', (!empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) ? $conf->global->MAIN_PDF_HIDE_SENDER_NAME : 0, 1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
//Invert sender and recipient
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("SwapSenderAndRecipientOnPDF").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_INVERT_SENDER_RECIPIENT');
|
||||||
|
} else {
|
||||||
|
print $form->selectyesno('MAIN_INVERT_SENDER_RECIPIENT', (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) ? $conf->global->MAIN_INVERT_SENDER_RECIPIENT : 0, 1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Place customer adress to the ISO location
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_PDF_USE_ISO_LOCATION');
|
||||||
|
} else {
|
||||||
|
print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION', (!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION)) ? $conf->global->MAIN_PDF_USE_ISO_LOCATION : 0, 1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@ -323,42 +379,6 @@ print '<div class="div-table-responsive-no-min">';
|
|||||||
print '<table summary="more" class="noborder centpercent">';
|
print '<table summary="more" class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
// Height of logo
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DOCUMENTS_LOGO_HEIGHT").'</td><td>';
|
|
||||||
print '<input type="text" class="maxwidth50" name="MAIN_DOCUMENTS_LOGO_HEIGHT" value="'.(!empty($conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT) ? $conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT : 20).'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Show project
|
|
||||||
|
|
||||||
if (!empty($conf->projet->enabled)) {
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_PROJECT").'</td><td>';
|
|
||||||
$tmparray = array('no' => 'No', 'showprojectref' => 'RefProject', 'showprojectlabel' => 'ShowProjectLabel');
|
|
||||||
$showprojectref = empty($conf->global->PDF_SHOW_PROJECT) ? (empty($conf->global->PDF_SHOW_PROJECT_TITLE) ? 'no' : 'showprojectlabel') : 'showprojectref';
|
|
||||||
print $form->selectarray('PDF_SHOW_PROJECT_REF_OR_LABEL', $tmparray, $showprojectref, 0, 0, 0, '', 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
//Invert sender and recipient
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("SwapSenderAndRecipientOnPDF").'</td><td>';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('MAIN_INVERT_SENDER_RECIPIENT');
|
|
||||||
} else {
|
|
||||||
print $form->selectyesno('MAIN_INVERT_SENDER_RECIPIENT', (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) ? $conf->global->MAIN_INVERT_SENDER_RECIPIENT : 0, 1);
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Place customer adress to the ISO location
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('MAIN_PDF_USE_ISO_LOCATION');
|
|
||||||
} else {
|
|
||||||
print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION', (!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION)) ? $conf->global->MAIN_PDF_USE_ISO_LOCATION : 0, 1);
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Use 2 languages into PDF
|
// Use 2 languages into PDF
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
|
||||||
@ -371,6 +391,32 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu
|
|||||||
//}
|
//}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Height of logo
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DOCUMENTS_LOGO_HEIGHT").'</td><td>';
|
||||||
|
print '<input type="text" class="maxwidth50" name="MAIN_DOCUMENTS_LOGO_HEIGHT" value="'.(!empty($conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT) ? $conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT : 20).'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Show project
|
||||||
|
if (!empty($conf->projet->enabled)) {
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_PROJECT").'</td><td>';
|
||||||
|
$tmparray = array('no' => 'No', 'showprojectref' => 'RefProject', 'showprojectlabel' => 'ShowProjectLabel');
|
||||||
|
$showprojectref = empty($conf->global->PDF_SHOW_PROJECT) ? (empty($conf->global->PDF_SHOW_PROJECT_TITLE) ? 'no' : 'showprojectlabel') : 'showprojectref';
|
||||||
|
print $form->selectarray('PDF_SHOW_PROJECT_REF_OR_LABEL', $tmparray, $showprojectref, 0, 0, 0, '', 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_HIDE_CUSTOMER_CODE");
|
||||||
|
print '</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_PDF_HIDE_CUSTOMER_CODE');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("MAIN_PDF_HIDE_CUSTOMER_CODE", $arrval, $conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
|
||||||
@ -420,9 +466,7 @@ print '</td></tr>';
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -113,26 +113,6 @@ if ($conf->use_javascript_ajax) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM");
|
|
||||||
print '</td><td>';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM);
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE");
|
|
||||||
print '</td><td>';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE);
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
@ -148,9 +128,7 @@ print '</table>';
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel();
|
||||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -117,7 +117,7 @@ if ($action == "set") {
|
|||||||
|
|
||||||
if ($action == "addnotif") {
|
if ($action == "addnotif") {
|
||||||
$bon = new BonPrelevement($db);
|
$bon = new BonPrelevement($db);
|
||||||
$bon->AddNotification($db, GETPOST('user', 'int'), $action);
|
$bon->addNotification($db, GETPOST('user', 'int'), $action);
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
@ -125,7 +125,7 @@ if ($action == "addnotif") {
|
|||||||
|
|
||||||
if ($action == "deletenotif") {
|
if ($action == "deletenotif") {
|
||||||
$bon = new BonPrelevement($db);
|
$bon = new BonPrelevement($db);
|
||||||
$bon->DeleteNotificationById(GETPOST('notif', 'int'));
|
$bon->deleteNotificationById(GETPOST('notif', 'int'));
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
@ -214,9 +214,8 @@ print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRE
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -341,7 +341,7 @@ if ($mode == 'config' && $user->admin) {
|
|||||||
print '<td>'.$printer->profileresprint.'</td>';
|
print '<td>'.$printer->profileresprint.'</td>';
|
||||||
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
|
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
@ -432,7 +432,7 @@ if ($mode == 'template' && $user->admin) {
|
|||||||
print '<textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
|
print '<textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
|
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
|
||||||
|
|||||||
@ -91,7 +91,13 @@ print '<br>';
|
|||||||
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
||||||
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
||||||
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
||||||
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None').' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Strict').")</span><br>\n";
|
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
|
||||||
|
if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
|
||||||
|
} elseif (ini_get('session.cookie_samesite') == 'Strict') {
|
||||||
|
print ' '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
|
||||||
|
}
|
||||||
|
print "<br>\n";
|
||||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
|
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
|
||||||
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||||
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||||
|
|||||||
@ -580,9 +580,7 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -390,7 +390,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -146,7 +146,7 @@ if ($action == 'add') {
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".$db->escape($conf->entity).")";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".((int) $conf->entity).")";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|||||||
@ -327,7 +327,7 @@ class DolibarrApi
|
|||||||
* Function to forge a SQL criteria
|
* Function to forge a SQL criteria
|
||||||
*
|
*
|
||||||
* @param array $matches Array of found string by regex search.
|
* @param array $matches Array of found string by regex search.
|
||||||
* Example: "t.ref:like:'SO-%'" or "t.date_creation:<:'20160101'" or "t.date_creation:<:'2016-01-01 12:30:00'" or "t.nature:is:NULL"
|
* Example: "t.ref:like:'SO-%'" or "t.date_creation:<:'20160101'" or "t.date_creation:<:'2016-01-01 12:30:00'" or "t.nature:is:NULL" or "t.nature:isnot:NULL"
|
||||||
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
||||||
*/
|
*/
|
||||||
protected static function _forge_criteria_callback($matches)
|
protected static function _forge_criteria_callback($matches)
|
||||||
@ -345,18 +345,36 @@ class DolibarrApi
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sanitize operand
|
||||||
$operand = preg_replace('/[^a-z0-9\._]/i', '', trim($tmp[0]));
|
$operand = preg_replace('/[^a-z0-9\._]/i', '', trim($tmp[0]));
|
||||||
|
|
||||||
|
// Sanitize operator
|
||||||
$operator = strtoupper(preg_replace('/[^a-z<>=]/i', '', trim($tmp[1])));
|
$operator = strtoupper(preg_replace('/[^a-z<>=]/i', '', trim($tmp[1])));
|
||||||
|
// Only some operators are allowed.
|
||||||
|
if (! in_array($operator, array('LIKE', 'ULIKE', '<', '>', '<=', '>=', '=', '<>', 'IS', 'ISNOT', 'IN'))) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if ($operator == 'ISNOT') {
|
||||||
|
$operator = 'IS NOT';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sanitize value
|
||||||
$tmpescaped = trim($tmp[2]);
|
$tmpescaped = trim($tmp[2]);
|
||||||
$regbis = array();
|
$regbis = array();
|
||||||
if ($operator == 'IN') {
|
if ($operator == 'IN') {
|
||||||
$tmpescaped = "(".$db->sanitize($tmpescaped, 1).")";
|
$tmpescaped = "(".$db->sanitize($tmpescaped, 1).")";
|
||||||
} elseif (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis)) {
|
} elseif (in_array($operator, array('<', '>', '<=', '>=', '=', '<>'))) {
|
||||||
|
if (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis)) { // If 'YYYY-MM-DD HH:MM:SS+X'
|
||||||
$tmpescaped = "'".$db->escape($regbis[1])."'";
|
$tmpescaped = "'".$db->escape($regbis[1])."'";
|
||||||
} else {
|
} else {
|
||||||
$tmpescaped = $db->sanitize($db->escape($tmpescaped));
|
$tmpescaped = ((float) $tmpescaped);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis)) {
|
||||||
|
$tmpescaped = "'".$db->escape($regbis[1])."'";
|
||||||
|
} else {
|
||||||
|
$tmpescaped = "'".$db->escape($tmpescaped)."'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $db->escape($operand).' '.$db->escape($operator)." ".$tmpescaped;
|
return $db->escape($operand).' '.$db->escape($operator)." ".$tmpescaped;
|
||||||
|
|||||||
@ -81,9 +81,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -169,11 +169,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Create");
|
||||||
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
@ -210,9 +206,7 @@ if (($id || $ref) && $action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
print $form->buttonsSaveCancel();
|
||||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,12 +197,12 @@ $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Assets"));
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$sql = 'SELECT ';
|
$sql = 'SELECT ';
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$sql .= 't.'.$key.', ';
|
$sql .= "t.".$key.", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -249,7 +249,7 @@ $sql .= $hookmanager->resPrint;
|
|||||||
$sql.= " GROUP BY "
|
$sql.= " GROUP BY "
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$sql.='t.'.$key.', ';
|
$sql .= "t.".$key.", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -396,11 +396,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
$form->buttonsSaveCancel("Add");
|
||||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
}
|
}
|
||||||
@ -600,9 +596,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
print $form->buttonsSaveCancel();
|
||||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,10 @@ $form = new Form($db);
|
|||||||
$block_static = new BlockedLog($db);
|
$block_static = new BlockedLog($db);
|
||||||
$block_static->loadTrackedEvents();
|
$block_static->loadTrackedEvents();
|
||||||
|
|
||||||
llxHeader('', $langs->trans("BlockedLogSetup"));
|
$title = $langs->trans("BlockedLogSetup");
|
||||||
|
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
|
||||||
|
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$linkback = '';
|
$linkback = '';
|
||||||
if ($withtab) {
|
if ($withtab) {
|
||||||
|
|||||||
@ -275,8 +275,9 @@ if (GETPOST('withtab', 'alpha')) {
|
|||||||
} else {
|
} else {
|
||||||
$title = $langs->trans("BrowseBlockedLog");
|
$title = $langs->trans("BrowseBlockedLog");
|
||||||
}
|
}
|
||||||
|
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
|
||||||
|
|
||||||
llxHeader('', $langs->trans("BrowseBlockedLog"));
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$MAXLINES = 10000;
|
$MAXLINES = 10000;
|
||||||
|
|
||||||
|
|||||||
@ -17,9 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/blockedlog/ajax/block-info.php
|
* \file htdocs/blockedlog/ajax/check_signature.php
|
||||||
* \ingroup blockedlog
|
* \ingroup blockedlog
|
||||||
* \brief block-info
|
* \brief This page is not used yet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -38,13 +38,15 @@ if (!defined('NOREQUIREHTML')) {
|
|||||||
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
|
||||||
|
|
||||||
|
|
||||||
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
|
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
|
||||||
exit('BLOCKEDLOG_AUTHORITY_URL not set');
|
exit('BLOCKEDLOG_AUTHORITY_URL not set');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
|
|
||||||
|
|
||||||
$auth = new BlockedLogAuthority($db);
|
$auth = new BlockedLogAuthority($db);
|
||||||
$auth->syncSignatureWithAuthority();
|
$auth->syncSignatureWithAuthority();
|
||||||
@ -63,8 +65,11 @@ if (is_array($bocks)) {
|
|||||||
|
|
||||||
$hash = $auth->getBlockchainHash();
|
$hash = $auth->getBlockchainHash();
|
||||||
|
|
||||||
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$auth->signature.'&h='.$hash;
|
// Call external authority
|
||||||
|
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.urlencode($auth->signature).'&h='.urlencode($hash);
|
||||||
|
|
||||||
|
$resarray = getURLContent($url, 'GET', '', 1, array(), array(), 2);
|
||||||
|
$res = $resarray['content'];
|
||||||
|
|
||||||
$res = file_get_contents($url);
|
|
||||||
//echo $url;
|
//echo $url;
|
||||||
echo $res;
|
echo dol_escape_htmltag($res);
|
||||||
|
|||||||
@ -267,11 +267,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print $form->buttonsSaveCancel("Create");
|
||||||
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@ -302,9 +298,7 @@ if (($id || $ref) && $action == 'edit') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
print $form->buttonsSaveCancel("Create");
|
||||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user