';
print $langs->trans("KeysToUseForUpdates");
print ' ';
@@ -1336,15 +1333,15 @@ if ($step == 5 && $datatoimport)
}
print ' '.$langs->trans("Modify").' ';
} else {
- if (count($objimport->array_import_updatekeys[0]))
- {
- print $form->multiselectarray('updatekeys', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '80%');
- }
+ if (count($objimport->array_import_updatekeys[0]))
+ {
+ print $form->multiselectarray('updatekeys', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '80%');
+ print $form->textwithpicto("", $langs->trans("SelectPrimaryColumnsForUpdateAttempt"));
+ }
else
{
- print ''.$langs->trans("UpdateNotYetSupportedForThisImport").' ';
+ print ''.$langs->trans("UpdateNotYetSupportedForThisImport").' ';
}
- print $form->textwithpicto("", $langs->trans("SelectPrimaryColumnsForUpdateAttempt"));
}
/*echo '';
print_r($objimport->array_import_updatekeys);
@@ -1432,7 +1429,8 @@ if ($step == 5 && $datatoimport)
if ($action != 'launchsimu')
{
// Show import id
- print $langs->trans("NowClickToTestTheImport",$langs->transnoentitiesnoconv("RunSimulateImportFile")).' ';
+ print '';
+ print $langs->trans("NowClickToTestTheImport",$langs->transnoentitiesnoconv("RunSimulateImportFile")).' ';
print ' ';
// Actions
@@ -1948,7 +1946,7 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='')
{
print '';
print '';
- print img_picto(($pos>0?$langs->trans("MoveField",$pos):''),'uparrow','class="boxhandle" style="cursor:move;"');
+ print img_picto(($pos>0?$langs->trans("MoveField",$pos):''),'grip_title','class="boxhandle" style="cursor:move;"');
print ' ';
print '';
print $langs->trans("NoFields");
@@ -1971,7 +1969,7 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='')
print ' ';
print '';
// 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),'uparrow','class="boxhandle" style="cursor:move;"');
+ print img_picto($langs->trans("MoveField",$pos),'grip_title','class="boxhandle" style="cursor:move;"');
print ' ';
print '';
print $langs->trans("Field").' '.$pos;
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index 207055c6ce8..cd67a90e4dd 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -60,13 +60,12 @@ print ' '.$langs->trans("Module").' ';
print ''.$langs->trans("ImportableDatas").' ';
//print ' ';
print ' ';
-$val=true;
+
if (count($import->array_import_code))
{
foreach ($import->array_import_code as $key => $value)
{
- $val=!$val;
- print '';
+ print ' ';
print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' ';
print $import->array_import_module[$key]->getName();
print ' ';
@@ -93,7 +92,7 @@ if (count($import->array_import_code))
{
//if ($user->rights->import->run)
//{
- print ''.$langs->trans("NewImport").' ';
+ print ''.$langs->trans("NewImport").' ';
//}
//else
//{
@@ -108,7 +107,6 @@ print ' ';
// List of available import format
-$var=true;
print '';
print '';
print ''.$langs->trans("AvailableFormats").' ';
@@ -122,7 +120,6 @@ $liste=$model->liste_modeles($db);
foreach($liste as $key)
{
-
print ' ';
print ''.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).' ';
$text=$model->getDriverDescForKey($key);
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 7c2895eb835..810e289d7e3 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -172,12 +172,17 @@ if (! empty($dolibarr_main_document_root_alt))
// Security check (old method, when directory is renamed /install.lock)
if (preg_match('/install\.lock/i',$_SERVER["SCRIPT_FILENAME"]))
{
- print 'Install pages have been disabled for security reason (directory renamed with .lock suffix).';
+ if (! is_object($langs))
+ {
+ $langs = new Translate('..');
+ $langs->setDefaultLang('auto');
+ }
+ $langs->load("install");
+ print $langs->trans("YouTryInstallDisabledByDirLock");
if (! empty($dolibarr_main_url_root))
{
- print 'Click on following link. ';
- print '';
- print 'Click here to go to Dolibarr';
+ print 'Click on following link, ';
+ print $langs->trans("ClickHereToGoToApp");
print ' ';
}
exit;
@@ -191,13 +196,18 @@ if (constant('DOL_DATA_ROOT') === null) {
}
if (@file_exists($lockfile))
{
- print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr documents directory). ';
+ if (! is_object($langs))
+ {
+ $langs = new Translate('..');
+ $langs->setDefaultLang('auto');
+ }
+ $langs->load("install");
+ print $langs->trans("YouTryInstallDisabledByFileLock");
if (! empty($dolibarr_main_url_root))
{
- print 'Click on following link. ';
- print 'If you always reach this page, you must remove install.lock file manually. ';
+ print $langs->trans("ClickOnLinkOrRemoveManualy").' ';
print '';
- print 'Click here to go to Dolibarr';
+ print $langs->trans("ClickHereToGoToApp");
print ' ';
}
else
@@ -370,6 +380,7 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='',$css
global $langs;
$langs->load("main");
$langs->load("admin");
+ $langs->load("install");
$jquerytheme='base';
diff --git a/htdocs/install/mysql/data/llx_c_ecotaxe.sql b/htdocs/install/mysql/data/llx_c_ecotaxe.sql
index 92046f38d0c..845ffa1e685 100644
--- a/htdocs/install/mysql/data/llx_c_ecotaxe.sql
+++ b/htdocs/install/mysql/data/llx_c_ecotaxe.sql
@@ -3,7 +3,7 @@
-- Copyright (C) 2004-2009 Laurent Destailleur
-- Copyright (C) 2004 Benoit Mortier
-- Copyright (C) 2004 Guillaume Delecourt
--- Copyright (C) 2005-2009 Regis Houssin
+-- Copyright (C) 2005-2018 Regis Houssin
-- Copyright (C) 2007 Patrick Raguin
--
-- This program is free software; you can redistribute it and/or modify
@@ -30,46 +30,23 @@
-- Eco-Taxes
--
--- France (Organisme ERP)
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 1, 'ER-A-A', 'Materiels electriques < 0,2kg', 0.01000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 2, 'ER-A-B', 'Materiels electriques >= 0,2 kg et < 0,5 kg', 0.03000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 3, 'ER-A-C', 'Materiels electriques >= 0,5 kg et < 1 kg', 0.04000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 4, 'ER-A-D', 'Materiels electriques >= 1 kg et < 2 kg', 0.13000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 5, 'ER-A-E', 'Materiels electriques >= 2 kg et < 4kg', 0.21000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 6, 'ER-A-F', 'Materiels electriques >= 4 kg et < 8 kg', 0.42000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 7, 'ER-A-G', 'Materiels electriques >= 8 kg et < 15 kg', 0.84000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 8, 'ER-A-H', 'Materiels electriques >= 15 kg et < 20 kg', 1.25000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES ( 9, 'ER-A-I', 'Materiels electriques >= 20 kg et < 30 kg', 1.88000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (10, 'ER-A-J', 'Materiels electriques >= 30 kg', 3.34000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (11, 'ER-M-1', 'TV, Moniteurs < 9kg', 0.84000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (12, 'ER-M-2', 'TV, Moniteurs >= 9kg et < 15kg', 1.67000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (13, 'ER-M-3', 'TV, Moniteurs >= 15kg et < 30kg', 3.34000000, 'ERP', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (14, 'ER-M-4', 'TV, Moniteurs >= 30 kg', 6.69000000, 'ERP', 1, 1);
-
--- France (Organisme Ecologic)
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (15, 'EC-A-A', 'Materiels electriques 0,2 kg max', 0.00840000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (16, 'EC-A-B', 'Materiels electriques 0,21 kg min - 0,50 kg max', 0.02500000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (17, 'EC-A-C', 'Materiels electriques 0,51 kg min - 1 kg max', 0.04000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (18, 'EC-A-D', 'Materiels electriques 1,01 kg min - 2,5 kg max', 0.13000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (19, 'EC-A-E', 'Materiels electriques 2,51 kg min - 4 kg max', 0.21000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (20, 'EC-A-F', 'Materiels electriques 4,01 kg min - 8 kg max', 0.42000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (21, 'EC-A-G', 'Materiels electriques 8,01 kg min - 12 kg max', 0.63000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (22, 'EC-A-H', 'Materiels electriques 12,01 kg min - 20 kg max', 1.05000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (23, 'EC-A-I', 'Materiels electriques 20,01 kg min', 1.88000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (24, 'EC-M-1', 'TV, Moniteurs 9 kg max', 0.84000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (25, 'EC-M-2', 'TV, Moniteurs 9,01 kg min - 18 kg max', 1.67000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (26, 'EC-M-3', 'TV, Moniteurs 18,01 kg min - 36 kg max', 3.34000000, 'Ecologic', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (27, 'EC-M-4', 'TV, Moniteurs 36,01 kg min', 6.69000000, 'Ecologic', 1, 1);
-
--- France (Organisme Eco-systemes)
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (28, 'ES-M-1', 'TV, Moniteurs <= 20 pouces', 0.84000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (29, 'ES-M-2', 'TV, Moniteurs > 20 pouces et <= 32 pouces', 3.34000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (30, 'ES-M-3', 'TV, Moniteurs > 32 pouces et autres grands ecrans', 6.69000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (31, 'ES-A-A', 'Ordinateur fixe, Audio home systems (HIFI), elements hifi separes', 0.84000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (32, 'ES-A-B', 'Ordinateur portable, CD-RCR, VCR, lecteurs et enregistreurs DVD, instruments de musique et caisses de resonance, haut parleurs...', 0.25000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (33, 'ES-A-C', 'Imprimante, photocopieur, telecopieur', 0.42000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (34, 'ES-A-D', 'Accessoires, clavier, souris, PDA, imprimante photo, appareil photo, gps, telephone, repondeur, telephone sans fil, modem, telecommande, casque, camescope, baladeur mp3, radio portable, radio K7 et CD portable, radio reveil', 0.08400000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (35, 'ES-A-E', 'GSM', 0.00840000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (36, 'ES-A-F', 'Jouets et equipements de loisirs et de sports < 0,5 kg', 0.04200000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (37, 'ES-A-G', 'Jouets et equipements de loisirs et de sports > 0,5 kg', 0.17000000, 'Eco-systemes', 1, 1);
-INSERT INTO llx_c_ecotaxe (rowid, code, libelle, price, organization, fk_pays, active) VALUES (38, 'ES-A-H', 'Jouets et equipements de loisirs et de sports > 10 kg', 1.25000000, 'Eco-systemes', 1, 1);
+-- France (Organisme Eco-systèmes)
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (1, '25040', 'PETIT APPAREILS MENAGERS', 0.25000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (2, '25050', 'TRES PETIT APPAREILS MENAGERS', 0.08000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (3, '32070', 'ECRAN POIDS < 5 KG', 2.08000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (4, '32080', 'ECRAN POIDS > 5 KG', 1.25000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (5, '32051', 'ORDINATEUR PORTABLE', 0.42000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (6, '32061', 'TABLETTE INFORMATIQUE', 0.84000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (7, '36011', 'ORDINATEUR FIXE (UC)', 1.15000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (8, '36021', 'IMPRIMANTES', 0.83000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (9, '36030', 'IT (INFORMATIQUE ET TELECOMS)', 0.83000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (10, '36040', 'PETIT IT (CLAVIERS / SOURIS)', 0.08000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (11, '36050', 'TELEPHONIE MOBILE', 0.02000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (12, '36060', 'CONNECTIQUE CABLES', 0.02000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (13, '45010', 'GROS MATERIEL GRAND PUBLIC (TELEAGRANDISSEURS)', 1.67000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (14, '45020', 'MOYEN MATERIEL GRAND PUBLIC (LOUPES ELECTRONIQUES)', 0.42000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (15, '45030', 'PETIT MATERIEL GRAND PUBLIC (VIE QUOTIDIENNE)', 0.08000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (16, '75030', 'JOUETS < 0,5 KG', 0.08000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (17, '75040', 'JOUETS ENTRE 0,5 KG ET 10 KG', 0.17000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (18, '74050', 'JOUETS > 10 KG', 1.67000000, 'Eco-systèmes', 1, 1);
+INSERT INTO llx_c_ecotaxe (rowid, code, label, price, organization, fk_pays, active) VALUES (19, '85010', 'EQUIPEMENT MEDICAL < 0,5 KG', 0.08000000, 'Eco-systèmes', 1, 1);
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index 18c4cfe2246..5327269fbe5 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -36,6 +36,11 @@ ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accountingaccount_fk_pcg_
-- Drop foreign key, so next alter will be a success
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accounting_account_fk_pcg_version;
+-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
+-- VMYSQL4.1 update llx_accounting_account set tms = datec where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
+-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
+-- VMYSQL4.1 update llx_accounting_account set tms = datec where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
+
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY fk_pcg_version VARCHAR(20) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY fk_pcg_version VARCHAR(20) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_system MODIFY pcg_version VARCHAR(20) CHARACTER SET utf8;
@@ -716,4 +721,3 @@ DROP TABLE llx_c_accountancy_category;
UPDATE llx_cronjob set entity = 1 where entity = 0 and label in ('RecurringInvoices', 'SendEmailsReminders');
UPDATE llx_cronjob set entity = 0 where entity = 1 and label in ('PurgeDeleteTemporaryFilesShort', 'MakeLocalDatabaseDumpShort');
-
diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
index be14a0af0e4..7ca1d16d67e 100644
--- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
+++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
@@ -35,6 +35,7 @@
-- Forgot in 7.0
+-- VMYSQL4.1 DROP INDEX nom on llx_societe;
-- VMYSQL4.1 ALTER TABLE llx_c_regions drop FOREIGN KEY fk_c_regions_fk_pays;
-- VMYSQL4.1 ALTER TABLE llx_product_association ADD COLUMN rowid integer AUTO_INCREMENT PRIMARY KEY;
@@ -42,6 +43,8 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_create integer;
ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFAULT 'page';
+
+
-- drop very old table (bad name)
DROP TABLE llx_c_accountancy_category;
DROP TABLE llx_c_accountingaccount;
@@ -94,7 +97,10 @@ delete from llx_usergroup_rights where fk_id not in (select id from llx_rights_d
ALTER TABLE llx_inventory ADD COLUMN fk_product integer DEFAULT NULL;
ALTER TABLE llx_inventory MODIFY COLUMN fk_warehouse integer DEFAULT NULL;
-ALTER TABLE llx_c_type_fees ADD COLUMN llx_c_type_fees integer DEFAULT 0;
+ALTER TABLE llx_c_type_fees DROP COLUMN llx_c_type_fees;
+ALTER TABLE llx_c_type_fees ADD COLUMN type integer DEFAULT 0;
+
+ALTER TABLE llx_c_ecotaxe CHANGE COLUMN libelle label varchar(255);
ALTER TABLE llx_product_fournisseur_price DROP COLUMN unitcharges;
@@ -532,3 +538,9 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR04', 'Standardkontenrahmen SKR 04', 1);
+-- advtargetmailing
+ALTER TABLE llx_advtargetemailing ADD COLUMN fk_element integer NOT NULL;
+ALTER TABLE llx_advtargetemailing ADD COLUMN type_element varchar(180) NOT NULL;
+UPDATE llx_advtargetemailing SET fk_element = fk_mailing, type_element='mailing';
+ALTER TABLE llx_advtargetemailing DROP COLUMN fk_mailing;
+
diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql
index 9493ef6c7c9..22409441eac 100755
--- a/htdocs/install/mysql/migration/repair.sql
+++ b/htdocs/install/mysql/migration/repair.sql
@@ -391,6 +391,11 @@ drop table tmp_bank_url_expense_user;
-- where price = 17.5
+-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
+-- VMYSQL4.1 update llx_accounting_account set tms = datec where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
+-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
+-- VMYSQL4.1 update llx_accounting_account set tms = datec where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
+
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
-- VMYSQL4.1 update llx_expensereport set date_debut = date_create where DATE(STR_TO_DATE(date_debut, '%Y-%m-%d')) IS NULL;
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
diff --git a/htdocs/install/mysql/tables/llx_advtargetemailing.sql b/htdocs/install/mysql/tables/llx_advtargetemailing.sql
index 395558c700f..3698e5e6626 100644
--- a/htdocs/install/mysql/tables/llx_advtargetemailing.sql
+++ b/htdocs/install/mysql/tables/llx_advtargetemailing.sql
@@ -22,7 +22,8 @@ CREATE TABLE llx_advtargetemailing
rowid integer NOT NULL auto_increment PRIMARY KEY,
name varchar(180) NOT NULL,
entity integer NOT NULL DEFAULT 1,
- fk_mailing integer NOT NULL,
+ fk_element integer NOT NULL,
+ type_element varchar(180) NOT NULL,
filtervalue text,
fk_user_author integer NOT NULL,
datec datetime NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_c_ecotaxe.sql b/htdocs/install/mysql/tables/llx_c_ecotaxe.sql
index 09613787f76..cd67bb34766 100644
--- a/htdocs/install/mysql/tables/llx_c_ecotaxe.sql
+++ b/htdocs/install/mysql/tables/llx_c_ecotaxe.sql
@@ -1,6 +1,6 @@
-- ========================================================================
--- Copyright (C) 2007 Regis Houssin
--- Copyright (C) 2009 Laurent Destailleur
+-- Copyright (C) 2007-2018 Regis Houssin
+-- Copyright (C) 2009 Laurent Destailleur
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -19,11 +19,11 @@
create table llx_c_ecotaxe
(
- rowid integer AUTO_INCREMENT PRIMARY KEY,
- code varchar(64) NOT NULL, -- Code servant a la traduction et a la reference interne
- libelle varchar(255), -- Description
- price double(24,8), -- Montant HT
- organization varchar(255), -- Organisme gerant le bareme tarifaire
- fk_pays integer NOT NULL, -- Pays correspondant
- active tinyint DEFAULT 1 NOT NULL
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ code varchar(64) NOT NULL, -- Code servant a la traduction et a la reference interne
+ label varchar(255), -- Description
+ price double(24,8), -- Montant HT
+ organization varchar(255), -- Organisme gerant le bareme tarifaire
+ fk_pays integer NOT NULL, -- Pays correspondant
+ active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql
index d413b60e25f..c795fa254dc 100644
--- a/htdocs/install/mysql/tables/llx_website_page.sql
+++ b/htdocs/install/mysql/tables/llx_website_page.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_website_page
(
rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
fk_website integer NOT NULL,
- type_container varchar(16) NOT NULL DEFAULT 'page'
+ type_container varchar(16) NOT NULL DEFAULT 'page',
pageurl varchar(255) NOT NULL,
aliasalt varchar(255),
title varchar(255),
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 134d9761180..266b2fae483 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -55,6 +55,7 @@ AccountancyAreaDescChartModel=STEP %s: Create a model of chart of account from m
AccountancyAreaDescChart=STEP %s: Create or check content of your chart of account from menu %s
AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s.
+AccountancyAreaDescDefault=STEP %s: Define default accounting accounts. For this, use the menu entry %s.
AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of expense report. For this, use the menu entry %s.
AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this, use the menu entry %s.
AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expences (miscellaneous taxes). For this, use the menu entry %s.
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index e4ecc5f0888..c40a8541d67 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -497,7 +497,7 @@ Module25Desc=Customer order management
Module30Name=Invoices
Module30Desc=Invoice and credit note management for customers. Invoice management for suppliers
Module40Name=Suppliers
-Module40Desc=Supplier management and buying (orders and invoices)
+Module40Desc=Suppliers and purchase management (purchase orders and billing)
Module42Name=Debug Logs
Module42Desc=Logging facilities (file, syslog, ...). Such logs are for technical/debug purposes.
Module49Name=Editors
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index fbd381bdde3..f95d0e18bf4 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -1,6 +1,6 @@
# Dolibarr language file - Source file is en_US - banks
Bank=Bank
-MenuBankCash=Bank/Cash
+MenuBankCash=Bank | Cash
MenuVariousPayment=Miscellaneous payments
MenuNewVariousPayment=New Miscellaneous payment
BankName=Bank name
@@ -132,7 +132,7 @@ PaymentDateUpdateSucceeded=Payment date updated successfully
PaymentDateUpdateFailed=Payment date could not be updated
Transactions=Transactions
BankTransactionLine=Bank entry
-AllAccounts=All bank/cash accounts
+AllAccounts=All bank and cash accounts
BackToAccount=Back to account
ShowAllAccounts=Show for all accounts
FutureTransaction=Transaction in futur. No way to conciliate.
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index e158f7a691d..d06b1512cc6 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -110,8 +110,8 @@ SendRemindByMail=Send reminder by EMail
DoPayment=Enter payment
DoPaymentBack=Enter refund
ConvertToReduc=Mark as credit available
-ConvertExcessReceivedToReduc=Convert excess received into future discount
-ConvertExcessPaidToReduc=Convert excess paid into future discount
+ConvertExcessReceivedToReduc=Convert excess received into available credit
+ConvertExcessPaidToReduc=Convert excess paid into available discount
EnterPaymentReceivedFromCustomer=Enter payment received from customer
EnterPaymentDueToCustomer=Make payment due to customer
DisabledBecauseRemainderToPayIsZero=Disabled because remaining unpaid is zero
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index ce70a9748a0..196ab114d6f 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -19,7 +19,8 @@ Income=Income
Outcome=Expense
MenuReportInOut=Income / Expense
ReportInOut=Balance of income and expenses
-ReportTurnover=Turnover
+ReportTurnover=Turnover invoiced
+ReportTurnoverCollected=Turnover collected
PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party
PaymentsNotLinkedToUser=Payments not linked to any user
Profit=Profit
@@ -117,8 +118,9 @@ CustomerAccountancyCodeShort=Cust. account. code
SupplierAccountancyCodeShort=Sup. account. code
AccountNumber=Account number
NewAccountingAccount=New account
-SalesTurnover=Sales turnover
-SalesTurnoverMinimum=Minimum sales turnover
+Turnover=Turnover invoiced
+TurnoverCollected=Turnover collected
+SalesTurnoverMinimum=Minimum turnover
ByExpenseIncome=By expenses & incomes
ByThirdParties=By third parties
ByUserAuthorOfInvoice=By invoice author
@@ -138,8 +140,8 @@ ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fisc
ExportDataset_tax_1=Social and fiscal taxes and payments
CalcModeVATDebt=Mode %sVAT on commitment accounting%s .
CalcModeVATEngagement=Mode %sVAT on incomes-expenses%s .
-CalcModeDebt=Mode %sClaims-Debts%s said Commitment accounting .
-CalcModeEngagement=Mode %sIncomes-Expenses%s said cash accounting
+CalcModeDebt=Analysis of known recorded invoices even if they are not yet accounted in ledger.
+CalcModeEngagement=Analysis of known recorded payments, even if they are not yet accounted in Ledger.
CalcModeBookkeeping=Analysis of data journalized in Bookkeeping Ledger table
CalcModeLT1= Mode %sRE on customer invoices - suppliers invoices%s
CalcModeLT1Debt=Mode %sRE on customer invoices%s
@@ -152,9 +154,9 @@ AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary
AnnualByCompanies=Balance of income and expenses, by predefined groups of account
AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by predefined groups, mode %sClaims-Debts%s said Commitment accounting .
AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by predefined groups, mode %sIncomes-Expenses%s said cash accounting .
-SeeReportInInputOutputMode=See report %sIncomes-Expenses%s said cash accounting for a calculation on actual payments made
-SeeReportInDueDebtMode=See report %sClaims-Debts%s said commitment accounting for a calculation on issued invoices
-SeeReportInBookkeepingMode=See report %sBookeeping%s for a calculation on bookkeeping table analysis
+SeeReportInInputOutputMode=See %sanalysis of payments%s for a calculation on actual payments made, if they are not yet accounted in Ledger.
+SeeReportInDueDebtMode=See %sanalysis of invoices%s for a calculation based on known recorded invoices even, if they are not yet accounted in Ledger.
+SeeReportInBookkeepingMode=See %sBookeeping report%s for a calculation on Bookkeeping Ledger table
RulesAmountWithTaxIncluded=- Amounts shown are with all taxes included
RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whether they are paid or not. Is also includes paid salaries. - It is based on the validation date of invoices and VAT and on the due date for expenses. For salaries defined with Salary module, the value date of payment is used.
RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries. - It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation.
@@ -219,8 +221,8 @@ Mode1=Method 1
Mode2=Method 2
CalculationRuleDesc=To calculate total VAT, there is two methods: Method 1 is rounding vat on each line, then summing them. Method 2 is summing all vat on each line, then rounding result. Final result may differs from few cents. Default mode is mode %s .
CalculationRuleDescSupplier=According to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
-TurnoverPerProductInCommitmentAccountingNotRelevant=The Turnover report per product, when using a cash accounting mode is not relevant. This report is only available when using commitment accounting mode (see setup of accountancy module).
-TurnoverPerSaleTaxRateInCommitmentAccountingNotRelevant=The Turnover report per sale tax rate, when using a cash accounting mode is not relevant. This report is only available when using commitment accounting mode (see setup of accountancy module).
+TurnoverPerProductInCommitmentAccountingNotRelevant=The report of Turnover collected per product is not available. This report is only available for turnover invoiced.
+TurnoverPerSaleTaxRateInCommitmentAccountingNotRelevant=The report of Turnover collected per sale tax rate is not available. This report is only available for turnover invoiced.
CalculationMode=Calculation mode
AccountancyJournal=Accounting code journal
ACCOUNTING_VAT_SOLD_ACCOUNT=Accounting account by default for VAT on sales (used if not defined on VAT dictionary setup)
@@ -252,5 +254,6 @@ VATDue=Sale tax claimed
ClaimedForThisPeriod=Claimed for the period
PaidDuringThisPeriod=Paid during this period
ByVatRate=By sale tax rate
-TurnoverbyVatrate=Turnover by sale tax rate
+TurnoverbyVatrate=Turnover invoiced by sale tax rate
+TurnoverCollectedbyVatrate=Turnover collected by sale tax rate
PurchasebyVatrate=Purchase by sale tax rate
\ No newline at end of file
diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang
index acdddfe3f59..00d4be864ff 100644
--- a/htdocs/langs/en_US/install.lang
+++ b/htdocs/langs/en_US/install.lang
@@ -204,3 +204,7 @@ MigrationResetBlockedLog=Reset module BlockedLog for v7 algorithm
ShowNotAvailableOptions=Show not available options
HideNotAvailableOptions=Hide not available options
ErrorFoundDuringMigration=Error were reported during migration process so next step is not available. To ignore errors, you can click here , but application or some features may not work correctly until fixed.
+YouTryInstallDisabledByDirLock=The application try to sefl upgrade, but install/upgrade pages have been disabled for security reason (directory renamed with .lock suffix).
+YouTryInstallDisabledByFileLock=The application try to sefl upgrade, but install/upgrade pages pages have been disabled for security reason (by lock file install.lock into dolibarr documents directory).
+ClickHereToGoToApp=Click here to go to your application
+ClickOnLinkOrRemoveManualy=Click on following link and if you always reach this page, you must remove the file install.lock into documents directory manually
\ No newline at end of file
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 13907ca380e..8ef8cc30090 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -80,8 +80,8 @@ LinkedObject=Linked object
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__USER_SIGNATURE__
PredefinedMailTestHtml=__(Hello)__\nThis is a test mail (the word test must be in bold). The two lines are separated by a carriage return. __USER_SIGNATURE__
-PredefinedMailContentSendInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\nThis is the link to make your online payment if this invoice is not already payed:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
-PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\nThis is the link to make your online payment:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendProposal=__(Hello)__\n\nYou will find here the commercial proposal __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nYou will find here the price request __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendOrder=__(Hello)__\n\nYou will find here the order __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
@@ -91,6 +91,7 @@ PredefinedMailContentSendShipping=__(Hello)__\n\nYou will find here the shipping
PredefinedMailContentSendFichInter=__(Hello)__\n\nYou will find here the intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n
DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available.
ChooseYourDemoProfil=Choose the demo profile that best suits your needs...
ChooseYourDemoProfilMore=...or build your own profile (manual module selection)
@@ -218,7 +219,7 @@ FileIsTooBig=Files is too big
PleaseBePatient=Please be patient...
NewPassword=New password
ResetPassword=Reset password
-RequestToResetPasswordReceived=A request to change your password has been received
+RequestToResetPasswordReceived=A request to change your password has been received.
NewKeyIs=This is your new keys to login
NewKeyWillBe=Your new key to login to software will be
ClickHereToGoTo=Click here to go to %s
diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang
index 2cbe4289654..547b188b4a5 100644
--- a/htdocs/langs/en_US/paypal.lang
+++ b/htdocs/langs/en_US/paypal.lang
@@ -14,7 +14,6 @@ PaypalModeOnlyPaypal=PayPal only
ONLINE_PAYMENT_CSS_URL=Optionnal URL of CSS style sheet on online payment page
ThisIsTransactionId=This is id of transaction: %s
PAYPAL_ADD_PAYMENT_URL=Add the url of Paypal payment when you send a document by mail
-PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done. %s
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
NewOnlinePaymentReceived=New online payment received
NewOnlinePaymentFailed=New online payment tried but failed
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index abf262ec9ba..21c2e1dc62c 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -251,8 +251,8 @@ PriceNumeric=Number
DefaultPrice=Default price
ComposedProductIncDecStock=Increase/Decrease stock on parent change
ComposedProduct=Sub-product
-MinSupplierPrice=Minimum supplier price
-MinCustomerPrice=Minimum customer price
+MinSupplierPrice=Minimum buying price
+MinCustomerPrice=Minimum selling price
DynamicPriceConfiguration=Dynamic price configuration
DynamicPriceDesc=On product card, with this module enabled, you should be able to set mathematic functions to calculate Customer or Supplier prices. Such function can use all mathematic operators, some constants and variables. You can set here the variables you want to be able to use and if the variable need an automatic update, the external URL to use to ask Dolibarr to update automaticaly the value.
AddVariable=Add Variable
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index 7745dde08da..5a7169ac925 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -75,6 +75,7 @@ AvailabilityTypeAV_1M=1 month
TypeContact_propal_internal_SALESREPFOLL=Representative following-up proposal
TypeContact_propal_external_BILLING=Customer invoice contact
TypeContact_propal_external_CUSTOMER=Customer contact following-up proposal
+TypeContact_propal_external_SHIPPING=Customer contact for delivery
# Document models
DocModelAzurDescription=A complete proposal model (logo...)
DefaultModelPropalCreate=Default model creation
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index d1b1f85224f..98aae045517 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -203,4 +203,4 @@ RegulateStock=Regulate Stock
ListInventory=List
StockSupportServices=Stock management support services
StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service"
-ReceiveProducts=Receive products
\ No newline at end of file
+ReceiveProducts=Receive items
\ No newline at end of file
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index a2b10dfb556..6cc31a25bfd 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -140,7 +140,7 @@ TicketStatByStatus=Tickets by status
#
Ticket=Incident ticket
TicketCard=Ticket card
-CreateTicket=Create new ticket
+CreateTicket=Create ticket
EditTicket=Edit ticket
TicketsManagement=Tickets Management
CreatedBy=Created by
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index 57df8cc540d..9f840556f75 100644
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -48,7 +48,7 @@ PasswordChangeRequest=Request to change password for %s
PasswordChangeRequestSent=Request to change password for %s sent to %s .
ConfirmPasswordReset=Confirm password reset
MenuUsersAndGroups=Users & Groups
-LastGroupsCreated=Latest %s created groups
+LastGroupsCreated=Latest %s groups created
LastUsersCreated=Latest %s users created
ShowGroup=Show group
ShowUser=Show user
diff --git a/htdocs/langs/fr_FR/mails.lang b/htdocs/langs/fr_FR/mails.lang
index d9e0e2b8cde..25a82ab2487 100644
--- a/htdocs/langs/fr_FR/mails.lang
+++ b/htdocs/langs/fr_FR/mails.lang
@@ -109,7 +109,7 @@ MailingNeedCommand2=Vous pouvez toutefois quand même les envoyer par l'interfac
ConfirmSendingEmailing=Si vous souhaitez envoyer l'e-mailing depuis cet écran, veuillez confirmer son envoi maintenant, depuis votre navigateur.
LimitSendingEmailing=Remarque: L'envoi d'Emailings à partir de l'interface web se fait en plusieurs fois pour des raisons de sécurité et de timeout, %s bénéficiaires à la fois pour chaque session d'envoi.
TargetsReset=Vider liste
-ToClearAllRecipientsClickHere=Pour vider la liste des destinataires de cet emailing, cliquez sur le bouton
+ToClearAllRecipientsClickHere=Pour vider la liste des destinataires, cliquez sur le bouton
ToAddRecipientsChooseHere=Pour ajouter des destinataires, choisir dans les listes ci-dessous
NbOfEMailingsReceived=Emailings de masse reçus
NbOfEMailingsSend=Emailings de masse envoyés
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 01d768261f9..f6543c89a80 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -82,7 +82,7 @@ PredefinedMailTest=__(Hello)__,\nCeci est un mail de test envoyé à __EMAIL__.\
PredefinedMailTestHtml=__(Hello)__\nCeci est un message de test (le mot test doit être en gras). Les 2 lignes sont séparées par un retour à la ligne. __SIGNATURE__
PredefinedMailContentSendInvoice=__(Hello)__\n\nVous trouverez ci-joint la facture __REF__\n\nVoici le lien pour effectuer votre paiement en ligne si elle n'est pas déjà été payée:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nNous souhaitons vous prévenir que la facture __REF__ ne semble pas avoir été payée. Voici donc la facture en pièce jointe, à titre de rappel.\n\nVoici le lien pour effectuer votre paiement en ligne:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
-PredefinedMailContentSendProposal=__(Hello)__\n\nYou will find here the commercial proposal __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendProposal=__(Hello)__\n\nVeuillez trouver, ci-joint, la proposition commerciale __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nVeuillez trouver, ci-joint, une demande de prix avec la référence __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendOrder=__(Hello)__\n\nVeuillez trouver, ci-joint, la commande __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendSupplierOrder=__(Hello)__\n\nVeuillez trouver, ci-joint, notre commande __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 5139c49674a..0d724e1ce5c 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -72,24 +72,30 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP
* Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF).
*
* @param string $val Value
- * @param string $type 1=GET, 0=POST, 2=PHP_SELF
+ * @param string $type 1=GET, 0=POST, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
* @return int >0 if there is an injection, 0 if none
*/
function test_sql_and_script_inject($val, $type)
{
$inj = 0;
// For SQL Injection (only GET are used to be included into bad escaped SQL requests)
- if ($type == 1)
+ if ($type == 1 || $type == 3)
{
- $inj += preg_match('/updatexml\(/i', $val);
$inj += preg_match('/delete\s+from/i', $val);
$inj += preg_match('/create\s+table/i', $val);
$inj += preg_match('/insert\s+into/i', $val);
$inj += preg_match('/select\s+from/i', $val);
$inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
+ $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login
+ $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database
}
- if ($type != 2) // Not common, we can check on POST
+ if ($type == 3)
{
+ $inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val);
+ }
+ if ($type != 2) // Not common key strings, so we can check them both on GET and POST
+ {
+ $inj += preg_match('/updatexml\(/i', $val);
$inj += preg_match('/update.+set.+=/i', $val);
$inj += preg_match('/union.+select/i', $val);
$inj += preg_match('/(\.\.%2f)+/i', $val);
@@ -707,7 +713,7 @@ if (! defined('NOLOGIN'))
$hookmanager->initHooks(array('main'));
// Code for search criteria persistence.
- if (! empty($_GET['save_lastsearch_values'])) // Keep $_GET here
+ if (! empty($_GET['save_lastsearch_values'])) // We must use $_GET here
{
$relativepathstring = preg_replace('/\?.*$/','',$_SERVER["HTTP_REFERER"]);
$relativepathstring = preg_replace('/^https?:\/\/[^\/]*/','',$relativepathstring); // Get full path except host server
@@ -720,9 +726,15 @@ if (! defined('NOLOGIN'))
// We click on a link that leave a page we have to save search criteria. We save them from tmp to no tmp
if (! empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring]))
{
- $_SESSION['lastsearch_values_'.$relativepathstring]=$_SESSION['lastsearch_values_tmp_'.$relativepathstring];
+ $_SESSION['lastsearch_values_'.$relativepathstring]=$_SESSION['lastsearch_values_tmp_'.$relativepathstring];
unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]);
}
+ // We also save contextpage
+ if (! empty($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]))
+ {
+ $_SESSION['lastsearch_contextpage_'.$relativepathstring]=$_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring];
+ unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
+ }
}
$action = '';
@@ -1614,8 +1626,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
print '';
- //unset($form);
-
print '
';
print "\n\n";
}
@@ -1904,7 +1914,10 @@ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinpu
$ret.=($accesskey?' accesskey="'.$accesskey.'"':'');
$ret.=' placeholder="'.strip_tags($title).'"';
$ret.=' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />';
- $ret.=' ';
+ //$ret.=' ';
+ $ret.='';
+ $ret.=' ';
+ $ret.=' ';
$ret.="\n";
return $ret;
}
@@ -1925,7 +1938,7 @@ if (! function_exists("llxFooter"))
function llxFooter($comment='',$zone='private', $disabledoutputofmessages=0)
{
global $conf, $langs, $user, $object;
- global $delayedhtmlcontent;
+ global $delayedhtmlcontent, $contextpage;
$ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION);
@@ -1933,24 +1946,37 @@ if (! function_exists("llxFooter"))
dol_htmloutput_events($disabledoutputofmessages);
// Code for search criteria persistence.
- // Save $user->lastsearch_values if defined (define on list pages when a form field search_xxx exists)
+ // $user->lastsearch_values was set by the GETPOST when form field search_xxx exists
if (is_object($user) && ! empty($user->lastsearch_values_tmp) && is_array($user->lastsearch_values_tmp))
{
- // Clean data
+ // Clean and save data
foreach($user->lastsearch_values_tmp as $key => $val)
{
- unset($_SESSION['lastsearch_values_tmp_'.$key]); // Clean arry to rebuild it just after
+ unset($_SESSION['lastsearch_values_tmp_'.$key]); // Clean array to rebuild it just after
if (count($val) && empty($_POST['button_removefilter'])) // If there is search criteria to save and we did not click on 'Clear filter' button
{
if (empty($val['sortfield'])) unset($val['sortfield']);
if (empty($val['sortorder'])) unset($val['sortorder']);
- dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criteria)");
+ dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criterias)");
$_SESSION['lastsearch_values_tmp_'.$key]=json_encode($val);
unset($_SESSION['lastsearch_values_'.$key]);
}
}
}
+
+ $relativepathstring = $_SERVER["PHP_SELF"];
+ // Clean $relativepathstring
+ if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring);
+ $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
+ $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
+ if (preg_match('/list\.php$/', $relativepathstring))
+ {
+ unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
+ if (! empty($contextpage)) $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]=$contextpage;
+ unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]);
+ }
+
// Core error message
if (! empty($conf->global->MAIN_CORE_ERROR))
{
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 9e2e48ce6cf..7b62c96ded5 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -69,6 +69,7 @@ $langs->loadLangs(array("mymodule@mymodule","other"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
@@ -123,9 +124,9 @@ if (empty($reshook))
$permissiontodelete = $user->rights->mymodule->delete;
if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__';
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
- $triggermodname = 'MYMODULE_MODIFY';
+ $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
- // Actions cancel, add, update or delete
+ // Actions cancel, add, update, delete or clone
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions when printing a doc from card
@@ -249,6 +250,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
}
+ // Clone confirmation
+ if ($action == 'clone') {
+ // Create an array for form
+ $formquestion = array();
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneMyObject'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+ }
+
// Confirmation of action xxxx
if ($action == 'xxx')
{
@@ -258,7 +266,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
- // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
+ // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))
}*/
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
}
@@ -358,6 +366,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Send
print 'id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . ' '."\n";
+ // Modify
if ($user->rights->mymodule->write)
{
print 'id.'&action=edit">'.$langs->trans("Modify").' '."\n";
@@ -367,8 +376,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ''.$langs->trans('Modify').' '."\n";
}
+ // Clone
+ if ($user->rights->mymodule->write)
+ {
+ print '';
+ }
+
/*
- if ($user->rights->mymodule->create)
+ if ($user->rights->mymodule->write)
{
if ($object->status == 1)
{
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index b6e2b351494..0e43aedc4e7 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -369,7 +369,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter = '';
diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php
index d7b91abe246..3c0fc4d2b2f 100644
--- a/htdocs/product/canvas/product/actions_card_product.class.php
+++ b/htdocs/product/canvas/product/actions_card_product.class.php
@@ -101,7 +101,7 @@ class ActionsCardProduct
$this->tpl['ref'] = $this->ref;
// Label
- $this->tpl['label'] = $this->libelle;
+ $this->tpl['label'] = $this->label;
// Description
$this->tpl['description'] = nl2br($this->description);
diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php
index e763605f701..bc4b5409688 100644
--- a/htdocs/product/canvas/product/tpl/card_create.tpl.php
+++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php
@@ -55,7 +55,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
trans("Label"); ?>
-
+
diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php
index c64c5dbe1e4..6c13bddb6a1 100644
--- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php
+++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php
@@ -55,7 +55,7 @@ dol_htmloutput_errors($object->error,$object->errors);
trans("Label"); ?>
-
+
diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php
index ba43898724e..af227e54b0b 100644
--- a/htdocs/product/canvas/service/actions_card_service.class.php
+++ b/htdocs/product/canvas/service/actions_card_service.class.php
@@ -100,7 +100,7 @@ class ActionsCardService
$this->tpl['ref'] = $this->ref;
// Label
- $this->tpl['label'] = $this->libelle;
+ $this->tpl['label'] = $this->label;
// Description
$this->tpl['description'] = nl2br($this->description);
diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php
index 46db54d63b8..b9dc10fd5dc 100644
--- a/htdocs/product/canvas/service/tpl/card_create.tpl.php
+++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php
@@ -52,7 +52,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
trans("Label"); ?>
-
+
diff --git a/htdocs/product/canvas/service/tpl/card_edit.tpl.php b/htdocs/product/canvas/service/tpl/card_edit.tpl.php
index 06d1b3ff612..6fc3bf3273a 100644
--- a/htdocs/product/canvas/service/tpl/card_edit.tpl.php
+++ b/htdocs/product/canvas/service/tpl/card_edit.tpl.php
@@ -52,7 +52,7 @@ dol_htmloutput_errors($object->error,$object->errors);
trans("Label"); ?>
-
+
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 03cfbc7f841..39a5697ad72 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -289,8 +289,8 @@ if (empty($reshook))
$object->url = GETPOST('url');
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private','none'));
$object->note = $object->note_private; // deprecated
- $object->customcode = GETPOST('customcode');
- $object->country_id = GETPOST('country_id');
+ $object->customcode = GETPOST('customcode','alpha');
+ $object->country_id = GETPOST('country_id','int');
$object->duration_value = $duration_value;
$object->duration_unit = $duration_unit;
$object->fk_default_warehouse = GETPOST('fk_default_warehouse');
@@ -307,13 +307,13 @@ if (empty($reshook))
$object->surface_units = GETPOST('surface_units');
$object->volume = GETPOST('volume');
$object->volume_units = GETPOST('volume_units');
- $object->finished = GETPOST('finished');
- $object->fk_unit = GETPOST('units');
+ $object->finished = GETPOST('finished','alpha');
+ $object->fk_unit = GETPOST('units','alpha');
- $accountancy_code_sell = GETPOST('accountancy_code_sell');
- $accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra');
- $accountancy_code_sell_export = GETPOST('accountancy_code_sell_export');
- $accountancy_code_buy = GETPOST('accountancy_code_buy');
+ $accountancy_code_sell = GETPOST('accountancy_code_sell','alpha');
+ $accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra','alpha');
+ $accountancy_code_sell_export = GETPOST('accountancy_code_sell_export','alpha');
+ $accountancy_code_buy = GETPOST('accountancy_code_buy','alpha');
if ($accountancy_code_sell <= 0) { $object->accountancy_code_sell = ''; } else { $object->accountancy_code_sell = $accountancy_code_sell; }
if ($accountancy_code_sell_intra <= 0) { $object->accountancy_code_sell_intra = ''; } else { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; }
@@ -386,11 +386,11 @@ if (empty($reshook))
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private','none'));
$object->note = $object->note_private;
}
- $object->customcode = GETPOST('customcode');
- $object->country_id = GETPOST('country_id');
- $object->status = GETPOST('statut');
- $object->status_buy = GETPOST('statut_buy');
- $object->status_batch = GETPOST('status_batch');
+ $object->customcode = GETPOST('customcode','alpha');
+ $object->country_id = GETPOST('country_id','int');
+ $object->status = GETPOST('statut','int');
+ $object->status_buy = GETPOST('statut_buy','int');
+ $object->status_batch = GETPOST('status_batch','aZ09');
// removed from update view so GETPOST always empty
$object->fk_default_warehouse = GETPOST('fk_default_warehouse');
/*
@@ -412,7 +412,7 @@ if (empty($reshook))
$object->surface_units = GETPOST('surface_units');
$object->volume = GETPOST('volume');
$object->volume_units = GETPOST('volume_units');
- $object->finished = GETPOST('finished');
+ $object->finished = GETPOST('finished','alpha');
$units = GETPOST('units', 'int');
@@ -439,10 +439,10 @@ if (empty($reshook))
$object->barcode_type_coder = $stdobject->barcode_type_coder;
$object->barcode_type_label = $stdobject->barcode_type_label;
- $accountancy_code_sell = GETPOST('accountancy_code_sell');
- $accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra');
- $accountancy_code_sell_export = GETPOST('accountancy_code_sell_export');
- $accountancy_code_buy = GETPOST('accountancy_code_buy');
+ $accountancy_code_sell = GETPOST('accountancy_code_sell','alpha');
+ $accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra','alpha');
+ $accountancy_code_sell_export = GETPOST('accountancy_code_sell_export','alpha');
+ $accountancy_code_buy = GETPOST('accountancy_code_buy','alpha');
if ($accountancy_code_sell <= 0) { $object->accountancy_code_sell = ''; } else { $object->accountancy_code_sell = $accountancy_code_sell; }
if ($accountancy_code_sell_intra <= 0) { $object->accountancy_code_sell_intra = ''; } else { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; }
@@ -1033,7 +1033,8 @@ else
if ($type == 1)
{
print ' ' . $langs->trans("Duration") . ' ';
- print ' '.$langs->trans("Hour").' ';
+ print ' '.$langs->trans("Minute").' ';
+ print ' '.$langs->trans("Hour").' ';
print ' '.$langs->trans("Day").' ';
print ' '.$langs->trans("Week").' ';
print ' '.$langs->trans("Month").' ';
@@ -1094,7 +1095,7 @@ else
}
// Other attributes
- $parameters=array('cols' => 3);
+ $parameters=array('colspan' => 3);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
@@ -1401,6 +1402,8 @@ else
// Duration
print ''.$langs->trans("Duration").' ';
print ' ';
+ print ' duration_unit=='i'?' checked':'').'>'.$langs->trans("Minute");
+ print ' ';
print ' duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour");
print ' ';
print ' duration_unit=='d'?' checked':'').'>'.$langs->trans("Day");
@@ -1807,11 +1810,11 @@ else
print ''.$langs->trans("Duration").' '.$object->duration_value.' ';
if ($object->duration_value > 1)
{
- $dur=array("h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
+ $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
else if ($object->duration_value > 0)
{
- $dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
+ $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
}
print (! empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." ";
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index ae2d3a4e8b1..7d7cbf7c282 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -275,14 +275,10 @@ class Product extends CommonObject
public $fk_price_expression;
- /**
- * @deprecated
- * @see fourn_pu
- */
- public $buyprice;
+ /* To store supplier price found */
public $fourn_pu;
-
public $fourn_price_base_type;
+ public $fourn_socid;
/**
* @deprecated
@@ -1544,6 +1540,7 @@ class Product extends CommonObject
$this->buyprice = $obj->price; // deprecated
$this->fourn_pu = $obj->price / $obj->quantity; // Unit price of product of supplier
$this->fourn_price_base_type = 'HT'; // Price base type
+ $this->fourn_socid = $obj->fk_soc; // Company that offer this price
$this->ref_fourn = $obj->ref_fourn; // deprecated
$this->ref_supplier = $obj->ref_fourn; // Ref supplier
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
@@ -1599,6 +1596,7 @@ class Product extends CommonObject
$this->fourn_qty = $obj->quantity; // min quantity for price for a virtual supplier
$this->fourn_pu = $obj->price / $obj->quantity; // Unit price of product for a virtual supplier
$this->fourn_price_base_type = 'HT'; // Price base type for a virtual supplier
+ $this->fourn_socid = $obj->fk_soc; // Company that offer this price
$this->ref_fourn = $obj->ref_supplier; // deprecated
$this->ref_supplier = $obj->ref_supplier; // Ref supplier
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 2167f15a7e5..a1cd63eea12 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville
* Copyright (C) 2004-2017 Laurent Destailleur
* Copyright (C) 2005 Eric Seigne
- * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2005-2018 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2011-2014 Juanjo Menent
* Copyright (C) 2015 Raphaël Doursenaud
@@ -342,6 +342,7 @@ if ($id > 0 || ! empty($ref))
$class='pair';
+ $totalsell=0;
if (count($prods_arbo))
{
foreach($prods_arbo as $value)
@@ -369,11 +370,16 @@ if ($id > 0 || ! empty($ref))
}
print ' ';
- $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) - $product_fourn->fourn_remise), 'MT');
+ // For avoid a non-numeric value
+ $fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0);
+ $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0);
+ $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0);
+
+ $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT');
$total+=$totalline;
print '';
- print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));
+ print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice,'','',0,0,-1,$conf->currency));
print ' ';
// Best selling price
@@ -382,10 +388,15 @@ if ($id > 0 || ! empty($ref))
{
$pricesell='Variable';
}
- $totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
- $totalsell+=$totallinesell;
+ else
+ {
+ $totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
+ $totalsell+=$totallinesell;
+ }
print '';
- print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($pricesell,'','',0,0,-1,$conf->currency));
+ print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : ''));
+ if (is_numeric($pricesell)) print price($pricesell,'','',0,0,-1,$conf->currency);
+ else print $langs->trans($pricesell);
print ' ';
// Stock
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 9ea0176a553..9f11813fdee 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -302,10 +302,12 @@ if ($result)
print '';
print '
';
- $colnb=5;
+ $colnb=4;
if (empty($conf->global->PRODUIT_MULTIPRICES)) $colnb++;
- print ''.$transRecordedType.' ';
+ print ''.$transRecordedType.' ';
+ print ''.$langs->trans("FullList").'';
+ print ' ';
while ($i < $num)
{
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index ee914971857..8c768c67f0b 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -33,6 +33,7 @@ $langs->loadLangs(array("stocks","other"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 3a483291a75..74422cc2601 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -333,7 +333,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter = '';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index de4051a933c..d1ea3d08a4c 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -242,751 +242,743 @@ if (empty($reshook))
$htmlother=new FormOther($db);
-if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
-{
- $objcanvas->assign_values($action); // This must contains code to load data (must call LoadListDatas($limit, $offset, $sortfield, $sortorder))
- $objcanvas->display_canvas($action); // This is code to show template
-}
-else
-{
- $title=$langs->trans("ProductsAndServices");
+$title=$langs->trans("ProductsAndServices");
- if ($search_type != '' && $search_type != '-1')
+if ($search_type != '' && $search_type != '-1')
+{
+ if ($search_type == 1)
{
- if ($search_type == 1)
- {
- $texte = $langs->trans("Services");
- }
- else
- {
- $texte = $langs->trans("Products");
- }
+ $texte = $langs->trans("Services");
}
else
{
- $texte = $langs->trans("ProductsAndServices");
+ $texte = $langs->trans("Products");
}
+}
+else
+{
+ $texte = $langs->trans("ProductsAndServices");
+}
- $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
- $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
- $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,';
- $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,';
- $sql.= ' MIN(pfp.unitprice) as minsellprice';
- if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) {
- $sql .= ', pac.rowid prod_comb_id';
- }
- // Add fields from extrafields
- if (! empty($extrafields->attributes[$object->table_element]['label'])) {
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
- }
- // Add fields from hooks
- $parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
- $sql.=$hookmanager->resPrint;
- $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
- if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
- if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
- // multilang
- if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'";
- if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) {
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
- }
+$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
+$sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
+$sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,';
+$sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,';
+$sql.= ' MIN(pfp.unitprice) as minsellprice';
+if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) {
+ $sql .= ', pac.rowid prod_comb_id';
+}
+// Add fields from extrafields
+if (! empty($extrafields->attributes[$object->table_element]['label'])) {
+ foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
+}
+// Add fields from hooks
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
+$sql.=$hookmanager->resPrint;
+$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
+if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
+if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
+// multilang
+if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'";
+if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) {
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
+}
- $sql.= ' WHERE p.entity IN ('.getEntity('product').')';
- if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
- // if the type is not 1, we show all products (type = 0,2,3)
- if (dol_strlen($search_type) && $search_type != '-1')
+$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
+if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
+// if the type is not 1, we show all products (type = 0,2,3)
+if (dol_strlen($search_type) && $search_type != '-1')
+{
+ if ($search_type == 1) $sql.= " AND p.fk_product_type = 1";
+ else $sql.= " AND p.fk_product_type <> 1";
+}
+if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
+if ($search_label) $sql .= natural_search('p.label', $search_label);
+if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode);
+if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell);
+if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy);
+if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
+if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
+if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
+if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ);
+if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL";
+if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
+if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch);
+if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell);
+if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy);
+if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) $sql .= " AND pac.rowid IS NULL";
+// Add where from extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
+// Add where from hooks
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
+$sql.=$hookmanager->resPrint;
+$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
+$sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
+$sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp';
+if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) $sql .= ', pac.rowid';
+// Add fields from extrafields
+if (! empty($extrafields->attributes[$object->table_element]['label'])) {
+ foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : '');
+}
+// Add fields from hooks
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook
+$sql.=$hookmanager->resPrint;
+//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
+$sql.= $db->order($sortfield,$sortorder);
+
+$nbtotalofrecords = '';
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+{
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
- if ($search_type == 1) $sql.= " AND p.fk_product_type = 1";
- else $sql.= " AND p.fk_product_type <> 1";
+ $page = 0;
+ $offset = 0;
}
- if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
- if ($search_label) $sql .= natural_search('p.label', $search_label);
- if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode);
- if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell);
- if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy);
- if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
- if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
- if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
- if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ);
- if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL";
- if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
- if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch);
- if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell);
- if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy);
- if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) $sql .= " AND pac.rowid IS NULL";
- // Add where from extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
- // Add where from hooks
- $parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
- $sql.=$hookmanager->resPrint;
- $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
- $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
- $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp';
- if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) $sql .= ', pac.rowid';
- // Add fields from extrafields
- if (! empty($extrafields->attributes[$object->table_element]['label'])) {
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : '');
- }
- // Add fields from hooks
- $parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook
- $sql.=$hookmanager->resPrint;
- //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
- $sql.= $db->order($sortfield,$sortorder);
+}
- $nbtotalofrecords = '';
- if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+$sql.= $db->plimit($limit + 1, $offset);
+
+$resql = $db->query($sql);
+if ($resql)
+{
+ $num = $db->num_rows($resql);
+
+ $arrayofselected=is_array($toselect)?$toselect:array();
+
+ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
{
- $result = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($result);
- if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ $obj = $db->fetch_object($resql);
+ $id = $obj->rowid;
+ header("Location: ".DOL_URL_ROOT.'/product/card.php?id='.$id);
+ exit;
+ }
+
+ $helpurl='';
+ if ($search_type != '')
+ {
+ if ($search_type == 0)
{
- $page = 0;
- $offset = 0;
+ $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
+ }
+ else if ($search_type == 1)
+ {
+ $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
}
- $sql.= $db->plimit($limit + 1, $offset);
+ llxHeader('',$title,$helpurl,'');
- $resql = $db->query($sql);
- if ($resql)
+ // Displays product removal confirmation
+ if (GETPOST('delprod')) {
+ setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs');
+ }
+
+ $param='';
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
+ if ($sall) $param.="&sall=".urlencode($sall);
+ if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ);
+ if ($search_ref) $param="&search_ref=".urlencode($search_ref);
+ if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier);
+ if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):"");
+ if ($search_label) $param.="&search_label=".urlencode($search_label);
+ if ($search_tosell != '') $param.="&search_tosell=".urlencode($search_tosell);
+ if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy);
+ if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:"");
+ if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):"");
+ if ($type != '') $param.='&type='.urlencode($type);
+ if ($search_type != '') $param.='&search_type='.urlencode($search_type);
+ if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
+ if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier);
+ if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell);
+ if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy);
+ // Add $param from extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
+
+ // List of mass actions available
+ $arrayofmassactions = array(
+ //'presend'=>$langs->trans("SendByMail"),
+ //'builddoc'=>$langs->trans("PDFMerge"),
+ );
+ if ($user->rights->produit->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
+ if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
+ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
+
+ $newcardbutton='';
+ $rightskey='produit';
+ if($type == Product::TYPE_SERVICE) $rightskey='service';
+ if($user->rights->{$rightskey}->creer)
{
- $num = $db->num_rows($resql);
+ $label='NewProduct';
+ if($type == Product::TYPE_SERVICE) $label='NewService';
+ $newcardbutton=''.$langs->trans($label).' ';
+ $newcardbutton.= ' ';
+ $newcardbutton.= ' ';
+ }
- $arrayofselected=is_array($toselect)?$toselect:array();
+ print '';
+}
+else
+{
+ dol_print_error($db);
}
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index 4bade1db2cf..959f2377d9d 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur
- * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2005-2018 Regis Houssin
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2015 Raphaël Doursenaud
*
@@ -57,6 +57,7 @@ $page = GETPOST("page",'int');
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
+if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page ;
// Load sale and categ filters
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index 7b82408cfc0..b4d14ef1231 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur
- * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2005-2018 Regis Houssin
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2016 Ferran Marcet
@@ -61,6 +61,7 @@ $page = GETPOST("page",'int');
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
+if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page ;
// Load sale and categ filters
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index 6ec624bb281..aba8655fae1 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -151,7 +151,7 @@ if ($result)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter='';
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 02498dbe8ff..410396a152b 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -735,7 +735,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter='';
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index d867848345d..7c18dc11281 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -82,6 +82,9 @@ if ($id > 0 || ! empty($ref))
$result = $object->fetch($id, $ref);
}
+
+if(empty($id) && !empty($object->id)) $id = $object->id;
+
$modulepart='product';
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
@@ -127,7 +130,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
if($maj_ok) {
$pse = new ProductStockEntrepot($db);
- if($pse->fetch('', GETPOST('id'), GETPOST('fk_entrepot')) > 0) {
+ if($pse->fetch('', $id, GETPOST('fk_entrepot')) > 0) {
// Update
$pse->seuil_stock_alerte = $seuil_stock_alerte;
@@ -138,7 +141,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
// Create
$pse->fk_entrepot = GETPOST('fk_entrepot');
- $pse->fk_product = GETPOST('id');
+ $pse->fk_product = $id;
$pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
$pse->desiredstock = GETPOST('desiredstock');
if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated'));
@@ -147,7 +150,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
}
- header("Location: ".$_SERVER["PHP_SELF"]."?id=".GETPOST('id'));
+ header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
@@ -948,7 +951,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
if (!empty($user->rights->produit->creer)){
print '';
print ' ';
- print ' ';
+ print ' ';
}
print '';
if (!empty($user->rights->produit->creer)){
@@ -965,7 +968,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
}
$pse = new ProductStockEntrepot($db);
- $lines = $pse->fetchAll(GETPOST('id'));
+ $lines = $pse->fetchAll($id);
if (!empty($lines))
{
@@ -978,7 +981,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
print ''.$line['seuil_stock_alerte'].' ';
print ''.$line['desiredstock'].' ';
if (!empty($user->rights->produit->creer)){
- print ''.img_delete().' ';
+ print ''.img_delete().' ';
}
print '';
}
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 5ea3df84839..7c15b3fa7c5 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -302,7 +302,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
/*$moreforfilter = '';
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index e8900d51bb4..c96e1c0f025 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2005-2018 Regis Houssin
* Copyright (C) 2007 Rodolphe Quiedeville
* Copyright (C) 2010-2012 Destailleur Laurent
* Copyright (C) 2014 Henry Florian
@@ -205,7 +205,7 @@ $linkback = 'rights->societe->client->voir && ! $user->socid)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->socid)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql .= ", ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= $this->buildWhere();
+ // For external user, no check is done on company permission because readability is managed by public status of project and assignement.
+ //if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
$sql .= " AND t.fk_opp_status = cls.rowid";
$sql .= " AND t.fk_statut <> 0"; // We want historic also, so all projects not draft
$sql .= " GROUP BY t.fk_opp_status, cls.code, cls.label";
@@ -78,22 +83,22 @@ class ProjectStats extends Stats
$row = $this->db->fetch_row($resql);
if ($i < $limit || $num == $limit)
{
- $label = (($langs->trans("OppStatus".$row[2]) != "OppStatus".$row[2]) ? $langs->trans("OppStatus".$row[2]) : $row[2]);
+ $label = (($langs->trans("OppStatus".$row[2]) != "OppStatus".$row[2]) ? $langs->trans("OppStatus".$row[2]) : $row[2]);
$result[$i] = array(
- $label. ' (' . price(price2num($row[0], 'MT'), 1, $langs, 1, -1, -1, $conf->currency) . ')',
- $row[0]
+ $label. ' (' . price(price2num($row[0], 'MT'), 1, $langs, 1, -1, -1, $conf->currency) . ')',
+ $row[0]
);
}
else
$other += $row[1];
- $i++;
+ $i++;
}
if ($num > $limit)
$result[$i] = array (
- $langs->transnoentitiesnoconv("Other"),
- $other
+ $langs->transnoentitiesnoconv("Other"),
+ $other
);
- $this->db->free($resql);
+ $this->db->free($resql);
} else {
$this->error = "Error " . $this->db->lasterror();
dol_syslog(get_class($this) . '::' . __METHOD__ . ' ' . $this->error, LOG_ERR);
@@ -119,9 +124,14 @@ class ProjectStats extends Stats
$sql = "SELECT date_format(t.datec,'%Y') as year, COUNT(t.rowid) as nb, SUM(t.opp_amount) as total, AVG(t.opp_amount) as avg,";
$sql.= " SUM(t.opp_amount * ".$this->db->ifsql("t.opp_percent IS NULL".($wonlostfilter?" OR cls.code IN ('WON','LOST')":""), '0', 't.opp_percent')." / 100) as weighted";
$sql.= " FROM " . MAIN_DB_PREFIX . "projet as t LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON cls.rowid = t.fk_opp_status";
- if (! $user->rights->societe->client->voir && ! $user->soc_id)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->soc_id)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql.= $this->buildWhere();
+ // For external user, no check is done on company permission because readability is managed by public status of project and assignement.
+ //if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
$sql.= " GROUP BY year";
$sql.= $this->db->order('year', 'DESC');
@@ -136,13 +146,21 @@ class ProjectStats extends Stats
*/
public function buildWhere()
{
+ global $user;
+
$sqlwhere_str = '';
$sqlwhere = array();
+ // Get list of project id allowed to user (in a string list separated by coma)
+ $object = new Project($this->db);
+ $projectsListId='';
+ if (! $user->rights->projet->all->lire) $projectsListId = $object->getProjectsAuthorizedForUser($user,0,1,$user->socid);
+
$sqlwhere[] = ' t.entity IN (' . getEntity('project') . ')';
if (! empty($this->userid))
$sqlwhere[] = ' t.fk_user_resp=' . $this->userid;
+
// Forced filter on socid is similar to forced filter on project. TODO Use project assignement to allow to not use filter on project
if (! empty($this->socid))
$sqlwhere[] = ' t.fk_soc=' . $this->socid;
@@ -154,6 +172,8 @@ class ProjectStats extends Stats
if (! empty($this->status))
$sqlwhere[] = " t.fk_opp_status IN (" . $this->status . ")";
+ if (! $user->rights->projet->all->lire) $sqlwhere[] = " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
+
if (count($sqlwhere) > 0) {
$sqlwhere_str = ' WHERE ' . implode(' AND ', $sqlwhere);
}
@@ -165,7 +185,7 @@ class ProjectStats extends Stats
* Return Project number by month for a year
*
* @param int $year Year to scan
- * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
+ * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of values
*/
function getNbByMonth($year, $format=0)
@@ -176,8 +196,9 @@ class ProjectStats extends Stats
$sql = "SELECT date_format(t.datec,'%m') as dm, COUNT(*) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t";
- if (! $user->rights->societe->client->voir && ! $user->soc_id)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->soc_id)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql .= $this->buildWhere();
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
@@ -193,7 +214,7 @@ class ProjectStats extends Stats
* Return the Project amount by month for a year
*
* @param int $year Year to scan
- * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
+ * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array with amount by month
*/
function getAmountByMonth($year, $format=0)
@@ -204,8 +225,9 @@ class ProjectStats extends Stats
$sql = "SELECT date_format(t.datec,'%m') as dm, SUM(t.opp_amount)";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t";
- if (! $user->rights->societe->client->voir && ! $user->soc_id)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->soc_id)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql .= $this->buildWhere();
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
@@ -230,45 +252,45 @@ class ProjectStats extends Stats
{
global $conf,$user,$langs;
- if ($startyear > $endyear) return -1;
+ if ($startyear > $endyear) return -1;
- $datay=array();
+ $datay=array();
- // Search into cache
- if (! empty($cachedelay))
- {
- include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
- }
+ // Search into cache
+ if (! empty($cachedelay))
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
+ }
- $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache';
- $newmask='0644';
+ $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache';
+ $newmask='0644';
- $nowgmt = dol_now();
+ $nowgmt = dol_now();
- $foundintocache=0;
- if ($cachedelay > 0)
- {
- $filedate=dol_filemtime($newpathofdestfile);
- if ($filedate >= ($nowgmt - $cachedelay))
- {
- $foundintocache=1;
+ $foundintocache=0;
+ if ($cachedelay > 0)
+ {
+ $filedate=dol_filemtime($newpathofdestfile);
+ if ($filedate >= ($nowgmt - $cachedelay))
+ {
+ $foundintocache=1;
- $this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
- }
- else
- {
- dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it.");
- }
- }
+ $this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
+ }
+ else
+ {
+ dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it.");
+ }
+ }
- // Load file into $data
- if ($foundintocache) // Cache file found and is not too old
- {
- dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate.".");
- $data = json_decode(file_get_contents($newpathofdestfile), true);
- }
- else
+ // Load file into $data
+ if ($foundintocache) // Cache file found and is not too old
+ {
+ dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate.".");
+ $data = json_decode(file_get_contents($newpathofdestfile), true);
+ }
+ else
{
$year=$startyear;
while($year <= $endyear)
@@ -327,8 +349,9 @@ class ProjectStats extends Stats
$sql = "SELECT date_format(t.datec,'%m') as dm, SUM(t.opp_amount * ".$this->db->ifsql("t.opp_percent IS NULL".($wonlostfilter?" OR cls.code IN ('WON','LOST')":""), '0', 't.opp_percent')." / 100)";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t LEFT JOIN ".MAIN_DB_PREFIX.'c_lead_status as cls ON t.fk_opp_status = cls.rowid';
- if (! $user->rights->societe->client->voir && ! $user->soc_id)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->soc_id)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql .= $this->buildWhere();
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
@@ -425,7 +448,7 @@ class ProjectStats extends Stats
* Return the Project transformation rate by month for a year
*
* @param int $year Year to scan
- * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
+ * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array with amount by month
*/
function getTransformRateByMonth($year, $format=0)
@@ -436,8 +459,9 @@ class ProjectStats extends Stats
$sql = "SELECT date_format(t.datec,'%m') as dm, count(t.opp_amount)";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t";
- if (! $user->rights->societe->client->voir && ! $user->soc_id)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->soc_id)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql .= $this->buildWhere();
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
@@ -448,8 +472,9 @@ class ProjectStats extends Stats
$sql = "SELECT date_format(t.datec,'%m') as dm, count(t.opp_amount)";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t";
- if (! $user->rights->societe->client->voir && ! $user->soc_id)
- $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
+ // No check is done on company permission because readability is managed by public status of project and assignement.
+ //if (! $user->rights->societe->client->voir && ! $user->soc_id)
+ // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id;
$sql .= $this->buildWhere();
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 4177895bc7c..46f04b08932 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -687,13 +687,13 @@ class Task extends CommonObject
* @param int $socid Third party id
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
* @param string $filteronproj Filter on project ref or label
- * @param string $filteronprojstatus Filter on project status
+ * @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only)
* @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...')
* @param string $filteronprojuser Filter on user that is a contact of project
* @param string $filterontaskuser Filter on user assigned to task
* @return array Array of tasks
*/
- function getTasksArray($usert=null, $userp=null, $projectid=0, $socid=0, $mode=0, $filteronproj='', $filteronprojstatus=-1, $morewherefilter='',$filteronprojuser=0,$filterontaskuser=0)
+ function getTasksArray($usert=null, $userp=null, $projectid=0, $socid=0, $mode=0, $filteronproj='', $filteronprojstatus='-1', $morewherefilter='',$filteronprojuser=0,$filterontaskuser=0)
{
global $conf;
@@ -769,7 +769,7 @@ class Task extends CommonObject
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
if ($projectid) $sql.= " AND p.rowid in (".$projectid.")";
if ($filteronproj) $sql.= natural_search(array("p.ref", "p.title"), $filteronproj);
- if ($filteronprojstatus > -1) $sql.= " AND p.fk_statut IN (".$filteronprojstatus.")";
+ if ($filteronprojstatus && $filteronprojstatus != '-1') $sql.= " AND p.fk_statut IN (".$filteronprojstatus.")";
if ($morewherefilter) $sql.=$morewherefilter;
$sql.= " ORDER BY p.ref, t.rang, t.dateo";
@@ -1828,10 +1828,10 @@ class Task extends CommonObject
// For external user, no check is done on company because readability is managed by public status of project and assignement.
//$socid=$user->societe_id;
-
+
$projectstatic = new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1,$socid);
-
+
// List of tasks (does not care about permissions. Filtering will be done later)
$sql = "SELECT p.rowid as projectid, p.fk_statut as projectstatus,";
$sql.= " t.rowid as taskid, t.progress as progress, t.fk_statut as status,";
@@ -1850,7 +1850,7 @@ class Task extends CommonObject
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
// if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
-
+
//print $sql;
$resql=$this->db->query($sql);
if ($resql)
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 990e7bb3dde..779091d069f 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -297,7 +297,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = c
// We'll need this table joined to the select in order to filter by categ
if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ
// We'll need this table joined to the select in order to filter by sale
-// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
+// No check is done on company permission because readability is managed by public status of project and assignement.
//if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
if ($search_sale > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
if ($search_project_user > 0)
@@ -307,7 +307,7 @@ if ($search_project_user > 0)
$sql.= " WHERE p.entity IN (".getEntity('project').')';
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
// No need to check if company is external user, as filtering of projects must be done by getProjectsAuthorizedForUser
-if ($socid > 0) $sql.= " AND (p.fk_soc = ".$socid.")";
+if ($socid > 0) $sql.= " AND (p.fk_soc = ".$socid.")"; // This filter if when we use a hard coded filter on company on url (not related to filter for external users)
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
@@ -355,8 +355,10 @@ if ($search_opp_status)
if ($search_opp_status == 'none') $sql .= " AND p.fk_opp_status IS NULL";
}
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
-if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale;
// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
+//if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
+if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale;
+// No check is done on company permission because readability is managed by public status of project and assignement.
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
if ($search_project_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user;
if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
@@ -485,7 +487,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter='';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 4adcb95d207..5af0d6da9e5 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -462,7 +462,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// List of projects
print ''.$langs->trans("ChildOfProjectTask").' ';
- print $formother->selectProjectTasks(GETPOST('task_parent'),$projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1);
+ print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
print ' ';
print ''.$langs->trans("AffectedTo").' ';
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 02549454e8e..14703f6d3eb 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -437,7 +437,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall).'
';
}
$morehtmlfilter = '';
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index af30cf2ff57..a189781c8c1 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -208,6 +208,8 @@ if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stri
$validpaymentmethod['stripe']='valid';
}
+// TODO Replace previous set of $validpaymentmethod with this line:
+//$validpaymentmethod = getValidOnlinePaymentMethods($paymentmethod);
// Check security token
@@ -444,10 +446,12 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
$thirdparty = new Societe($db);
$thirdparty->fetch($thirdparty_id);
+ // Create Stripe customer
include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
$stripe = new Stripe($db);
$customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1);
+ // Create Stripe card from Token
$card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata));
if (empty($card))
@@ -1559,7 +1563,7 @@ if (preg_match('/^dopayment/',$action))
?>
- // Create a Stripe client
+ // Create a Stripe client.
var stripe = Stripe('');
// Create an instance of Elements
@@ -1605,43 +1609,40 @@ if (preg_match('/^dopayment/',$action))
console.log(form);
form.addEventListener('submit', function(event) {
event.preventDefault();
-
-
global->STRIPE_USE_3DSECURE)) // Ask credit card directly, no 3DS test
{
?>
- /* Use token */
- stripe.createToken(card).then(function(result) {
- if (result.error) {
- // Inform the user if there was an error
- var errorElement = document.getElementById('card-errors');
- errorElement.textContent = result.error.message;
- } else {
- // Send the token to your server
- stripeTokenHandler(result.token);
- }
- });
+ /* Use token */
+ stripe.createToken(card).then(function(result) {
+ if (result.error) {
+ // Inform the user if there was an error
+ var errorElement = document.getElementById('card-errors');
+ errorElement.textContent = result.error.message;
+ } else {
+ // Send the token to your server
+ stripeTokenHandler(result.token);
+ }
+ });
- /* Use 3DS source */
- stripe.createSource(card).then(function(result) {
- if (result.error) {
- // Inform the user if there was an error
- var errorElement = document.getElementById('card-errors');
- errorElement.textContent = result.error.message;
- } else {
- // Send the source to your server
- stripeSourceHandler(result.source);
- }
- });
+ /* Use 3DS source */
+ stripe.createSource(card).then(function(result) {
+ if (result.error) {
+ // Inform the user if there was an error
+ var errorElement = document.getElementById('card-errors');
+ errorElement.textContent = result.error.message;
+ } else {
+ // Send the source to your server
+ stripeSourceHandler(result.source);
+ }
+ });
-
});
diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php
index 349e19b0c26..d62c8a445d6 100644
--- a/htdocs/societe/ajax/company.php
+++ b/htdocs/societe/ajax/company.php
@@ -87,7 +87,7 @@ else
if (! $searchkey) return;
- $form = new Form($db);
+ if (! is_object($form)) $form = new Form($db);
$arrayresult=$form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson);
$db->close();
diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php
index 508fe892ebe..b99257da275 100644
--- a/htdocs/societe/class/api_contacts.class.php
+++ b/htdocs/societe/class/api_contacts.class.php
@@ -122,6 +122,7 @@ class Contacts extends DolibarrApi
$sql = "SELECT t.rowid";
$sql.= " FROM " . MAIN_DB_PREFIX . "socpeople as t";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX . "socpeople_extrafields as te ON te.fk_object = t.rowid";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) {
// We need this table joined to the select in order to filter by sale
$sql.= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php
index 73c782ddf7c..2b355b56eb7 100644
--- a/htdocs/societe/class/api_thirdparties.class.php
+++ b/htdocs/societe/class/api_thirdparties.class.php
@@ -129,6 +129,7 @@ class Thirdparties extends DolibarrApi
$sql = "SELECT t.rowid";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as t";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX . "societe_extrafields as te ON te.fk_object = t.rowid";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 56cd37dc7d8..03bdedd3d4f 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -909,6 +909,8 @@ class Societe extends CommonObject
$sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null");
$sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
+ $sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
+
$sql .= ",note_private = ".(! empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
$sql .= ",note_public = ".(! empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index ea1925afc08..1bed6e635a0 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -296,7 +296,7 @@ if ($result)
print ' '.$transRecordedType.' ';
print ' ';
- print ''.$langs->trans('Status').' ';
+ print ''.$langs->trans("FullList").' ';
print ' '."\n";
while ($i < $num)
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index ec31cefdd52..ac08d1251e2 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -91,9 +91,9 @@ $search_level_to = GETPOST("search_level_to","alpha");
$search_stcomm=GETPOST('search_stcomm','int');
$search_import_key = GETPOST("search_import_key","alpha");
-$type=GETPOST('type');
+$type=GETPOST('type','alpha');
$optioncss=GETPOST('optioncss','alpha');
-$mode=GETPOST("mode");
+$mode=GETPOST("mode",'');
$diroutputmassaction=$conf->societe->dir_output . '/temp/massgeneration/'.$user->id;
@@ -108,9 +108,9 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if ($type == 'c') { $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; }
-if ($type == 'p') { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
-if ($type == 'f') { $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; }
+if ($type == 'c') { if (empty($contextpage) || $contextpage == 'thirdpartylist') $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; }
+if ($type == 'p') { if (empty($contextpage) || $contextpage == 'thirdpartylist') $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
+if ($type == 'f') { if (empty($contextpage) || $contextpage == 'thirdpartylist') $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; }
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Societe($db);
@@ -533,20 +533,20 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url);
$param='';
-if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
-if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_all != '') $param = "&sall=".urlencode($search_all);
if ($sall != '') $param.= "&sall=".urlencode($sall);
-if ($search_categ_cus > 0) $param.='&search_categ_cus='.urlencode($search_categ_cus);
-if ($search_categ_sup > 0) $param.='&search_categ_sup='.urlencode($search_categ_sup);
-if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
+if ($search_categ_cus > 0) $param.= '&search_categ_cus='.urlencode($search_categ_cus);
+if ($search_categ_sup > 0) $param.= '&search_categ_sup='.urlencode($search_categ_sup);
+if ($search_sale > 0) $param.= '&search_sale='.urlencode($search_sale);
if ($search_id > 0) $param.= "&search_id=".urlencode($search_id);
if ($search_nom != '') $param.= "&search_nom=".urlencode($search_nom);
if ($search_alias != '') $param.= "&search_alias=".urlencode($search_alias);
if ($search_town != '') $param.= "&search_town=".urlencode($search_town);
if ($search_zip != '') $param.= "&search_zip=".urlencode($search_zip);
if ($search_phone != '') $param.= "&search_phone=".urlencode($search_phone);
-if ($search_fax != '') $param.= "&search_fax=".urlencode($search_fax);
+if ($search_fax != '') $param.= "&search_fax=".urlencode($search_fax);
if ($search_email != '') $param.= "&search_email=".urlencode($search_email);
if ($search_url != '') $param.= "&search_url=".urlencode($search_url);
if ($search_state != '') $param.= "&search_state=".urlencode($search_state);
@@ -642,7 +642,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall).'
';
}
// Filter on categories
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 2ff40f83764..3ce1477a9c3 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -343,7 +343,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
/*$moreforfilter = '';
diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php
index 1e9eb7a5181..c61de994874 100644
--- a/htdocs/stripe/config.php
+++ b/htdocs/stripe/config.php
@@ -46,11 +46,11 @@ $stripearrayofkeysbyenv = array(
$stripearrayofkeys = array();
if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))
{
- $stripearrayofkeys = $stripearrayofkeysbyenv[0];
+ $stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test
}
else
{
- $stripearrayofkeys = $stripearrayofkeysbyenv[1];
+ $stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live
}
\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 113ef3db88c..e3e91b6c38f 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -589,21 +589,34 @@ if (empty($reshook))
$productsupplier = new ProductFournisseur($db);
$idprod=0;
- if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
+ if (GETPOST('idprodfournprice','alpha') == -1 || GETPOST('idprodfournprice','alpha') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
- if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice'), $reg))
+ if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice','alpha'), $reg))
{
$idprod=$reg[1];
$res=$productsupplier->fetch($idprod);
- // Call to init properties of $productsupplier
+ // Call to init some price properties of $productsupplier
// So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
- $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
+ if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER))
+ {
+ $fksoctosearch = 0;
+ $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist
+ if ($productsupplier->fourn_socid != $socid) // The price we found is for another supplier, so we clear supplier price
+ {
+ $productsupplier->ref_supplier = '';
+ }
+ }
+ else
+ {
+ $fksoctosearch = $object->thirdparty->id;
+ $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist
+ }
}
- elseif (GETPOST('idprodfournprice') > 0)
+ elseif (GETPOST('idprodfournprice','alpha') > 0)
{
//$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
- $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
+ $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice','alpha'), $qtytosearch);
$res=$productsupplier->fetch($idprod);
}
@@ -621,8 +634,8 @@ if (empty($reshook))
$ref_supplier = $productsupplier->ref_supplier;
- $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
- $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
+ $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice','alpha'));
+ $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice','alpha'));
if (empty($tva_tx)) $tva_npr=0;
$localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
$localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 4b012e31c2d..54672da2b75 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -12,6 +12,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014 Marcos García
* Copyright (C) 2016 Ferran Marcet
+ * Copyright (C) 2018 Nicolas ZABOURI
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -2582,9 +2583,10 @@ class SupplierProposal extends CommonObject
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
+ * @param null|array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
- public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
+ public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf, $langs;
@@ -2603,7 +2605,7 @@ class SupplierProposal extends CommonObject
$modelpath = "core/modules/supplier_proposal/doc/";
- return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 7ab88474bac..3dcf9601944 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -415,7 +415,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$i = 0;
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 3d2fa9ca7d7..79aed1eaf68 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -36,7 +36,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
// Colors
-$colorbackhmenu1='80,90,120'; // topmenu
+$colorbackhmenu1='60,70,100'; // topmenu
$colorbackvmenu1='248,248,248'; // vmenu
$colortopbordertitle1='200,200,200'; // top border of title
$colorbacktitle1='220,220,223'; // title of tables,list
@@ -201,8 +201,8 @@ $nbtopmenuentries=$menumanager->showmenu('topnb');
$minwidthtmenu=66; /* minimum width for one top menu entry */
-$heightmenu=46; /* height of top menu, part with image */
-$heightmenu2=48; /* height of top menu, part with login */
+$heightmenu=48; /* height of top menu, part with image */
+$heightmenu2=49; /* height of top menu, part with login */
$disableimages = 0;
$maxwidthloginblock = 130;
if (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; }
@@ -285,8 +285,13 @@ input.select2-input {
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
.liste_titre input[name=search_month_lim], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], .liste_titre input[name=search_month_create],
-.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end],
+.liste_titre input[name=day_date_when], .liste_titre input[name=dayvalid], .liste_titre input[name=search_orderday], .liste_titre input[name=search_deliveryday],
+.liste_titre input[name=search_sday], .liste_titre input[name=search_day], .liste_titre input[name=search_eday], .liste_titre input[name=sday], .liste_titre input[name=day], .liste_titre select[name=day],
+.liste_titre input[name=day_lim], .liste_titre input[name=day_start], .liste_titre input[name=day_end], .liste_titre input[name=day_create],
+.liste_titre input[name=search_day_lim], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end], .liste_titre input[name=search_day_create],
+.liste_titre input[name=search_day_create], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end],
+.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
.liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth]
{
margin-right: 4px;
@@ -586,6 +591,9 @@ th .button {
.soixantepercent {
width: 60%;
}
+.quatrevingtquinzepercent {
+ width: 95%;
+}
textarea.centpercent {
width: 96%;
}
@@ -689,6 +697,13 @@ div.divsearchfield {
margin-bottom: 4px;
padding-left: 2px;
}
+.divsearchfieldfilter {
+ text-overflow: clip;
+ overflow: auto;
+ white-space: nowrap;
+ padding-bottom: 5px;
+ opacity: 0.6;
+}
div.confirmmessage {
padding-top: 6px;
}
@@ -801,6 +816,10 @@ select.flat.selectlimit {
font-weight: bold;
font-size: 1.4em;
}
+.amountpaymentneutral {
+ font-weight: bold;
+ font-size: 1.4em;
+}
.savingdocmask {
margin-top: 6px;
margin-bottom: 12px;
@@ -1425,9 +1444,9 @@ div.statusrefbis {
vertical-align: text-bottom;
}
img.photoref, div.photoref {
- border: 1px solid #CCC;
- -webkit-box-shadow: 2px 2px 4px #ccc;
- box-shadow: 2px 2px 4px #ccc;
+ border: 1px solid #DDD;
+ -webkit-box-shadow: 0px 0px 6px #DDD;
+ box-shadow: 0px 0px 6px #DDD;
padding: 4px;
height: 80px;
width: 80px;
@@ -2049,6 +2068,8 @@ input.vmenusearchselectcombo[type=text] {
#menu_contenu_logo { /* padding-top: 0; */ }
.companylogo { }
.searchform { padding-top: 10px; }
+.searchform input { font-size: 16px; }
+
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-family: ; text-align: ; font-weight: bold; }
font.vmenudisabled { font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; }
@@ -2385,22 +2406,26 @@ span.butAction, span.butActionDelete {
cursor: pointer;
}
+.butAction {
+ background: rgb(230, 236, 230)
+ /* background: rgb(230, 232, 239); */
+}
.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
- margin: 0em em !important;
- padding: 0.6em em;
+ margin: 0em em !important;
+ padding: 0.6em em;
font-family: ;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
display: inline-block;
text-align: center;
cursor: pointer;
/* color: #fff; */
/* background: rgb(); */
- color: #000;
- border: 1px solid #aaa;
+ color: #444;
+ /* border: 1px solid #aaa; */
+ /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important;
@@ -2415,13 +2440,13 @@ span.butAction, span.butActionDelete {
margin: 0em 0.3em 0 0.3em !important;
padding: 0.2em em 0.3em;
font-family: ;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
display: inline-block;
- text-align: center;
+ /* text-align: center; New button are on right of screen */
cursor: pointer;
/*color: #fff !important;
background: rgb();
border: 1px solid rgb();*/
+ border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important;
@@ -2437,8 +2462,8 @@ a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-ci
}
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
- /* background: #633; */
- border: 1px solid #633;
+ background: rgb(239, 232, 230);
+ /* border: 1px solid #633; */
color: #633;
}
@@ -2454,14 +2479,17 @@ a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-ci
white-space: nowrap !important;
cursor: not-allowed !important;
- margin: 0em em;
- padding: 0.6em em;
+ margin: 0em em;
+ padding: 0.6em em;
font-family: !important;
display: inline-block;
text-align: center;
cursor: pointer;
color: #999 !important;
- border: 1px solid #bbb;
+ border: 1px solid #ccc;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
}
.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
text-decoration: none !important;
@@ -2474,7 +2502,7 @@ a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-ci
padding: 0.2em em;
font-family: !important;
display: inline-block;
- text-align: center;
+ /* text-align: center; New button are on right of screen */
cursor: pointer;
color: #999 !important;
padding-top: 0.2em;
@@ -2732,7 +2760,7 @@ div.refidpadding {
}
div.refid {
font-weight: bold;
- color: #625;
+ color: rgb();
font-size: 1.2em;
}
div.refidno {
@@ -3162,7 +3190,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
background: #f8f8f8;
border: 1px solid #eee;
- box-shadow: 1px 1px 6px #bbb;
+ box-shadow: 1px 1px 8px #ddd;
border-radius: 0px;
}
.boxstats, .boxstats130, .boxstatscontent {
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 3d24df3d6ee..a7c102d16eb 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -289,8 +289,13 @@ textarea.cke_source:focus
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
.liste_titre input[name=search_month_lim], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], .liste_titre input[name=search_month_create],
+.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end],
+.liste_titre input[name=day_date_when], .liste_titre input[name=dayvalid], .liste_titre input[name=search_orderday], .liste_titre input[name=search_deliveryday],
+.liste_titre input[name=search_sday], .liste_titre input[name=search_day], .liste_titre input[name=search_eday], .liste_titre input[name=sday], .liste_titre input[name=day], .liste_titre select[name=day],
+.liste_titre input[name=day_lim], .liste_titre input[name=day_start], .liste_titre input[name=day_end], .liste_titre input[name=day_create],
+.liste_titre input[name=search_day_lim], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end], .liste_titre input[name=search_day_create],
+.liste_titre input[name=search_day_create], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end],
.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
-.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end]
.liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth]
{
margin-right: 4px;
@@ -578,6 +583,9 @@ th .button {
.soixantepercent {
width: 60%;
}
+.quatrevingtquinzepercent {
+ width: 95%;
+}
textarea.centpercent {
width: 96%;
}
@@ -682,6 +690,13 @@ div.divsearchfield {
margin-bottom: 4px;
padding-left: 2px;
}
+.divsearchfieldfilter {
+ text-overflow: clip;
+ overflow: auto;
+ white-space: nowrap;
+ padding-bottom: 5px;
+ opacity: 0.6;
+}
div.confirmmessage {
padding-top: 6px;
}
@@ -792,6 +807,10 @@ select.flat.selectlimit {
.amountremaintopayback {
font-weight: bold;
}
+.amountpaymentneutral {
+ font-weight: bold;
+ font-size: 1.4em;
+}
.savingdocmask {
margin-top: 6px;
margin-bottom: 12px;
@@ -853,11 +872,10 @@ div.fiche>form>div.div-table-responsive {
flex: 1 1 150px;
}
.thumbstat, .thumbstat150 {
- /* flex-grow: 1; */
- /* flex-shrink: 1; */
+ flex-grow: 1;
+ flex-shrink: 1;
/* flex-basis: 140px; */
- display: inline;
- width: 100%;
+ min-width: 150px;
justify-content: flex-start;
align-self: flex-start;
}
@@ -2390,7 +2408,7 @@ span.butAction, span.butActionDelete {
padding: 0.2em em;
margin: 0em em;
line-height: 20px;
- text-align: center;
+ /* text-align: center; New button are on right of screen */
vertical-align: middle;
cursor: pointer;
/* color: #ffffff !important; */
@@ -2716,7 +2734,7 @@ div.refidpadding {
}
div.refid {
font-weight: bold;
- color: #766;
+ color: rgb();
font-size: 160%;
}
div.refidno {
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index 1f47ce11247..9207ea02860 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -80,12 +80,15 @@ $result = restrictedArea($user, 'ticket', $object->id);
$triggermodname = 'TICKETSUP_MODIFY';
$permissiontoadd = $user->rights->ticket->write;
+$actionobject = new ActionsTicket($db);
/*
* Actions
*/
+// TODO Replace actions with common includes actions_addupdatedelete.inc.php
+
if ($cancel)
{
if (! empty($backtopage))
@@ -96,8 +99,7 @@ if ($cancel)
$action='';
}
-
-$actionobject = new ActionsTicket($db);
+// Do action
$actionobject->doActions($action, $object);
// Action to update one extrafield
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index d654c763f9b..b3df986cde7 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -471,7 +471,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
print '';
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index e58b7154487..e5c24fbac04 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1648,85 +1648,90 @@ else
print '
';
- if (! empty($object->email))
+ $parameters=array();
+ $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ if (empty($reshook))
{
- $langs->load("mails");
- print '
';
- }
- else
- {
- $langs->load("mails");
- print '
';
- }
-
- if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
- {
- if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
+ if (! empty($object->email))
{
- print '
';
+ $langs->load("mails");
+ print '
';
}
else
{
- print '
';
+ $langs->load("mails");
+ print '
';
}
- }
- elseif ($caneditpassword && ! $object->ldap_sid &&
- (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
- {
- print '
';
- }
- // Si on a un gestionnaire de generation de mot de passe actif
- if ($conf->global->USER_PASSWORD_GENERATED != 'none')
- {
- if ($object->statut == 0)
+ if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{
- print '
';
+ if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
+ {
+ print '
';
+ }
+ else
+ {
+ print '
';
+ }
}
- elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
+ elseif ($caneditpassword && ! $object->ldap_sid &&
+ (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
+ {
+ print '
';
+ }
+
+ // Si on a un gestionnaire de generation de mot de passe actif
+ if ($conf->global->USER_PASSWORD_GENERATED != 'none')
+ {
+ if ($object->statut == 0)
+ {
+ print '
';
+ }
+ elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
+ ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
+ {
+ print '
';
+ }
+
+ if ($object->statut == 0)
+ {
+ print '
';
+ }
+ else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
+ ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
+ {
+ if ($object->email) print '
';
+ else print '
';
+ }
+ }
+
+ // Activer
+ if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{
- print '
';
+ print '
';
}
-
- if ($object->statut == 0)
- {
- print '
';
- }
- else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
+ // Desactiver
+ if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{
- if ($object->email) print '
';
- else print '
';
+ print '
';
}
- }
-
- // Activer
- if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
- ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
- {
- print '
';
- }
- // Desactiver
- if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
- ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
- {
- print '
';
- }
- // Delete
- if ($user->id <> $id && $candisableuser &&
- ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
- {
- if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
+ // Delete
+ if ($user->id <> $id && $candisableuser &&
+ ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{
- print '
';
- }
- else
- {
- print '
';
+ if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
+ {
+ print '
';
+ }
+ else
+ {
+ print '
';
+ }
}
}
-
+
print "
\n";
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 032eb2112d8..5b7416dbaa6 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -10,6 +10,7 @@
* Copyright (C) 2013-2014 Philippe Grand
* Copyright (C) 2013-2015 Alexandre Spangaro
* Copyright (C) 2015 Marcos García
+ * Copyright (C) 2018 Nicolas ZABOURI
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -2976,9 +2977,10 @@ class User extends CommonObject
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
+ * @param null|array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
- public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
+ public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf,$user,$langs;
@@ -2999,7 +3001,7 @@ class User extends CommonObject
$modelpath = "core/modules/user/doc/";
- return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
/**
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index def96bac0bd..2400c855a6d 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -5,6 +5,7 @@
* Copyright (C) 2012 Florian Henry
* Copyright (C) 2014 Juanjo Menent
* Copyright (C) 2014 Alexis Algoud
+ * Copyright (C) 2018 Nicolas ZABOURI
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -952,9 +953,10 @@ class UserGroup extends CommonObject
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
+ * @param null|array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
- public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
+ public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf,$user,$langs;
@@ -975,7 +977,7 @@ class UserGroup extends CommonObject
$modelpath = "core/modules/usergroup/doc/";
- return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
}
diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php
index b478f99bd59..946ba132af8 100644
--- a/htdocs/user/group/list.php
+++ b/htdocs/user/group/list.php
@@ -162,13 +162,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
- }
-
- if ($sall)
- {
- foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter='';
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index 5dbec430687..6ace60c2fca 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -124,7 +124,9 @@ if ($resql)
{
$num = $db->num_rows($resql);
print '';
- print ''.$langs->trans("LastUsersCreated",min($num,$max)).' ';
+ print ''.$langs->trans("LastUsersCreated",min($num,$max)).' ';
+ print ''.$langs->trans("FullList").' ';
+ print ' ';
$i = 0;
while ($i < $num && $i < $max)
@@ -233,11 +235,13 @@ if ($canreadperms)
$resql=$db->query($sql);
if ($resql)
{
- $colspan=2;
+ $colspan=1;
if (! empty($conf->multicompany->enabled)) $colspan++;
$num = $db->num_rows($resql);
print '';
- print ''.$langs->trans("LastGroupsCreated",($num ? $num : $max)).' ';
+ print ''.$langs->trans("LastGroupsCreated",($num ? $num : $max)).' ';
+ print ''.$langs->trans("FullList").' ';
+ print ' ';
$i = 0;
$grouptemp = new UserGroup($db);
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index 29a3d0fc647..a1f0cdd5471 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -298,7 +298,7 @@ print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sorto
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+ print ''.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
';
}
$moreforfilter='';
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index d62adfb063b..25ff7215e5d 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -48,6 +48,7 @@ $langs->loadLangs(array("website","other"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
@@ -106,8 +107,8 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
- $trigger_name='MYOBJECT_SENTBYMAIL';
- $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
+ $trigger_name='WEBSITEACCOUNT_SENTBYMAIL';
+ $autocopy='MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
$trackid='websiteaccount'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
}
diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php
index 74822e34d3c..c690d7b63ef 100755
--- a/scripts/cron/cron_run_jobs.php
+++ b/scripts/cron/cron_run_jobs.php
@@ -73,7 +73,7 @@ $error=0;
$now=dol_now();
@set_time_limit(0);
-print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=" . $userlogin . " ***** " . dol_print_date($now, 'dayrfc') . " *****\n";
+print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=" . $userlogin . " ***** " . dol_print_date($now, 'dayhourrfc') . " *****\n";
// Check module cron is activated
if (empty($conf->cron->enabled))
diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php
index 45b960878ab..cb745d9aff3 100755
--- a/scripts/user/sync_groups_ldap2dolibarr.php
+++ b/scripts/user/sync_groups_ldap2dolibarr.php
@@ -186,8 +186,13 @@ if ($result >= 0)
foreach($ldapgroup[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] as $key => $userdn) {
if($key === 'count') continue;
if(empty($userList[$userdn])) { // Récupération de l'utilisateur
- $userFilter = explode(',', $userdn);
- $userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS);
+ // Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement
+ if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS === 'memberUid'){
+ $userKey = array($userdn);
+ } else { // Pour les autres schémas, les membres sont listés sous forme de DN complets
+ $userFilter = explode(',', $userdn);
+ $userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS);
+ }
if(!is_array($userKey)) continue;
$fuser = new User($db);