Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop#3
This commit is contained in:
commit
23da46938a
@ -24,7 +24,6 @@ Component Version License GPL Compatible
|
||||
-------------------------------------------------------------------------------------
|
||||
PHP libraries:
|
||||
ADOdb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
|
||||
CKEditor 4.12.1 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||
Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||
GeoIP2 0.2.0 Apache License 2.0 Yes Lib to make geoip convert
|
||||
@ -50,6 +49,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
|
||||
JS libraries:
|
||||
Ace 1.4.14 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||
ChartJS 3.7.1 MIT License Yes JS library for graph
|
||||
CKEditor 4.18 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
jQuery 3.6.0 MIT License Yes JS library
|
||||
jQuery UI 1.13.1 GPL and MIT License Yes JS library plugin UI
|
||||
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
||||
|
||||
@ -9,7 +9,7 @@ English Dolibarr ChangeLog
|
||||
For users:
|
||||
---------------
|
||||
|
||||
NEW: PHP 8.0 compatibility
|
||||
NEW: PHP 8.1 compatibility
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6,8 +6,9 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
||||
|
||||
| Version | Supported |
|
||||
| ---------- | ---------------------- |
|
||||
| <= 14.0.4 | :x: |
|
||||
| >= 14.0.5+ | :white_check_mark: except CSRF attacks|
|
||||
| <= 15.0.0 | :x: |
|
||||
| >= 15.0.1+ | :white_check_mark: except CSRF attacks|
|
||||
| >= 16.0.0 | :white_check_mark: |
|
||||
| >= develop | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
@ -27,12 +27,12 @@ OutputBaseFilename=__FILENAMEEXEDOLIWAMP__
|
||||
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
|
||||
SourceDir=..\..\..
|
||||
AppId=doliwamp
|
||||
AppPublisher=NLTechno
|
||||
AppPublisherURL=https://www.nltechno.com
|
||||
AppPublisher=DoliCloud
|
||||
AppPublisherURL=https://www.dolicloud.com
|
||||
AppSupportURL=https://www.dolibarr.org
|
||||
AppUpdatesURL=https://www.dolibarr.org
|
||||
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql software.
|
||||
AppCopyright=Copyright (C) 2008-2020 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
|
||||
AppCopyright=Copyright (C) 2008-2022 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
|
||||
DefaultDirName=c:\dolibarr
|
||||
DefaultGroupName=Dolibarr
|
||||
;LicenseFile=COPYING
|
||||
@ -99,13 +99,12 @@ Source: "build\exe\doliwamp\startdoliwamp_manual_donotuse.bat.install"; DestDir:
|
||||
Source: "build\exe\doliwamp\builddemosslfiles.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversion;
|
||||
|
||||
; PhpMyAdmin, Apache, Php, Mysql
|
||||
; Apache, Php, Mysql
|
||||
; Put here path of Wampserver applications
|
||||
; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45
|
||||
; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45
|
||||
; Value OK: apache 2.4.9, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
||||
; Value OK: apache 2.4.41, php 7.3.12, mariadb10.4.10 (wampserver3.2.0_x64.exe)
|
||||
Source: "C:\wamp64\apps\phpmyadmin4.9.2\*.*"; DestDir: "{app}\apps\phpmyadmin4.9.2"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
|
||||
;Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\wamp64\bin\apache\apache2.4.41\*.*"; DestDir: "{app}\bin\apache\apache2.4.41"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||
;Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||
@ -125,9 +124,7 @@ Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversi
|
||||
Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,default.properties,install.lock"
|
||||
|
||||
; Config files
|
||||
Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion;
|
||||
;Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.41\conf"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
|
||||
@ -196,7 +193,6 @@ var destFileA: String;
|
||||
var srcContents: String;
|
||||
var browser: String;
|
||||
var mysqlVersion: String;
|
||||
var phpmyadminVersion: String;
|
||||
var phpDllCopy: String;
|
||||
var batFile: String;
|
||||
|
||||
@ -246,7 +242,6 @@ begin
|
||||
phpVersion := '7.3.12' ;
|
||||
//mysqlVersion := '5.0.45';
|
||||
mysqlVersion := '10.4.10';
|
||||
phpmyadminVersion := '4.1.14';
|
||||
|
||||
smtpServer := 'localhost';
|
||||
apachePort := '80';
|
||||
@ -635,27 +630,6 @@ begin
|
||||
begin
|
||||
|
||||
|
||||
//----------------------------------------------
|
||||
// Create file alias phpmyadmin (always)
|
||||
//----------------------------------------------
|
||||
|
||||
destFile := pathWithSlashes+'/alias/phpmyadmin.conf';
|
||||
srcFile := pathWithSlashes+'/alias/phpmyadmin.conf.install';
|
||||
|
||||
if FileExists(srcFile) then
|
||||
begin
|
||||
LoadStringFromFile (srcFile, srcContents);
|
||||
|
||||
//installDir et version de phpmyadmin
|
||||
StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
|
||||
StringChangeEx (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion, True);
|
||||
|
||||
SaveStringToFile(destFile,srcContents, False);
|
||||
end;
|
||||
DeleteFile(srcFile);
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------
|
||||
// Create file alias dolibarr (if not exists)
|
||||
//----------------------------------------------
|
||||
@ -691,35 +665,6 @@ begin
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------
|
||||
// Create file configuration for phpmyadmin (if not exists)
|
||||
//----------------------------------------------
|
||||
|
||||
destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
|
||||
srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
|
||||
|
||||
if FileExists(srcFile) then
|
||||
begin
|
||||
if not FileExists (destFile) then
|
||||
begin
|
||||
LoadStringFromFile (srcFile, srcContents);
|
||||
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
||||
SaveStringToFile(destFile,srcContents, False);
|
||||
end
|
||||
else
|
||||
begin
|
||||
// We must replace to use format 2.4 of apache
|
||||
DeleteFile(destFile);
|
||||
LoadStringFromFile (srcFile, srcContents);
|
||||
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
||||
SaveStringToFile(destFile,srcContents, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------
|
||||
// Create file httpd.conf (if not exists)
|
||||
//----------------------------------------------
|
||||
|
||||
@ -395,8 +395,8 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
@ -406,9 +406,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$param = '';
|
||||
@ -608,7 +608,7 @@ if ($result) {
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
// Ref produit as link
|
||||
$product_static->ref = $obj->ref;
|
||||
@ -891,7 +891,7 @@ if ($result) {
|
||||
|
||||
print '</form>';
|
||||
|
||||
$db->free($result);
|
||||
$db->free($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -586,11 +586,11 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= ' WHERE a.rowid = ' . ((int) $id);
|
||||
|
||||
dol_syslog(get_class($this) . '::info sql=' . $sql);
|
||||
$result = $this->db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
if ($this->db->num_rows($result)) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$this->id = $obj->rowid;
|
||||
if ($obj->fk_user_author) {
|
||||
$cuser = new User($this->db);
|
||||
@ -605,7 +605,7 @@ class AccountingAccount extends CommonObject
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
$this->date_modification = $this->db->jdate($obj->tms);
|
||||
}
|
||||
$this->db->free($result);
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
@ -266,14 +266,14 @@ class Lettering extends BookKeeping
|
||||
$sql .= " ORDER BY ab2.lettering_code DESC";
|
||||
$sql .= " LIMIT 1 ";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$resqla = $this->db->query($sql);
|
||||
if ($resqla) {
|
||||
$obj = $this->db->fetch_object($resqla);
|
||||
$lettre = (empty($obj->lettering_code) ? 'AAA' : $obj->lettering_code);
|
||||
if (!empty($obj->lettering_code)) {
|
||||
$lettre++;
|
||||
}
|
||||
$this->db->free($result);
|
||||
$this->db->free($resqla);
|
||||
} else {
|
||||
$this->errors[] = 'Error'.$this->db->lasterror();
|
||||
$error++;
|
||||
@ -281,14 +281,14 @@ class Lettering extends BookKeeping
|
||||
|
||||
$sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE ";
|
||||
$sql .= " rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND lettering_code IS NULL AND subledger_account != ''";
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$resqlb = $this->db->query($sql);
|
||||
if ($resqlb) {
|
||||
$obj = $this->db->fetch_object($resqlb);
|
||||
if (!(round(abs($obj->deb), 2) === round(abs($obj->cred), 2))) {
|
||||
$this->errors[] = 'Total not exacts '.round(abs($obj->deb), 2).' vs '.round(abs($obj->cred), 2);
|
||||
$error++;
|
||||
}
|
||||
$this->db->free($result);
|
||||
$this->db->free($resqlb);
|
||||
} else {
|
||||
$this->errors[] = 'Erreur sql'.$this->db->lasterror();
|
||||
$error++;
|
||||
|
||||
@ -64,7 +64,7 @@ if ($action == 'set_default') {
|
||||
} elseif ($action == 'del_default') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
if ($conf->global->MEMBER_ADDON_PDF_ODT == "$value") {
|
||||
if (getDolGlobalString('MEMBER_ADDON_PDF_ODT') == "$value") {
|
||||
dolibarr_del_const($db, 'MEMBER_ADDON_PDF_ODT', $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,12 +95,13 @@ if ($action == 'update') {
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("MembersSetup");
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
llxHeader('', $langs->trans("MembersSetup"), $help_url);
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($title, $linkback, 'title_setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
|
||||
@ -490,17 +490,17 @@ class Subscription extends CommonObject
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'subscription as c';
|
||||
$sql .= ' WHERE c.rowid = '.((int) $id);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
if ($this->db->num_rows($result)) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
$this->date_modification = $this->db->jdate($obj->datem);
|
||||
}
|
||||
|
||||
$this->db->free($result);
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
@ -99,12 +99,12 @@ $sql .= " WHERE t.entity IN (".getEntity('member_type').")";
|
||||
$sql .= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut";
|
||||
|
||||
dol_syslog("index.php::select nb of members per type", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$adhtype = new AdherentType($db);
|
||||
$adhtype->id = $objp->rowid;
|
||||
@ -127,7 +127,7 @@ if ($result) {
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->free($result);
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
@ -143,16 +143,16 @@ $sql .= " AND t.rowid = d.fk_adherent_type";
|
||||
$sql .= " GROUP BY d.fk_adherent_type";
|
||||
|
||||
dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $db->fetch_object($resql);
|
||||
$MembersUpToDate[$objp->fk_adherent_type] = $objp->somme;
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -173,6 +173,9 @@ if (!empty($triggers)) {
|
||||
if ($module == 'contact') {
|
||||
$module = 'societe';
|
||||
}
|
||||
if ($module == 'facturerec') {
|
||||
$module = 'facture';
|
||||
}
|
||||
|
||||
// If 'element' value is myobject@mymodule instead of mymodule
|
||||
$tmparray = explode('@', $module);
|
||||
|
||||
@ -42,21 +42,24 @@ $label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'ticket';
|
||||
|
||||
$error = 0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
$error = 0;
|
||||
$errors = array();
|
||||
|
||||
if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
|
||||
if (GETPOST('value')) {
|
||||
dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setvar') {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
} elseif ($action == 'setvar') {
|
||||
include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||
|
||||
if (GETPOSTISSET('TICKET_ENABLE_PUBLIC_INTERFACE')) { // only for no js case
|
||||
@ -64,14 +67,7 @@ if ($action == 'setvar') {
|
||||
$res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', $param_enable_public_interface, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOSTISSET('TICKET_EMAIL_MUST_EXISTS')) { // only for no js case
|
||||
$param_must_exists = GETPOST('TICKET_EMAIL_MUST_EXISTS', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_EMAIL_MUST_EXISTS', $param_must_exists, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,6 +76,7 @@ if ($action == 'setvar') {
|
||||
$res = dolibarr_set_const($db, 'TICKET_DISABLE_CUSTOMER_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,6 +85,7 @@ if ($action == 'setvar') {
|
||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,6 +97,7 @@ if ($action == 'setvar') {
|
||||
}
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
|
||||
@ -109,6 +108,7 @@ if ($action == 'setvar') {
|
||||
}
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
|
||||
@ -119,6 +119,7 @@ if ($action == 'setvar') {
|
||||
}
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
|
||||
@ -129,6 +130,7 @@ if ($action == 'setvar') {
|
||||
}
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
$url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
|
||||
@ -139,12 +141,14 @@ if ($action == 'setvar') {
|
||||
}
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
$param_public_notification_new_message_default_email = GETPOST('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', $param_public_notification_new_message_default_email, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
@ -152,10 +156,60 @@ if ($action == 'setvar') {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1;
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if ($code == 'TICKET_EMAIL_MUST_EXISTS') {
|
||||
$res = dolibarr_del_const($db, 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
} elseif ($code == 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST') {
|
||||
$res = dolibarr_del_const($db, 'TICKET_EMAIL_MUST_EXISTS', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
|
||||
// enable captcha by default
|
||||
$res = dolibarr_set_const($db, 'MAIN_SECURITY_ENABLECAPTCHA', 1, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
if ($action != '') {
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('SetupSaved'));
|
||||
header("Location: " . $_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages('', $errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -180,7 +234,7 @@ $head = ticketAdminPrepareHead();
|
||||
|
||||
print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php" target="_blank" rel="noopener noreferrer">'.dol_buildpath('/public/ticket/index.php', 2).'</a>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php?entity='.$conf->entity.'" target="_blank" rel="noopener noreferrer">'.dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 2).'</a>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -220,11 +274,10 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
// Check if email exists
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailMustExist").'</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKET_EMAIL_MUST_EXISTS');
|
||||
if (empty(getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS'))) {
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_EMAIL_MUST_EXISTS">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TICKET_EMAIL_MUST_EXISTS", $arrval, $conf->global->TICKET_EMAIL_MUST_EXISTS);
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_EMAIL_MUST_EXISTS">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center width75">';
|
||||
@ -232,6 +285,20 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Create third-party with contact if email not linked to a contact
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
|
||||
print '<td class="left">';
|
||||
if (empty(getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST'))) {
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
|
||||
} else {
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center width75">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketCreateThirdPartyWithContactIfNotExistHelp"), 1, 'help');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
// Show logo for module
|
||||
|
||||
@ -102,7 +102,8 @@ if (empty($nosearch)) {
|
||||
print '<td colspan="3">'.$langs->trans("Search").'</td>';
|
||||
print '</tr>';
|
||||
print '<tr class="oddeven nohover"><td>';
|
||||
print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.dol_escape_htmltag($catname).'"></td>';
|
||||
print '<td><input type="submit" class="button small" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print '</table></form>';
|
||||
|
||||
|
||||
|
||||
@ -1598,7 +1598,7 @@ class ActionComm extends CommonObject
|
||||
//$tooltip .= '<br><b>'.img_picto('', 'email').' '.$langs->trans("Email").'</b>';
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTopic').':</b> '.$this->email_subject;
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailFrom').':</b> '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_from);
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTo').':</b>, '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_to);
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTo').':</b> '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_to);
|
||||
if (!empty($this->email_tocc)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailCC').':</b> '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_tocc);
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ if ($user->rights->banque->modifier && $action == "update") {
|
||||
$acline = new AccountLine($db);
|
||||
$result = $acline->fetch($rowid);
|
||||
if ($result <= 0) {
|
||||
dol_syslog('Failed to read bank line with id '.$rowid, LOG_ERR); // This happens due to old bug that has set fk_account to null.
|
||||
dol_syslog('Failed to read bank line with id '.$rowid, LOG_WARNING); // This happens due to old bug that has set fk_account to null.
|
||||
$acline->id = $rowid;
|
||||
}
|
||||
|
||||
@ -334,11 +334,12 @@ if ($result) {
|
||||
// Bank account
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Account").'</td>';
|
||||
print '<td>';
|
||||
if (!$objp->rappro && !$bankline->getVentilExportCompta()) {
|
||||
// $objp->fk_account may be not > 0 if data was lost by an old bug. In such a case, we let a chance to user to fix it.
|
||||
if (($objp->rappro || $bankline->getVentilExportCompta()) && $objp->fk_account > 0) {
|
||||
print $acct->getNomUrl(1, 'transactions', 'reflabel');
|
||||
} else {
|
||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||
print $form->select_comptes($acct->id, 'accountid', 0, '', ($acct->id > 0 ? $acct->id : 1), '', 0, '', 1);
|
||||
} else {
|
||||
print $acct->getNomUrl(1, 'transactions', 'reflabel');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1695,7 +1695,20 @@ if ($action == 'create') {
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
print '</div></div>';
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -305,7 +305,7 @@ if (empty($reshook)) {
|
||||
$object->fetch($id);
|
||||
|
||||
if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) {
|
||||
$last_of_type = $object->willBeLastOfSameType();
|
||||
$last_of_type = $object->willBeLastOfSameType(true);
|
||||
if (empty($object->date_validation) && !$last_of_type[0]) {
|
||||
setEventMessages($langs->transnoentities("ErrorInvoiceIsNotLastOfSameType", $object->ref, dol_print_date($object->date, 'day'), dol_print_date($last_of_type[1], 'day')), null, 'errors');
|
||||
$action = '';
|
||||
|
||||
@ -270,6 +270,7 @@ class FactureRec extends CommonInvoice
|
||||
if ($result > 0) {
|
||||
// On positionne en mode brouillon la facture
|
||||
$this->brouillon = 1;
|
||||
$this->fk_soc = $facsrc->socid;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_rec (";
|
||||
$sql .= "titre";
|
||||
@ -301,7 +302,7 @@ class FactureRec extends CommonInvoice
|
||||
$sql .= ", suspended";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= "'".$this->db->escape($this->titre ? $this->titre : $this->title)."'";
|
||||
$sql .= ", ".((int) $facsrc->socid);
|
||||
$sql .= ", ".((int) $this->fk_soc);
|
||||
$sql .= ", ".((int) $conf->entity);
|
||||
$sql .= ", '".$this->db->idate($now)."'";
|
||||
$sql .= ", ".(!empty($facsrc->total_ttc) ? ((float) $facsrc->total_ttc) : '0');
|
||||
@ -1256,9 +1257,10 @@ class FactureRec extends CommonInvoice
|
||||
*
|
||||
* @param int $restrictioninvoiceid 0=All qualified template invoices found. > 0 = restrict action on invoice ID
|
||||
* @param int $forcevalidation 1=Force validation of invoice whatever is template auto_validate flag.
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function createRecurringInvoices($restrictioninvoiceid = 0, $forcevalidation = 0)
|
||||
public function createRecurringInvoices($restrictioninvoiceid = 0, $forcevalidation = 0, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs, $db, $user, $hookmanager;
|
||||
|
||||
@ -1338,6 +1340,8 @@ class FactureRec extends CommonInvoice
|
||||
$this->error = $facture->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (!$error && ($facturerec->auto_validate || $forcevalidation)) {
|
||||
$result = $facture->validate($user);
|
||||
if ($result <= 0) {
|
||||
@ -1356,6 +1360,16 @@ class FactureRec extends CommonInvoice
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $facturerec->call_trigger('BILLREC_CREATEBILL', $user);
|
||||
if ($result < 0) {
|
||||
$this->errors = $facturerec->errors;
|
||||
$this->error = $facturerec->error;
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
$this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n";
|
||||
@ -1788,10 +1802,13 @@ class FactureRec extends CommonInvoice
|
||||
*
|
||||
* @param int $frequency value of frequency
|
||||
* @param string $unit unit of frequency (d, m, y)
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setFrequencyAndUnit($frequency, $unit)
|
||||
public function setFrequencyAndUnit($frequency, $unit, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (!$this->table_element) {
|
||||
dol_syslog(get_class($this)."::setFrequencyAndUnit was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
@ -1815,6 +1832,16 @@ class FactureRec extends CommonInvoice
|
||||
if (!empty($unit)) {
|
||||
$this->unit_frequency = $unit;
|
||||
}
|
||||
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -1827,10 +1854,14 @@ class FactureRec extends CommonInvoice
|
||||
*
|
||||
* @param datetime $date date of execution
|
||||
* @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setNextDate($date, $increment_nb_gen_done = 0)
|
||||
public function setNextDate($date, $increment_nb_gen_done = 0, $notrigger = 0)
|
||||
{
|
||||
|
||||
global $user;
|
||||
|
||||
if (!$this->table_element) {
|
||||
dol_syslog(get_class($this)."::setNextDate was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
@ -1848,6 +1879,15 @@ class FactureRec extends CommonInvoice
|
||||
if ($increment_nb_gen_done > 0) {
|
||||
$this->nb_gen_done++;
|
||||
}
|
||||
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -1859,10 +1899,14 @@ class FactureRec extends CommonInvoice
|
||||
* Update the maximum period
|
||||
*
|
||||
* @param int $nb number of maximum period
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setMaxPeriod($nb)
|
||||
public function setMaxPeriod($nb, $notrigger = 0)
|
||||
{
|
||||
|
||||
global $user;
|
||||
|
||||
if (!$this->table_element) {
|
||||
dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
@ -1879,6 +1923,16 @@ class FactureRec extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::setMaxPeriod", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
$this->nb_gen_max = $nb;
|
||||
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -1890,10 +1944,13 @@ class FactureRec extends CommonInvoice
|
||||
* Update the auto validate flag of invoice
|
||||
*
|
||||
* @param int $validate 0 to create in draft, 1 to create and validate invoice
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setAutoValidate($validate)
|
||||
public function setAutoValidate($validate, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (!$this->table_element) {
|
||||
dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
@ -1906,6 +1963,16 @@ class FactureRec extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
$this->auto_validate = $validate;
|
||||
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -1917,10 +1984,13 @@ class FactureRec extends CommonInvoice
|
||||
* Update the auto generate documents
|
||||
*
|
||||
* @param int $validate 0 no document, 1 to generate document
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setGeneratePdf($validate)
|
||||
public function setGeneratePdf($validate, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (!$this->table_element) {
|
||||
dol_syslog(get_class($this)."::setGeneratePdf was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
@ -1933,6 +2003,16 @@ class FactureRec extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::setGeneratePdf", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
$this->generate_pdf = $validate;
|
||||
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -1944,10 +2024,12 @@ class FactureRec extends CommonInvoice
|
||||
* Update the model for documents
|
||||
*
|
||||
* @param string $model model of document generator
|
||||
* @param int $notrigger Disable the trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setModelPdf($model)
|
||||
public function setModelPdf($model, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
if (!$this->table_element) {
|
||||
dol_syslog(get_class($this)."::setModelPdf was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
@ -1960,6 +2042,16 @@ class FactureRec extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::setModelPdf", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
$this->model_pdf = $model;
|
||||
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
|
||||
@ -3009,7 +3009,7 @@ class Facture extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) {
|
||||
$last_of_type = $this->willBeLastOfSameType();
|
||||
$last_of_type = $this->willBeLastOfSameType(true);
|
||||
if (!$last_of_type[0]) {
|
||||
$this->error = $langs->transnoentities("ErrorInvoiceIsNotLastOfSameType", $this->ref, dol_print_date($this->date, 'day'), dol_print_date($last_of_type[1], 'day'));
|
||||
return -1;
|
||||
@ -5567,9 +5567,10 @@ class Facture extends CommonInvoice
|
||||
|
||||
/**
|
||||
* See if current invoice date is posterior to the last invoice date among validated invoices of same type.
|
||||
* @param boolean $allow_validated_drafts return true if the invoice has been validated before returning to DRAFT state.
|
||||
* @return boolean
|
||||
*/
|
||||
public function willBeLastOfSameType()
|
||||
public function willBeLastOfSameType($allow_validated_drafts = false)
|
||||
{
|
||||
// get date of last validated invoices of same type
|
||||
$sql = "SELECT datef";
|
||||
@ -5586,7 +5587,12 @@ class Facture extends CommonInvoice
|
||||
$last_date = $this->db->jdate($obj->datef);
|
||||
$invoice_date = $this->date;
|
||||
|
||||
return [$invoice_date >= $last_date, $last_date];
|
||||
$is_last_of_same_type = $invoice_date >= $last_date;
|
||||
if ($allow_validated_drafts) {
|
||||
$is_last_of_same_type = $is_last_of_same_type || (!strpos($this->ref, 'PROV') && $this->status == self::STATUS_DRAFT);
|
||||
}
|
||||
|
||||
return [$is_last_of_same_type, $last_date];
|
||||
} else {
|
||||
// element is first of type to be validated
|
||||
return [true];
|
||||
|
||||
@ -310,9 +310,9 @@ if ($object->id > 0) {
|
||||
$sql .= " AND pfd.ext_payment_id IS NULL";
|
||||
$sql .= " ORDER BY pfd.date_demande DESC";
|
||||
|
||||
$result_sql = $db->query($sql);
|
||||
if ($result_sql) {
|
||||
$num = $db->num_rows($result_sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$numopen = $num;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -695,9 +695,9 @@ if ($object->id > 0) {
|
||||
$sql .= " AND pfd.traite = 0";
|
||||
$sql .= " AND pfd.ext_payment_id IS NULL";
|
||||
|
||||
$result_sql = $db->query($sql);
|
||||
if ($result_sql) {
|
||||
$obj = $db->fetch_object($result_sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$pending = $obj->amount;
|
||||
}
|
||||
@ -797,17 +797,17 @@ if ($object->id > 0) {
|
||||
$sql .= " AND pfd.ext_payment_id IS NULL";
|
||||
$sql .= " ORDER BY pfd.date_demande DESC";
|
||||
|
||||
$result_sql = $db->query($sql);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$num = 0;
|
||||
if ($result_sql) {
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
|
||||
$tmpuser = new User($db);
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result_sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$tmpuser->id = $obj->user_id;
|
||||
$tmpuser->login = $obj->login;
|
||||
@ -840,7 +840,7 @@ if ($object->id > 0) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($result_sql);
|
||||
$db->free($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ if ($action == 'create') {
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$sumpaid = $obj->total;
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
}
|
||||
/*print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td>'.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td>'.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';*/
|
||||
|
||||
@ -194,7 +194,7 @@ if ($action == 'create') {
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$sumpaid = $obj->total;
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
}
|
||||
/*print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td>'.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td>'.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';*/
|
||||
|
||||
@ -143,7 +143,8 @@ if ($resql) {
|
||||
print price($total);
|
||||
print '</td><td class="right"> </td>';
|
||||
print "</tr></table>";
|
||||
$db->free();
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -772,16 +772,6 @@ class Contrat extends CommonObject
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
/*
|
||||
if (!is_object($extrafields)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
}
|
||||
|
||||
$line = new ContratLigne($this->db);
|
||||
$extrafields->fetch_name_optionals_label(ContratLigne::$table_element, true);
|
||||
*/
|
||||
|
||||
$this->lines = array();
|
||||
$pos = 0;
|
||||
|
||||
@ -875,7 +865,7 @@ class Contrat extends CommonObject
|
||||
$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
|
||||
$line->date_fin_reel = $this->db->jdate($objp->date_cloture);
|
||||
|
||||
// Retrieve all extrafields for contract
|
||||
// Retrieve all extrafields for contract line
|
||||
// fetch optionals attributes and labels
|
||||
$line->fetch_optionals();
|
||||
|
||||
|
||||
@ -346,22 +346,27 @@ if ($result) {
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$datem = $db->jdate($obj->tms);
|
||||
|
||||
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
|
||||
$staticcontrat->id = $obj->cid;
|
||||
|
||||
$staticcompany->id = $obj->socid;
|
||||
$staticcompany->name = $obj->name;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowraponall">';
|
||||
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
|
||||
$staticcontrat->id = $obj->cid;
|
||||
print $staticcontrat->getNomUrl(1, 16);
|
||||
if ($obj->nb_late) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$staticcompany->id = $obj->socid;
|
||||
$staticcompany->name = $obj->name;
|
||||
print $staticcompany->getNomUrl(1, '', 20);
|
||||
print '</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>';
|
||||
print '<td class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
|
||||
print dol_print_date($datem, 'dayhour');
|
||||
print '</td>';
|
||||
//print '<td class="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
|
||||
print '<td class="right nowraponall" width="32">'.($obj->nb_initial > 0 ? '<span class="paddingright">'.$obj->nb_initial.'</span>'.$staticcontratligne->LibStatut(0, 3, -1, 'class="paddingleft"') : '').'</td>';
|
||||
print '<td class="right nowraponall" width="32">'.($obj->nb_running > 0 ? '<span class="paddingright">'.$obj->nb_running.'</span>'.$staticcontratligne->LibStatut(4, 3, 0, 'class="marginleft"') : '').'</td>';
|
||||
@ -451,7 +456,7 @@ if ($resql) {
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
|
||||
print "</table></div>";
|
||||
} else {
|
||||
@ -532,7 +537,8 @@ if ($resql) {
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
print "</table></div>";
|
||||
} else {
|
||||
@ -614,7 +620,7 @@ if ($resql) {
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
|
||||
print "</table></div>";
|
||||
} else {
|
||||
|
||||
@ -121,7 +121,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
if (!$error) {
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '', 1);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ class box_boms extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, 'day', 'tzuserrel'),
|
||||
);
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ class box_clients extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, "day", 'tzuserrel')
|
||||
);
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ class box_contacts extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, "day", 'tzuserrel'),
|
||||
);
|
||||
|
||||
|
||||
@ -83,8 +83,8 @@ class box_contracts extends ModeleBoxes
|
||||
$thirdpartytmp = new Societe($this->db);
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql .= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
|
||||
$sql .= ", c.ref_customer, c.ref_supplier";
|
||||
$sql .= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.tms as date_modification, c.fin_validite, c.date_cloture,";
|
||||
$sql .= " c.ref_customer, c.ref_supplier";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -117,6 +117,7 @@ class box_contracts extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$datem = $this->db->jdate($objp->date_modification);
|
||||
$dateterm = $this->db->jdate($objp->fin_validite);
|
||||
$dateclose = $this->db->jdate($objp->date_cloture);
|
||||
$late = '';
|
||||
@ -155,8 +156,8 @@ class box_contracts extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datec, 'day', 'tzuserrel'),
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, 'day', 'tzuserrel'),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
|
||||
@ -145,7 +145,7 @@ class box_members extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, "day", 'tzuserrel'),
|
||||
);
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ class box_mos extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, 'day', 'tzuserrel'),
|
||||
);
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ class box_propales extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("Date").': '.dol_print_date($datem, 'day', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($date, 'day', 'tzuserrel'),
|
||||
);
|
||||
|
||||
|
||||
@ -7805,7 +7805,7 @@ abstract class CommonObject
|
||||
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
|
||||
* @param string $onetrtd All fields in same tr td. Used by objectline_create.tpl.php for example.
|
||||
* @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...)
|
||||
* @return string
|
||||
* @return string String with html content to show
|
||||
*/
|
||||
public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0, $display_type = 'card')
|
||||
{
|
||||
@ -7814,13 +7814,20 @@ abstract class CommonObject
|
||||
if (!is_object($form)) {
|
||||
$form = new Form($db);
|
||||
}
|
||||
if (!is_object($extrafields)) {
|
||||
dol_syslog('Bad parameter extrafields for showOptionals', LOG_ERR);
|
||||
return 'Bad parameter extrafields for showOptionals';
|
||||
}
|
||||
if (!is_array($extrafields->attributes[$this->table_element])) {
|
||||
dol_syslog("extrafields->attributes was not loaded with extrafields->fetch_name_optionals_label(table_element);", LOG_WARNING);
|
||||
}
|
||||
|
||||
$out = '';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if (key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
|
||||
if (is_array($extrafields->attributes[$this->table_element]) && key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
|
||||
$out .= "\n";
|
||||
$out .= '<!-- commonobject:showOptionals --> ';
|
||||
$out .= "\n";
|
||||
|
||||
@ -170,6 +170,9 @@ class DolEditor
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_WSC)) { // spellchecker has end of life december 2021
|
||||
$pluginstodisable .= ',wsc';
|
||||
}
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_PDF)) {
|
||||
$pluginstodisable .= ',exportpdf';
|
||||
}
|
||||
$scaytautostartup = '';
|
||||
if (!empty($conf->global->FCKEDITOR_ENABLE_SCAYT_AUTOSTARTUP)) {
|
||||
$scaytautostartup = 'scayt_autoStartup: true,';
|
||||
@ -189,14 +192,14 @@ class DolEditor
|
||||
tmpeditor = CKEDITOR.replace(\''.$this->htmlname.'\',
|
||||
{
|
||||
/* property:xxx is same than CKEDITOR.config.property = xxx */
|
||||
customConfig : ckeditorConfig,
|
||||
removePlugins : \''.$pluginstodisable.'\',
|
||||
readOnly : '.($this->readonly ? 'true' : 'false').',
|
||||
htmlEncodeOutput :'.$htmlencode_force.',
|
||||
allowedContent :'.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */
|
||||
extraAllowedContent : \'a[target];div{float,display}\', /* Add the style float and display into div to default other allowed tags */
|
||||
disallowedContent : '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */
|
||||
fullPage : '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */
|
||||
customConfig: ckeditorConfig,
|
||||
removePlugins: \''.$pluginstodisable.'\',
|
||||
readOnly: '.($this->readonly ? 'true' : 'false').',
|
||||
htmlEncodeOutput:'.$htmlencode_force.',
|
||||
allowedContent:'.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */
|
||||
extraAllowedContent: \'a[target];div{float,display}\', /* Add the style float and display into div to default other allowed tags */
|
||||
disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */
|
||||
fullPage: '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */
|
||||
toolbar: \''.$this->toolbarname.'\',
|
||||
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
|
||||
width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').',
|
||||
|
||||
@ -1948,14 +1948,15 @@ class ExtraFields
|
||||
/**
|
||||
* Fill array_options property of object by extrafields value (using for data sent by forms)
|
||||
*
|
||||
* @param array $extralabels Deprecated (old $array of extrafields, now set this to null)
|
||||
* @param object $object Object
|
||||
* @param string $onlykey Only some keys are filled:
|
||||
* 'string' => When we make update of only one extrafield ($action = 'update_extras'), calling page can set this to avoid to have other extrafields being reset.
|
||||
* '@GETPOSTISSET' => When we make update of several extrafields ($action = 'update'), calling page can set this to avoid to have fields not into POST being reset.
|
||||
* @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example)
|
||||
* @param array $extralabels Deprecated (old $array of extrafields, now set this to null)
|
||||
* @param object $object Object
|
||||
* @param string $onlykey Only some keys are filled:
|
||||
* 'string' => When we make update of only one extrafield ($action = 'update_extras'), calling page can set this to avoid to have other extrafields being reset.
|
||||
* '@GETPOSTISSET' => When we make update of several extrafields ($action = 'update'), calling page can set this to avoid to have fields not into POST being reset.
|
||||
* @param int $todefaultifmissing 1=Set value to the default value in database if value is mandatory and missing
|
||||
* @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example)
|
||||
*/
|
||||
public function setOptionalsFromPost($extralabels, &$object, $onlykey = '')
|
||||
public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $todefaultifmissing = 0)
|
||||
{
|
||||
global $_POST, $langs;
|
||||
|
||||
@ -2015,8 +2016,10 @@ class ExtraFields
|
||||
|| (!is_array($_POST["options_".$key]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_'.$key] == '0')
|
||||
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) {
|
||||
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
|
||||
|
||||
// Field is not defined. We mark this as a problem. We may fix it later if there is a default value and $todefaultifmissing is set.
|
||||
$nofillrequired++;
|
||||
$error_field_required[] = $langs->transnoentitiesnoconv($value);
|
||||
$error_field_required[$key] = $langs->transnoentitiesnoconv($value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2047,12 +2050,22 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($error_field_required[$key]) && $todefaultifmissing) {
|
||||
// Value is required but we have a default value and we asked to set empty value to the default value
|
||||
if (!empty($this->attributes[$object->table_element]['default']) && !is_null($this->attributes[$object->table_element]['default'][$key])) {
|
||||
$value_key = $this->attributes[$object->table_element]['default'][$key];
|
||||
unset($error_field_required[$key]);
|
||||
$nofillrequired--;
|
||||
}
|
||||
}
|
||||
|
||||
$object->array_options["options_".$key] = $value_key;
|
||||
}
|
||||
|
||||
if ($nofillrequired) {
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ', $error_field_required), null, 'errors');
|
||||
$this->error = $langs->trans('ErrorFieldsRequired').' : '.implode(', ', $error_field_required);
|
||||
setEventMessages($this->error, null, 'errors');
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
|
||||
@ -234,7 +234,11 @@ class Form
|
||||
if (preg_match('/^(string|safehtmlstring|email)/', $typeofdata)) {
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||
} elseif (preg_match('/^(numeric|amount|integer)/', $typeofdata)) {
|
||||
} elseif (preg_match('/^(integer)/', $typeofdata)) {
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||
} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$valuetoshow = price2num($editvalue ? $editvalue : $value);
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||
@ -280,6 +284,7 @@ class Form
|
||||
$ret .= '</td>';
|
||||
}
|
||||
|
||||
// Button save-cancel
|
||||
if (empty($notabletag)) {
|
||||
$ret .= '<td class="left">';
|
||||
}
|
||||
@ -1272,7 +1277,7 @@ class Form
|
||||
}
|
||||
|
||||
// mode 1
|
||||
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
|
||||
$urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
@ -1633,7 +1638,7 @@ class Form
|
||||
* @param int $socid Id ot third party or 0 for all or -1 for empty list
|
||||
* @param array|int $selected Array of ID of pre-selected contact id
|
||||
* @param string $htmlname Name of HTML field ('none' for a not editable field)
|
||||
* @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list
|
||||
* @param int|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list
|
||||
* @param string $exclude List of contacts id to exclude
|
||||
* @param string $limitto Disable answers that are not id in this array list
|
||||
* @param integer $showfunction Add function into label
|
||||
@ -8917,10 +8922,11 @@ class Form
|
||||
$addgendertxt .= '<i class="fas fa-venus"></i>';
|
||||
break;
|
||||
case 'other':
|
||||
$addgendertxt .= '<i class="fas fa-genderless"></i>';
|
||||
$addgendertxt .= '<i class="fas fa-transgender"></i>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$addadmin = '';
|
||||
if (property_exists($object, 'admin')) {
|
||||
@ -9062,7 +9068,7 @@ class Form
|
||||
$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
|
||||
}
|
||||
} elseif (in_array($object->element, array('contact', 'user', 'usergroup'))) {
|
||||
$ret .= dol_htmlentities($object->getFullName($langs));
|
||||
$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
|
||||
} elseif (in_array($object->element, array('action', 'agenda'))) {
|
||||
$ret .= $object->ref.'<br>'.$object->label;
|
||||
} elseif (in_array($object->element, array('adherent_type'))) {
|
||||
|
||||
@ -1533,10 +1533,12 @@ class FormMail extends Form
|
||||
if (!is_object($extrafields)) {
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
}
|
||||
$extrafields->fetch_name_optionals_label('product', true);
|
||||
$product = new Product($this->db);
|
||||
$product->fetch($line->fk_product, '', '', 1);
|
||||
$product->fetch_optionals();
|
||||
|
||||
$extrafields->fetch_name_optionals_label($product->table_element, true);
|
||||
|
||||
if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) {
|
||||
foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) {
|
||||
$substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key];
|
||||
|
||||
@ -127,12 +127,13 @@ class FormTicket
|
||||
/**
|
||||
* Show the form to input ticket
|
||||
*
|
||||
* @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end()
|
||||
* @param string $mode Mode ('create' or 'edit')
|
||||
* @param int $public 1=If we show the form for the public interface
|
||||
* @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end()
|
||||
* @param string $mode Mode ('create' or 'edit')
|
||||
* @param int $public 1=If we show the form for the public interface
|
||||
* @param Contact|null $with_contact [=NULL] Contact to link to this ticket if exists
|
||||
* @return void
|
||||
*/
|
||||
public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0)
|
||||
public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0, Contact $with_contact = null)
|
||||
{
|
||||
global $conf, $langs, $user, $hookmanager;
|
||||
|
||||
@ -178,10 +179,104 @@ class FormTicket
|
||||
}
|
||||
|
||||
// TITLE
|
||||
$email = GETPOSTISSET('email') ? GETPOST('email', 'alphanohtml') : '';
|
||||
if ($this->withemail) {
|
||||
print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("Email").'</span></label></td><td>';
|
||||
print '<input class="text minwidth200" id="email" name="email" value="'.(GETPOST('email', 'alpha') ? GETPOST('email', 'alpha') : $subject).'" autofocus>';
|
||||
print '<input class="text minwidth200" id="email" name="email" value="'.$email.'" autofocus>';
|
||||
print '</td></tr>';
|
||||
|
||||
if ($with_contact) {
|
||||
// contact search and result
|
||||
$html_contact_search = '';
|
||||
$html_contact_search .= '<tr id="contact_search_line">';
|
||||
$html_contact_search .= '<td class="titlefield">';
|
||||
$html_contact_search .= '<label for="contact"><span class="fieldrequired">' . $langs->trans('Contact') . '</span></label>';
|
||||
$html_contact_search .= '<input type="hidden" id="contact_id" name="contact_id" value="" />';
|
||||
$html_contact_search .= '</td>';
|
||||
$html_contact_search .= '<td id="contact_search_result"></td>';
|
||||
$html_contact_search .= '</tr>';
|
||||
print $html_contact_search;
|
||||
// contact lastname
|
||||
$html_contact_lastname = '';
|
||||
$html_contact_lastname .= '<tr id="contact_lastname_line" class="contact_field"><td class="titlefield"><label for="contact_lastname"><span class="fieldrequired">' . $langs->trans('Lastname') . '</span></label></td><td>';
|
||||
$html_contact_lastname .= '<input type="text" id="contact_lastname" name="contact_lastname" value="' . dol_escape_htmltag(GETPOSTISSET('contact_lastname') ? GETPOST('contact_lastname', 'alphanohtml') : '') . '" />';
|
||||
$html_contact_lastname .= '</td></tr>';
|
||||
print $html_contact_lastname;
|
||||
// contact firstname
|
||||
$html_contact_firstname = '';
|
||||
$html_contact_firstname .= '<tr id="contact_firstname_line" class="contact_field"><td class="titlefield"><label for="contact_firstname"><span class="fieldrequired">' . $langs->trans('Firstname') . '</span></label></td><td>';
|
||||
$html_contact_firstname .= '<input type="text" id="contact_firstname" name="contact_firstname" value="' . dol_escape_htmltag(GETPOSTISSET('contact_firstname') ? GETPOST('contact_firstname', 'alphanohtml') : '') . '" />';
|
||||
$html_contact_firstname .= '</td></tr>';
|
||||
print $html_contact_firstname;
|
||||
// company name
|
||||
$html_company_name = '';
|
||||
$html_company_name .= '<tr id="contact_company_name_line" class="contact_field"><td><label for="company_name"><span>' . $langs->trans('Company') . '</span></label></td><td>';
|
||||
$html_company_name .= '<input type="text" id="company_name" name="company_name" value="' . dol_escape_htmltag(GETPOSTISSET('company_name') ? GETPOST('company_name', 'alphanohtml') : '') . '" />';
|
||||
$html_company_name .= '</td></tr>';
|
||||
print $html_company_name;
|
||||
// contact phone
|
||||
$html_contact_phone = '';
|
||||
$html_contact_phone .= '<tr id="contact_phone_line" class="contact_field"><td><label for="contact_phone"><span>' . $langs->trans('Phone') . '</span></label></td><td>';
|
||||
$html_contact_phone .= '<input type="text" id="contact_phone" name="contact_phone" value="' . dol_escape_htmltag(GETPOSTISSET('contact_phone') ? GETPOST('contact_phone', 'alphanohtml') : '') . '" />';
|
||||
$html_contact_phone .= '</td></tr>';
|
||||
print $html_contact_phone;
|
||||
|
||||
// search contact form email
|
||||
$langs->load('errors');
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
var contact = jQuery.parseJSON("'.dol_escape_js(json_encode($with_contact), 2).'");
|
||||
jQuery("#contact_search_line").hide();
|
||||
if (contact) {
|
||||
if (contact.id > 0) {
|
||||
jQuery("#contact_search_line").show();
|
||||
jQuery("#contact_id").val(contact.id);
|
||||
jQuery("#contact_search_result").html(contact.firstname+" "+contact.lastname);
|
||||
jQuery(".contact_field").hide();
|
||||
} else {
|
||||
jQuery(".contact_field").show();
|
||||
}
|
||||
}
|
||||
|
||||
jQuery("#email").change(function() {
|
||||
jQuery("#contact_search_line").show();
|
||||
jQuery("#contact_search_result").html("'.dol_escape_js($langs->trans('Select2SearchInProgress')).'");
|
||||
jQuery("#contact_id").val("");
|
||||
jQuery("#contact_lastname").val("");
|
||||
jQuery("#contact_firstname").val("");
|
||||
jQuery("#company_name").val("");
|
||||
jQuery("#contact_phone").val("");
|
||||
|
||||
jQuery.getJSON(
|
||||
"'.dol_escape_js(dol_buildpath('/public/ticket/ajax/ajax.php', 1)).'",
|
||||
{
|
||||
action: "getContacts",
|
||||
email: jQuery("#email").val()
|
||||
},
|
||||
function(response) {
|
||||
if (response.error) {
|
||||
jQuery("#contact_search_result").html("<span class=\"error\">"+response.error+"</span>");
|
||||
} else {
|
||||
var contact_list = response.contacts;
|
||||
if (contact_list.length == 1) {
|
||||
var contact = contact_list[0];
|
||||
jQuery("#contact_id").val(contact.id);
|
||||
jQuery("#contact_search_result").html(contact.firstname+" "+contact.lastname);
|
||||
jQuery(".contact_field").hide();
|
||||
} else if (contact_list.length <= 0) {
|
||||
jQuery("#contact_search_line").hide();
|
||||
jQuery(".contact_field").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
).fail(function(jqxhr, textStatus, error) {
|
||||
var error_msg = "'.dol_escape_js($langs->trans('ErrorAjaxRequestFailed')).'"+" ["+textStatus+"] : "+error;
|
||||
jQuery("#contact_search_result").html("<span class=\"error\">"+error_msg+"</span>");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
|
||||
// If ticket created from another object
|
||||
@ -325,7 +420,7 @@ class FormTicket
|
||||
print '</span>';
|
||||
print '<span class="nowrap inline-block">';
|
||||
print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
|
||||
print '<a class="inline-block valignmiddle" href="'.$php_self.'" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>';
|
||||
print '<a class="inline-block valignmiddle" href="" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>';
|
||||
print '</span>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -62,6 +62,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
$dataforitem = constant('JS_QUERY_AUTOCOMPLETE_ITEM');
|
||||
}
|
||||
|
||||
$htmlnamejquery = str_replace('.', '\\\\.', $htmlname);
|
||||
|
||||
// Input search_htmlname is original field
|
||||
// Input htmlname is a second input field used when using ajax autocomplete.
|
||||
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" '.($moreparams ? $moreparams : '').' />';
|
||||
@ -73,21 +75,21 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
var options = '.json_encode($ajaxoptions).'; /* Option of actions to do after keyup, or after select */
|
||||
|
||||
/* Remove selected id as soon as we type or delete a char (it means old selection is wrong). Use keyup/down instead of change to avoid loosing the product id. This is needed only for select of predefined product */
|
||||
$("input#search_'.$htmlname.'").keydown(function(e) {
|
||||
$("input#search_'.$htmlnamejquery.'").keydown(function(e) {
|
||||
if (e.keyCode != 9) /* If not "Tab" key */
|
||||
{
|
||||
if (e.keyCode == 13) { return false; } /* disable "ENTER" key useful for barcode readers */
|
||||
console.log("Clear id previously selected for field '.$htmlname.'");
|
||||
$("#'.$htmlname.'").val("");
|
||||
$("#'.$htmlnamejquery.'").val("");
|
||||
}
|
||||
});
|
||||
|
||||
// Check options for secondary actions when keyup
|
||||
$("input#search_'.$htmlname.'").keyup(function() {
|
||||
$("input#search_'.$htmlnamejquery.'").keyup(function() {
|
||||
if ($(this).val().length == 0)
|
||||
{
|
||||
$("#search_'.$htmlname.'").val("");
|
||||
$("#'.$htmlname.'").val("").trigger("change");
|
||||
$("#search_'.$htmlnamejquery.'").val("");
|
||||
$("#'.$htmlnamejquery.'").val("").trigger("change");
|
||||
if (options.option_disabled) {
|
||||
$("#" + options.option_disabled).removeAttr("disabled");
|
||||
}
|
||||
@ -118,15 +120,15 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
}
|
||||
});
|
||||
|
||||
$("input#search_'.$htmlname.'").autocomplete({
|
||||
$("input#search_'.$htmlnamejquery.'").autocomplete({
|
||||
source: function( request, response ) {
|
||||
$.get("'.$url.($urloption ? '?'.$urloption : '').'", { '.$htmlname.': request.term }, function(data){
|
||||
$.get("'.$url.($urloption ? '?'.$urloption : '').'", { "'.str_replace('.', '_', $htmlname).'": request.term }, function(data){
|
||||
if (data != null)
|
||||
{
|
||||
response($.map( data, function(item) {
|
||||
if (autoselect == 1 && data.length == 1) {
|
||||
$("#search_'.$htmlname.'").val(item.value);
|
||||
$("#'.$htmlname.'").val(item.key).trigger("change");
|
||||
$("#search_'.$htmlnamejquery.'").val(item.value);
|
||||
$("#'.$htmlnamejquery.'").val(item.key).trigger("change");
|
||||
}
|
||||
var label = item.label.toString();
|
||||
var update = {};
|
||||
@ -151,12 +153,13 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
description : item.description,
|
||||
ref_customer: item.ref_customer }
|
||||
}));
|
||||
} else {
|
||||
console.error("Error: Ajax url '.$url.($urloption ? '?'.$urloption : '').' has returned an empty page. Should be an empty json array.");
|
||||
}
|
||||
else console.error("Error: Ajax url '.$url.($urloption ? '?'.$urloption : '').' has returned an empty page. Should be an empty json array.");
|
||||
}, "json");
|
||||
},
|
||||
dataType: "json",
|
||||
minLength: '.$minLength.',
|
||||
minLength: '.((int) $minLength).',
|
||||
select: function( event, ui ) { // Function ran once new value has been selected into javascript combo
|
||||
console.log("We will trigger change on input '.$htmlname.' because of the select definition of autocomplete code for input#search_'.$htmlname.'");
|
||||
console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective");
|
||||
@ -164,25 +167,25 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
console.log("Propagate before some properties retrieved by ajax into data-xxx properties");
|
||||
|
||||
// For supplier price and customer when price by quantity is off
|
||||
$("#'.$htmlname.'").attr("data-up", ui.item.price_ht);
|
||||
$("#'.$htmlname.'").attr("data-base", ui.item.pricebasetype);
|
||||
$("#'.$htmlname.'").attr("data-qty", ui.item.qty);
|
||||
$("#'.$htmlname.'").attr("data-discount", ui.item.discount);
|
||||
$("#'.$htmlname.'").attr("data-description", ui.item.description);
|
||||
$("#'.$htmlname.'").attr("data-ref-customer", ui.item.ref_customer);
|
||||
$("#'.$htmlnamejquery.'").attr("data-up", ui.item.price_ht);
|
||||
$("#'.$htmlnamejquery.'").attr("data-base", ui.item.pricebasetype);
|
||||
$("#'.$htmlnamejquery.'").attr("data-qty", ui.item.qty);
|
||||
$("#'.$htmlnamejquery.'").attr("data-discount", ui.item.discount);
|
||||
$("#'.$htmlnamejquery.'").attr("data-description", ui.item.description);
|
||||
$("#'.$htmlnamejquery.'").attr("data-ref-customer", ui.item.ref_customer);
|
||||
';
|
||||
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
|
||||
$script .= '
|
||||
// For customer price when PRODUIT_CUSTOMER_PRICES_BY_QTY is on
|
||||
$("#'.$htmlname.'").attr("data-pbq", ui.item.pbq);
|
||||
$("#'.$htmlname.'").attr("data-pbqup", ui.item.price_ht);
|
||||
$("#'.$htmlname.'").attr("data-pbqbase", ui.item.pricebasetype);
|
||||
$("#'.$htmlname.'").attr("data-pbqqty", ui.item.qty);
|
||||
$("#'.$htmlname.'").attr("data-pbqpercent", ui.item.discount);
|
||||
$("#'.$htmlnamejquery.'").attr("data-pbq", ui.item.pbq);
|
||||
$("#'.$htmlnamejquery.'").attr("data-pbqup", ui.item.price_ht);
|
||||
$("#'.$htmlnamejquery.'").attr("data-pbqbase", ui.item.pricebasetype);
|
||||
$("#'.$htmlnamejquery.'").attr("data-pbqqty", ui.item.qty);
|
||||
$("#'.$htmlnamejquery.'").attr("data-pbqpercent", ui.item.discount);
|
||||
';
|
||||
}
|
||||
$script .= '
|
||||
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
|
||||
$("#'.$htmlnamejquery.'").val(ui.item.id).trigger("change"); // Select new value
|
||||
|
||||
// Disable an element
|
||||
if (options.option_disabled) {
|
||||
@ -236,7 +239,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
}
|
||||
console.log("ajax_autocompleter new value selected, we trigger change also on original component so on field #search_'.$htmlname.'");
|
||||
|
||||
$("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
|
||||
$("#search_'.$htmlnamejquery.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
|
||||
}
|
||||
,delay: 500
|
||||
}).data("'.$dataforrenderITem.'")._renderItem = function( ul, item ) {
|
||||
|
||||
@ -2257,7 +2257,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
|
||||
|
||||
$ret = '';
|
||||
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR', 'CN'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
||||
$sep = "\n";
|
||||
|
||||
// See format of addresses on https://en.wikipedia.org/wiki/Address
|
||||
// Address
|
||||
if (empty($mode)) {
|
||||
@ -2357,7 +2357,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
||||
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
|
||||
* false or 'tzserver' => output string is for local PHP server TZ usage
|
||||
* 'tzuser' => output string is for user TZ (current browser TZ with current dst) => In a future, we should have same behaviour than 'tzuserrel'
|
||||
* 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) (TODO not implemented yet)
|
||||
* 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position)
|
||||
* @param Translate $outputlangs Object lang that contains language for text translation.
|
||||
* @param boolean $encodetooutput false=no convert into output pagecode
|
||||
* @return string Formated date or '' if time is null
|
||||
@ -3788,7 +3788,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring',
|
||||
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'world', 'private',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
))) {
|
||||
$fakey = $pictowithouttext;
|
||||
@ -3839,7 +3839,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
|
||||
);
|
||||
if ($pictowithouttext == 'off') {
|
||||
@ -3908,7 +3908,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'switch_on_red'=>'font-status8',
|
||||
'holiday'=>'infobox-holiday', 'info'=>'opacityhigh', 'invoice'=>'infobox-commande',
|
||||
'knowledgemanagement'=>'infobox-contrat rotate90', 'loan'=>'infobox-bank_account',
|
||||
'payment'=>'infobox-bank_account', 'payment_vat'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal',
|
||||
'payment'=>'infobox-bank_account', 'payment_vat'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project',
|
||||
'propal'=>'infobox-propal', 'private'=>'infobox-project',
|
||||
'reception'=>'flip', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent',
|
||||
'resource'=>'infobox-action',
|
||||
'salary'=>'infobox-bank_account', 'shipment'=>'infobox-commande', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier',
|
||||
@ -3931,7 +3932,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
//'dolly'=>'#a69944', 'dollyrevert'=>'#a69944',
|
||||
'lot'=>'#a69944',
|
||||
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'inventory'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944',
|
||||
'other'=>'#ddd',
|
||||
'other'=>'#ddd', 'world'=>'#986c6a',
|
||||
'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba',
|
||||
//'shipment'=>'#a69944',
|
||||
'security'=>'#999', 'square'=>'#888', 'stop-circle'=>'#888', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555',
|
||||
|
||||
@ -2229,6 +2229,11 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
|
||||
$classpath = 'product/stock/class';
|
||||
$classfile = 'entrepot';
|
||||
$classname = 'Entrepot';
|
||||
} elseif ($objecttype == 'facturerec') {
|
||||
$classpath = 'compta/facture/class';
|
||||
$classfile = 'facture-rec';
|
||||
$classname = 'FactureRec';
|
||||
$module='facture';
|
||||
}
|
||||
|
||||
if (!empty($conf->$module->enabled)) {
|
||||
|
||||
@ -509,7 +509,7 @@ function project_admin_prepare_head()
|
||||
$head[$h][2] = 'attributes_task';
|
||||
$h++;
|
||||
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
$langs->load("members");
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/admin/website.php';
|
||||
@ -2819,7 +2819,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
|
||||
$out .= ' </div>';
|
||||
} else {
|
||||
// bad
|
||||
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.floatval($progressCalculated).'%" title="'.floatval($progressCalculated).'%">';
|
||||
$out .= ' <div class="progress-bar progress-bar-consumed-late" style="width: '.floatval($progressCalculated).'%" title="'.floatval($progressCalculated).'%">';
|
||||
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.($task->progress ? floatval($task->progress / $progressCalculated * 100).'%' : '1px').'" title="'.floatval($task->progress).'%"></div>';
|
||||
$out .= ' </div>';
|
||||
}
|
||||
|
||||
@ -378,6 +378,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
$nbko++;
|
||||
}
|
||||
} elseif (!empty($feature) && ($feature != 'user' && $feature != 'usergroup')) { // This is permissions on 1 level
|
||||
var_dump($user->rights);
|
||||
if (empty($user->rights->$feature->lire)
|
||||
&& empty($user->rights->$feature->read)
|
||||
&& empty($user->rights->$feature->run)) {
|
||||
|
||||
@ -233,7 +233,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
||||
print '<div class="backgreypublicpayment">';
|
||||
print '<div class="logopublicpayment">';
|
||||
if ($urllogo) {
|
||||
print '<a href="'.($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticket/index.php', 1)).'">';
|
||||
print '<a href="'.($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 1)).'">';
|
||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
||||
print '>';
|
||||
print '</a>';
|
||||
|
||||
@ -382,7 +382,7 @@ class modCategorie extends DolibarrModules
|
||||
$this->export_enabled[$r] = '!empty($conf->projet->enabled)';
|
||||
$this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export"));
|
||||
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name");
|
||||
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"List:societe:nom:rowid", 's.nom'=>"Text");
|
||||
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text");
|
||||
$this->export_entities_array[$r] = array('p.rowid'=>'project', 'p.ref'=>'project', 's.rowid'=>"company", 's.nom'=>"company"); // We define here only fields that use another picto
|
||||
|
||||
$keyforselect = 'projet';
|
||||
|
||||
@ -218,7 +218,7 @@ class modCommande extends DolibarrModules
|
||||
}
|
||||
}
|
||||
//$this->export_TypeFields_array[$r]=array(
|
||||
// 's.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label',
|
||||
// 's.rowid'=>"Numeric",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label',
|
||||
// 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",
|
||||
// 'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.total_ht'=>"Numeric",
|
||||
// 'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",
|
||||
|
||||
@ -181,7 +181,7 @@ class modContrat extends DolibarrModules
|
||||
'cod.date_ouverture'=>"contract_line", 'cod.date_ouverture_prevue'=>"contract_line", 'cod.date_fin_validite'=>"contract_line", 'cod.date_cloture'=>"contract_line",
|
||||
'p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product');
|
||||
|
||||
$this->export_TypeFields_array[$r] = array('s.rowid'=>"List:societe:nom", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text',
|
||||
$this->export_TypeFields_array[$r] = array('s.rowid'=>"Numeric", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text',
|
||||
's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text',
|
||||
's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
'co.ref'=>"Text", 'co.datec'=>"Date", 'co.date_contrat'=>"Date",
|
||||
|
||||
@ -121,7 +121,7 @@ class modDeplacement extends DolibarrModules
|
||||
$this->export_label[$r] = 'ListTripsAndExpenses';
|
||||
$this->export_permission[$r] = array(array("deplacement", "export"));
|
||||
$this->export_fields_array[$r] = array('u.login'=>'Login', 'u.lastname'=>'Lastname', 'u.firstname'=>'Firstname', 'd.rowid'=>"TripId", 'd.type'=>"Type", 'd.km'=>"FeesKilometersOrAmout", 'd.dated'=>"Date", 'd.note_private'=>'NotePrivate', 'd.note_public'=>'NotePublic', 's.nom'=>'ThirdParty');
|
||||
$this->export_TypeFields_array[$r] = array('u.rowid'=>'List:user:name', 'u.login'=>'Text', 'u.lastname'=>'Text', 'u.firstname'=>'Text', 'd.type'=>"Text", 'd.km'=>"Numeric", 'd.dated'=>"Date", 'd.note_private'=>'Text', 'd.note_public'=>'Text', 's.rowid'=>"List:societe:CompanyName", 's.nom'=>'Text');
|
||||
$this->export_TypeFields_array[$r] = array('u.rowid'=>'List:user:name', 'u.login'=>'Text', 'u.lastname'=>'Text', 'u.firstname'=>'Text', 'd.type'=>"Text", 'd.km'=>"Numeric", 'd.dated'=>"Date", 'd.note_private'=>'Text', 'd.note_public'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>'Text');
|
||||
$this->export_entities_array[$r] = array('u.login'=>'user', 'u.lastname'=>'user', 'u.firstname'=>'user', 'd.rowid'=>"trip", 'd.type'=>"trip", 'd.km'=>"trip", 'd.dated'=>"trip", 'd.note_private'=>'trip', 'd.note_public'=>'trip', 's.nom'=>'company');
|
||||
$this->export_dependencies_array[$r] = array('trip'=>'d.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
|
||||
|
||||
|
||||
@ -255,7 +255,7 @@ class modExpedition extends DolibarrModules
|
||||
$this->export_fields_array[$r] += array('sp.rowid'=>'IdContact', 'sp.lastname'=>'Lastname', 'sp.firstname'=>'Firstname', 'sp.note_public'=>'NotePublic');
|
||||
}
|
||||
//$this->export_TypeFields_array[$r]=array(
|
||||
// 's.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label',
|
||||
// 's.rowid'=>"Numeric",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label',
|
||||
// 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",
|
||||
// 'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",
|
||||
// 'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text"
|
||||
|
||||
@ -325,7 +325,7 @@ class modFournisseur extends DolibarrModules
|
||||
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
|
||||
}
|
||||
//$this->export_TypeFields_array[$r]=array(
|
||||
// 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text',
|
||||
// 's.rowid'=>"Numeric",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text',
|
||||
// 's.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",
|
||||
// 'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric",
|
||||
// 'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text'
|
||||
@ -399,7 +399,7 @@ class modFournisseur extends DolibarrModules
|
||||
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
|
||||
}
|
||||
//$this->export_TypeFields_array[$r]=array(
|
||||
// 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text',
|
||||
// 's.rowid'=>"Numeric",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text',
|
||||
// 's.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",
|
||||
// 'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",
|
||||
// 'pf.amount'=>'Numeric','p.datep'=>'Date','p.num_paiement'=>'Numeric'
|
||||
|
||||
@ -224,13 +224,13 @@ class modProjet extends DolibarrModules
|
||||
$this->export_dependencies_array[$r] = array('projecttask'=>'pt.rowid', 'task_time'=>'ptt.rowid');
|
||||
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
's.rowid'=>"List:societe:nom::thirdparty", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 's.fk_pays'=>'List:c_country:label',
|
||||
's.rowid'=>"Numeric", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 's.fk_pays'=>'List:c_country:label',
|
||||
's.phone'=>'Text', 's.email'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text',
|
||||
'p.rowid'=>"List:projet:ref::project", 'p.ref'=>"Text", 'p.title'=>"Text",
|
||||
'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.title'=>"Text",
|
||||
'p.usage_opportunity'=>'Boolean', 'p.usage_task'=>'Boolean', 'p.usage_bill_time'=>'Boolean',
|
||||
'p.datec'=>"Date", 'p.dateo'=>"Date", 'p.datee'=>"Date", 'p.fk_statut'=>'Status', 'cls.code'=>"Text", 'p.opp_percent'=>'Numeric', 'p.opp_amount'=>'Numeric', 'p.description'=>"Text", 'p.entity'=>'Numeric', 'p.budget_amount'=>'Numeric',
|
||||
'pt.rowid'=>'Numeric', 'pt.ref'=>'Text', 'pt.label'=>'Text', 'pt.dateo'=>"Date", 'pt.datee'=>"Date", 'pt.duration_effective'=>"Duree", 'pt.planned_workload'=>"Numeric", 'pt.progress'=>"Numeric", 'pt.description'=>"Text",
|
||||
'ptt.rowid'=>'Numeric', 'ptt.task_date'=>'Date', 'ptt.task_duration'=>"Duree", 'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)", 'ptt.note'=>"Text"
|
||||
'ptt.rowid'=>'Numeric', 'ptt.task_date'=>'Date', 'ptt.task_duration'=>"Duree", 'ptt.fk_user'=>"FormSelect:select_dolusers", 'ptt.note'=>"Text"
|
||||
);
|
||||
$this->export_entities_array[$r] = array(
|
||||
's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 's.fk_pays'=>'company',
|
||||
|
||||
@ -212,7 +212,7 @@ class modPropale extends DolibarrModules
|
||||
}
|
||||
}
|
||||
//$this->export_TypeFields_array[$r]=array(
|
||||
// 's.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.code'=>'Text','s.phone'=>'Text',
|
||||
// 's.rowid'=>"Numeric",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.code'=>'Text','s.phone'=>'Text',
|
||||
// 's.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",
|
||||
// 'c.fin_validite'=>"Date",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",
|
||||
// 'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",
|
||||
|
||||
@ -189,7 +189,7 @@ class modReception extends DolibarrModules
|
||||
if ($idcontacts && !empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) {
|
||||
$this->export_fields_array[$r] += array('sp.rowid'=>'IdContact', 'sp.lastname'=>'Lastname', 'sp.firstname'=>'Firstname', 'sp.note_public'=>'NotePublic');
|
||||
}
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"Numeric",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text',
|
||||
'co.label'=>'List:c_country:label:label', 'co.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text',
|
||||
|
||||
@ -306,7 +306,7 @@ class modSociete extends DolibarrModules
|
||||
$this->export_fields_array[$r] += array('u.login'=>'SaleRepresentativeLogin', 'u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname');
|
||||
|
||||
//$this->export_TypeFields_array[$r]=array(
|
||||
// 's.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",
|
||||
// 's.rowid'=>"Numeric",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",
|
||||
// 's.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",
|
||||
// 'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.canvas' => "Canvas",'s.siret'=>"Text",'s.siren'=>"Text",
|
||||
// 's.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text",
|
||||
@ -397,7 +397,7 @@ class modSociete extends DolibarrModules
|
||||
'c.address'=>"Text", 'c.zip'=>"Text", 'c.town'=>"Text", 'd.nom'=>'Text', 'r.nom'=>'Text', 'co.label'=>"List:c_country:label:rowid", 'co.code'=>"Text", 'c.phone'=>"Text",
|
||||
'c.fax'=>"Text", 'c.email'=>"Text",
|
||||
'c.statut'=>"Status",
|
||||
's.rowid'=>"List:societe:nom::thirdparty", 's.nom'=>"Text", 's.status'=>"Status", 's.code_client'=>"Text", 's.code_fournisseur'=>"Text",
|
||||
's.rowid'=>"Numeric", 's.nom'=>"Text", 's.status'=>"Status", 's.code_client'=>"Text", 's.code_fournisseur'=>"Text",
|
||||
's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text",
|
||||
's.client'=>"Text", 's.fournisseur'=>"Text",
|
||||
's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 's.phone'=>"Text", 's.email'=>"Text",
|
||||
|
||||
@ -239,7 +239,7 @@ class modStock extends DolibarrModules
|
||||
);
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
|
||||
'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
|
||||
'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree",
|
||||
'p.datec'=>'Date', 'p.tms'=>'Date', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric',
|
||||
'ps.reel'=>'Numeric',
|
||||
@ -286,7 +286,7 @@ class modStock extends DolibarrModules
|
||||
);
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.description'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
|
||||
'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
|
||||
'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree",
|
||||
'p.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice',
|
||||
'pb.batch'=>'Text', 'pb.qty'=>'Numeric',
|
||||
@ -332,7 +332,7 @@ class modStock extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
'sm.rowid'=>'Numeric', 'sm.value'=>'Numeric', 'sm.datem'=>'Date', 'sm.batch'=>'Text', 'sm.label'=>'Text', 'sm.inventorycode'=>'Text',
|
||||
'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.description'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
|
||||
'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
|
||||
'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date'
|
||||
);
|
||||
$this->export_entities_array[$r] = array(
|
||||
|
||||
@ -227,11 +227,14 @@ class modUser extends DolibarrModules
|
||||
'u.office_phone'=>'Phone', 'u.user_mobile'=>"Mobile", 'u.office_fax'=>'Fax',
|
||||
'u.email'=>"Email", 'u.note'=>"Note", 'u.signature'=>'Signature',
|
||||
'u.fk_user'=>'HierarchicalResponsible', 'u.thm'=>'THM', 'u.tjm'=>'TJM', 'u.weeklyhours'=>'WeeklyHours',
|
||||
'u.dateemployment'=>'DateEmployment', 'u.salary'=>'Salary', 'u.color'=>'Color', 'u.api_key'=>'ApiKey',
|
||||
'u.dateemployment'=>'DateEmploymentStart', 'u.dateemploymentend'=>'DateEmploymentEnd', 'u.salary'=>'Salary', 'u.color'=>'Color', 'u.api_key'=>'ApiKey',
|
||||
'u.birth'=>'DateOfBirth',
|
||||
'u.datec'=>"DateCreation", 'u.tms'=>"DateLastModification",
|
||||
'u.admin'=>"Administrator", 'u.statut'=>'Status', 'u.datelastlogin'=>'LastConnexion', 'u.datepreviouslogin'=>'PreviousConnexion',
|
||||
'u.fk_socpeople'=>"IdContact", 'u.fk_soc'=>"IdCompany", 'u.fk_member'=>"MemberId",
|
||||
'u.fk_socpeople'=>"IdContact", 'u.fk_soc'=>"IdCompany",
|
||||
'u.fk_member'=>"MemberId",
|
||||
"a.firstname"=>"MemberFirstname",
|
||||
"a.lastname"=>"MemberLastname",
|
||||
'g.nom'=>"Group"
|
||||
);
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
@ -240,9 +243,17 @@ class modUser extends DolibarrModules
|
||||
'u.address'=>"Text", 'u.zip'=>"Text", 'u.town'=>"Text",
|
||||
'u.office_phone'=>'Text', 'u.user_mobile'=>'Text', 'u.office_fax'=>'Text',
|
||||
'u.email'=>'Text', 'u.datec'=>"Date", 'u.tms'=>"Date", 'u.admin'=>"Boolean", 'u.statut'=>'Status', 'u.note'=>"Text", 'u.signature'=>"Text", 'u.datelastlogin'=>'Date',
|
||||
'u.fk_user'=>"List:user:login",
|
||||
'u.fk_user'=>"FormSelect:select_dolusers",
|
||||
'u.birth'=>'Date',
|
||||
'u.datepreviouslogin'=>'Date', 'u.fk_soc'=>"List:societe:nom:rowid", 'u.fk_member'=>"List:adherent:firstname",
|
||||
'u.datepreviouslogin'=>'Date',
|
||||
'u.fk_socpeople'=>'FormSelect:selectcontacts',
|
||||
'u.fk_soc'=>"FormSelect:select_company",
|
||||
'u.tjm'=>"Numeric", 'u.thm'=>"Numeric", 'u.fk_member'=>"Numeric",
|
||||
'u.weeklyhours'=>"Numeric",
|
||||
'u.dateemployment'=>"Date", 'u.dateemploymentend'=>"Date", 'u.salary'=>"Numeric",
|
||||
'u.color'=>'Text', 'u.api_key'=>'Text',
|
||||
'a.firstname'=>'Text',
|
||||
'a.lastname'=>'Text',
|
||||
'g.nom'=>"Text"
|
||||
);
|
||||
$this->export_entities_array[$r] = array(
|
||||
@ -252,11 +263,12 @@ class modUser extends DolibarrModules
|
||||
'u.office_phone'=>'user', 'u.user_mobile'=>'user', 'u.office_fax'=>'user',
|
||||
'u.email'=>'user', 'u.note'=>"user", 'u.signature'=>'user',
|
||||
'u.fk_user'=>'user', 'u.thm'=>'user', 'u.tjm'=>'user', 'u.weeklyhours'=>'user',
|
||||
'u.dateemployment'=>'user', 'u.salary'=>'user', 'u.color'=>'user', 'u.api_key'=>'user',
|
||||
'u.dateemployment'=>'user', 'u.dateemploymentend'=>'user', 'u.salary'=>'user', 'u.color'=>'user', 'u.api_key'=>'user',
|
||||
'u.birth'=>'user',
|
||||
'u.datec'=>"user", 'u.tms'=>"user",
|
||||
'u.admin'=>"user", 'u.statut'=>'user', 'u.datelastlogin'=>'user', 'u.datepreviouslogin'=>'user',
|
||||
'u.fk_socpeople'=>"contact", 'u.fk_soc'=>"company", 'u.fk_member'=>"member",
|
||||
'a.firstname'=>"member", 'a.lastname'=>"member",
|
||||
'g.nom'=>"Group"
|
||||
);
|
||||
$keyforselect = 'user';
|
||||
@ -272,6 +284,7 @@ class modUser extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extra ON u.rowid = extra.fk_object';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'usergroup_user as ug ON u.rowid = ug.fk_user';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'usergroup as g ON ug.fk_usergroup = g.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'adherent as a ON u.fk_member = a.rowid';
|
||||
$this->export_sql_end[$r] .= ' WHERE u.entity IN ('.getEntity('user').')';
|
||||
|
||||
// Imports
|
||||
@ -292,7 +305,7 @@ class modUser extends DolibarrModules
|
||||
'u.office_phone'=>"Phone", 'u.user_mobile'=>"Mobile", 'u.office_fax'=>"Fax",
|
||||
'u.email'=>"Email", 'u.note'=>"Note", 'u.signature'=>'Signature',
|
||||
'u.fk_user'=>'HierarchicalResponsible', 'u.thm'=>'THM', 'u.tjm'=>'TJM', 'u.weeklyhours'=>'WeeklyHours',
|
||||
'u.dateemployment'=>'DateEmployment', 'u.salary'=>'Salary', 'u.color'=>'Color', 'u.api_key'=>'ApiKey',
|
||||
'u.dateemployment'=>'DateEmploymentStart', 'u.dateemploymentend'=>'DateEmploymentEnd', 'u.salary'=>'Salary', 'u.color'=>'Color', 'u.api_key'=>'ApiKey',
|
||||
'u.birth'=>'DateOfBirth',
|
||||
'u.datec'=>"DateCreation",
|
||||
'u.statut'=>'Status'
|
||||
|
||||
@ -41,6 +41,7 @@ if (!isset($parameters)) {
|
||||
}
|
||||
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
$params = array();
|
||||
@ -48,6 +49,7 @@ if (empty($reshook)) {
|
||||
$params['tpl_context'] = $tpl_context;
|
||||
}
|
||||
$params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
|
||||
|
||||
print $object->showOptionals($extrafields, 'create', $params);
|
||||
}
|
||||
|
||||
|
||||
@ -924,7 +924,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
}
|
||||
}
|
||||
|
||||
// If trackid is not defined, we set it
|
||||
// If trackid is not defined, we set it.
|
||||
// Note that it should be set by caller. This is for compatibility purpose only.
|
||||
if (empty($object->trackid)) {
|
||||
// See also similar list into emailcollector.class.php
|
||||
if (preg_match('/^COMPANY_/', $action)) {
|
||||
@ -1039,15 +1040,17 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
$actioncomm->contact_id = $contactforaction->id; // deprecated, use ->socpeopleassigned instead
|
||||
$actioncomm->authorid = $user->id; // User saving action
|
||||
$actioncomm->userownerid = $user->id; // Owner of action
|
||||
// Fields defined when action is an email (content should be into object->actionmsg to be added into note, subject into object->actionms2 to be added into label)
|
||||
$actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
|
||||
$actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
|
||||
$actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
|
||||
$actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
|
||||
$actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
|
||||
$actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
|
||||
$actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
|
||||
$actioncomm->errors_to = empty($object->errors_to) ? null : $object->errors_to;
|
||||
// Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionms2 to be added into event label)
|
||||
if (!property_exists($object, 'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
|
||||
$actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
|
||||
$actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
|
||||
$actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
|
||||
$actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
|
||||
$actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
|
||||
$actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
|
||||
$actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
|
||||
$actioncomm->errors_to = empty($object->errors_to) ? null : $object->errors_to;
|
||||
}
|
||||
|
||||
// Object linked (if link is for thirdparty, contact, project it is a recording error. We should not have links in link table
|
||||
// for such objects because there is already a dedicated field into table llx_actioncomm or llx_actioncomm_resources.
|
||||
|
||||
@ -149,7 +149,7 @@ $resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$sumpaid = $obj->total;
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -333,10 +333,12 @@ if ($projectid > 0) {
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($project->public) {
|
||||
print $langs->trans('SharedProject');
|
||||
if ($project->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print $langs->trans('PrivateProject');
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -59,6 +59,7 @@ $conf_or_booth_id = GETPOST('conforboothid', 'int');
|
||||
|
||||
$withproject = GETPOST('withproject', 'int');
|
||||
$fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int');
|
||||
$projectid = $fk_project;
|
||||
|
||||
$withProjectUrl='';
|
||||
|
||||
@ -459,10 +460,12 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print $langs->trans('SharedProject');
|
||||
if ($projectstatic->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print $langs->trans('PrivateProject');
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -541,6 +544,12 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $projectstatic, $permissiontoadd, 'integer:3', '&withproject=1', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', 0, 0, '&withproject=1', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
|
||||
@ -212,7 +212,7 @@ if ($action == 'create' || empty($action)) {
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$sumpaid = $obj->total;
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td>'.price($sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td>'.price($total - $sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
@ -268,7 +268,7 @@ class Export
|
||||
continue;
|
||||
}
|
||||
if ($value != '') {
|
||||
$sqlWhere .= " and ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
|
||||
$sqlWhere .= " AND ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
|
||||
}
|
||||
}
|
||||
$sql .= $sqlWhere;
|
||||
@ -350,6 +350,13 @@ class Export
|
||||
case 'Boolean':
|
||||
$szFilterQuery = " ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField == 'yes' ? 1 : 0));
|
||||
break;
|
||||
case 'FormSelect':
|
||||
if (is_numeric($ValueField) && $ValueField > 0) {
|
||||
$szFilterQuery = " ".$NameField." = ".((float) $ValueField);
|
||||
} else {
|
||||
$szFilterQuery = " 1=1"; // Test always true
|
||||
}
|
||||
break;
|
||||
case 'Status':
|
||||
case 'List':
|
||||
if (is_numeric($ValueField)) {
|
||||
@ -402,7 +409,7 @@ class Export
|
||||
public function build_filterField($TypeField, $NameField, $ValueField)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $form;
|
||||
|
||||
$szFilterField = '';
|
||||
$InfoFieldList = explode(":", $TypeField);
|
||||
@ -443,6 +450,16 @@ class Export
|
||||
$szFilterField .= ' value="0">'.yn(0).'</option>';
|
||||
$szFilterField .= "</select>";
|
||||
break;
|
||||
case 'FormSelect':
|
||||
//var_dump($NameField);
|
||||
if ($InfoFieldList[1] == 'select_company') {
|
||||
$szFilterField .= $form->select_company('', $NameField, '', 1);
|
||||
} elseif ($InfoFieldList[1] == 'selectcontacts') {
|
||||
$szFilterField .= $form->selectcontacts(0, '', $NameField, ' ');
|
||||
} elseif ($InfoFieldList[1] == 'select_dolusers') {
|
||||
$szFilterField .= $form->select_dolusers('', $NameField, 1);
|
||||
}
|
||||
break;
|
||||
case 'List':
|
||||
// 0 : Type du champ
|
||||
// 1 : Nom de la table
|
||||
@ -615,6 +632,9 @@ class Export
|
||||
} else {
|
||||
$filename = "export_".$datatoexport;
|
||||
}
|
||||
if (!empty($conf->global->EXPORT_NAME_WITH_DT)) {
|
||||
$filename .= dol_print_date(dol_now(), '%Y%m%d%_%H%M');
|
||||
}
|
||||
$filename .= '.'.$objmodel->getDriverExtension();
|
||||
$dirname = $conf->export->dir_temp.'/'.$user->id;
|
||||
|
||||
|
||||
@ -519,7 +519,7 @@ if ($step == 2 && $datatoexport) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("SelectExportFields").'</span> ';
|
||||
$htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id);
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
||||
print '<input type="submit" class="button small" value="'.$langs->trans("Select").'">';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
@ -868,12 +868,18 @@ if ($step == 4 && $datatoexport) {
|
||||
print '<td>'.$list.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// List of filtered fiels
|
||||
// List of filtered fields
|
||||
if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
|
||||
print '<tr><td>'.$langs->trans("FilteredFields").'</td>';
|
||||
$list = '';
|
||||
if (!empty($array_filtervalue)) {
|
||||
foreach ($array_filtervalue as $code => $value) {
|
||||
if (preg_match('/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
|
||||
// We discard this filter if it is a FromSelect field with a value of -1.
|
||||
if ($value == -1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (isset($objexport->array_export_fields[0][$code])) {
|
||||
$list .= ($list ? ', ' : '');
|
||||
if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) {
|
||||
@ -1015,7 +1021,7 @@ if ($step == 4 && $datatoexport) {
|
||||
print $form->selectarray('visibility', $arrayvisibility, 'private');
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button reposition button-save" value="'.$langs->trans("Save").'">';
|
||||
print '<input type="submit" class="button reposition button-save small" value="'.$langs->trans("Save").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
$tmpuser = new User($db);
|
||||
@ -1148,6 +1154,12 @@ if ($step == 5 && $datatoexport) {
|
||||
$list = '';
|
||||
if (!empty($array_filtervalue)) {
|
||||
foreach ($array_filtervalue as $code => $value) {
|
||||
if (preg_match('/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
|
||||
// We discard this filter if it is a FromSelect field with a value of -1.
|
||||
if ($value == -1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (isset($objexport->array_export_fields[0][$code])) {
|
||||
$list .= ($list ? ', ' : '');
|
||||
if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) {
|
||||
|
||||
@ -3523,7 +3523,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
empty($this->receptions[$obj->rowid]) ? $this->receptions[$obj->rowid] = $obj->qty : $this->receptions[$obj->rowid] += $obj->qty;
|
||||
$i++;
|
||||
}
|
||||
$this->db->free();
|
||||
$this->db->free($resql);
|
||||
|
||||
return $num;
|
||||
} else {
|
||||
|
||||
@ -352,6 +352,7 @@ if ($step == 1 || !$datatoimport) {
|
||||
$serialized_array_match_file_to_database = '';
|
||||
$array_match_file_to_database = array();
|
||||
$_SESSION["dol_array_match_file_to_database"] = '';
|
||||
$_SESSION["dol_array_match_file_to_database_select"] = '';
|
||||
|
||||
$param = '';
|
||||
if ($excludefirstline) {
|
||||
@ -1078,16 +1079,16 @@ if ($step == 4 && $datatoimport) {
|
||||
}
|
||||
}
|
||||
|
||||
$height = '24px'; //needs px for css height attribute below
|
||||
$height = '32px'; //needs px for css height attribute below
|
||||
$i = 0;
|
||||
$mandatoryfieldshavesource = true;
|
||||
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<table class="nobordernopadding centpercent tableimport">';
|
||||
foreach ($fieldstarget as $code => $line) {
|
||||
if ($i == $minpos) {
|
||||
break;
|
||||
}
|
||||
print '<tr class="oddeven" style="height:'.$height.'">';
|
||||
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
|
||||
$entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]);
|
||||
|
||||
$tablealias = preg_replace('/(\..*)$/i', '', $code);
|
||||
@ -1096,7 +1097,8 @@ if ($step == 4 && $datatoimport) {
|
||||
$entityicon = !empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity; // $entityicon must string name of picto of the field like 'project', 'company', 'contact', 'modulename', ...
|
||||
$entitylang = $entitytolang[$entity] ? $entitytolang[$entity] : $objimport->array_import_label[0]; // $entitylang must be a translation key to describe object the field is related to, like 'Company', 'Contact', 'MyModyle', ...
|
||||
|
||||
print '<td class="nowraponall" style="font-weight: normal">=>'.img_object('', $entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||
print '<td class="nowraponall" style="font-weight: normal">=> '.img_object('', $entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||
|
||||
print '<td class="nowraponall" style="font-weight: normal">';
|
||||
print '<select id="selectorderimport_'.($i+1).'" class="targetselectchange minwidth300" name="select_'.$line["label"].'">';
|
||||
if ($line["imported"]) {
|
||||
@ -1106,16 +1108,19 @@ if ($step == 4 && $datatoimport) {
|
||||
print '<option selected="" value="-1"> </option>';
|
||||
print '<option value="'.$code.'">';
|
||||
}
|
||||
$text = $langs->trans($line["label"]);
|
||||
$more = '';
|
||||
$text = $langs->trans($line["label"]);
|
||||
if ($line["required"]) {
|
||||
$text .= "*";
|
||||
print '<strong>'.$text.'*</strong>';
|
||||
} else {
|
||||
print $text;
|
||||
}
|
||||
print $text;
|
||||
print '</option>';
|
||||
print $optionsnotused;
|
||||
print '</select>';
|
||||
//print ajax_combobox('selectorderimport_'.($i+1));
|
||||
print "</td>";
|
||||
|
||||
print '<td class="nowraponall" style="font-weight:normal; text-align:right">';
|
||||
$filecolumn = !empty($array_match_database_to_file[$code])?$array_match_database_to_file[$code]:0;
|
||||
// Source field info
|
||||
@ -1180,6 +1185,7 @@ if ($step == 4 && $datatoimport) {
|
||||
print '</td></tr>';
|
||||
|
||||
// List of not imported fields
|
||||
/*
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("NotUsedFields").'</td></tr>';
|
||||
|
||||
print '<tr valign="top"><td width="50%">';
|
||||
@ -1218,12 +1224,13 @@ if ($step == 4 && $datatoimport) {
|
||||
$i++;
|
||||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print '<script type="text/javascript">'."\n";
|
||||
print 'var previousselectedvalueimport = "0";'."\n";
|
||||
print 'var previousselectedlabelimport = "0";'."\n";
|
||||
@ -1231,7 +1238,7 @@ if ($step == 4 && $datatoimport) {
|
||||
print '$(".targetselectchange").focus(function(){'."\n";
|
||||
print 'previousselectedvalueimport = $(this).val();'."\n";
|
||||
print 'previousselectedlabelimport = $(this).children("option:selected").text();'."\n";
|
||||
print 'console.log(previousselectedvalueimport)'."\n";
|
||||
print 'console.log("previousselectedvalueimport="+previousselectedvalueimport)'."\n";
|
||||
print '})'."\n";
|
||||
print '$(".targetselectchange").change(function(){'."\n";
|
||||
print 'if(previousselectedlabelimport != "" && previousselectedvalueimport != -1){'."\n";
|
||||
@ -1258,15 +1265,17 @@ if ($step == 4 && $datatoimport) {
|
||||
print 'value = $(this).val()'."\n";
|
||||
print 'arrayselectedfields.push(value);'."\n";
|
||||
print '});'."\n";
|
||||
print '$.ajax({'."\n";
|
||||
print 'type: "POST",'."\n";
|
||||
print 'dataType: "json",'."\n";
|
||||
print 'url: "'.$_SERVER["PHP_SELF"].'?action=saveselectorder",'."\n";
|
||||
print 'data: "selectorder="+arrayselectedfields.toString(),'."\n";
|
||||
print 'success: function(){'."\n";
|
||||
print 'console.log("Select order saved");'."\n";
|
||||
print '},'."\n";
|
||||
|
||||
print "$.ajax({\n";
|
||||
print " type: 'POST',\n";
|
||||
print " dataType: 'json',\n";
|
||||
print " url: '".dol_escape_js($_SERVER["PHP_SELF"])."?action=saveselectorder&token=".newToken()."',\n";
|
||||
print " data: 'selectorder='+arrayselectedfields.toString(),\n";
|
||||
print " success: function(){\n";
|
||||
print " console.log('Select order saved');\n";
|
||||
print " },\n";
|
||||
print '});'."\n";
|
||||
|
||||
print '});'."\n";
|
||||
print '})'."\n";
|
||||
print '</script>'."\n";
|
||||
@ -2173,24 +2182,24 @@ $db->close();
|
||||
*/
|
||||
function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
|
||||
{
|
||||
global $langs, $bc;
|
||||
global $langs;
|
||||
|
||||
$height = '28px';
|
||||
$height = '32px';
|
||||
|
||||
if ($key == 'none') {
|
||||
//stop multiple duplicate ids with no number
|
||||
print "\n\n<!-- Box_no-key start-->\n";
|
||||
print '<div class="box boximport" style="padding:0;">'."\n";
|
||||
print '<table summary="boxtable_no-key" width="100%" class="nobordernopadding">'."\n";
|
||||
print '<table summary="boxtable_no-key" class="centpercent nobordernopadding">'."\n";
|
||||
} else {
|
||||
print "\n\n<!-- Box ".$pos." start -->\n";
|
||||
print '<div class="box boximport" style="padding: 0;" id="boxto_'.$pos.'">'."\n";
|
||||
|
||||
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
|
||||
print '<table summary="boxtable'.$pos.'" class="nobordernopadding centpercent tableimport">'."\n";
|
||||
}
|
||||
|
||||
if (($pos && $pos > count($fieldssource)) && (!isset($fieldssource[$pos]["imported"]))) { // No fields
|
||||
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
||||
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
|
||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||
//print img_picto(($pos > 0 ? $langs->trans("MoveField", $pos) : ''), 'grip_title', 'class="boxhandle" style="cursor:move;"');
|
||||
print '</td>';
|
||||
@ -2199,7 +2208,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
} elseif ($key == 'none') { // Empty line
|
||||
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
||||
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
|
||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
@ -2209,7 +2218,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
|
||||
print '</tr>';
|
||||
} else {
|
||||
// Print field of source file
|
||||
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
||||
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
|
||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
|
||||
//print img_picto($langs->trans("MoveField", $pos), 'grip_title', 'class="boxhandle" style="cursor:move;"');
|
||||
|
||||
@ -6,4 +6,4 @@ To upgrade ckeditor:
|
||||
- Choose skin mona-lisa
|
||||
- Choose all languages
|
||||
- Download
|
||||
- Repalce files and remove dir 'samples'.
|
||||
- Replace files and remove dir 'samples'.
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@ Software License Agreement
|
||||
==========================
|
||||
|
||||
CKEditor - The text editor for Internet - https://ckeditor.com/
|
||||
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||||
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
|
||||
Licensed under the terms of any of the following licenses at your
|
||||
choice:
|
||||
@ -16,7 +16,7 @@ choice:
|
||||
(See Appendix B)
|
||||
|
||||
- Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
https://www.mozilla.org/MPL/MPL-1.1.html
|
||||
(See Appendix C)
|
||||
|
||||
You are not required to, but if you want to explicitly declare the
|
||||
@ -37,14 +37,15 @@ done by developers outside of CKSource with their express permission.
|
||||
|
||||
The following libraries are included in CKEditor under the MIT license (see Appendix D):
|
||||
|
||||
* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2019, CKSource - Frederico Knabben.
|
||||
* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2022, CKSource Holding sp. z o.o.
|
||||
* PicoModal (included in `samples/js/sf.js`) - Copyright (c) 2012 James Frasca.
|
||||
* CodeMirror (included in the samples) - Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others.
|
||||
* ES6Promise - Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors.
|
||||
* A polyfill for `CSS.escape` (adopted with modifications in `core/tools.js`), Mathias Bynens, v1.5.1, https://mths.be/cssescape.
|
||||
|
||||
Parts of code taken from the following libraries are included in CKEditor under the MIT license (see Appendix D):
|
||||
|
||||
* jQuery (inspired the domReady function, ckeditor_base.js) - Copyright (c) 2011 John Resig, http://jquery.com/
|
||||
* jQuery (inspired the domReady function, ckeditor_base.js) - Copyright (c) 2011 John Resig, https://jquery.com/
|
||||
|
||||
The following libraries are included in CKEditor under the SIL Open Font License, Version 1.1 (see Appendix E):
|
||||
|
||||
@ -59,7 +60,7 @@ The following libraries are included in CKEditor under the BSD-3 License (see Ap
|
||||
Trademarks
|
||||
----------
|
||||
|
||||
CKEditor is a trademark of CKSource - Frederico Knabben. All other brand
|
||||
CKEditor is a trademark of CKSource Holding sp. z o.o. All other brand
|
||||
and product names are trademarks, registered trademarks or service
|
||||
marks of their respective holders.
|
||||
|
||||
@ -1419,3 +1420,17 @@ Redistribution and use in source and binary forms, with or without modification,
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
|
||||
Appendix H: The BSD-2 License
|
||||
-----------------------------
|
||||
|
||||
```
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
(Ignore this line: %REMOVE_START%)
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
CKEditor 4
|
||||
==========
|
||||
|
||||
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||||
http://ckeditor.com - See LICENSE.md for license information.
|
||||
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
https://ckeditor.com - See LICENSE.md for license information.
|
||||
|
||||
CKEditor is a text editor to be used inside web pages. It's not a replacement
|
||||
CKEditor 4 is a text editor to be used inside web pages. It's not a replacement
|
||||
for desktop text editors like Word or OpenOffice, but a component to be used as
|
||||
part of web applications and websites.
|
||||
|
||||
## Documentation
|
||||
|
||||
The full editor documentation is available online at the following address:
|
||||
http://docs.ckeditor.com
|
||||
https://ckeditor.com/docs/
|
||||
|
||||
## Installation
|
||||
|
||||
Installing CKEditor is an easy task. Just follow these simple steps:
|
||||
|
||||
1. **Download** the latest version from the CKEditor website:
|
||||
http://ckeditor.com. You should have already completed this step, but be
|
||||
https://ckeditor.com. You should have already completed this step, but be
|
||||
sure you have the very latest version.
|
||||
2. **Extract** (decompress) the downloaded file into the root of your website.
|
||||
|
||||
|
||||
10
htdocs/includes/ckeditor/ckeditor/SECURITY.md
Normal file
10
htdocs/includes/ckeditor/ckeditor/SECURITY.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Reporting a security issues
|
||||
|
||||
If you believe you have found a security issue in the CKEditor 4 software, please contact us immediately.
|
||||
|
||||
When reporting a potential security problem, please bear this in mind:
|
||||
|
||||
* Make sure to provide as many details as possible about the vulnerability.
|
||||
* Please do not disclose publicly any security issues until we fix them and publish security releases.
|
||||
|
||||
Contact the security team at security@cksource.com. As soon as we receive the security report, we will work promptly to confirm the issue and then to provide a security fix.
|
||||
@ -1,10 +1,10 @@
|
||||
/*
|
||||
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||||
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
|
||||
ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,9999);
|
||||
else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor",
|
||||
[d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).submit();return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
|
||||
ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if("function"!==typeof g){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,
|
||||
9999);else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor",
|
||||
[d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).trigger("submit");return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).on("submit",c);a(h.form).on("form-pre-serialize",c);b.on("destroy.ckeditor",function(){a(h.form).off("submit",c);a(h.form).off("form-pre-serialize",
|
||||
c)})}d.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[d]);g&&g.apply(d,[h]);l.resolve()}else setTimeout(n,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(e){if(arguments.length){var m=
|
||||
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(e,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,e)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);
|
||||
16
htdocs/includes/ckeditor/ckeditor/bender-runner.config.json
Normal file
16
htdocs/includes/ckeditor/ckeditor/bender-runner.config.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"bender": {
|
||||
"port": 9001
|
||||
},
|
||||
"server": {
|
||||
"port": 9002
|
||||
},
|
||||
"paths": {
|
||||
"ckeditor4": "../ckeditor4/",
|
||||
"runner": "./src/runner.html"
|
||||
},
|
||||
"browsers": {
|
||||
"linux": [ "chrome", "firefox" ],
|
||||
"macos": [ "safari" ]
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/license
|
||||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license/
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -13,10 +13,10 @@
|
||||
* (1) https://ckeditor.com/cke4/builder
|
||||
* Visit online builder to build CKEditor from scratch.
|
||||
*
|
||||
* (2) https://ckeditor.com/cke4/builder/c0b7b44e9f5c0f0cac8bacb78b968de8
|
||||
* (2) https://ckeditor.com/cke4/builder/6490967e78ab135a44d8c0998d90e841
|
||||
* Visit online builder to build CKEditor, starting with the same setup as before.
|
||||
*
|
||||
* (3) https://ckeditor.com/cke4/builder/download/c0b7b44e9f5c0f0cac8bacb78b968de8
|
||||
* (3) https://ckeditor.com/cke4/builder/download/6490967e78ab135a44d8c0998d90e841
|
||||
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
|
||||
*
|
||||
* NOTE:
|
||||
@ -39,6 +39,7 @@ var CKBUILDER_CONFIG = {
|
||||
'.jshintrc',
|
||||
'.mailmap',
|
||||
'.npm',
|
||||
'.nvmrc',
|
||||
'.travis.yml',
|
||||
'bender-err.log',
|
||||
'bender-out.log',
|
||||
@ -48,6 +49,7 @@ var CKBUILDER_CONFIG = {
|
||||
'gruntfile.js',
|
||||
'less',
|
||||
'node_modules',
|
||||
'package-lock.json',
|
||||
'package.json',
|
||||
'tests'
|
||||
],
|
||||
@ -64,12 +66,13 @@ var CKBUILDER_CONFIG = {
|
||||
'copyformatting' : 1,
|
||||
'dialogadvtab' : 1,
|
||||
'div' : 1,
|
||||
'editorplaceholder' : 1,
|
||||
'elementspath' : 1,
|
||||
'enterkey' : 1,
|
||||
'entities' : 1,
|
||||
'exportpdf' : 1,
|
||||
'filebrowser' : 1,
|
||||
'find' : 1,
|
||||
'flash' : 1,
|
||||
'floatingspace' : 1,
|
||||
'font' : 1,
|
||||
'format' : 1,
|
||||
@ -89,6 +92,8 @@ var CKBUILDER_CONFIG = {
|
||||
'maximize' : 1,
|
||||
'newpage' : 1,
|
||||
'pagebreak' : 1,
|
||||
'pastefromgdocs' : 1,
|
||||
'pastefromlibreoffice' : 1,
|
||||
'pastefromword' : 1,
|
||||
'pastetext' : 1,
|
||||
'preview' : 1,
|
||||
@ -102,7 +107,6 @@ var CKBUILDER_CONFIG = {
|
||||
'showborders' : 1,
|
||||
'smiley' : 1,
|
||||
'sourcearea' : 1,
|
||||
'sourcedialog' : 1,
|
||||
'specialchar' : 1,
|
||||
'stylescombo' : 1,
|
||||
'tab' : 1,
|
||||
@ -113,12 +117,78 @@ var CKBUILDER_CONFIG = {
|
||||
'toolbar' : 1,
|
||||
'undo' : 1,
|
||||
'uploadimage' : 1,
|
||||
'wsc' : 1,
|
||||
'wysiwygarea' : 1
|
||||
},
|
||||
languages : {
|
||||
'af' : 1,
|
||||
'ar' : 1,
|
||||
'az' : 1,
|
||||
'bg' : 1,
|
||||
'bn' : 1,
|
||||
'bs' : 1,
|
||||
'ca' : 1,
|
||||
'cs' : 1,
|
||||
'cy' : 1,
|
||||
'da' : 1,
|
||||
'de' : 1,
|
||||
'de-ch' : 1,
|
||||
'el' : 1,
|
||||
'en' : 1,
|
||||
'en-au' : 1,
|
||||
'en-ca' : 1,
|
||||
'en-gb' : 1,
|
||||
'eo' : 1,
|
||||
'es' : 1,
|
||||
'fr' : 1
|
||||
'es-mx' : 1,
|
||||
'et' : 1,
|
||||
'eu' : 1,
|
||||
'fa' : 1,
|
||||
'fi' : 1,
|
||||
'fo' : 1,
|
||||
'fr' : 1,
|
||||
'fr-ca' : 1,
|
||||
'gl' : 1,
|
||||
'gu' : 1,
|
||||
'he' : 1,
|
||||
'hi' : 1,
|
||||
'hr' : 1,
|
||||
'hu' : 1,
|
||||
'id' : 1,
|
||||
'is' : 1,
|
||||
'it' : 1,
|
||||
'ja' : 1,
|
||||
'ka' : 1,
|
||||
'km' : 1,
|
||||
'ko' : 1,
|
||||
'ku' : 1,
|
||||
'lt' : 1,
|
||||
'lv' : 1,
|
||||
'mk' : 1,
|
||||
'mn' : 1,
|
||||
'ms' : 1,
|
||||
'nb' : 1,
|
||||
'nl' : 1,
|
||||
'no' : 1,
|
||||
'oc' : 1,
|
||||
'pl' : 1,
|
||||
'pt' : 1,
|
||||
'pt-br' : 1,
|
||||
'ro' : 1,
|
||||
'ru' : 1,
|
||||
'si' : 1,
|
||||
'sk' : 1,
|
||||
'sl' : 1,
|
||||
'sq' : 1,
|
||||
'sr' : 1,
|
||||
'sr-latn' : 1,
|
||||
'sv' : 1,
|
||||
'th' : 1,
|
||||
'tr' : 1,
|
||||
'tt' : 1,
|
||||
'ug' : 1,
|
||||
'uk' : 1,
|
||||
'vi' : 1,
|
||||
'zh' : 1,
|
||||
'zh-cn' : 1
|
||||
}
|
||||
};
|
||||
2042
htdocs/includes/ckeditor/ckeditor/ckeditor.js
vendored
2042
htdocs/includes/ckeditor/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||||
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
|
||||
5
htdocs/includes/ckeditor/ckeditor/lang/af.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/af.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/ar.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/ar.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/az.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/az.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/bg.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/bg.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/bn.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/bn.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/bs.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/bs.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/ca.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/ca.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/cs.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/cs.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/cy.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/cy.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/da.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/da.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/de-ch.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/de-ch.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/de.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/de.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/el.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/el.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/en-au.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/en-au.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/en-ca.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/en-ca.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/en-gb.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/en-gb.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/eo.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/eo.js
Normal file
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/es-mx.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/es-mx.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
5
htdocs/includes/ckeditor/ckeditor/lang/et.js
Normal file
5
htdocs/includes/ckeditor/ckeditor/lang/et.js
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user