Merge branch 'develop' into NEW_develop_sub_BOM

This commit is contained in:
Laurent Destailleur 2021-09-18 16:31:51 +02:00 committed by GitHub
commit 97bb04c5b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2558 changed files with 44394 additions and 13984 deletions

2
.github/FUNDING.yml vendored
View File

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

View File

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

View File

@ -2,6 +2,89 @@
English Dolibarr ChangeLog English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
FIX: #18353 Invoice list translation issue
FIX: #18375 SQL Error on tasks statistics
FIX: #18465
FIX: #18484
FIX: #18531
FIX: #18542 REST API: set global $user variable to DolibarrApiAccess::user.
FIX: #18544 Shipment REST API: load thirdparty object into the shipment before validating.
FIX: #18544 Shipment rest api: load thirdparty object when validating
FIX: #18565
FIX: #18589 #18617
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
FIX: #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
FIX: Accountancy - Some problems of length with general & subledger account
FIX: add DISTINCT
FIX: Add option $noescapecommand in executeCLI for better compatibility
FIX: Add token to remove error when removing widget
FIX: Add token when remove the last widget on home page
FIX: an approved holiday can be canceled by an admin.
FIX: better sql request
FIX: change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done)
FIX: Collapsing of extrafields has disappeared.
FIX: Date of payment of subscription must not be set to 1970-01-01.
FIX: Export of website generates a package that contains a sql error
FIX: Field already present in SQL request
FIX: increase maxlength of password input
FIX: invoice fetch not found syslog debug level instead of error
FIX: Invoice list - Wrong name for column total_tva
FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts
FIX: Manage credit note on situation invoice for calculate margin
FIX: Menu List of project was not visible.
FIX: migration script
FIX: multicompany transverse mode compatibility
FIX: option "Default value for field 'Refuse bulk emailings'"
FIX: Recommended session.cookie_samesite must be 'Lax' not 'Strict'.
FIX: Relative discount with high nb of decimals
FIX: salary extrafields don't work and table is not well named
FIX: Supplier invoice list - Wrong language key used
FIX: wrong table_element_line
FIX: wrong users count in multicompany transverse mode
FIX: #yogosha6944 Protection against traversal path.
***** 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 *****

View File

@ -4,10 +4,10 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
## Supported Versions for security reports ## Supported Versions for security reports
| Version | Supported | | Version | Supported |
| --------- | ------------------ | | ---------- | ------------------ |
| <= 12.* | :x: | | <= 14.0.1 | :x: |
| >= 13.* | :white_check_mark: | | >= 14.0.2+ | :white_check_mark: |
## Reporting a Vulnerability ## Reporting a Vulnerability

View File

@ -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,22 @@ fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
fputs($fp, '</checksum_list>'."\n"); fputs($fp, '</checksum_list>'."\n");
fclose($fp); fclose($fp);
print "File ".$outputfile." generated\n"; if (empty($buildzip)) {
print "File ".$outputfile." generated\n";
} else {
if ($buildzip == '1' || $buildzip == 'zip') {
$result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip');
if ($result > 0) {
dol_delete_file($outputfile);
print "File ".$outputfile.".zip generated\n";
}
} elseif ($buildzip == '2' || $buildzip == 'gz') {
$result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz');
if ($result > 0) {
dol_delete_file($outputfile);
print "File ".$outputfile.".gz generated\n";
}
}
}
exit(0); exit(0);

View File

@ -3,11 +3,26 @@
# #
# Use this sample to search into a ldap # Use this sample to search into a ldap
# #
# ldapsearch -h hostname -x
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra" # Anonymous access
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)" # ldapsearch -h hostname -p 389
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)" #
# Login access (using a Bind DN)
# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
#
# Login access in SSL (using a Bind DN)
# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local
# If it fails, you may try to use "hostname" that is real name of certificate.
# You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt
# What to search
# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local"
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra"
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)"
# #
# Example to test a ldap search: # Example to test a ldap search:
# ldapsearch -h hostname -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password # ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password

View File

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

View File

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

View File

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

View File

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

View File

@ -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,23 +61,29 @@ 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 then
echo "***** Search original into "$reflang if [ $aa"_"$bb != $aa"_"$aaupper ]
echo $dirshort is an alternative language of $reflang then
echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2 echo "***** Search original into "$reflang
./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2 echo $dirshort is an alternative language of $reflang
for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
for fic in `ls htdocs/langs/${aa}_${bb}/*.lang`; ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
do f=`cat $fic | wc -l`; for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
#echo $f lines into file $fic; for fic in `ls htdocs/langs/${aa}_${bb}/*.lang`;
if [ $f = 1 ] do f=`cat $fic | wc -l`;
then #echo $f lines into file $fic;
echo Only one line remainging into file $fic, we delete it; if [ $f = 1 ]
rm $fic then
fi; echo Only one line remainging into file $fic, we delete it;
done rm $fic
fi fi;
done
fi
fi
fi fi
done; done;
fi fi

View File

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

View File

@ -392,7 +392,7 @@ if ($resql) {
} }
print "</select>"; print "</select>";
print ajax_combobox("chartofaccounts"); print ajax_combobox("chartofaccounts");
print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">'; print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button button-edit" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
print '<br>'; print '<br>';
print '<br>'; print '<br>';

View File

@ -535,7 +535,7 @@ if ($id) {
} }
print '<td colspan="3" class="right">'; print '<td colspan="3" class="right">';
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
@ -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
@ -631,7 +631,7 @@ if ($id) {
fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit'); fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit');
} }
print '<td colspan="3" class="right"><a name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'">&nbsp;</a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<td colspan="3" class="right"><a name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'">&nbsp;</a><input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '&nbsp;<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>'; print '&nbsp;<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
} else { } else {
$tmpaction = 'view'; $tmpaction = 'view';

View File

@ -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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';
} else { } else {

View File

@ -110,7 +110,7 @@ print '<table class="border centpercent">';
print '<tr><td class="titlefield">'.$langs->trans("AccountingCategory").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("AccountingCategory").'</td>';
print '<td>'; print '<td>';
$formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 1); $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 1);
print '<input class="button" type="submit" value="'.$langs->trans("Select").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
print '</td></tr>'; print '</td></tr>';
// Select the accounts // Select the accounts
@ -137,7 +137,7 @@ if (!empty($cat_id)) {
print '</select><br>'; print '</select><br>';
print ajax_combobox('cpt_bk'); print ajax_combobox('cpt_bk');
*/ */
print '<input class="button" type="submit" id="" class="action-delete" value="'.$langs->trans("Add").'"> '; print '<input type="submit" class="button button-add" id="" class="action-delete" value="'.$langs->trans("Add").'"> ';
} }
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -558,7 +558,7 @@ if ($tabname[$id]) {
} }
print '<td colspan="4" class="right">'; print '<td colspan="4" class="right">';
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
@ -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) {
@ -734,7 +734,7 @@ if ($resql) {
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>'; print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';

View File

@ -124,7 +124,7 @@ print '</td></tr>';
print "</table>\n"; print "</table>\n";
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
print '</form>'; print '</form>';

View File

@ -196,7 +196,7 @@ foreach ($list_account as $key) {
print "</table>\n"; print "</table>\n";
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
print '</form>'; print '</form>';

View File

@ -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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';

View File

@ -446,7 +446,7 @@ print '</tr>';
print '</table>'; print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
print '</form>'; print '</form>';

View File

@ -494,7 +494,7 @@ if ($id) {
} }
print '<td colspan="4" class="right">'; print '<td colspan="4" class="right">';
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
@ -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) {
@ -606,7 +606,7 @@ if ($id) {
print '<td class="center" colspan="4">'; print '<td class="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>'; print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
print '</td>'; print '</td>';

View File

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

View File

@ -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 .= '&amp;date_startmonth='.GETPOST('date_startmonth', 'int').'&amp;date_startday='.GETPOST('date_startday', 'int').'&amp;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 .= '&amp;date_endmonth='.GETPOST('date_endmonth', 'int').'&amp;date_endday='.GETPOST('date_endday', 'int').'&amp;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 .= '&amp;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 .= '&amp;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;

View File

@ -389,11 +389,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" value="'.$langs->trans("Create").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="button" value="'.$langs->trans("Cancel").'" class="button button-cancel" onclick="history.go(-1)" />';
print '</div>';
print '</form>'; print '</form>';
} else { } else {
@ -450,7 +446,7 @@ if ($action == 'create') {
print '<input type="hidden" name="action" value="setdate">'; print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<input type="hidden" name="mode" value="'.$mode.'">';
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate"); print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print $object->doc_date ? dol_print_date($object->doc_date, 'day') : '&nbsp;'; print $object->doc_date ? dol_print_date($object->doc_date, 'day') : '&nbsp;';
@ -477,7 +473,7 @@ if ($action == 'create') {
print '<input type="hidden" name="action" value="setjournal">'; print '<input type="hidden" name="action" value="setjournal">';
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<input type="hidden" name="mode" value="'.$mode.'">';
print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1); print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print $object->code_journal; print $object->code_journal;
@ -504,7 +500,7 @@ if ($action == 'create') {
print '<input type="hidden" name="action" value="setdocref">'; print '<input type="hidden" name="action" value="setdocref">';
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<input type="text" size="20" name="doc_ref" value="'.dol_escape_htmltag($object->doc_ref).'">'; print '<input type="text" size="20" name="doc_ref" value="'.dol_escape_htmltag($object->doc_ref).'">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print $object->doc_ref; print $object->doc_ref;

View File

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

View File

@ -212,7 +212,7 @@ class AccountancyCategory // extends CommonObject
$sql .= " ".(!isset($this->position) ? 'NULL' : ((int) $this->position)).","; $sql .= " ".(!isset($this->position) ? 'NULL' : ((int) $this->position)).",";
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : ((int) $this->fk_country)).","; $sql .= " ".(!isset($this->fk_country) ? 'NULL' : ((int) $this->fk_country)).",";
$sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active)); $sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active));
$sql .= ", ".$conf->entity; $sql .= ", ".((int) $conf->entity);
$sql .= ")"; $sql .= ")";
$this->db->begin(); $this->db->begin();
@ -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++;

View File

@ -479,7 +479,7 @@ class AccountancyExport
/** /**
* Export format : CIEL (Format XIMPORT) * Export format : CIEL (Format XIMPORT)
* Format since 2003 compatible CIEL version > 2002 / Sage50 * Format since 2003 compatible CIEL version > 2002 / Sage50
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr) * Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr)
* *
* Help : https://sage50c.online-help.sage.fr/aide-technique/ * Help : https://sage50c.online-help.sage.fr/aide-technique/
* In sage software | Use menu : "Exchange" > "Importing entries..." * In sage software | Use menu : "Exchange" > "Importing entries..."
@ -507,7 +507,7 @@ class AccountancyExport
$Tab = array(); $Tab = array();
$Tab['num_ecriture'] = str_pad($data->piece_num, 5); $Tab['num_ecriture'] = str_pad($data->piece_num, 5);
$Tab['code_journal'] = str_pad($data->code_journal, 2); $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
@ -515,9 +515,9 @@ class AccountancyExport
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT); $Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
$Tab['type_montant'] = str_pad($data->sens, 1); $Tab['type_montant'] = str_pad($data->sens, 1);
$Tab['vide'] = str_repeat(' ', 18); $Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34); $Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
$Tab['end'] = 'O2003'; $Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel
$Tab['end_line'] = $end_line; $Tab['end_line'] = $end_line;

View File

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

View File

@ -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);
@ -274,7 +274,7 @@ class AccountingAccount extends CommonObject
$sql .= ", reconcilable"; $sql .= ", reconcilable";
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= " '".$this->db->idate($now)."'"; $sql .= " '".$this->db->idate($now)."'";
$sql .= ", ".$conf->entity; $sql .= ", ".((int) $conf->entity);
$sql .= ", ".(empty($this->fk_pcg_version) ? 'NULL' : "'".$this->db->escape($this->fk_pcg_version)."'"); $sql .= ", ".(empty($this->fk_pcg_version) ? 'NULL' : "'".$this->db->escape($this->fk_pcg_version)."'");
$sql .= ", ".(empty($this->pcg_type) ? 'NULL' : "'".$this->db->escape($this->pcg_type)."'"); $sql .= ", ".(empty($this->pcg_type) ? 'NULL' : "'".$this->db->escape($this->pcg_type)."'");
$sql .= ", ".(empty($this->account_number) ? 'NULL' : "'".$this->db->escape($this->account_number)."'"); $sql .= ", ".(empty($this->account_number) ? 'NULL' : "'".$this->db->escape($this->account_number)."'");
@ -282,14 +282,14 @@ class AccountingAccount extends CommonObject
$sql .= ", ".(empty($this->label) ? "''" : "'".$this->db->escape($this->label)."'"); $sql .= ", ".(empty($this->label) ? "''" : "'".$this->db->escape($this->label)."'");
$sql .= ", ".(empty($this->labelshort) ? "''" : "'".$this->db->escape($this->labelshort)."'"); $sql .= ", ".(empty($this->labelshort) ? "''" : "'".$this->db->escape($this->labelshort)."'");
$sql .= ", ".(empty($this->account_category) ? 0 : (int) $this->account_category); $sql .= ", ".(empty($this->account_category) ? 0 : (int) $this->account_category);
$sql .= ", ".$user->id; $sql .= ", ".((int) $user->id);
$sql .= ", ".(int) $this->active; $sql .= ", ".(int) $this->active;
$sql .= ", ".(int) $this->reconcilable; $sql .= ", ".(int) $this->reconcilable;
$sql .= ")"; $sql .= ")";
$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();

View File

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

View File

@ -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)."'";
@ -382,15 +382,15 @@ class BookKeeping extends CommonObject
$sql .= ", '".$this->db->escape($this->numero_compte)."'"; $sql .= ", '".$this->db->escape($this->numero_compte)."'";
$sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL"); $sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL");
$sql .= ", '".$this->db->escape($this->label_operation)."'"; $sql .= ", '".$this->db->escape($this->label_operation)."'";
$sql .= ", ".$this->debit; $sql .= ", ".((float) $this->debit);
$sql .= ", ".$this->credit; $sql .= ", ".((float) $this->credit);
$sql .= ", ".$this->montant; $sql .= ", ".((float) $this->montant);
$sql .= ", ".(!empty($this->sens) ? ("'".$this->db->escape($this->sens)."'") : "NULL"); $sql .= ", ".(!empty($this->sens) ? ("'".$this->db->escape($this->sens)."'") : "NULL");
$sql .= ", '".$this->db->escape($this->fk_user_author)."'"; $sql .= ", '".$this->db->escape($this->fk_user_author)."'";
$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)."'").',';
@ -883,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)) {
@ -893,11 +893,9 @@ class BookKeeping extends CommonObject
$sql .= ' ORDER BY t.numero_compte ASC'; $sql .= ' ORDER BY t.numero_compte ASC';
} }
if (!empty($sortfield)) { $sql .= $this->db->order($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);
@ -1043,13 +1041,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();
@ -1137,17 +1135,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);
@ -1155,13 +1153,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';
@ -1170,7 +1168,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);
@ -1347,8 +1345,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) {
@ -1637,7 +1636,7 @@ class BookKeeping extends CommonObject
$sql .= ", date_export"; $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);
@ -1678,7 +1677,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) {
@ -1718,7 +1717,7 @@ class BookKeeping extends CommonObject
$sql .= ", date_export"; $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);
@ -1858,7 +1857,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) {
@ -2017,7 +2016,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 = '';
@ -2057,7 +2056,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 = '';

View File

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

View File

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

View File

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

View File

@ -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";
}*/ }*/
@ -260,13 +260,13 @@ $y = $year_current;
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>'; $buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>'; print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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);
@ -314,12 +314,12 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) { while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("Unknown"); print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else { } else {
print length_accountg($row[0]); print length_accountg($row[0]);
} }
print '</td>'; print '</td>';
print '<td class="left">'; print '<td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else { } else {
@ -344,13 +344,13 @@ print '</div>';
print '<br>'; print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>'; print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";
@ -404,7 +404,7 @@ if ($resql) {
} }
print '</td>'; print '</td>';
print '<td class="left">'; print '<td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else { } else {
@ -436,7 +436,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("TotalVente").'</td>'; print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";
@ -497,7 +497,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print "<br>\n"; print "<br>\n";
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400">'.$langs->trans("TotalMarge").'</td>'; print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";

View File

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

View File

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

View File

@ -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";
} }
@ -149,13 +149,13 @@ $y = $year_current;
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>'; $buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>'; print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -166,13 +166,13 @@ for ($i = 1; $i <= 12; $i++) {
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'; print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,"; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,"; $sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
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";
@ -197,12 +197,12 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) { while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("Unknown"); print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else { } else {
print length_accountg($row[0]); print length_accountg($row[0]);
} }
print '</td>'; print '</td>';
print '<td class="left">'; print '<td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else { } else {
@ -227,14 +227,14 @@ print '</div>';
print '<br>'; print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>'; print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";
@ -276,13 +276,13 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) { while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("Unknown"); print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else { } else {
print length_accountg($row[0]); print length_accountg($row[0]);
} }
print '</td>'; print '</td>';
print '<td class="left">'; print '<td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else { } else {
@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>'; print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";

View File

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

View File

@ -364,10 +364,10 @@ if ($result) {
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
$sqlmid = 'SELECT cchgsoc.accountancy_code'; $sqlmid = 'SELECT cchgsoc.accountancy_code';
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
$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);

View File

@ -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>
@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') {
$userstatic->id = $tabuser[$key]['id']; $userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name']; $userstatic->name = $tabuser[$key]['name'];
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>"; print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>"; print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>"; print "</tr>";
} }
@ -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 {

View File

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

View File

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

View File

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

View File

@ -260,13 +260,13 @@ $y = $year_current;
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>'; $buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>'; print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";
@ -309,12 +309,12 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) { while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("Unknown"); print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else { } else {
print length_accountg($row[0]); print length_accountg($row[0]);
} }
print '</td>'; print '</td>';
print '<td class="left">'; print '<td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else { } else {
@ -339,13 +339,13 @@ print '</div>';
print '<br>'; print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>'; print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";
@ -393,7 +393,7 @@ if ($resql) {
print length_accountg($row[0]); print length_accountg($row[0]);
} }
print '</td>'; print '</td>';
print '<td class="left">'; print '<td>';
if ($row[0] == 'tobind') { if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else { } else {
@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>'; print '<tr class="liste_titre"><td>'.$langs->trans("Total").'</td>';
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) { if ($j > 12) {
@ -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";

View File

@ -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++;
@ -620,10 +620,12 @@ if ($result) {
} }
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (!empty($objp->company_code_buy)) { if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
$objp->code_buy_t = $objp->company_code_buy; if (!empty($objp->company_code_buy)) {
$objp->aarowid_suggest = $objp->aarowid_thirdparty; $objp->code_buy_t = $objp->company_code_buy;
$suggestedaccountingaccountfor = ''; $objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
}
} }
if (!empty($objp->code_buy_p)) { if (!empty($objp->code_buy_p)) {
@ -724,11 +726,13 @@ if ($result) {
$s .= $langs->trans("NotDefined"); $s .= $langs->trans("NotDefined");
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
} }
print '<br>'; if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; print '<br>';
$shelp = ''; $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>'); $shelp = '';
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); $s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>'; print '</td>';
// Suggested accounting account // Suggested accounting account

View File

@ -25,7 +25,7 @@
*/ */
/** /**
* \file htdocs/adherents/admin/adherent.php * \file htdocs/adherents/admin/member.php
* \ingroup member * \ingroup member
* \brief Page to setup the module Foundation * \brief Page to setup the module Foundation
*/ */
@ -205,16 +205,16 @@ print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
// Login/Pass required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
print "</td></tr>\n";
// Mail required for members // Mail required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1); print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
print "</td></tr>\n"; print "</td></tr>\n";
// Login/Pass required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
print "</td></tr>\n";
// Send mail information is on by default // Send mail information is on by default
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1); print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
@ -225,6 +225,13 @@ print '<tr class="oddeven"><td>'.$langs->trans("MemberCreateAnExternalUserForSub
print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1); print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1);
print "</td></tr>\n"; print "</td></tr>\n";
// Allow members to change type on renewal forms
/* To test during next beta
print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
print "</td></tr>\n";
*/
// Insert subscription into bank account // Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices = array('0'=>$langs->trans("None")); $arraychoices = array('0'=>$langs->trans("None"));

View File

@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') {
if ($action == 'update') { if ($action == 'update') {
$public = GETPOST('MEMBER_ENABLE_PUBLIC'); $public = GETPOST('MEMBER_ENABLE_PUBLIC');
$amount = GETPOST('MEMBER_NEWFORM_AMOUNT'); $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<tr class="oddeven" id="tramount"><td>'; print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount"); print $langs->trans("DefaultAmount");
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">'; print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
print "</td></tr>\n"; print "</td></tr>\n";
// Can edit // Can edit
@ -238,7 +238,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '</div>'; print '</div>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print '</div>'; print '</div>';
} }

View File

@ -124,8 +124,23 @@ if ($reshook < 0) {
} }
if (empty($reshook)) { if (empty($reshook)) {
$backurlforlist = DOL_URL_ROOT.'/adherents/list.php';
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
$backtopage = DOL_URL_ROOT.'/adherents/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
}
}
}
if ($cancel) { if ($cancel) {
if (!empty($backtopage)) { if (!empty($backtopageforcancel)) {
header("Location: ".$backtopageforcancel);
exit;
} elseif (!empty($backtopage)) {
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
@ -535,7 +550,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');
@ -645,7 +660,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template // Get email content from template
$arraydefaultmessage = null; $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@ -716,7 +731,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template // Get email content from template
$arraydefaultmessage = null; $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
@ -787,7 +802,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template // Get email content from template
$arraydefaultmessage = null; $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
@ -1032,7 +1047,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 +1136,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 '&nbsp;&nbsp;';
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 +1403,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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';
} }
@ -1506,7 +1509,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template // Get email content from template
$arraydefaultmessage = null; $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@ -1814,15 +1817,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<tr><td>'; print '<tr><td>';
print $form->select_company($object->socid, 'socid', '', 1); print $form->select_company($object->socid, 'socid', '', 1);
print '</td>'; print '</td>';
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table></form>';
} else { } else {
if ($object->socid) { if ($object->socid) {
$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>';
@ -1846,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
print '</td></tr>'; print '</td></tr>';
//VCard // VCard
print '<tr><td>'; print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">'; print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">'; print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
@ -1941,7 +1952,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->societe->enabled) && !$object->socid) { if (!empty($conf->societe->enabled) && !$object->socid) {
if ($user->rights->societe->creer) { if ($user->rights->societe->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) { if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
} else { } else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n"; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
} }
@ -1954,7 +1965,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!$user->socid && !$object->user_id) { if (!$user->socid && !$object->user_id) {
if ($user->rights->user->user->creer) { if ($user->rights->user->user->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) { if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
} else { } else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n"; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
} }
@ -2002,8 +2013,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;

View File

@ -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";
@ -276,7 +276,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) {
} }
asort($arrayoflabels); asort($arrayoflabels);
print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">'; print '<br><input type="submit" class="button" value="'.$langs->trans("BuildDoc").'">';
print '</form>'; print '</form>';
print '<br><br>'; print '<br><br>';
@ -295,7 +295,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) {
asort($arrayoflabels); asort($arrayoflabels);
print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '<br>'.$langs->trans("Login").': <input size="10" type="text" name="foruserlogin" value="'.GETPOST('foruserlogin').'">'; print '<br>'.$langs->trans("Login").': <input size="10" type="text" name="foruserlogin" value="'.GETPOST('foruserlogin').'">';
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">'; print '<br><input type="submit" class="button" value="'.$langs->trans("BuildDoc").'">';
print '</form>'; print '</form>';
print '<br><br>'; print '<br><br>';
@ -313,7 +313,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) {
} }
asort($arrayoflabels); asort($arrayoflabels);
print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">'; print '<br><input type="submit" class="button" value="'.$langs->trans("BuildDoc").'">';
print '</form>'; print '</form>';
// End of page // End of page

View File

@ -574,7 +574,7 @@ class Adherent extends CommonObject
$sql .= ", ".($this->login ? "'".$this->db->escape($this->login)."'" : "null"); $sql .= ", ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
$sql .= ", ".($user->id > 0 ? $user->id : "null"); // Can be null because member can be created by a guest or a script $sql .= ", ".($user->id > 0 ? $user->id : "null"); // Can be null because member can be created by a guest or a script
$sql .= ", null, null, '".$this->db->escape($this->morphy)."'"; $sql .= ", null, null, '".$this->db->escape($this->morphy)."'";
$sql .= ", ".$this->typeid; $sql .= ", ".((int) $this->typeid);
$sql .= ", ".$conf->entity; $sql .= ", ".$conf->entity;
$sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null");
$sql .= ")"; $sql .= ")";
@ -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) {
@ -2185,6 +2185,9 @@ class Adherent extends CommonObject
if (!empty($this->ref)) { if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
} }
if (!empty($this->login)) {
$label .= '<br><b>'.$langs->trans('Login').':</b> '.$this->login;
}
if (!empty($this->firstname) || !empty($this->lastname)) { if (!empty($this->firstname) || !empty($this->lastname)) {
$label .= '<br><b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs); $label .= '<br><b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs);
} }

View File

@ -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,21 +181,21 @@ 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);
if ($this->db->num_rows($result)) { // if there is already a description line for this language if ($this->db->num_rows($result)) { // if there is already a description line for this language
$sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang"; $sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang";
$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);
@ -215,9 +215,9 @@ class AdherentType extends CommonObject
if ($this->db->num_rows($result)) { // if there is already a description line for this language if ($this->db->num_rows($result)) { // if there is already a description line for this language
$sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang"; $sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang";
$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

View File

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

View File

@ -204,7 +204,7 @@ class Members extends DolibarrApi
* @param int $limit Limit for list * @param int $limit Limit for list
* @param int $page Page number * @param int $page Page number
* @param string $typeid ID of the type of member * @param string $typeid ID of the type of member
* @param int $category Use this param to filter list by category * @param int $category Use this param to filter list by category
* @param string $sqlfilters Other criteria to filter answers separated by a comma. * @param string $sqlfilters Other criteria to filter answers separated by a comma.
* Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))" * Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))"
* @return array Array of member objects * @return array Array of member objects

View File

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

View File

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

View File

@ -318,12 +318,13 @@ $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.p
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; $sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
$sql .= " d.note_private, d.note_public,"; $sql .= " d.note_private, d.note_public,";
$sql .= " s.nom,"; $sql .= " s.nom,";
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
$sql .= " t.libelle as type, t.subscription,"; $sql .= " t.libelle as type, t.subscription,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $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
@ -492,7 +493,7 @@ if (GETPOSTISSET("search_status")) {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') { if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate"); $titre = $langs->trans("MembersListNotUpToDate");
} }
if ($search_status == Adherent::STATUS_RESILIATED) { if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is ''
$titre = $langs->trans("MembersListResiliated"); $titre = $langs->trans("MembersListResiliated");
} }
if ($search_status == Adherent::STATUS_EXCLUDED) { if ($search_status == Adherent::STATUS_EXCLUDED) {
@ -601,7 +602,7 @@ if ($user->rights->societe->creer) {
if ($user->rights->adherent->creer && $user->rights->user->user->creer) { if ($user->rights->adherent->creer && $user->rights->user->user->creer) {
$arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser"); $arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
} }
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) { if (in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
$arrayofmassactions = array(); $arrayofmassactions = array();
} }
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
@ -833,7 +834,7 @@ if (!empty($arrayfields['d.gender']['checked'])) {
print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder);
} }
if (!empty($arrayfields['d.company']['checked'])) { if (!empty($arrayfields['d.company']['checked'])) {
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
} }
if (!empty($arrayfields['d.login']['checked'])) { if (!empty($arrayfields['d.login']['checked'])) {
print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder);
@ -906,6 +907,7 @@ while ($i < min($num, $limit)) {
$memberstatic->id = $obj->rowid; $memberstatic->id = $obj->rowid;
$memberstatic->ref = $obj->ref; $memberstatic->ref = $obj->ref;
$memberstatic->civility_id = $obj->civility; $memberstatic->civility_id = $obj->civility;
$memberstatic->login = $obj->login;
$memberstatic->lastname = $obj->lastname; $memberstatic->lastname = $obj->lastname;
$memberstatic->firstname = $obj->firstname; $memberstatic->firstname = $obj->firstname;
$memberstatic->gender = $obj->gender; $memberstatic->gender = $obj->gender;
@ -920,9 +922,13 @@ while ($i < min($num, $limit)) {
if (!empty($obj->fk_soc)) { if (!empty($obj->fk_soc)) {
$memberstatic->fetch_thirdparty(); $memberstatic->fetch_thirdparty();
$companyname = $memberstatic->thirdparty->name; if ($memberstatic->thirdparty->id > 0) {
$companyname = $memberstatic->thirdparty->name;
$companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
}
} else { } else {
$companyname = $obj->company; $companyname = $obj->company;
$companynametoshow = $obj->company;
} }
$memberstatic->company = $companyname; $memberstatic->company = $companyname;
@ -956,7 +962,8 @@ while ($i < min($num, $limit)) {
// Firstname // Firstname
if (!empty($arrayfields['d.firstname']['checked'])) { if (!empty($arrayfields['d.firstname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
print $obj->firstname; print $memberstatic->getNomUrl(0, 0, 'card', 'fistname');
//print $obj->firstname;
print "</td>\n"; print "</td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -965,7 +972,8 @@ while ($i < min($num, $limit)) {
// Lastname // Lastname
if (!empty($arrayfields['d.lastname']['checked'])) { if (!empty($arrayfields['d.lastname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">';
print $obj->lastname; print $memberstatic->getNomUrl(0, 0, 'card', 'lastname');
//print $obj->lastname;
print "</td>\n"; print "</td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -985,7 +993,7 @@ while ($i < min($num, $limit)) {
// Company // Company
if (!empty($arrayfields['d.company']['checked'])) { if (!empty($arrayfields['d.company']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">'; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
print $companyname; print $companynametoshow;
print "</td>\n"; print "</td>\n";
} }
// Login // Login
@ -1095,7 +1103,9 @@ while ($i < min($num, $limit)) {
} }
// EMail // EMail
if (!empty($arrayfields['d.email']['checked'])) { if (!empty($arrayfields['d.email']['checked'])) {
print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n"; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).'">';
print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1);
print "</td>\n";
} }
// End of subscription date // End of subscription date
$datefin = $db->jdate($obj->datefin); $datefin = $db->jdate($obj->datefin);

View File

@ -308,7 +308,7 @@ if ($mode) {
print '</tr>'; print '</tr>';
foreach ($data as $val) { foreach ($data as $val) {
$year = isset($val['year']) ? $val['year'] : '';; $year = isset($val['year']) ? $val['year'] : '';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$val['label'].'</td>'; print '<td>'.$val['label'].'</td>';
if (isset($label2)) { if (isset($label2)) {

View File

@ -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"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
} }
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) { if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
} }
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) { if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
} }
} else { } else {
if (GETPOST("accountid")) { if (GETPOST("accountid", 'int')) {
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
} }
} }
if ($errmsg) {
$error++;
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
} }
} }
} }
@ -594,15 +601,23 @@ if ($rowid > 0) {
print '<tr><td>'; print '<tr><td>';
print $form->select_company($object->fk_soc, 'socid', '', 1); print $form->select_company($object->fk_soc, 'socid', '', 1);
print '</td>'; print '</td>';
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table></form>';
} else { } else {
if ($object->fk_soc) { if ($object->fk_soc) {
$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>';

View File

@ -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 ' &nbsp; &nbsp; &nbsp; ';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';
print "\n"; print "\n";

View File

@ -172,7 +172,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
$object->morphy = trim($morphy); $object->morphy = trim($morphy);
$object->status = (int) $status; $object->status = (int) $status;
$object->subscription = (int) $subscription; $object->subscription = (int) $subscription;
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));; $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
$object->duration_value = $duration_value; $object->duration_value = $duration_value;
$object->duration_unit = $duration_unit; $object->duration_unit = $duration_unit;
$object->note = trim($comment); $object->note = trim($comment);
@ -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>';
@ -398,11 +398,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" name="button" class="button" value="'.$langs->trans("Add").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
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";
} }
@ -814,12 +810,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 +826,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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print "</form>"; print "</form>";
} }

View File

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

View File

@ -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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';

View File

@ -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 '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
//print '<br>';
print '</form>'; print '</form>';

View File

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

View File

@ -41,8 +41,7 @@ if (!$user->admin) {
$langs->loadLangs(array('agenda', 'admin', 'other')); $langs->loadLangs(array('agenda', 'admin', 'other'));
$def = array(); $def = array();
$actiontest = GETPOST('test', 'alpha'); $action = GETPOST('action', 'alpha');
$actionsave = GETPOST('save', 'alpha');
if (empty($conf->global->AGENDA_EXT_NB)) { if (empty($conf->global->AGENDA_EXT_NB)) {
$conf->global->AGENDA_EXT_NB = 5; $conf->global->AGENDA_EXT_NB = 5;
@ -57,14 +56,57 @@ $colorlist = array('BECEDD', 'DDBECE', 'BFDDBE', 'F598B4', 'F68654', 'CBF654', '
* Actions * Actions
*/ */
if ($actionsave) { $error = 0;
$errors = array();
if (preg_match('/set_(.*)/', $action, $reg)) {
$db->begin();
$code = $reg[1];
$value = (GETPOST($code) ? GETPOST($code) : 1);
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
if (!$res > 0) {
$error++;
$errors[] = $db->lasterror();
}
if ($error) {
$db->rollback();
setEventMessages('', $errors, 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('SetupSaved'));
header('Location: ' . $_SERVER["PHP_SELF"]);
exit();
}
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
$db->begin();
$code = $reg[1];
$res = dolibarr_del_const($db, $code, $conf->entity);
if (!$res > 0) {
$error++;
$errors[] = $db->lasterror();
}
if ($error) {
$db->rollback();
setEventMessages('', $errors, 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('SetupSaved'));
header('Location: ' . $_SERVER["PHP_SELF"]);
exit();
}
} elseif ($action == 'save') {
$db->begin(); $db->begin();
$disableext = GETPOST('AGENDA_DISABLE_EXT', 'alpha'); $disableext = GETPOST('AGENDA_DISABLE_EXT', 'alpha');
$res = dolibarr_set_const($db, 'AGENDA_DISABLE_EXT', $disableext, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'AGENDA_DISABLE_EXT', $disableext, 'chaine', 0, '', $conf->entity);
$i = 1; $errorsaved = 0; $i = 1; $errorsaved = 0;
$error = 0;
// Save agendas // Save agendas
while ($i <= $MAXAGENDA) { while ($i <= $MAXAGENDA) {
@ -159,6 +201,10 @@ print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action
print '<span class="opacitymedium">'.$langs->trans("AgendaExtSitesDesc")."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("AgendaExtSitesDesc")."</span><br>\n";
print "<br>\n"; print "<br>\n";
$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
@ -203,31 +249,44 @@ print "<td>".$langs->trans("Name")."</td>";
print "<td>".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</td>'; print "<td>".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</td>';
print "<td>".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).'</td>'; print "<td>".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).'</td>';
print '<td class="right">'.$langs->trans("Color").'</td>'; print '<td class="right">'.$langs->trans("Color").'</td>';
print '<td class="right">'.$langs->trans("ActiveByDefault").'</td>';
print "</tr>"; print "</tr>";
$i = 1; $i = 1;
while ($i <= $MAXAGENDA) { while ($i <= $MAXAGENDA) {
$key = $i; $key = $i;
$name = 'AGENDA_EXT_NAME'.$key; $name = 'AGENDA_EXT_NAME' . $key;
$src = 'AGENDA_EXT_SRC'.$key; $src = 'AGENDA_EXT_SRC' . $key;
$offsettz = 'AGENDA_EXT_OFFSETTZ'.$key; $offsettz = 'AGENDA_EXT_OFFSETTZ' . $key;
$color = 'AGENDA_EXT_COLOR'.$key; $color = 'AGENDA_EXT_COLOR' . $key;
$enabled = 'AGENDA_EXT_ENABLED'.$key; $enabled = 'AGENDA_EXT_ENABLED' . $key;
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT' . $key;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Nb // Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb", $key)."</td>"; print '<td width="180" class="nowrap">' . $langs->trans("AgendaExtNb", $key) . "</td>";
// Name // Name
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : getDolGlobalString($name)).'" size="28"></td>'; print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME' . $key . '" value="' . (GETPOST('AGENDA_EXT_NAME' . $key) ? GETPOST('AGENDA_EXT_NAME' . $key, 'alpha') : getDolGlobalString($name)) . '" size="28"></td>';
// URL // URL
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : getDolGlobalString($src)).'" size="60"></td>'; print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC' . $key . '" value="' . (GETPOST('AGENDA_EXT_SRC' . $key) ? GETPOST('AGENDA_EXT_SRC' . $key, 'alpha') : getDolGlobalString($src)) . '" size="60"></td>';
// Offset TZ // Offset TZ
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : getDolGlobalString($offsettz)).'" size="2"></td>'; print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ' . $key . '" value="' . (GETPOST('AGENDA_EXT_OFFSETTZ' . $key) ? GETPOST('AGENDA_EXT_OFFSETTZ' . $key) : getDolGlobalString($offsettz)) . '" size="2"></td>';
// Color (Possible colors are limited by Google) // Color (Possible colors are limited by Google)
print '<td class="nowrap right">'; print '<td class="nowrap right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, '', 'hideifnotset');
print '</td>';
// Calendar active by default
print '<td class="nowrap right">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
} else {
if (empty($conf->global->{$default})) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
} else {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
}
}
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
$i++; $i++;

View File

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

View File

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

View File

@ -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">'; print $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";

View File

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

View File

@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -457,7 +457,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
@ -471,7 +471,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1,
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.$conf->global->BOM_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.$conf->global->BOM_DRAFT_WATERMARK.'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';

View File

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

View File

@ -174,7 +174,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -268,7 +268,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</table>'; print '</table>';
print "<br>"; print "<br>";

View File

@ -117,7 +117,7 @@ print '</td></tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<div class="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print $form->buttonsSaveCancel("Modify", '');
print '</form><br><br>'; print '</form><br><br>';

View File

@ -289,7 +289,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -507,7 +507,7 @@ print '<input type="hidden" name="action" value="setribchq">';
print $langs->trans("PaymentMode").'</td>'; print $langs->trans("PaymentMode").'</td>';
print '<td align="right">'; print '<td align="right">';
if (empty($conf->facture->enabled)) { if (empty($conf->facture->enabled)) {
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
} }
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -628,7 +628,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
@ -642,7 +642,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';

View File

@ -696,7 +696,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') { if ($mysoc->country_code == 'FR') {
$tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>"; $tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
} }
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>"; print '<label for="use_vat">'.$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
print "</td></tr>\n"; print "</td></tr>\n";
@ -706,7 +706,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') { if ($mysoc->country_code == 'FR') {
$tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n"; $tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
} }
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>"; print '<label for="no_vat">'.$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
print "</td></tr>\n"; print "</td></tr>\n";
print "</table>"; print "</table>";
@ -721,12 +721,12 @@ print "</tr>\n";
if ($mysoc->useLocalTax(1)) { if ($mysoc->useLocalTax(1)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option // Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>"; print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> <label for="lt1">'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">'; print '<td colspan="2">';
print '<div class="nobordernopadding">'; print '<div class="nobordernopadding">';
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); $tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : ""); $tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
print '<label for="lt1">'.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>"; print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
if (!isOnlyOneLocalTax(1)) { if (!isOnlyOneLocalTax(1)) {
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: '; print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) {
print "</div>"; print "</div>";
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>"; print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> <label for="nolt1">'.$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">'; print '<td colspan="2">';
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); $tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : ""); $tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>"; print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
print "</td></tr>\n"; print "</td></tr>\n";
} else { } else {
if (empty($mysoc->country_code)) { if (empty($mysoc->country_code)) {
@ -765,7 +765,7 @@ print "</tr>\n";
if ($mysoc->useLocalTax(2)) { if ($mysoc->useLocalTax(2)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option // Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>"; print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> <label for="lt2">'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">'; print '<td colspan="2">';
print '<div class="nobordernopadding">'; print '<div class="nobordernopadding">';
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>"; print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) {
print "</div>"; print "</div>";
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>"; print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> <label for="nolt2">'.$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">'; print '<td colspan="2">';
print "<div>"; print "<div>";
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); $tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
@ -803,7 +803,7 @@ print "</table>";
print '<br>'; print '<br>';
print '<table class="noborder centpercent editmode">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>'; print '<td>'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
if ($mysoc->useRevenueStamp()) { if ($mysoc->useRevenueStamp()) {
@ -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>';

View File

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

View File

@ -199,7 +199,7 @@ print '</td></tr>';
print "</table>\n"; print "</table>\n";
print '<br><br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<br><br><div style="text-align:center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
print '</form>'; print '</form>';
// End of page // End of page

View File

@ -222,7 +222,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) {
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
} }
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">'; print '<input type="submit" class="button button-add" name="add" value="'.$langs->trans("Add").'">';
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
@ -310,10 +310,10 @@ print '</div>';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print '<br>'; print '<br>';
print '<div id="updateconst" class="right">'; print '<div id="updateconst" class="right">';
print '<input type="submit" name="update" class="button marginbottomonly" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit marginbottomonly" name="update" value="'.$langs->trans("Modify").'">';
print '</div>'; print '</div>';
print '<div id="delconst" class="right">'; print '<div id="delconst" class="right">';
print '<input type="submit" name="delete" class="button marginbottomonly" value="'.$langs->trans("Delete").'">'; print '<input type="submit" class="button button-cancel marginbottomonly" name="delete" value="'.$langs->trans("Delete").'">';
print '</div>'; print '</div>';
} }

View File

@ -220,7 +220,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -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>';

View File

@ -399,7 +399,7 @@ if (!is_array($result) && $result<0) {
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$id.'">'; print '<input type="hidden" name="rowid" value="'.$id.'">';
print '<div name="'.(!empty($defaultvalue->id) ? $defaultvalue->id : 'none').'"></div>'; print '<div name="'.(!empty($defaultvalue->id) ? $defaultvalue->id : 'none').'"></div>';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
} }
print '</td>'; print '</td>';

View File

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

View File

@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -439,7 +439,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';

View File

@ -1487,7 +1487,7 @@ if ($id) {
} }
print '<td colspan="3" class="center">'; print '<td colspan="3" class="center">';
if ($action != 'edit') { if ($action != 'edit') {
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
} }
print '</td>'; print '</td>';
@ -1813,7 +1813,7 @@ if ($id) {
if (!is_null($withentity)) { if (!is_null($withentity)) {
print '<input type="hidden" name="entity" value="'.$withentity.'">'; print '<input type="hidden" name="entity" value="'.$withentity.'">';
} }
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
} else { } else {

View File

@ -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
@ -217,15 +217,15 @@ class Dolistore
for ($i = 0; $i < $nbofcateg; $i++) { for ($i = 0; $i < $nbofcateg; $i++) {
$cat = $this->categories[$i]; $cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) { if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '; $html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.((int) $cat->id).'" ';
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>'; $html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a></h3>';
$html .= self::get_categories($cat->id); $html .= self::get_categories($cat->id);
$html .= "</li>\n"; $html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : ''; $select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'; $html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.((int) $cat->id).'"';
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" '; $html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>'; $html .= '>'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a>';
$html .= self::get_categories($cat->id); $html .= self::get_categories($cat->id);
$html .= "</li>\n"; $html .= "</li>\n";
} }
@ -267,9 +267,9 @@ class Dolistore
// add image or default ? // add image or default ?
if ($product->id_default_image != '') { if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image; $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">'; $images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>'; $images .= '<img src="'.urlencode($image_url).'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else { } else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />'; $images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
} }
@ -277,11 +277,11 @@ class Dolistore
// free or pay ? // free or pay ?
if ($product->price > 0) { if ($product->price > 0) {
$price = '<h3>'.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>'; $price = '<h3>'.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; $download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} else { } else {
$price = '<h3>'.$langs->trans('Free').'</h3>'; $price = '<h3>'.$langs->trans('Free').'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>'; $download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; $download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} }
//checking versions //checking versions
@ -319,14 +319,14 @@ class Dolistore
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a> //.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template //output template
$html .= '<tr class="app oddeven '.$compatible.'"> $html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td> <td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1] <td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1])
.'<br><small>'.$version.'</small></h2> .'<br><small>'.dol_escape_htmltag($version).'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>'; <small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
// do not load if display none // do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>'; //$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.$price.'</td>'; $html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>'; $html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>'; $html .= '</tr>';
} }
@ -343,7 +343,7 @@ class Dolistore
public function get_previous_link($text = '<<') public function get_previous_link($text = '<<')
{ {
// phpcs:enable // phpcs:enable
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>'; return '<a href="'.$this->get_previous_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -356,7 +356,7 @@ class Dolistore
public function get_next_link($text = '>>') public function get_next_link($text = '>>')
{ {
// phpcs:enable // phpcs:enable
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>'; return '<a href="'.$this->get_next_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@ -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 '&nbsp; ';
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 ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';
} }

View File

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

View File

@ -16,7 +16,7 @@
*/ */
/** /**
* \file htdocs/admin/setup.php * \file htdocs/admin/eventorganization.php
* \ingroup eventorganization * \ingroup eventorganization
* \brief EventOrganization setup page. * \brief EventOrganization setup page.
*/ */
@ -48,8 +48,8 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1), 'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), 'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
@ -213,7 +213,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) { foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) { if ($val['enabled']==1) {
@ -264,7 +264,7 @@ if ($action == 'edit') {
} elseif (preg_match('/thirdparty_type/', $val['type'])) { } elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
} elseif ($val['type'] == 'securekey') { } elseif ($val['type'] == 'securekey') {
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">'; print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
@ -298,18 +298,14 @@ 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 ' &nbsp; ';
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} else { } else {
if (!empty($arrayofparameters)) { if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) { foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) { if ($val['enabled']==1) {
@ -366,7 +362,7 @@ if ($action == 'edit') {
$product = new Product($db); $product = new Product($db);
$resprod = $product->fetch($conf->global->{$constname}); $resprod = $product->fetch($conf->global->{$constname});
if ($resprod > 0) { if ($resprod > 0) {
print $product->ref; print $product->getNomUrl(1);
} elseif ($resprod < 0) { } elseif ($resprod < 0) {
setEventMessages(null, $object->errors, "errors"); setEventMessages(null, $object->errors, "errors");
} }
@ -449,7 +445,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }

View File

@ -219,7 +219,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -454,7 +454,7 @@ print "</td></tr>\n";
print '</table>'; print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print $form->buttonsSaveCancel("Modify", '');
print '</form>'; print '</form>';

View File

@ -228,7 +228,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -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>';

View File

@ -201,7 +201,7 @@ if ($action != 'edit') {
echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>'; echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>';
echo '<td><input type="text" value="" class="maxwidth100" name="amount" class="amount" /> '.$conf->currency.'</td>'; echo '<td><input type="text" value="" class="maxwidth100" name="amount" class="amount" /> '.$conf->currency.'</td>';
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>'; echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
echo '<td class="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>'; echo '<td class="right"><input type="submit" class="button button-add" value="'.$langs->trans('Add').'" /></td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';

View File

@ -98,7 +98,7 @@ print '</td></tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ExportCsvSeparator").'</td>'; print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';
print '<td width="60" align="center"><input class="flat width50" maxlength="3" type="text" name="EXPORT_CSV_SEPARATOR_TO_USE" value="'.(empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE).'"></td>'; print '<td width="60" align="center"><input class="flat width50" maxlength="3" type="text" name="EXPORT_CSV_SEPARATOR_TO_USE" value="'.(empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE).'"></td>';
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';

View File

@ -180,6 +180,7 @@ if (GETPOST("delete")) {
/* /*
* View * View
*/ */
$form = new Form($db);
llxHeader('', $langs->trans("ExternalRSSSetup")); llxHeader('', $langs->trans("ExternalRSSSetup"));
@ -209,11 +210,9 @@ print '<td>http://news.google.com/news?ned=us&topic=h&output=rss<br>http://www.d
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '<br><div class="center">'; print $form->buttonsSaveCancel("Add", '');
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="norss" value="'.($lastexternalrss + 1).'">'; print '<input type="hidden" name="norss" value="'.($lastexternalrss + 1).'">';
print '</div>';
print '</form>'; print '</form>';
@ -253,9 +252,8 @@ if ($resql) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print "<td>".$langs->trans("RSS")." ".($i + 1)."</td>"; print "<td>".$langs->trans("RSS")." ".($i + 1)."</td>";
print '<td class="right">'; print '<td class="right">';
print '<input type="submit" class="button buttongen" name="modify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button buttongen button-save" name="modify" value="'.$langs->trans("Modify").'">';
print " &nbsp; "; print '<input type="submit" class="button buttongen button-cancel" name="delete" value="'.$langs->trans("Delete").'">';
print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
print '<input type="hidden" name="norss" value="'.$idrss.'">'; print '<input type="hidden" name="norss" value="'.$idrss.'">';
print '</td>'; print '</td>';
print '</tr>'."\n"; print '</tr>'."\n";

View File

@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -579,7 +579,7 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Type").'</td>'; print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n"; print "</tr>\n";
$listtype = array( $listtype = array(
@ -623,7 +623,7 @@ print '<tr class="liste_titre">';
print '<td>'; print '<td>';
print '<input type="hidden" name="action" value="setribchq">'; print '<input type="hidden" name="action" value="setribchq">';
print $langs->trans("PaymentMode").'</td>'; print $langs->trans("PaymentMode").'</td>';
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -716,7 +716,7 @@ print $langs->trans("ForceInvoiceDate");
print '</td><td width="60" class="center">'; print '</td><td width="60" class="center">';
print $form->selectyesno("forcedate", $conf->global->FAC_FORCE_DATE_VALIDATION, 1); print $form->selectyesno("forcedate", $conf->global->FAC_FORCE_DATE_VALIDATION, 1);
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
@ -742,7 +742,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
@ -755,7 +755,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1,
print '</td>'; print '</td>';
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />'; print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';

View File

@ -47,6 +47,8 @@ if (!$user->admin) {
// Constant and translation of the module description // Constant and translation of the module description
$modules = array( $modules = array(
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
'SOCIETE' => 'FCKeditorForCompany', 'SOCIETE' => 'FCKeditorForCompany',
'PRODUCTDESC' => 'FCKeditorForProduct', 'PRODUCTDESC' => 'FCKeditorForProduct',
'DETAILS' => 'FCKeditorForProductDetails', 'DETAILS' => 'FCKeditorForProductDetails',
@ -54,11 +56,11 @@ $modules = array(
'MAILING' => 'FCKeditorForMailing', 'MAILING' => 'FCKeditorForMailing',
'MAIL' => 'FCKeditorForMail', 'MAIL' => 'FCKeditorForMail',
'TICKET' => 'FCKeditorForTicket', 'TICKET' => 'FCKeditorForTicket',
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
); );
// Conditions for the option to be offered // Conditions for the option to be offered
$conditions = array( $conditions = array(
'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1,
'SOCIETE' => 1, 'SOCIETE' => 1,
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)), 'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), 'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
@ -66,11 +68,11 @@ $conditions = array(
'MAILING' => !empty($conf->mailing->enabled), 'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)), 'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
'TICKET' => !empty($conf->ticket->enabled), 'TICKET' => !empty($conf->ticket->enabled),
'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1,
); );
// Picto // Picto
$picto = array( $picto = array(
'NOTE_PUBLIC' => 'generic',
'NOTE_PRIVATE' => 'generic',
'SOCIETE' => 'generic', 'SOCIETE' => 'generic',
'PRODUCTDESC' => 'product', 'PRODUCTDESC' => 'product',
'DETAILS' => 'product', 'DETAILS' => 'product',
@ -78,8 +80,6 @@ $picto = array(
'MAILING' => 'email', 'MAILING' => 'email',
'MAIL' => 'email', 'MAIL' => 'email',
'TICKET' => 'ticket', 'TICKET' => 'ticket',
'NOTE_PUBLIC' => 'generic',
'NOTE_PRIVATE' => 'generic',
); );
@ -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";

View File

@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -512,7 +512,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
@ -525,7 +525,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
// print products on fichinter // print products on fichinter
@ -540,7 +540,7 @@ if ($conf->global->FICHINTER_PRINT_PRODUCTS) {
} }
print '/>'; print '/>';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
// Use services duration // Use services duration
@ -555,7 +555,7 @@ print '<td class="center">';
print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.($conf->global->FICHINTER_USE_SERVICE_DURATION ? ' checked' : '').'>'; print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.($conf->global->FICHINTER_USE_SERVICE_DURATION ? ' checked' : '').'>';
print '</td>'; print '</td>';
print '<td class="right">'; print '<td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';
@ -571,7 +571,7 @@ print '<td class="center">';
print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.($conf->global->FICHINTER_WITHOUT_DURATION ? ' checked' : '').'>'; print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.($conf->global->FICHINTER_WITHOUT_DURATION ? ' checked' : '').'>';
print '</td>'; print '</td>';
print '<td class="right">'; print '<td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';
@ -587,7 +587,7 @@ print '<td class="center">';
print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.($conf->global->FICHINTER_DATE_WITHOUT_HOUR ? ' checked' : '').'>'; print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.($conf->global->FICHINTER_DATE_WITHOUT_HOUR ? ' checked' : '').'>';
print '</td>'; print '</td>';
print '<td class="right">'; print '<td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';

View File

@ -107,7 +107,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>';
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n"; print "</tr>\n";
// Lib version // Lib version

View File

@ -220,7 +220,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors"); $langs->load("errors");
print '<div class="error">'.$langs->trans($tmp).'</div>'; print '<div class="error">'.$langs->trans($tmp).'</div>';
} elseif ($tmp == 'NotConfigured') { } elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp); print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
} else { } else {
print $tmp; print $tmp;
} }
@ -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>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -43,12 +44,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') : 'other'; // 'template', 'dashboard', 'login', 'other'
if (!defined("MAIN_MOTD")) { if (!defined("MAIN_MOTD")) {
define("MAIN_MOTD", ""); define("MAIN_MOTD", "");
} }
/* /*
* Action * Action
*/ */
@ -94,168 +95,177 @@ if ($action == 'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKG
} }
if ($action == 'update') { if ($action == 'update') {
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); $error = 0;
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_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); if ($mode == 'template') {
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');
if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/ else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array()))));
if ($val == '') { if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
} else { } else {
dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_USE_HOVER'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_USE_HOVER', $conf->entity);
} else {
dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_USE_CHECKED'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity);
} else {
dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity);
}
} }
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array())))); if ($mode == 'dashboard') {
if ($val == '') { dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val, 'chaine', 0, '', $conf->entity);
} }
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'), array())))); if ($mode == 'other') {
if ($val == '') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val, '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_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
} }
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'), array())))); if ($mode == 'login') {
if ($val == '') { dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity);
dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); //dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
} else {
dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array())))); $varforimage = 'imagebackground';
if ($val == '') { $dirforimage = $conf->mycompany->dir_output . '/logos/';
dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); if ($_FILES[$varforimage]["tmp_name"]) {
} else { $reg = array();
dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val, 'chaine', 0, '', $conf->entity); if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) {
} $original_file = $reg[1];
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'), array())))); $isimage = image_format_supported($original_file);
if ($val == '') { if ($isimage >= 0) {
dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity); dol_syslog("Move file " . $_FILES[$varforimage]["tmp_name"] . " to " . $dirforimage . $original_file);
} else { if (!is_dir($dirforimage)) {
dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity); dol_mkdir($dirforimage);
} }
$result = dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage . $original_file, 1, 0, $_FILES[$varforimage]['error']);
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array())))); if ($result > 0) {
if ($val == '') { dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity);
dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity); } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) {
} else { $error++;
dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity); $langs->load("errors");
} $tmparray = explode(':', $result);
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array())))); } else {
if ($val == '') { $error++;
dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity); setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
} else { }
dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
} else {
dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_USE_HOVER'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_USE_HOVER', $conf->entity);
} else {
dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $val, 'chaine', 0, '', $conf->entity);
}
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_USE_CHECKED'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity);
} else {
dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, '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_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), '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_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
$varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/';
if ($_FILES[$varforimage]["tmp_name"]) {
$reg = array();
if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) {
$original_file = $reg[1];
$isimage = image_format_supported($original_file);
if ($isimage >= 0) {
dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file);
if (!is_dir($dirforimage)) {
dol_mkdir($dirforimage);
}
$result = dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']);
if ($result > 0) {
dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity);
} elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) {
$error++;
$langs->load("errors");
$tmparray = explode(':', $result);
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
} else { } else {
$error++; $error++;
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); $langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
} }
} else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
} }
} }
} }
$_SESSION["mainmenu"] = ""; // The menu manager may have changed
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".'&mode='.$mode.(GETPOSTISSET('page_y') ? '&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,242 +293,346 @@ 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 == 'template') {
print '<div class="div-table-responsive-no-min">'; // Themes and themes options
print '<table summary="edit" class="noborder centpercent editmode tableforfield">'; showSkins(null, 1);
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
print '</tr>';
// Default language
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
print img_picto('', 'language', 'class="pictofixedwidth"');
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
//print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</td>';
print '</tr>';
// Multilingual GUI
print '<tr class="oddeven"><td>'.$langs->trans("EnableMultilangInterface").'</td><td>';
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '</tr>';
print '</table>'."\n";
print '</div>';
print '<br>';
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
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>';
// Other
print '<div class="div-table-responsive-no-min">';
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">&nbsp;</tg>';
print '</tr>';
// Disable javascript and ajax
print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
print ' <span class="opacitymedium"> &nbsp; &nbsp; '.$langs->trans("DisableJavascriptNote").'</span>';
print '</td>';
print '<td>';
print '</td>';
print '</tr>';
// Max size of lists
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'"></td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Max size of short lists on customer card
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="'.$conf->global->MAIN_SIZE_SHORTLIST_LIMIT.'"></td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// show input border
/*
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
// First day for weeks
print '<tr class="oddeven"><td>'.$langs->trans("WeekStartOnDay").'</td><td>';
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// DefaultWorkingDays
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingDays").'</td><td>';
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5').'">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// DefaultWorkingHours
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingHours").'</td><td>';
print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18').'">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Firstname/Name
print '<tr class="oddeven"><td>'.$langs->trans("FirstnameNamePosition").'</td><td>';
$array = array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide unauthorized menus
print '<tr class="oddeven"><td>'.$langs->trans("HideUnauthorizedMenu").'</td><td>';
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide unauthorized button
print '<tr class="oddeven"><td>'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide version link
/*
print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
// Show bugtrack link
print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="'.(empty($conf->global->MAIN_BUGTRACK_ENABLELINK) ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK).'">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td>'.str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')).'</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Message of the day on home page
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
complete_substitutions_array($substitutionarray, $langs);
print '<tr class="oddeven"><td>';
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
foreach ($substitutionarray as $key => $val) {
$texthelp .= $key.'<br>';
} }
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
print '</td><td colspan="2">'; if ($mode == 'dashboard') {
print '<div class="div-table-responsive-no-min">';
print '<table summary="blockdashboard" class="noborder centpercent editmode tableforfield">';
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); // Message of the day on home page
$doleditor->Create(); $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
complete_substitutions_array($substitutionarray, $langs);
print '</td></tr>'."\n"; print '<tr class="oddeven width25p"><td>';
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
print '</table>'."\n"; foreach ($substitutionarray as $key => $val) {
print '</div>'; $texthelp .= $key . '<br>';
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>';
// Other
print '<div class="div-table-responsive-no-min">';
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">&nbsp;</th>';
print '</tr>';
// Hide helpcenter link on login page
print '<tr class="oddeven"><td>'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Message on login page
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
complete_substitutions_array($substitutionarray, $langs);
print '<tr class="oddeven"><td>';
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
foreach ($substitutionarray as $key => $val) {
$texthelp .= $key.'<br>';
}
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
print '</td><td colspan="2">';
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>'."\n";
// Background
print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
print '<div class="centpercent inline-block">';
$disabled = '';
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
$disabled = ' disabled="disabled"';
}
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"'.$disabled.'>';
if ($disabled) {
print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
}
if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
print ' &nbsp; ';
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
} }
} else { print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
}
print '</div>';
print '</td></tr>';
print '</table>'."\n"; print '</td><td>';
print '</div>';
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>' . "\n";
/* no more need for this option. It is now a widget already controlled by end user
print '<tr class="oddeven"><td>' . $langs->trans('BoxstatsDisableGlobal') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_GLOBAL_BOXSTATS", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '</tr>';
*/
print '</table>';
print '</div>';
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table summary="blockdashboard" class="noborder centpercent editmode tableforfield">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
print $langs->trans("DashboardDisableBlocks");
print '</td><td class="titlefieldmiddle">';
print '</td></tr>';
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableGlobal') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
// Block meteo
print '<tr class="oddeven"><td>' . $langs->trans('MAIN_DISABLE_METEO') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block agenda
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockAgenda') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block agenda
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockProject') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block customer
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockCustomer') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block supplier
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockSupplier') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block contract
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockContract') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block ticket
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockTicket') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block bank
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockBank') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block adherent
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockAdherent') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block expense report
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockExpenseReport') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
// Block holiday
print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockHoliday') . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
print '</td>';
print '</tr>';
}
print '</table>' . "\n";
print '</div>';
}
if ($mode == 'other') {
print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
print $langs->trans("Language");
print '</td><td class="titlefieldmiddle">';
print '</td></tr>';
// Default language
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
print img_picto('', 'language', 'class="pictofixedwidth"');
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
//print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</td>';
print '</tr>';
// Multilingual GUI
print '<tr class="oddeven"><td>' . $langs->trans("EnableMultilangInterface") . '</td><td>';
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'language');
print '</td>';
print '</tr>';
print '</table>' . "\n";
print '</div>';
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>';
// Other
print '<div class="div-table-responsive-no-min">';
print '<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
print $langs->trans("Miscelaneous");
print '</td><td class="titlefieldmiddle">';
print '</td></tr>';
// Max size of lists
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Max size of short lists on customer card
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeShortList") . '</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '"></td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// show input border
/*
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
// First day for weeks
print '<tr class="oddeven"><td>' . $langs->trans("WeekStartOnDay") . '</td><td>';
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// DefaultWorkingDays
print '<tr class="oddeven"><td>' . $langs->trans("DefaultWorkingDays") . '</td><td>';
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="' . (isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5') . '">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// DefaultWorkingHours
print '<tr class="oddeven"><td>' . $langs->trans("DefaultWorkingHours") . '</td><td>';
print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="' . (isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18') . '">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Firstname/Name
print '<tr class="oddeven"><td>' . $langs->trans("FirstnameNamePosition") . '</td><td>';
$array = array(0 => $langs->trans("Firstname") . ' ' . $langs->trans("Lastname"), 1 => $langs->trans("Lastname") . ' ' . $langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide unauthorized menus
print '<tr class="oddeven"><td>' . $langs->trans("HideUnauthorizedMenu") . '</td><td>';
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide unauthorized button
print '<tr class="oddeven"><td>' . $langs->trans("ButtonHideUnauthorized") . '</td><td>';
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide version link
/*
print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
// Show bugtrack link
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
print '</td><td>';
print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="' . (empty($conf->global->MAIN_BUGTRACK_ENABLELINK) ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK) . '">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Disable javascript and ajax
print '<tr class="oddeven"><td>' . $langs->trans("DisableJavascript") . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print ' <span class="opacitymedium paddingleft marginleft">' . $langs->trans("DisableJavascriptNote") . '</span>';
print '</td>';
print '<td>';
print '</td>';
print '</tr>';
print '</table>' . "\n";
print '</div>';
}
if ($mode == 'login') {
// Other
print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
print $langs->trans("Parameter");
print '</td><td class="titlefieldmiddle">';
print $langs->trans("Value");
print '</td></tr>';
// Hide helpcenter link on login page
print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0, 0, 0, '', 'login');
print '</td>';
print '</tr>';
// Message on login page
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
complete_substitutions_array($substitutionarray, $langs);
print '<tr class="oddeven"><td>';
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
foreach ($substitutionarray as $key => $val) {
$texthelp .= $key . '<br>';
}
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
print '</td><td>';
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>' . "\n";
// Background
print '<tr class="oddeven"><td><label for="imagebackground">' . $langs->trans("BackgroundImageLogin") . ' (png,jpg)</label></td><td>';
print '<div class="centpercent inline-block">';
$disabled = '';
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
$disabled = ' disabled="disabled"';
}
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"' . $disabled . '>';
if ($disabled) {
print '(' . $langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND") . ') ';
}
if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=removebackgroundlogin">' . img_delete($langs->trans("Delete")) . '</a>';
if (file_exists($conf->mycompany->dir_output . '/logos/' . $conf->global->MAIN_LOGIN_BACKGROUND)) {
print ' &nbsp; ';
print '<img class="paddingleft valignmiddle" width="100" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&amp;file=' . urlencode('logos/' . $conf->global->MAIN_LOGIN_BACKGROUND) . '">';
}
} else {
print '<img class="paddingleft valignmiddle" width="100" src="' . DOL_URL_ROOT . '/public/theme/common/nophoto.png">';
}
print '</div>';
print '</td></tr>';
print '</table>' . "\n";
print '</div>';
}
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

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