';
foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file.
@@ -1132,23 +1139,19 @@ if ($step == 4 && $datatoimport) {
print '| => | ';
print '';
- $modetoautofillmapping = 'session'; // Use setup in session
- if ($initialloadofstep4) {
- $modetoautofillmapping = 'guess';
- }
//var_dump($_SESSION['dol_array_match_file_to_database_select']);
- //var_dump($modetoautofillmapping);
//var_dump($_SESSION['dol_array_match_file_to_database']);
- //var_dump($modetoautofillmapping);
- print ' | ";
+ $selectforline .= '';
+ $selectforline .= ajax_combobox('selectorderimport_'.($i+1));
+
+ print $selectforline;
+
+ print '';
print '';
$filecolumn = ($i + 1);
@@ -1317,18 +1325,21 @@ if ($step == 4 && $datatoimport) {
print ' console.log("Remove the disabled flag everywhere");'."\n";
print ' $("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n"; // Enable all options
print ' arrayofselectedvalues = [];'."\n";
+
print ' $("select.targetselectchange").each(function(){'."\n";
print ' id = $(this).attr(\'id\')'."\n";
print ' value = $(this).val()'."\n";
- //print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n";
+ print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n";
print ' arrayofselectedvalues.push(value);'."\n";
print ' });'."\n";
- print ' console.log("List of all selected values");'."\n";
+
+ print ' console.log("List of all selected values arrayofselectedvalues");'."\n";
print ' console.log(arrayofselectedvalues);'."\n";
print ' console.log("Set the option to disabled for every entry that is currently selected somewhere else (so into arrayofselectedvalues)");'."\n";
- print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n"; // Loop on each selected value
+
+ print ' $.each(arrayofselectedvalues, function(key, value) {'."\n"; // Loop on each selected value
print ' if (value != -1) {'."\n";
- //print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n";
+ print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n";
print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected
print ' }'."\n";
print ' });'."\n";
@@ -1338,12 +1349,13 @@ if ($step == 4 && $datatoimport) {
print 'function saveSelection() {'."\n";
//print ' console.log(arrayofselectedvalues);'."\n";
print ' arrayselectedfields = [];'."\n";
- print ' arrayselectedfields.push("0");'."\n";
+ print ' arrayselectedfields.push(0);'."\n";
+
print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n";
print ' if (value != -1) {'."\n";
- print ' arrayselectedfields.push(value);'."\n";
+ print ' arrayselectedfields.push(value);'."\n";
print ' } else {'."\n";
- print ' arrayselectedfields.push(0);'."\n";
+ print ' arrayselectedfields.push(0);'."\n";
print ' }'."\n";
print ' });'."\n";
@@ -1353,12 +1365,14 @@ if ($step == 4 && $datatoimport) {
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 " console.log('The selected fields have been saved into '+arrayselectedfields.toString());\n";
print " },\n";
print ' });'."\n";
// Now we loop on all target fields that are mandatory to show if they are not mapped yet.
+ print ' console.log("arrayselectedfields");';
print ' console.log(arrayselectedfields);';
+ print ' console.log("arrayoftargetmandatoryfields");';
print ' console.log(arrayoftargetmandatoryfields);';
print " listtoshow = '';";
print " nbelement = arrayoftargetmandatoryfields.length
@@ -1886,16 +1900,17 @@ if ($step == 5 && $datatoimport) {
// Show OK
if (!count($arrayoferrors) && !count($arrayofwarnings)) {
- print ' '.img_picto($langs->trans("OK"), 'tick').' '.$langs->trans("NoError").'
';
- print '';
+ print ' ';
+ print ' ';
+ print ' '.$langs->trans("ResultOfSimulationNoError").' ';
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).' ';
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).' ';
print ' ';
print ' ';
} else {
print ' ';
- print ' ';
- print $langs->trans("NbOfLinesOK", $nbok).' ';
+ print ' ';
+ print $langs->trans("NbOfLinesOK", $nbok).'... ';
print ' ';
print ' ';
}
@@ -2281,10 +2296,10 @@ if ($step == 6 && $datatoimport) {
// Show result
print ' ';
- print ' ';
+ print ' ';
print $langs->trans("NbOfLinesImported", $nbok).' ';
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).' ';
- print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'
';
+ print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).' ';
print ' ';
print ' ';
print $langs->trans("FileWasImported", $importid).' ';
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index 2d8b0a8cc17..b57cab5b4eb 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -181,48 +181,48 @@ ALTER TABLE llx_stock_mouvement_extrafields ADD INDEX idx_stock_mouvement_extraf
CREATE TABLE llx_facture_fourn_rec
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- titre varchar(200) NOT NULL,
- ref_supplier varchar(180) NOT NULL,
- entity integer DEFAULT 1 NOT NULL,
- fk_soc integer NOT NULL,
+ titre varchar(200) NOT NULL,
+ ref_supplier varchar(180) NOT NULL,
+ entity integer DEFAULT 1 NOT NULL,
+ fk_soc integer NOT NULL,
datec datetime,
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- suspended integer DEFAULT 0,
- libelle varchar(255),
- amount double(24, 8) DEFAULT 0 NOT NULL,
- remise real DEFAULT 0,
- vat_src_code varchar(10) DEFAULT '',
- localtax1 double(24,8) DEFAULT 0,
- localtax2 double(24,8) DEFAULT 0,
- total_ht double(24,8) DEFAULT 0,
- total_tva double(24,8) DEFAULT 0,
- total_ttc double(24,8) DEFAULT 0,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ suspended integer DEFAULT 0,
+ libelle varchar(255),
+ amount double(24,8) DEFAULT 0 NOT NULL,
+ remise real DEFAULT 0,
+ vat_src_code varchar(10) DEFAULT '',
+ localtax1 double(24,8) DEFAULT 0,
+ localtax2 double(24,8) DEFAULT 0,
+ total_ht double(24,8) DEFAULT 0,
+ total_tva double(24,8) DEFAULT 0,
+ total_ttc double(24,8) DEFAULT 0,
fk_user_author integer,
fk_user_modif integer,
fk_projet integer,
fk_account integer,
- fk_cond_reglement integer,
- fk_mode_reglement integer,
+ fk_cond_reglement integer,
+ fk_mode_reglement integer,
date_lim_reglement date,
note_private text,
note_public text,
modelpdf varchar(255),
fk_multicurrency integer,
multicurrency_code varchar(3),
- multicurrency_tx double(24,8) DEFAULT 1,
- multicurrency_total_ht double(24,8) DEFAULT 0,
- multicurrency_total_tva double(24,8) DEFAULT 0,
- multicurrency_total_ttc double(24,8) DEFAULT 0,
- usenewprice integer DEFAULT 0,
+ multicurrency_tx double(24,8) DEFAULT 1,
+ multicurrency_total_ht double(24,8) DEFAULT 0,
+ multicurrency_total_tva double(24,8) DEFAULT 0,
+ multicurrency_total_ttc double(24,8) DEFAULT 0,
+ usenewprice integer DEFAULT 0,
frequency integer,
- unit_frequency varchar(2) DEFAULT 'm',
- date_when datetime DEFAULT NULL,
- date_last_gen datetime DEFAULT NULL,
- nb_gen_done integer DEFAULT NULL,
- nb_gen_max integer DEFAULT NULL,
- auto_validate integer DEFAULT 0,
- generate_pdf integer DEFAULT 1
-)ENGINE=innodb;
+ unit_frequency varchar(2) DEFAULT 'm',
+ date_when datetime DEFAULT NULL,
+ date_last_gen datetime DEFAULT NULL,
+ nb_gen_done integer DEFAULT NULL,
+ nb_gen_max integer DEFAULT NULL,
+ auto_validate integer DEFAULT 0,
+ generate_pdf integer DEFAULT 1
+) ENGINE=innodb;
ALTER TABLE llx_facture_fourn_rec ADD UNIQUE INDEX uk_facture_fourn_rec_ref (titre, entity);
ALTER TABLE llx_facture_fourn_rec ADD UNIQUE INDEX uk_facture_fourn_rec_ref_supplier (ref_supplier, fk_soc, entity);
@@ -251,23 +251,23 @@ CREATE TABLE llx_facture_fourn_det_rec
fk_parent_line integer NULL,
fk_product integer NULL,
ref varchar(50),
- label varchar(255) DEFAULT NULL,
+ label varchar(255) DEFAULT NULL,
description text,
pu_ht double(24,8),
pu_ttc double(24,8),
qty real,
- remise_percent real DEFAULT 0,
- fk_remise_except integer NULL,
- vat_src_code varchar(10) DEFAULT '',
+ remise_percent real DEFAULT 0,
+ fk_remise_except integer NULL,
+ vat_src_code varchar(10) DEFAULT '',
tva_tx double(7,4),
- localtax1_tx double(7,4) DEFAULT 0,
- localtax1_type varchar(10) NULL,
- localtax2_tx double(7,4) DEFAULT 0,
- localtax2_type varchar(10) NULL,
+ localtax1_tx double(7,4) DEFAULT 0,
+ localtax1_type varchar(10) NULL,
+ localtax2_tx double(7,4) DEFAULT 0,
+ localtax2_type varchar(10) NULL,
total_ht double(24,8),
total_tva double(24,8),
- total_localtax1 double(24,8) DEFAULT 0,
- total_localtax2 double(24,8) DEFAULT 0,
+ total_localtax1 double(24,8) DEFAULT 0,
+ total_localtax2 double(24,8) DEFAULT 0,
total_ttc double(24,8),
product_type integer DEFAULT 0,
date_start integer DEFAULT NULL,
@@ -285,17 +285,20 @@ CREATE TABLE llx_facture_fourn_det_rec
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0
-)ENGINE=innodb;
+) ENGINE=innodb;
+
ALTER TABLE llx_facture_fourn_det_rec ADD CONSTRAINT fk_facture_fourn_det_rec_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid);
+
CREATE TABLE llx_facture_fourn_det_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
- import_key varchar(14) -- import key
-)ENGINE=innodb;
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
ALTER TABLE llx_facture_fourn_det_rec_extrafields ADD INDEX idx_facture_fourn_det_rec_extrafields (fk_object);
@@ -314,7 +317,8 @@ ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN position INTEGER NOT NU
ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget;
-ALTER TABLE llx_mailing ADD UNIQUE INDEX uk_mailing(titre, entity);
+ALTER TABLE llx_mailing ADD UNIQUE INDEX uk_mailing (titre, entity);
+
create table llx_inventory_extrafields
(
@@ -324,6 +328,7 @@ create table llx_inventory_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
+
ALTER TABLE llx_inventory_extrafields ADD INDEX idx_inventory_extrafields (fk_object);
ALTER TABLE llx_reception MODIFY COLUMN ref_supplier varchar(128);
@@ -364,136 +369,149 @@ ALTER TABLE llx_asset ADD COLUMN model_pdf varchar(255) AFTER import_key;
DROP TABLE llx_asset_type;
+
CREATE TABLE llx_c_asset_disposal_type
(
- rowid integer AUTO_INCREMENT PRIMARY KEY,
- entity integer NOT NULL DEFAULT 1,
- code varchar(16) NOT NULL,
- label varchar(50) NOT NULL,
- active integer DEFAULT 1 NOT NULL
-)ENGINE=innodb;
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ entity integer NOT NULL DEFAULT 1,
+ code varchar(16) NOT NULL,
+ label varchar(50) NOT NULL,
+ active integer NOT NULL DEFAULT 1
+) ENGINE=innodb;
-CREATE TABLE llx_asset_accountancy_codes_economic(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+
+CREATE TABLE llx_asset_accountancy_codes_economic
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ fk_asset integer,
+ fk_asset_model integer,
+
+ asset varchar(32),
+ depreciation_asset varchar(32),
+ depreciation_expense varchar(32),
+ value_asset_sold varchar(32),
+ receivable_on_assignment varchar(32),
+ proceeds_from_sales varchar(32),
+ vat_collected varchar(32),
+ vat_deductible varchar(32),
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_modif integer
+) ENGINE=innodb;
+
+
+CREATE TABLE llx_asset_accountancy_codes_fiscal
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
fk_asset integer,
fk_asset_model integer,
- asset varchar(32),
- depreciation_asset varchar(32),
- depreciation_expense varchar(32),
- value_asset_sold varchar(32),
- receivable_on_assignment varchar(32),
- proceeds_from_sales varchar(32),
- vat_collected varchar(32),
- vat_deductible varchar(32),
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- fk_user_modif integer
-) ENGINE=innodb;
-
-CREATE TABLE llx_asset_accountancy_codes_fiscal(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- fk_asset integer,
- fk_asset_model integer,
-
- accelerated_depreciation varchar(32),
+ accelerated_depreciation varchar(32),
endowment_accelerated_depreciation varchar(32),
provision_accelerated_depreciation varchar(32),
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- fk_user_modif integer
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_modif integer
) ENGINE=innodb;
-CREATE TABLE llx_asset_depreciation_options_economic(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- fk_asset integer,
- fk_asset_model integer,
- depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
- accelerated_depreciation_option integer, -- activate accelerated depreciation mode (fiscal)
+CREATE TABLE llx_asset_depreciation_options_economic
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ fk_asset integer,
+ fk_asset_model integer,
- degressive_coefficient double(24,8),
- duration smallint NOT NULL,
- duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
+ depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
+ accelerated_depreciation_option integer, -- activate accelerated depreciation mode (fiscal)
- amount_base_depreciation_ht double(24,8),
- amount_base_deductible_ht double(24,8),
- total_amount_last_depreciation_ht double(24,8),
+ degressive_coefficient double(24,8),
+ duration smallint NOT NULL,
+ duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- fk_user_modif integer
+ amount_base_depreciation_ht double(24,8),
+ amount_base_deductible_ht double(24,8),
+ total_amount_last_depreciation_ht double(24,8),
+
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_modif integer
) ENGINE=innodb;
-CREATE TABLE llx_asset_depreciation_options_fiscal(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- fk_asset integer,
- fk_asset_model integer,
- depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
+CREATE TABLE llx_asset_depreciation_options_fiscal
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ fk_asset integer,
+ fk_asset_model integer,
- degressive_coefficient double(24,8),
- duration smallint NOT NULL,
- duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
+ depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
- amount_base_depreciation_ht double(24,8),
- amount_base_deductible_ht double(24,8),
- total_amount_last_depreciation_ht double(24,8),
+ degressive_coefficient double(24,8),
+ duration smallint NOT NULL,
+ duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- fk_user_modif integer
+ amount_base_depreciation_ht double(24,8),
+ amount_base_deductible_ht double(24,8),
+ total_amount_last_depreciation_ht double(24,8),
+
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_modif integer
) ENGINE=innodb;
-CREATE TABLE llx_asset_depreciation(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- fk_asset integer NOT NULL,
- depreciation_mode varchar(255) NOT NULL, -- (economic, fiscal or other)
+CREATE TABLE llx_asset_depreciation
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- ref varchar(255) NOT NULL,
- depreciation_date datetime NOT NULL,
- depreciation_ht double(24,8) NOT NULL,
- cumulative_depreciation_ht double(24,8) NOT NULL,
+ fk_asset integer NOT NULL,
+ depreciation_mode varchar(255) NOT NULL, -- (economic, fiscal or other)
- accountancy_code_debit varchar(32),
- accountancy_code_credit varchar(32),
+ ref varchar(255) NOT NULL,
+ depreciation_date datetime NOT NULL,
+ depreciation_ht double(24,8) NOT NULL,
+ cumulative_depreciation_ht double(24,8) NOT NULL,
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- fk_user_modif integer
+ accountancy_code_debit varchar(32),
+ accountancy_code_credit varchar(32),
+
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_modif integer
) ENGINE=innodb;
+
CREATE TABLE llx_asset_model(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- entity integer DEFAULT 1 NOT NULL, -- multi company id
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ entity integer DEFAULT 1 NOT NULL, -- multi company id
ref varchar(128) NOT NULL,
label varchar(255) NOT NULL,
- asset_type smallint NOT NULL,
- fk_pays integer DEFAULT 0,
+ asset_type smallint NOT NULL,
+ fk_pays integer DEFAULT 0,
- note_public text,
- note_private text,
- date_creation datetime NOT NULL,
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- fk_user_creat integer NOT NULL,
- fk_user_modif integer,
- import_key varchar(14),
- status smallint NOT NULL
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ import_key varchar(14),
+ status smallint NOT NULL
) ENGINE=innodb;
CREATE TABLE llx_asset_model_extrafields
(
- rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
+
ALTER TABLE llx_c_asset_disposal_type ADD UNIQUE INDEX uk_c_asset_disposal_type(code, entity);
ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_model (fk_asset_model);
ALTER TABLE llx_asset ADD INDEX idx_asset_fk_disposal_type (fk_disposal_type);
-ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
-ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_disposal_type FOREIGN KEY (fk_disposal_type) REFERENCES llx_c_asset_disposal_type (rowid);
+ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
+ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_disposal_type FOREIGN KEY (fk_disposal_type) REFERENCES llx_c_asset_disposal_type (rowid);
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
@@ -501,33 +519,33 @@ ALTER TABLE llx_asset_accountancy_codes_economic ADD INDEX idx_asset_ace_rowid (
ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset (fk_asset);
ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset_model (fk_asset_model);
-ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
+ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
-ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD INDEX idx_asset_acf_rowid (rowid);
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset (fk_asset);
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset_model (fk_asset_model);
-ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
-ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
-ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
+ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
+ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset_depreciation_options_economic ADD INDEX idx_asset_doe_rowid (rowid);
ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset (fk_asset);
ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset_model (fk_asset_model);
-ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
+ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
-ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset_depreciation_options_fiscal ADD INDEX idx_asset_dof_rowid (rowid);
ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset (fk_asset);
ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset_model (fk_asset_model);
-ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
+ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
-ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_rowid (rowid);
ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_fk_asset (fk_asset);
@@ -535,8 +553,8 @@ ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_depreciation
ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_ref (ref);
ALTER TABLE llx_asset_depreciation ADD UNIQUE uk_asset_depreciation_fk_asset (fk_asset, depreciation_mode, ref);
-ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
-ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
+ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_rowid (rowid);
ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_ref (ref);
@@ -544,8 +562,8 @@ ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_pays (fk_pays);
ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_entity (entity);
ALTER TABLE llx_asset_model ADD UNIQUE INDEX uk_asset_model (entity, ref);
-ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
-ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
+ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
ALTER TABLE llx_asset_model_extrafields ADD INDEX idx_asset_model_extrafields (fk_object);
@@ -581,10 +599,11 @@ UPDATE llx_c_availability SET type_duration = 'w', qty = 4 WHERE code = 'AV_4W';
-- Deposit generation helper with specific payment terms
-ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage;
-ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement;
-ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
-ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
+ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage;
+ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement;
+ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
+ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
+
INSERT INTO llx_c_payment_term(code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values ('DEP30PCTDEL', 13, 0, '__DEPOSIT_PERCENT__% deposit', '__DEPOSIT_PERCENT__% deposit, remainder on delivery', 0, 1, '30');
@@ -599,13 +618,13 @@ DELETE FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php', 'box_
ALTER TABLE llx_takepos_floor_tables ADD UNIQUE(entity,label);
-ALTER TABLE llx_partnership ADD COLUMN url_to_check varchar(255);
-ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128);
+ALTER TABLE llx_partnership ADD COLUMN url_to_check varchar(255);
+ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128);
-ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100);
-ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
-ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
ALTER TABLE llx_c_email_template ADD COLUMN email_from varchar(255);
diff --git a/htdocs/install/mysql/tables/llx_adherent_type.sql b/htdocs/install/mysql/tables/llx_adherent_type.sql
index 243372c0452..4144d9b32b7 100644
--- a/htdocs/install/mysql/tables/llx_adherent_type.sql
+++ b/htdocs/install/mysql/tables/llx_adherent_type.sql
@@ -18,22 +18,23 @@
--
-- ===================================================================
--
--- statut
--- 0 : actif
--- 1 : inactif
+-- state / statut
+-- 0 : active / actif
+-- 1 : inactive / inactif
+--
create table llx_adherent_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- entity integer DEFAULT 1 NOT NULL,
+ entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- statut smallint NOT NULL DEFAULT 0,
- libelle varchar(50) NOT NULL,
- morphy varchar(3) NOT NULL,
- duration varchar(6) DEFAULT NULL,
- subscription varchar(3) NOT NULL DEFAULT '1',
- amount double(24,8) DEFAULT NULL,
- vote varchar(3) NOT NULL DEFAULT '1',
- note text,
- mail_valid text
+ statut smallint NOT NULL DEFAULT 0, -- state 0 = active , 1 = inactive
+ libelle varchar(50) NOT NULL, -- label
+ morphy varchar(3) NOT NULL, -- moral and/or physical entity
+ duration varchar(6) DEFAULT NULL, -- (minimal) duration of membership
+ subscription varchar(3) NOT NULL DEFAULT '1', -- subscription with costs / fee or without / for free
+ amount double(24,8) DEFAULT NULL, -- membership fee
+ vote varchar(3) NOT NULL DEFAULT '1', -- entitled to vote
+ note text, -- description / comment
+ mail_valid text -- text for welcome email
)ENGINE=innodb;
diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php
index 13231c43af2..3185e8a030e 100644
--- a/htdocs/intracommreport/admin/intracommreport.php
+++ b/htdocs/intracommreport/admin/intracommreport.php
@@ -117,7 +117,7 @@ foreach ($list_DEB as $key) {
print ' '.$label.' | ';
// Value
print '';
- print '';
+ print '';
print ' | ';
print '';
@@ -181,7 +181,7 @@ foreach ($list_DES as $key) {
print ''.$label.' | ';
// Value
print '';
- print '';
+ print '';
print ' | ';
print '';
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 26c2a959a13..95ed076f347 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2252,13 +2252,21 @@ TemplateforBusinessCards=Template for a business card in different size
InventorySetup= Inventory Setup
ExportUseLowMemoryMode=Use a low memory mode
ExportUseLowMemoryModeHelp=Use the low memory mode to execute the exec of the dump (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that file is completed and error message can't be reported if it fails.
-ShowQuickAddLink=Show a button to quickly add an object, in top right menu
+
+ModuleWebhookName = Webhook
+ModuleWebhookDesc = Interface to catch dolibarr triggers and send it to an URL
+WebhookSetup = Webhook setup
+Settings = Settings
+WebhookSetupPage = Webhook setup page
+ShowQuickAddLink=Show a button to quickly add an element in top right menu
+
HashForPing=Hash used for ping
ReadOnlyMode=Is instance in "Read Only" mode
DEBUGBAR_USE_LOG_FILE=Use the dolibarr.log file to trap Logs
UsingLogFileShowAllRecordOfSubrequestButIsSlower=Use the dolibarr.log file to trap Logs instead of live memory catching. It allows to catch all logs instead of only log of current process (so including the one of ajax subrequests pages) but will make your instance very very slow. Not recommended.
FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent')
DefaultOpportunityStatus=Default opportunity status (first status when lead is created)
+
IconAndText=Icon and text
TextOnly=Text only
IconOnlyAllTextsOnHover=Icon only - All texts appears under icon on mouse hover menu bar
@@ -2268,4 +2276,4 @@ INVOICE_ADD_ZATCA_QR_CODE=Show the ZATCA QR code on invoices
INVOICE_ADD_ZATCA_QR_CODEMore=Some Arabic countries need this QR Code on their invoices
INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices
UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID.
-IfThisCategoryIsChildOfAnother=If this category is a child of another one
\ No newline at end of file
+IfThisCategoryIsChildOfAnother=If this category is a child of another one
diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang
index a2d05767cae..62c2752ff9f 100644
--- a/htdocs/langs/en_US/categories.lang
+++ b/htdocs/langs/en_US/categories.lang
@@ -95,6 +95,7 @@ ShowCategory=Show tag/category
ByDefaultInList=By default in list
ChooseCategory=Choose category
StocksCategoriesArea=Warehouse Categories
+TicketsCategoriesArea=Tickets Categories
ActionCommCategoriesArea=Event Categories
WebsitePagesCategoriesArea=Page-Container Categories
KnowledgemanagementsCategoriesArea=KM article Categories
diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang
index f06acd49f41..c4c629c9a87 100644
--- a/htdocs/langs/en_US/exports.lang
+++ b/htdocs/langs/en_US/exports.lang
@@ -141,4 +141,5 @@ WarningFirstImportedLine=The first line(s) will not be imported with the current
NotUsedFields=Fields of database not used
SelectImportFieldsSource = Choose the source file fields you want to import and their target field in database by choosing the fields in each select boxes, or select a predefined import profile:
MandatoryTargetFieldsNotMapped=Some mandatory target fields are not mapped
-AllTargetMandatoryFieldsAreMapped=All target fields that need a mandatory value are mapped
\ No newline at end of file
+AllTargetMandatoryFieldsAreMapped=All target fields that need a mandatory value are mapped
+ResultOfSimulationNoError=Result of simulation: No error
\ No newline at end of file
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index 16249087403..f6aba7f2597 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -747,7 +747,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print ' | ';
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
// Available
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
@@ -756,7 +756,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' | ';
}
// Lot - serial
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Batch");
@@ -787,11 +787,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print '';
print ' | ';
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print ' | ';
}
// Lot - serial
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' | ';
}
// Action
@@ -909,7 +909,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print ' | ';
// Stock
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print '';
if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
print img_warning($langs->trans('StockTooLow')).' ';
@@ -918,7 +918,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' | ';
}
// Lot
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' | ';
}
// Action delete line
@@ -965,12 +965,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
// Stock
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print ' | ';
}
// Lot Batch
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($line2['batch'] != '') {
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
@@ -1033,12 +1033,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' | ';
// Stock
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print ' | ';
}
// Lot / Batch
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($tmpproduct->status_batch) {
$preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : '');
@@ -1121,7 +1121,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $langs->trans("Warehouse");
}
print ' | ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Batch");
@@ -1149,7 +1149,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print ' | ';
// Lot - serial
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' | ';
}
// Action
@@ -1236,7 +1236,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print ''; // Warehouse
print ' | ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' | '; // Lot
}
@@ -1277,7 +1277,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print '';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($line2['batch'] != '') {
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
@@ -1324,7 +1324,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ''.$langs->trans("NoStockChangeOnServices").'';
}
print ' | ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($tmpproduct->status_batch) {
$preselected = (GETPOSTISSET('batchtoproduce-'.$line->id.'-'.$i) ? GETPOST('batchtoproduce-'.$line->id.'-'.$i) : '');
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 9aade4fa62d..d0b7e4ece73 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1860,7 +1860,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' | ';
// Batch number managment
- if (!empty($conf->productbatch->enabled)) {
+ if (isModEnabled('productbatch')) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print '| '.$langs->trans("ManageLotSerial").' | ';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
@@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' |
| '.$langs->trans("Description").' | ';
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
- $doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, !empty($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)?$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC:0, ROWS_4, '90%');
+ $doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
$doleditor->Create();
print " |
";
@@ -2146,7 +2146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
print '| '.$langs->trans("NoteNotVisibleOnBill").' | ';
- $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
+ $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
$doleditor->Create();
print " |
";
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 96ce57c5bbe..6e7db72c393 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -285,34 +285,8 @@ if (empty($reshook)) {
if (GETPOSTISSET('ref_fourn_price_id')) {
$object->fetch_product_fournisseur_price(GETPOST('ref_fourn_price_id', 'int'));
}
-
$extralabels = $extrafields->fetch_name_optionals_label("product_fournisseur_price");
$extrafield_values = $extrafields->getOptionalsFromPost("product_fournisseur_price");
- if (!empty($extrafield_values)) {
- $resql = $db->query("SELECT fk_object FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = ".((int) $object->product_fourn_price_id));
- // Insert a new extrafields row, if none exists
- if ($db->num_rows($resql) != 1) {
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields (fk_object, ";
- foreach ($extrafield_values as $key => $value) {
- $sql .= str_replace('options_', '', $key).', ';
- }
- $sql = substr($sql, 0, strlen($sql) - 2).") VALUES (".((int) $object->product_fourn_price_id).", ";
- foreach ($extrafield_values as $key => $value) {
- $sql .= "'".$db->escape($value)."', ";
- }
- $sql = substr($sql, 0, strlen($sql) - 2).')';
- } else {
- // update the existing one
- $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields SET ";
- foreach ($extrafield_values as $key => $value) {
- $sql .= str_replace('options_', '', $key)." = '".$db->escape($value)."', ";
- }
- $sql = substr($sql, 0, strlen($sql) - 2).' WHERE fk_object = '.((int) $object->product_fourn_price_id);
- }
-
- // Execute the sql command from above
- $db->query($sql);
- }
$newprice = price2num(GETPOST("price", "alpha"));
@@ -330,9 +304,9 @@ if (empty($reshook)) {
$multicurrency_price = price2num(GETPOST("multicurrency_price", 'alpha'));
$multicurrency_code = GETPOST("multicurrency_code", 'alpha');
- $ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $multicurrency_price, GETPOST("multicurrency_price_base_type"), $multicurrency_tx, $multicurrency_code, $supplier_description, $barcode, $fk_barcode_type);
+ $ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $multicurrency_price, GETPOST("multicurrency_price_base_type"), $multicurrency_tx, $multicurrency_code, $supplier_description, $barcode, $fk_barcode_type, $extrafield_values);
} else {
- $ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', 0, 'HT', 1, '', $supplier_description, $barcode, $fk_barcode_type);
+ $ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', 0, 'HT', 1, '', $supplier_description, $barcode, $fk_barcode_type, $extrafield_values);
}
if ($ret < 0) {
$error++;
@@ -806,7 +780,7 @@ END;
print ''.$langs->trans('ProductSupplierDescription').' | ';
print '';
- $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
+ $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
$doleditor->Create();
print ' | ';
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index 80823c7ba5a..e0e2f9c59da 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -308,7 +308,7 @@ class Inventory extends CommonObject
$inventoryline->batch = $obj->batch;
$inventoryline->datec = dol_now();
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
} else {
$inventoryline->qty_stock = $obj->reel;
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index e0e191fc5d1..85848942fbe 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -569,7 +569,7 @@ print '';
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
-if ($conf->productbatch->enabled) {
+if (isModEnabled('productbatch')) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
}
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
@@ -601,7 +601,7 @@ print img_picto($langs->trans("Product"), 'product', 'class="paddingright"');
print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 1, array(), 0, '1', 0, 'minwidth200imp maxwidth300', 1, '', null, 1);
print '';
// Batch number
-if ($conf->productbatch->enabled) {
+if (isModEnabled('productbatch')) {
print '| ';
print img_picto($langs->trans("LotSerial"), 'lot', 'class="paddingright"');
print '';
@@ -643,7 +643,7 @@ foreach ($listofdata as $key => $val) {
print ' | ';
print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print ' | ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
print $val['batch'];
print ' | ';
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 3054e6785bd..6af0e105b47 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -631,7 +631,7 @@ if ($id > 0 || $ref) {
print '
';
}
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '| '.$langs->trans("ManageLotSerial").' | ';
print $object->getLibStatut(0, 2);
print ' |
';
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php
index b88df4e1da1..b009ace7275 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php
@@ -749,7 +749,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
}
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
@@ -789,7 +789,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($action === 'editline' && $line->id == $lineid) $form->select_produits($line->fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
else print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print '';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '| ';
if ($action === 'editline' && $line->id == $lineid) print '';
else {
@@ -883,7 +883,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$form->select_produits($fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
print ' | ';
// Batch number
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
print '';
print ' | ';
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 65906a0cc0f..7f91e9c73a8 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -264,12 +264,12 @@ if ($action == 'edit') {
print '';
print '| '.$langs->trans('Label').' | |
';
print '| '.$langs->trans('Description').' | ';
- $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
+ $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
$doleditor->Create();
print ' |
';
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
print '| '.$langs->trans('Other').' ('.$langs->trans("NotUsed").') | ';
- $doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
+ $doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
$doleditor->Create();
}
print ' |
';
@@ -335,13 +335,13 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
print '';
print '| '.$langs->trans('Label').' | |
';
print '| '.$langs->trans('Description').' | ';
- $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
+ $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
$doleditor->Create();
print ' |
';
// Other field (not used)
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
print '| '.$langs->trans('Other').' ('.$langs->trans("NotUsed").' | ';
- $doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
+ $doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
$doleditor->Create();
print ' |
';
}
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 0cfe126d69b..2ad89326e6a 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -996,7 +996,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Description
print '| '.$langs->trans("Description").' | ';
print '';
- $doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
+ $doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%');
$doleditor->Create();
print ' |
';
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 0c56ecf0677..4d851b86270 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -86,8 +86,33 @@ class Project extends CommonObject
*/
public $title;
+ /**
+ * @var int Date start
+ * @deprecated
+ * @see $date_start
+ */
+ public $dateo;
+
+ /**
+ * @var int Date start
+ */
public $date_start;
+
+ /**
+ * @var int Date end
+ * @deprecated
+ * @see $date_end
+ */
+ public $datee;
+
+ /**
+ * @var int Date end
+ */
public $date_end;
+
+ /**
+ * @var int Date close
+ */
public $date_close;
public $socid; // To store id of thirdparty
@@ -694,12 +719,12 @@ class Project extends CommonObject
* @param string $type 'propal','order','invoice','order_supplier','invoice_supplier',...
* @param string $tablename name of table associated of the type
* @param string $datefieldname name of date field for filter
- * @param int $dates Start date
- * @param int $datee End date
+ * @param int $date_start Start date
+ * @param int $date_end End date
* @param string $projectkey Equivalent key to fk_projet for actual type
* @return mixed Array list of object ids linked to project, < 0 or string if error
*/
- public function get_element_list($type, $tablename, $datefieldname = '', $dates = '', $datee = '', $projectkey = 'fk_projet')
+ public function get_element_list($type, $tablename, $datefieldname = '', $date_start = '', $date_end = '', $projectkey = 'fk_projet')
{
// phpcs:enable
@@ -729,28 +754,28 @@ class Project extends CommonObject
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")";
}
- if ($dates > 0 && $type == 'loan') {
- $sql .= " AND (dateend > '".$this->db->idate($dates)."' OR dateend IS NULL)";
- } elseif ($dates > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
+ if ($date_start > 0 && $type == 'loan') {
+ $sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)";
+ } elseif ($date_start > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
if (empty($datefieldname) && !empty($this->table_element_date)) {
$datefieldname = $this->table_element_date;
}
if (empty($datefieldname)) {
return 'Error this object has no date field defined';
}
- $sql .= " AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)";
+ $sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)";
}
- if ($datee > 0 && $type == 'loan') {
- $sql .= " AND (datestart < '".$this->db->idate($datee)."' OR datestart IS NULL)";
- } elseif ($datee > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
+ if ($date_end > 0 && $type == 'loan') {
+ $sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)";
+ } elseif ($date_end > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
if (empty($datefieldname) && !empty($this->table_element_date)) {
$datefieldname = $this->table_element_date;
}
if (empty($datefieldname)) {
return 'Error this object has no date field defined';
}
- $sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)";
+ $sql .= " AND (".$datefieldname." <= '".$this->db->idate($date_end)."' OR ".$datefieldname." IS NULL)";
}
$parameters = array(
@@ -758,8 +783,8 @@ class Project extends CommonObject
'type' => $type,
'tablename' => $tablename,
'datefieldname' => $datefieldname,
- 'dates' => $dates,
- 'datee' => $datee,
+ 'dates' => $date_start,
+ 'datee' => $date_end,
'fk_projet' => $projectkey,
'ids' => $ids,
);
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index f2e514afe56..612aa0e6fe7 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -729,16 +729,21 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Project
print '| '.$langs->trans("ChildOfProjectTask").' | ';
print img_picto('', 'project');
- $formother->selectProjectTasks(GETPOST('task_parent'), !empty($projectid) ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
+ $formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx');
print ' |
';
+ $contactsofproject = (empty($object->id) ? '' : $object->getListContactId('internal'));
+
// Assigned to
print '| '.$langs->trans("AffectedTo").' | ';
- $contactsofproject = (!empty($object->id) ? $object->getListContactId('internal') : '');
if (is_array($contactsofproject) && count($contactsofproject)) {
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
} else {
- print ''.$langs->trans("NoUserAssignedToTheProject").'';
+ if ($projectid > 0 || $object->id > 0) {
+ print ''.$langs->trans("NoUserAssignedToTheProject").'';
+ } else {
+ print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
+ }
}
print ' |
';
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 9c0d3b01136..ed4586a7376 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -1244,7 +1244,7 @@ if ($action == 'create') {
if (!empty($extrafields)) {
//var_dump($line);
$colspan = 5;
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
$colspan += 3;
}
$recLine = new CommandeFournisseurDispatch($db);
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 958528e2fe7..f7d695abaad 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -600,7 +600,7 @@ class Reception extends CommonObject
$inventorycode = '';
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), '', '', '', '', 0, $inventorycode);
- if ($result < 0) {
+ if (intval($result) < 0) {
$error++;
$this->errors[] = $mouvS->error;
$this->errors = array_merge($this->errors, $mouvS->errors);
@@ -614,7 +614,7 @@ class Reception extends CommonObject
$inventorycode = '';
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode);
- if ($result < 0) {
+ if (intval($result) < 0) {
$error++;
$this->errors[] = $mouvS->error;
$this->errors = array_merge($this->errors, $mouvS->errors);
diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php
index 1ef8fa544ad..c2cd40f6b6d 100644
--- a/htdocs/recruitment/admin/setup.php
+++ b/htdocs/recruitment/admin/setup.php
@@ -229,7 +229,7 @@ if ($action == 'edit') {
print '| ';
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
- print ' | |
';
+ print ' | ';
}
print '
';
@@ -250,7 +250,7 @@ if ($action == 'edit') {
print '
| ';
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
- print ' | '.$conf->global->$key.' |
';
+ print ''.getDolGlobalString($key).' | ';
}
print '
';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 58172c2e767..1ab24288401 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -226,7 +226,7 @@ if ($action == 'edit') {
print '