';
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {
diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php
index 082a485f817..93c8dea0a3e 100644
--- a/htdocs/compta/sociales/list.php
+++ b/htdocs/compta/sociales/list.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -112,7 +112,7 @@ $arrayfields = array(
'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30),
'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40),
'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50),
- 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->projet->enabled))),
+ 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))),
'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70),
'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"),
'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100),
@@ -191,7 +191,7 @@ $formother = new FormOther($db);
$bankstatic = new Account($db);
$formsocialcontrib = new FormSocialContrib($db);
$chargesociale_static = new ChargeSociales($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$projectstatic = new Project($db);
}
@@ -199,7 +199,7 @@ llxHeader('', $langs->trans("SocialContributions"));
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
}
$sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
@@ -209,7 +209,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
@@ -223,7 +223,7 @@ if ($search_ref) {
if ($search_label) {
$sql .= natural_search("cs.libelle", $search_label);
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
if ($search_project_ref != '') {
$sql .= natural_search("p.ref", $search_project_ref);
}
@@ -259,7 +259,7 @@ if ($search_typeid > 0) {
$sql .= " AND cs.fk_type = ".((int) $search_typeid);
}
$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname";
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$sql .= ", p.rowid, p.ref, p.title";
}
$sql .= $db->order($sortfield, $sortorder);
@@ -560,7 +560,7 @@ while ($i < min($num, $limit)) {
$chargesociale_static->label = $obj->label;
$chargesociale_static->type_label = $obj->type_label;
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$projectstatic->id = $obj->project_id;
$projectstatic->ref = $obj->project_ref;
$projectstatic->title = $obj->project_label;
diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php
index 0447d3168b1..8ede1c3b502 100644
--- a/htdocs/compta/sociales/note.php
+++ b/htdocs/compta/sociales/note.php
@@ -25,7 +25,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {
diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php
index 22b3f988a70..dc362e60051 100644
--- a/htdocs/compta/tva/document.php
+++ b/htdocs/compta/tva/document.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -102,7 +102,7 @@ if ($action == 'setlib' && $permissiontoadd) {
*/
$form = new Form($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 30189680bc7..67b144ffd89 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -1039,7 +1039,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
';
print '';
print '';
diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php
index 70761162153..a8dc5e7ee3b 100644
--- a/htdocs/contrat/agenda.php
+++ b/htdocs/contrat/agenda.php
@@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -110,7 +110,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formfile = new FormFile($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -171,7 +171,7 @@ if ($id > 0) {
$morehtmlref .= ' (
)';
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 3202d8598d0..0f61ecada43 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -1002,7 +1002,7 @@ llxHeader('', $langs->trans("Contract"), $help_url);
$form = new Form($db);
$formfile = new FormFile($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -1161,7 +1161,7 @@ if ($action == 'create') {
print "";
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load('projects');
$formproject = new FormProjets($db);
@@ -1321,7 +1321,7 @@ if ($action == 'create') {
$morehtmlref .= ' (
)';
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
@@ -1415,7 +1415,7 @@ if ($action == 'create') {
}
- $arrayothercontracts = $object->getListOfContracts('others');
+ $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error
/*
* Lines of contracts
@@ -1544,9 +1544,9 @@ if ($action == 'create') {
print '
';
}
- // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
+ // Icon move, update et delete (status contract 0=draft,1=validated,2=closed)
print '
';
}
+ // Customer template invoices
+ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
+ $nblines++;
+ $ret = $product->load_stats_facturerec($socid);
+ if ($ret < 0) {
+ dol_print_error($db);
+ }
+ $langs->load("bills");
+ print '
';
+ }
// Supplier invoices
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
$nblines++;
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index bcc6fde98c8..c820e260b4e 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -186,7 +186,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->tax->enabled)) {
$nbElements += $project->getElementCount('chargesociales', 'chargesociales');
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$nbElements += $project->getElementCount('project_task', 'projet_task');
}
if (!empty($conf->stock->enabled)) {
@@ -275,7 +275,7 @@ function project_prepare_head(Project $project, $moreparam = '')
} else {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
- $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($project->ref);
+ $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($project->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $project->element, $project->id);
$totalAttached = $nbFiles + $nbLinks;
@@ -401,7 +401,7 @@ function task_prepare_head($object)
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : '');
- $filesdir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref);
+ $filesdir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
@@ -650,7 +650,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if ($showproject) {
// Project ref
- print "
\n";
}
// Date start
if (count($arrayfields) > 0 && !empty($arrayfields['t.dateo']['checked'])) {
- print '
';
}
// Date end
if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) {
- print '
';
+
+ if (!empty($conf->global->MAIN_FORCETHEME)) {
+ $langs->load("errors");
+ print $langs->trans("WarningThemeForcedTo", $conf->global->MAIN_FORCETHEME);
+ }
print '';
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 9270b946199..96625dd1f95 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -15,7 +15,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
-insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->projet->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
+insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
@@ -404,19 +404,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Project
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Project - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index ddb4b1fab95..9e88d4dda3d 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -2211,6 +2211,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"'));
+ $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire);
}
}
}
diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
index 23917c4b79c..43bf3ecd2cb 100644
--- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
+++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
@@ -174,7 +174,13 @@ class doc_generic_bom_odt extends ModelePDFBom
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '';
}
// Add input to upload a new template file.
- $texte .= ''.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index bdda6f26862..cb73b6fc282 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -611,6 +611,9 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 212d324acaf..8930481d219 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -27,7 +27,7 @@
/**
* \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
* \ingroup commande
- * \brief File of Class to generate PDF orders with template Eratosthène
+ * \brief File of Class to generate PDF orders with template Eratosthene
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
@@ -835,6 +835,9 @@ class pdf_eratosthene extends ModelePDFCommandes
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == $pageposafter) {
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index 23ed4bec34a..9050e1accf5 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -166,7 +166,13 @@ class doc_generic_contract_odt extends ModelePDFContract
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index 4dbad109cf4..1875cfb833c 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -437,6 +437,9 @@ class pdf_strato extends ModelePDFContract
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
index 9c588fdf55e..7d880328663 100644
--- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
@@ -574,6 +574,9 @@ class pdf_storm extends ModelePDFDeliveryOrder
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
index a9537b324f1..2e0c3f2d05c 100644
--- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
@@ -498,6 +498,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index 209acf648d6..f2035c89575 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -180,7 +180,13 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index 982a63dade8..3a8defb8db4 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -708,6 +708,9 @@ class pdf_espadon extends ModelePdfExpedition
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index e1da387d1ad..ab9461d104f 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -614,6 +614,9 @@ class pdf_rouget extends ModelePdfExpedition
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index 907688b4878..43c1ae9e4de 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -152,7 +152,7 @@ class pdf_standard extends ModeleExpenseReport
$this->posxqty = 150;
$this->postotalht = 160;
$this->postotalttc = 180;
- // if (empty($conf->projet->enabled)) {
+ // if (empty($conf->project->enabled)) {
// $this->posxtva-=20;
// $this->posxup-=20;
// $this->posxqty-=20;
@@ -450,6 +450,9 @@ class pdf_standard extends ModeleExpenseReport
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
@@ -581,7 +584,7 @@ class pdf_standard extends ModeleExpenseReport
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$nextColumnPosX = $this->posxtva;
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$nextColumnPosX = $this->posxprojet;
}
@@ -597,7 +600,7 @@ class pdf_standard extends ModeleExpenseReport
//$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C');
// Project
- //if (! empty($conf->projet->enabled))
+ //if (! empty($conf->project->enabled))
//{
// $pdf->SetFont('','', $default_font_size - 1);
// $pdf->SetXY($this->posxprojet, $curY);
@@ -955,7 +958,7 @@ class pdf_standard extends ModeleExpenseReport
// $pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
//}
- //if (!empty($conf->projet->enabled))
+ //if (!empty($conf->project->enabled))
//{
// // Project
// $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 07a1e3966a6..fc73460bd1b 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -179,7 +179,13 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 1bb5400acc7..63e9d61c409 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -452,8 +452,13 @@ class pdf_crabe extends ModelePDFFactures
// You can add more thing under header here, if you increase $extra_under_address_shift too.
$extra_under_address_shift = 0;
+ $qrcodestring = '';
if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) {
$qrcodestring = $object->buildZATCAQRString();
+ } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) {
+ $qrcodestring = $object->buildSwitzerlandQRString();
+ }
+ if ($qrcodestring) {
$qrcodecolor = array('25', '25', '25');
// set style for QR-code
$styleQr = array(
@@ -795,6 +800,9 @@ class pdf_crabe extends ModelePDFFactures
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index bc4dad25f91..46ac4ffde37 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -435,8 +435,13 @@ class pdf_sponge extends ModelePDFFactures
// You can add more thing under header here, if you increase $extra_under_address_shift too.
$extra_under_address_shift = 0;
+ $qrcodestring = '';
if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) {
$qrcodestring = $object->buildZATCAQRString();
+ } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) {
+ $qrcodestring = $object->buildSwitzerlandQRString();
+ }
+ if ($qrcodestring) {
$qrcodecolor = array('25', '25', '25');
// set style for QR-code
$styleQr = array(
@@ -929,6 +934,9 @@ class pdf_sponge extends ModelePDFFactures
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index 8c07dbb64f3..bb4a6826278 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -418,6 +418,9 @@ class pdf_soleil extends ModelePDFFicheinter
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php
index e3e349d2a17..decbc81716b 100644
--- a/htdocs/core/modules/mailings/contacts1.modules.php
+++ b/htdocs/core/modules/mailings/contacts1.modules.php
@@ -310,7 +310,7 @@ class mailing_contacts1 extends MailingTargets
// Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
- $s .= $langs->trans("DefaultLang").': ';
+ $s .= '
'.$langs->trans("DefaultLang").': ';
$s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1);
return $s;
diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php
index 073d45439eb..89bc2cf2b5e 100644
--- a/htdocs/core/modules/mailings/thirdparties.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties.modules.php
@@ -117,6 +117,10 @@ class mailing_thirdparties extends MailingTargets
$addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'";
$addDescription = $langs->trans('DefaultLang')."=";
}
+ if (GETPOST('filter_lang_thirdparties', 'alpha')) {
+ $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('filter_lang_thirdparties', 'alpha'))."%'";
+ $addDescription = $langs->trans('DefaultLang')."=";
+ }
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c";
@@ -315,8 +319,8 @@ class mailing_thirdparties extends MailingTargets
// Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
- $s .= $langs->trans("DefaultLang").': ';
- $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1);
+ $s .= '
'.$langs->trans("DefaultLang").': ';
+ $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1);
return $s;
}
diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php
index 77044ddb29e..d698a646371 100644
--- a/htdocs/core/modules/mailings/xinputfile.modules.php
+++ b/htdocs/core/modules/mailings/xinputfile.modules.php
@@ -110,6 +110,11 @@ class mailing_xinputfile extends MailingTargets
global $langs;
$s = '';
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $s .= '
'; // MAX_FILE_SIZE must precede the field type=file
+ }
$s .= '
';
return $s;
}
@@ -151,10 +156,12 @@ class mailing_xinputfile extends MailingTargets
$cpt++;
$buffer = trim(fgets($handle));
$tab = explode(';', $buffer, 4);
- $email = $tab[0];
- $name = $tab[1];
- $firstname = $tab[2];
- $other = $tab[3];
+
+ $email = dol_string_nohtmltag($tab[0]);
+ $name = dol_string_nohtmltag(empty($tab[1]) ? '' : $tab[1]);
+ $firstname = dol_string_nohtmltag(empty($tab[2]) ? '' : $tab[2]);
+ $other = dol_string_nohtmltag(empty($tab[3]) ? '' : $tab[3]);
+
if (!empty($buffer)) {
//print 'xx'.dol_strlen($buffer).empty($buffer)."
\n";
if (isValidEMail($email)) {
diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php
index 117a5722c3c..74ed18ba91f 100644
--- a/htdocs/core/modules/mailings/xinputuser.modules.php
+++ b/htdocs/core/modules/mailings/xinputuser.modules.php
@@ -127,10 +127,11 @@ class mailing_xinputuser extends MailingTargets
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$tmparray = explode(';', GETPOST('xinputuser'));
+
$email = $tmparray[0];
- $lastname = $tmparray[1];
- $firstname = $tmparray[2];
- $other = $tmparray[3];
+ $lastname = empty($tmparray[1]) ? '' : $tmparray[1];
+ $firstname = empty($tmparray[2]) ? '' : $tmparray[2];
+ $other = empty($tmparray[3]) ? '' : $tmparray[3];
$cibles = array();
if (!empty($email)) {
diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
index fb084f312fe..0b64203798f 100644
--- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
+++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
@@ -169,7 +169,13 @@ class doc_generic_member_odt extends ModelePDFMember
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php
index c9a28863c97..57ac7a637dc 100644
--- a/htdocs/core/modules/modCategorie.class.php
+++ b/htdocs/core/modules/modCategorie.class.php
@@ -145,7 +145,7 @@ class modCategorie extends DolibarrModules
if (!empty($conf->bank->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."5=Bank account";
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."6=Project";
}
if (!empty($conf->user->enabled)) {
@@ -379,7 +379,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6];
$this->export_label[$r] = 'CatProjectsList';
$this->export_icon[$r] = $this->picto;
- $this->export_enabled[$r] = '!empty($conf->projet->enabled)';
+ $this->export_enabled[$r] = '!empty($conf->project->enabled)';
$this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name");
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text");
@@ -568,7 +568,7 @@ class modCategorie extends DolibarrModules
// 5 Bank accounts, TODO ?
// 6 Projects
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$r++;
$this->import_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6];
$this->import_label[$r] = "CatProjectsLinks"; // Translation key
diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php
index 80e5468b140..e75147ba78a 100644
--- a/htdocs/core/modules/modCommande.class.php
+++ b/htdocs/core/modules/modCommande.class.php
@@ -370,7 +370,7 @@ class modCommande extends DolibarrModules
),
);
- //Import CPV Lines
+ //Import Order Lines
$r++;
$this->import_code[$r] = 'commande_lines_'.$r;
$this->import_label[$r] = 'SaleOrderLines';
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index 817fa1b53cf..2cdc8229e51 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -134,7 +134,7 @@ class modFacture extends DolibarrModules
'objectname'=>'Facture',
'method'=>'sendEmailsRemindersOnInvoiceDueDate',
'parameters'=>"10,all,EmailTemplateCode",
- 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).',
+ 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. The version in the language of the thirdparty will be used in priority to update the PDF of the sent invoice).',
'frequency'=>1,
'unitfrequency'=>3600 * 24,
'priority'=>50,
@@ -224,6 +224,274 @@ class modFacture extends DolibarrModules
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
+ // Imports
+ //--------
+ $r = 1;
+
+ $r++;
+ $this->import_code[$r] = $this->rights_class.'_'.$r;
+ $this->import_label[$r] = "Invoices"; // Translation key
+ $this->import_icon[$r] = $this->picto;
+ $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
+ $this->import_tables_array[$r] = array('f' => MAIN_DB_PREFIX.'facture', 'extra' => MAIN_DB_PREFIX.'facture_extrafields');
+ $this->import_tables_creator_array[$r] = array('f' => 'fk_user_author'); // Fields to store import user id
+ $this->import_fields_array[$r] = array(
+ 'f.ref' => 'InvoiceRef*',
+ 'f.ref_ext' => 'ExternalRef',
+ 'f.ref_int' => 'ExternalRef',
+ 'f.ref_client' => 'CutomerRef',
+ 'f.type' => 'Type*',
+ 'f.fk_soc' => 'Customer*',
+ 'f.datec' => 'InvoiceDateCreation',
+ 'f.datef' => 'DateInvoice',
+ 'f.date_valid' => 'Validation Date',
+ 'f.paye' => 'InvoicePaid',
+ 'f.remise_percent' => 'RemisePercent',
+ 'f.remise_absolue' => 'RemiseAbsolue',
+ 'f.remise' => 'Remise',
+ 'f.total_tva' => 'TotalVAT',
+ 'f.total_ht' => 'TotalHT',
+ 'f.total_ttc' => 'TotalTTC',
+ 'f.fk_statut' => 'InvoiceStatus',
+ 'f.fk_user_modif' => 'Modifier Id',
+ 'f.fk_user_valid' => 'Validator Id',
+ 'f.fk_user_closing' => 'Closer Id',
+ 'f.fk_facture_source' => 'Invoice Source Id',
+ 'f.fk_projet' => 'Project Id',
+ 'f.fk_account' => 'Bank Account',
+ 'f.fk_currency' => 'Currency*',
+ 'f.fk_cond_reglement' => 'Payment Condition',
+ 'f.fk_mode_reglement' => 'Payment Mode',
+ 'f.date_lim_reglement' => 'DateMaxPayment',
+ 'f.note_public' => 'InvoiceNote',
+ 'f.note_private' => 'NotePrivate',
+ 'f.model_pdf' => 'Model'
+ );
+ if (!empty($conf->multicurrency->enabled)) {
+ $this->import_fields_array[$r]['f.multicurrency_code'] = 'Currency';
+ $this->import_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
+ $this->import_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
+ $this->import_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
+ $this->import_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
+ }
+ // Add extra fields
+ $import_extrafield_sample = array();
+ $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture' AND entity IN (0, ".$conf->entity.")";
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ while ($obj = $this->db->fetch_object($resql)) {
+ $fieldname = 'extra.'.$obj->name;
+ $fieldlabel = ucfirst($obj->label);
+ $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
+ $import_extrafield_sample[$fieldname] = $fieldlabel;
+ }
+ }
+ // End add extra fields
+ $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facture');
+ $this->import_regex_array[$r] = array('f.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency');
+ $import_sample = array(
+ 'f.ref' => '(PROV0001)',
+ 'f.ref_ext' => '',
+ 'f.ref_int' => '',
+ 'f.ref_client' => '',
+ 'f.type' => '0',
+ 'f.fk_soc' => '80LIMIT',
+ 'f.datec' => '2021-11-24',
+ 'f.datef' => '2021-11-24',
+ 'f.date_valid' => '2021-11-24',
+ 'f.paye' => '1',
+ 'f.remise_percent' => '0',
+ 'f.remise_absolue' => '0',
+ 'f.remise' => '0',
+ 'f.total_tva' => '21',
+ 'f.total_ht' => '100',
+ 'f.total_ttc' => '121',
+ 'f.fk_statut' => '1',
+ 'f.fk_user_modif' => '',
+ 'f.fk_user_valid' => '',
+ 'f.fk_user_closing' => '',
+ 'f.fk_facture_source' => '',
+ 'f.fk_projet' => '',
+ 'f.fk_account' => '',
+ 'f.fk_currency' => 'EUR',
+ 'f.fk_cond_reglement' => '30D',
+ 'f.fk_mode_reglement' => 'VIR',
+ 'f.date_lim_reglement' => '2021-12-24',
+ 'f.note_public' => '',
+ 'f.note_private' => '',
+ 'f.model_pdf' => 'crabe',
+ 'f.multicurrency_code' => 'EUR',
+ 'f.multicurrency_tx' => '1',
+ 'f.multicurrency_total_ht' => '100',
+ 'f.multicurrency_total_tva' => '21',
+ 'f.multicurrency_total_ttc' => '121'
+ );
+ $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample);
+ $this->import_updatekeys_array[$r] = array('f.ref' => 'Ref');
+ $this->import_convertvalue_array[$r] = array(
+ 'f.fk_soc' => array(
+ 'rule' => 'fetchidfromref',
+ 'file' => '/societe/class/societe.class.php',
+ 'class' => 'Societe',
+ 'method' => 'fetch',
+ 'element' => 'ThirdParty'
+ ),
+ 'f.fk_projet' => array(
+ 'rule' => 'fetchidfromref',
+ 'file' => '/projet/class/project.class.php',
+ 'class' => 'Project',
+ 'method' => 'fetch',
+ 'element' => 'facture'
+ ),
+ 'f.fk_cond_reglement' => array(
+ 'rule' => 'fetchidfromcodeorlabel',
+ 'file' => '/compta/facture/class/paymentterm.class.php',
+ 'class' => 'PaymentTerm',
+ 'method' => 'fetch',
+ 'element' => 'c_payment_term'
+ )
+ );
+
+ //Import Supplier Invoice Lines
+ $r++;
+ $this->import_code[$r] = $this->rights_class.'_'.$r;
+ $this->import_label[$r] = "InvoiceLine"; // Translation key
+ $this->import_icon[$r] = $this->picto;
+ $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
+ $this->import_tables_array[$r] = array('fd' => MAIN_DB_PREFIX.'facturedet', 'extra' => MAIN_DB_PREFIX.'facturedet_extrafields');
+ $this->import_fields_array[$r] = array(
+ 'fd.fk_facture' => 'InvoiceRef*',
+ 'fd.fk_parent_line' => 'FacParentLine',
+ 'fd.fk_product' => 'IdProduct',
+ 'fd.label' => 'Label',
+ 'fd.description' => 'LineDescription*',
+ 'fd.vat_src_code' => 'Vat Source Code',
+ 'fd.tva_tx' => 'LineVATRate*',
+ // localtax1_tx
+ // localtax1_type
+ // localtax2_tx
+ // localtax2_type
+ 'fd.qty' => 'LineQty',
+ 'fd.remise_percent' => 'Reduc. (%)',
+ // remise
+ // fk_remise_except
+ // subprice
+ // price
+ 'fd.total_ht' => 'LineTotalHT',
+ 'fd.total_tva' => 'LineTotalVAT',
+ // total_localtax1
+ // total_localtax2
+ 'fd.total_ttc' => 'LineTotalTTC',
+ 'fd.product_type' => 'TypeOfLineServiceOrProduct',
+ 'fd.date_start' => 'Start Date',
+ 'fd.date_end' => 'End Date',
+ // info_bits
+ // buy_price_ht
+ // fk_product_fournisseur_price
+ // specia_code
+ // rang
+ // fk_contract_line
+ 'fd.fk_unit' => 'Unit',
+ // fk_code_ventilation
+ // situation_percent
+ // fk_prev_id
+ // fk_user_author
+ // fk_user_modif
+ // ref_ext
+ );
+ if (!empty($conf->multicurrency->enabled)) {
+ $this->import_fields_array[$r]['fd.multicurrency_code'] = 'Currency';
+ $this->import_fields_array[$r]['fd.multicurrency_subprice'] = 'CurrencyRate';
+ $this->import_fields_array[$r]['fd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
+ $this->import_fields_array[$r]['fd.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
+ $this->import_fields_array[$r]['fd.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
+ }
+ // Add extra fields
+ $import_extrafield_sample = array();
+ $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_det' AND entity IN (0, ".$conf->entity.")";
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ while ($obj = $this->db->fetch_object($resql)) {
+ $fieldname = 'extra.'.$obj->name;
+ $fieldlabel = ucfirst($obj->label);
+ $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
+ $import_extrafield_sample[$fieldname] = $fieldlabel;
+ }
+ }
+ // End add extra fields
+ $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facturedet');
+ $this->import_regex_array[$r] = array(
+ 'fd.fk_product' => 'rowid@'.MAIN_DB_PREFIX.'product',
+ 'fd.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'
+ );
+ $import_sample = array(
+ 'fd.fk_facture' => '(PROV00001)',
+ 'fd.fk_parent_line' => '',
+ 'fd.fk_product' => '',
+ 'fd.label' => '',
+ 'fd.description' => 'Test product',
+ 'fd.vat_src_code' => '',
+ 'fd.tva_tx' => '21',
+ // localtax1_tx
+ // localtax1_type
+ // localtax2_tx
+ // localtax2_type
+ 'fd.qty' => '1',
+ 'fd.remise_percent' => '0',
+ // remise
+ // fk_remise_except
+ // subprice
+ // price
+ 'fd.total_ht' => '100',
+ 'fd.total_tva' => '21',
+ // total_localtax1
+ // total_localtax2
+ 'fd.total_ttc' => '121',
+ 'fd.product_type' => '0',
+ 'fd.date_start' => '',
+ 'fd.date_end' => '',
+ // info_bits
+ // buy_price_ht
+ // fk_product_fournisseur_price
+ // specia_code
+ // rang
+ // fk_contract_line
+ 'fd.fk_unit' => '',
+ // fk_code_ventilation
+ // situation_percent
+ // fk_prev_id
+ // fk_user_author
+ // fk_user_modif
+ // ref_ext
+ 'fd.multicurrency_code' => 'EUR',
+ 'fd.multicurrency_tx' => '21',
+ 'fd.multicurrency_total_ht' => '100',
+ 'fd.multicurrency_total_tva' => '21',
+ 'fd.multicurrency_total_ttc' => '121'
+ );
+ $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample);
+ $this->import_updatekeys_array[$r] = array(
+ 'fd.rowid' => 'Row Id',
+ 'fd.fk_facture' => 'Invoice Id'
+ );
+ $this->import_convertvalue_array[$r] = array(
+ 'fd.fk_facture' => array(
+ 'rule' => 'fetchidfromref',
+ 'file' => '/compta/facture/class/facture.class.php',
+ 'class' => 'Facture',
+ 'method' => 'fetch',
+ 'element' => 'facture'
+ ),
+ 'fd.fk_projet' => array(
+ 'rule' => 'fetchidfromref',
+ 'file' => '/projet/class/project.class.php',
+ 'class' => 'Project',
+ 'method' => 'fetch',
+ 'element' => 'facture'
+ ),
+ );
+
+
// Exports
//--------
$r = 1;
diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php
index f597f580b47..f83b6efa1ed 100644
--- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php
@@ -675,6 +675,9 @@ class pdf_standard extends ModelePDFMovement
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 090a45f4b3f..5d228da7d8c 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -177,7 +177,13 @@ class doc_generic_product_odt extends ModelePDFProduct
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 10b78673cf5..8bd8d030a37 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -522,7 +522,7 @@ class doc_generic_project_odt extends ModelePDFProjects
// Load translation files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
// If $object is id instead of object
if (!is_object($object)) {
$id = $object;
@@ -536,7 +536,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$object->fetch_thirdparty();
- $dir = $conf->projet->dir_output;
+ $dir = $conf->project->dir_output;
$objectref = dol_sanitizeFileName($object->ref);
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;
@@ -575,9 +575,9 @@ class doc_generic_project_odt extends ModelePDFProjects
//print "file=".$file;
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
- dol_mkdir($conf->projet->dir_temp);
- if (!is_writable($conf->projet->dir_temp)) {
- $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
+ dol_mkdir($conf->project->dir_temp);
+ if (!is_writable($conf->project->dir_temp)) {
+ $this->error = "Failed to write in temp directory ".$conf->project->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
@@ -615,7 +615,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$odfHandler = new odf(
$srctemplatepath,
array(
- 'PATH_TO_TMP' => $conf->projet->dir_temp,
+ 'PATH_TO_TMP' => $conf->project->dir_temp,
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}'
@@ -826,7 +826,7 @@ class doc_generic_project_odt extends ModelePDFProjects
// Replace tags of project files
$listtasksfiles = $listlines->__get('tasksfiles');
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref);
+ $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1);
@@ -861,7 +861,7 @@ class doc_generic_project_odt extends ModelePDFProjects
try {
$listlines = $odfHandler->setSegment('projectfiles');
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1);
foreach ($filearray as $filedetail) {
diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php
index cf9e84a3deb..df013a2fad0 100644
--- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php
@@ -195,11 +195,11 @@ class pdf_baleine extends ModelePDFProjects
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
//$nblines = count($object->lines); // This is set later with array of tasks
$objectref = dol_sanitizeFileName($object->ref);
- $dir = $conf->projet->dir_output;
+ $dir = $conf->project->dir_output;
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;
}
@@ -470,6 +470,9 @@ class pdf_baleine extends ModelePDFProjects
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index abd05f63651..fba5e02b098 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -242,11 +242,11 @@ class pdf_beluga extends ModelePDFProjects
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
//$nblines = count($object->lines); // This is set later with array of tasks
$objectref = dol_sanitizeFileName($object->ref);
- $dir = $conf->projet->dir_output;
+ $dir = $conf->project->dir_output;
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;
}
@@ -743,6 +743,9 @@ class pdf_beluga extends ModelePDFProjects
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
}
diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php
index cb7430c3011..9d118b2a555 100644
--- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php
@@ -195,11 +195,11 @@ class pdf_timespent extends ModelePDFProjects
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
//$nblines = count($object->lines); // This is set later with array of tasks
$objectref = dol_sanitizeFileName($object->ref);
- $dir = $conf->projet->dir_output;
+ $dir = $conf->project->dir_output;
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;
}
@@ -473,6 +473,9 @@ class pdf_timespent extends ModelePDFProjects
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 3702b1c8452..e26318b749c 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -133,8 +133,8 @@ class doc_generic_task_odt extends ModelePDFTask
// Get source company
$this->emetteur = $mysoc;
- if (!$this->emetteur->pays_code) {
- $this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined
+ if (!$this->emetteur->country_code) {
+ $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
}
}
@@ -481,7 +481,7 @@ class doc_generic_task_odt extends ModelePDFTask
// Load translation files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
// If $object is id instead of object
if (!is_object($object)) {
$id = $object;
@@ -496,7 +496,7 @@ class doc_generic_task_odt extends ModelePDFTask
$project->fetch($object->fk_project);
$project->fetch_thirdparty();
- $dir = $conf->projet->dir_output."/".$project->ref."/";
+ $dir = $conf->project->dir_output."/".$project->ref."/";
$objectref = dol_sanitizeFileName($object->ref);
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;
@@ -525,9 +525,9 @@ class doc_generic_task_odt extends ModelePDFTask
//print "file=".$file;
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
- dol_mkdir($conf->projet->dir_temp);
- if (!is_writable($conf->projet->dir_temp)) {
- $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
+ dol_mkdir($conf->project->dir_temp);
+ if (!is_writable($conf->project->dir_temp)) {
+ $this->error = "Failed to write in temp directory ".$conf->project->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
@@ -550,7 +550,7 @@ class doc_generic_task_odt extends ModelePDFTask
$odfHandler = new odf(
$srctemplatepath,
array(
- 'PATH_TO_TMP' => $conf->projet->dir_temp,
+ 'PATH_TO_TMP' => $conf->project->dir_temp,
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}'
@@ -708,7 +708,7 @@ class doc_generic_task_odt extends ModelePDFTask
// Replace tags of project files
$listtasksfiles = $odfHandler->setSegment('tasksfiles');
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1);
@@ -741,7 +741,7 @@ class doc_generic_task_odt extends ModelePDFTask
try {
$listlines = $odfHandler->setSegment('projectfiles');
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1);
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 39ffd92ac5e..6f91d676949 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -211,7 +211,13 @@ class doc_generic_proposal_odt extends ModelePDFPropales
}
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 511677d742b..177443153ce 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -726,6 +726,9 @@ class pdf_azur extends ModelePDFPropales
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index 47af81d8aa2..1ed76728b92 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -850,6 +850,9 @@ class pdf_cyan extends ModelePDFPropales
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
index 3e48aaf18bc..1976dea773f 100644
--- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
+++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@@ -173,7 +173,13 @@ class doc_generic_reception_odt extends ModelePdfReception
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php
index ecbeccb5a61..3fd3917da2d 100644
--- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php
@@ -460,6 +460,9 @@ class pdf_standard extends ModelePDFStock
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
index 74b0ea032b9..c00bf34621e 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
@@ -22,9 +22,9 @@
*/
/**
- * \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+ * \file htdocs/core/modules/expedition/doc/pdf_eagle.modules.php
* \ingroup expedition
- * \brief Class file used to generate the dispatch slips for the Rouget model
+ * \brief Class file used to generate the dispatch slips for the Eagle model
*/
require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktransfer.php';
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
index bd9e4d3f11a..5bff26a9d1d 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
@@ -26,9 +26,9 @@
*/
/**
- * \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+ * \file htdocs/core/modules/commande/doc/pdf_eagle_proforma.modules.php
* \ingroup commande
- * \brief File of Class to generate PDF orders with template Eratosthène
+ * \brief File of Class to generate PDF orders with template Eagle
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
@@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
- * Class to generate PDF orders with template Eratosthene
+ * Class to generate PDF orders with template Eagle
*/
class pdf_eagle_proforma extends ModelePDFCommandes
{
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index da8c1f4ac26..233d18ce229 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -777,6 +777,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == $pageposafter) {
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
index c7dc161330c..5498800aefc 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
@@ -659,6 +659,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
index 4e1027207a7..6919ffe69aa 100644
--- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
@@ -420,6 +420,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 6b47240016f..70ee5d75710 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -659,6 +659,9 @@ class pdf_aurore extends ModelePDFSupplierProposal
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
+ if (!empty($tplidx)) {
+ $pdf->useTemplate($tplidx);
+ }
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {
diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
index d69da78aacc..cf358cae606 100644
--- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
+++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
@@ -166,7 +166,13 @@ class doc_generic_ticket_odt extends ModelePDFTicket
$texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
';
}
// Add input to upload a new template file.
- $texte .= '
'.$langs->trans("UploadNewTemplate").'
';
+ $texte .= '
'.$langs->trans("UploadNewTemplate");
+ $maxfilesizearray = getMaxFileSizeArray();
+ $maxmin = $maxfilesizearray['maxmin'];
+ if ($maxmin > 0) {
+ $texte .= ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '
';
diff --git a/htdocs/core/tpl/ajax/fileupload_view.tpl.php b/htdocs/core/tpl/ajax/fileupload_view.tpl.php
index 70182a17dbc..22f8d687db0 100644
--- a/htdocs/core/tpl/ajax/fileupload_view.tpl.php
+++ b/htdocs/core/tpl/ajax/fileupload_view.tpl.php
@@ -37,6 +37,13 @@ if (empty($conf) || !is_object($conf)) {
trans('AddFiles'); ?>
+ 0) {
+ print ' '; // MAX_FILE_SIZE must precede the field type=file
+ }
+ ?>
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 0c744e165d3..7b47c4676a6 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2022 Charlene Benke
*
* 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
@@ -58,11 +59,11 @@ if ($action == 'presend') {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
- $newlang = GETPOST('lang_id', 'aZ09');
- }
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
+ if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
+ if (GETPOST('lang_id', 'aZ09')) {
+ $newlang = GETPOST('lang_id', 'aZ09');
+ }
}
if (!empty($newlang)) {
@@ -212,7 +213,14 @@ if ($action == 'presend') {
$formmail->setSubstitFromObject($object, $langs);
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
- $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? ' ' : '';
+ $substitutionarray['__CHECK_READ__'] = "";
+ if (is_object($object) && is_object($object->thirdparty)) {
+ $checkRead= ' global->MAILING_EMAIL_UNSUBSCRIBE_KEY)?urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY):"");
+ $checkRead.='" width="1" height="1" style="width:1px;height:1px" border="0"/>';
+ $substitutionarray['__CHECK_READ__'] = $checkRead;
+ }
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
$substitutionarray['__CONTACTCIVNAME__'] = '';
$parameters = array(
diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php
index 39103fdbb0a..1439ce73afe 100644
--- a/htdocs/core/tpl/commonfields_edit.tpl.php
+++ b/htdocs/core/tpl/commonfields_edit.tpl.php
@@ -63,9 +63,11 @@ foreach ($object->fields as $key => $val) {
}
print ' ';
print '';
+
if (!empty($val['picto'])) {
print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth');
}
+
if (in_array($val['type'], array('int', 'integer'))) {
$value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key;
} elseif ($val['type'] == 'double') {
@@ -78,6 +80,8 @@ foreach ($object->fields as $key => $val) {
$check = 'restricthtml';
}
$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
+ } elseif (in_array($val['type'], array('date', 'datetime'))) {
+ $value = GETPOSTISSET($key) ? dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')) : $object->$key;
} elseif ($val['type'] == 'price') {
$value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key);
} elseif ($key == 'lang') {
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 1072f68b48f..c8cb251ea46 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -353,6 +353,10 @@ if ($action == 'execute') {
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"), $langs->trans("CronConfirmExecute"), "confirm_execute", '', '', 1);
}
+if ($action == 'delete') {
+ print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.$param, $langs->trans("CronDelete"), $langs->trans("CronConfirmDelete"), "confirm_delete", '', '', 1);
+}
+
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php
index 15bb2360ed8..af824a64392 100644
--- a/htdocs/debugbar/class/DebugBar.php
+++ b/htdocs/debugbar/class/DebugBar.php
@@ -40,7 +40,7 @@ class DolibarrDebugBar extends DebugBar
//$this->addCollector(new DolExceptionsCollector());
$this->addCollector(new DolQueryCollector());
$this->addCollector(new DolibarrCollector());
- if ($conf->syslog->enabled) {
+ if (isModEnabled('syslog')) {
$this->addCollector(new DolLogsCollector());
}
}
diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php
index 382e78df8d3..dba3d0de437 100644
--- a/htdocs/delivery/card.php
+++ b/htdocs/delivery/card.php
@@ -43,7 +43,7 @@ if (!empty($conf->expedition_bon->enabled)) {
if (!empty($conf->stock->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -328,7 +328,7 @@ if ($action == 'create') { // Create. Seems to no be used
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index 2c43cd715a3..9edc080701b 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -106,6 +106,8 @@ class Delivery extends CommonObject
*/
public $model_pdf;
+ public $commande_id;
+
public $lines = array();
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 960ff7e7b2d..30a3ec24c6c 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -382,7 +382,7 @@ llxHeader('', $title, $help_url);
$form = new Form($db);
$formfile = new FormFile($db);
$formcompany = new FormCompany($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -511,7 +511,7 @@ if ($action == 'create') {
print ' ';
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print "".$langs->trans("Project")." ";
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
print " \n";
@@ -639,7 +639,7 @@ if (!empty($id) && $action == 'edit') {
print "".''.$langs->trans("Status").' '.$object->getLibStatut(4).' ';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
$langs->load('projects');
@@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') {
$morehtmlref = '';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index ab99ba3df1d..030ca5cb085 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -99,7 +99,7 @@ if ($action == 'classin' && $user->rights->don->creer) {
*/
$form = new Form($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -129,7 +129,7 @@ if ($object->id) {
$morehtmlref = '
';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/don/info.php b/htdocs/don/info.php
index 0057bf87dce..f326972f782 100644
--- a/htdocs/don/info.php
+++ b/htdocs/don/info.php
@@ -25,7 +25,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -63,7 +63,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M
llxHeader('', $title, $help_url);
$form = new Form($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -77,7 +77,7 @@ $linkback = '
';
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index d7697dba43d..891f7e6877b 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -93,7 +93,7 @@ $fieldstosearchall = array(
$donationstatic = new Don($db);
$form = new Form($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$projectstatic = new Project($db);
}
@@ -219,7 +219,7 @@ if ($resql) {
print ' ';
print ' ';
print ' ';
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print '
';
print ' ';
print ' ';
@@ -249,7 +249,7 @@ if ($resql) {
}
print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center ');
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder);
}
@@ -280,7 +280,7 @@ if ($resql) {
}
print "
".$donationstatic->getFullName($langs)." ";
print '
'.dol_print_date($db->jdate($objp->datedon), 'day').' ';
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print "
";
if ($objp->pid) {
$projectstatic->id = $objp->pid;
diff --git a/htdocs/don/note.php b/htdocs/don/note.php
index 1629aa0f28f..8e1b5192ee2 100644
--- a/htdocs/don/note.php
+++ b/htdocs/don/note.php
@@ -29,7 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -84,7 +84,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M
llxHeader('', $title, $help_url);
$form = new Form($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref = '';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php
index d8d1da60e24..d70f5c863d7 100644
--- a/htdocs/ecm/class/ecmfiles.class.php
+++ b/htdocs/ecm/class/ecmfiles.class.php
@@ -569,7 +569,7 @@ class EcmFiles extends CommonObject
$line = new EcmfilesLine();
$line->id = $obj->rowid;
- $line->ref = $obj->ref;
+ $line->ref = $obj->rowid;
$line->label = $obj->label;
$line->share = $obj->share;
$line->entity = $obj->entity;
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 51a3f7ced7b..1fcdac35b0f 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -347,9 +347,9 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$langs->load("compta");
$rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>$conf->salaries->enabled, 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
}
- if (!empty($conf->projet->enabled)) {
- $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
- $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
+ if (!empty($conf->project->enabled)) {
+ $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
+ $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
}
if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions");
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index a6782317802..27a76d2ae6e 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -143,8 +143,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
if (!empty($conf->tax->enabled)) {
$langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
}
-if (!empty($conf->projet->enabled)) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
+if (!empty($conf->project->enabled)) {
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
}
if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php
index 5ce35541a16..5c7681a3782 100644
--- a/htdocs/emailcollector/class/emailcollectoraction.class.php
+++ b/htdocs/emailcollector/class/emailcollectoraction.class.php
@@ -271,9 +271,9 @@ class EmailCollectorAction extends CommonObject
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
- if ($result > 0 && !empty($this->table_element_line)) {
- $this->fetchLines();
- }
+ // if ($result > 0 && !empty($this->table_element_line)) {
+ // $this->fetchLinesCommon();
+ // }
return $result;
}
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index 292b55d0dc9..2ab747f12c1 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -107,7 +107,7 @@ class ConferenceOrBooth extends ActionComm
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"Help text", 'showoncombobox'=>'1',),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1),
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'),
'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',),
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 533c9f4e8c0..b65d152189f 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -104,7 +104,7 @@ class ConferenceOrBoothAttendee extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1),
'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1),
'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1),
diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php
index da6c0f8ee04..57f2a76c042 100644
--- a/htdocs/eventorganization/conferenceorbooth_contact.php
+++ b/htdocs/eventorganization/conferenceorbooth_contact.php
@@ -392,7 +392,7 @@ if ($object->id) {
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (! empty($conf->projet->enabled))
+ if (! empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='
'.$langs->trans('Project') . ' ';
diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php
index b8fb87d39fa..4c5b2f394a9 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_note.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_note.php
@@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (! empty($conf->projet->enabled))
+ if (! empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='
'.$langs->trans('Project') . ' ';
diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php
index cda9274e6d6..a446c04ca9a 100644
--- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php
+++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php
@@ -31,7 +31,7 @@
// $parameters, $object, $action must be defined for the hook.
// $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined
-// $uploaddir may be defined (example to $conf->projet->dir_output."/";)
+// $uploaddir may be defined (example to $conf->project->dir_output."/";)
// $toselect may be defined
// $diroutputmassaction may be defined
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index af508cf3291..e873ef6e056 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -56,7 +56,7 @@ if (!empty($conf->propal->enabled)) {
if (!empty($conf->productbatch->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -815,7 +815,7 @@ if (empty($action)) {
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -902,7 +902,7 @@ if ($action == 'create') {
print '';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0;
if (empty($projectid) && !empty($object->fk_project)) {
$projectid = $object->fk_project;
@@ -1571,7 +1571,8 @@ if ($action == 'create') {
}
}
- // Line extrafield
+ // Display lines for extrafields of the Shipment line
+ // $line is a 'Order line'
if (!empty($extrafields)) {
//var_dump($line);
$colspan = 5;
@@ -1580,6 +1581,7 @@ if ($action == 'create') {
$srcLine = new OrderLine($db);
$srcLine->id = $line->id;
$srcLine->fetch_optionals(); // fetch extrafields also available in orderline
+
$expLine->array_options = array_merge($expLine->array_options, $srcLine->array_options);
print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
@@ -1716,7 +1718,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
@@ -2414,7 +2416,8 @@ if ($action == 'create') {
}
print "";
- // Display lines extrafields
+ // Display lines extrafields.
+ // $line is a line of shipment
if (!empty($extrafields)) {
$colspan = 6;
if ($origin && $origin_id > 0) {
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index 944f76266d2..669c6f8e56d 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -149,7 +149,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index 68336e8dbf6..d0729879017 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index d8d70b3cc49..e391d5be180 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 2919a42bdb7..a64e6c2b761 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -227,7 +227,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -287,7 +287,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 818b3d564a6..1a2718e7d9a 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
-$projectRequired = $conf->projet->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED);
+$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED);
$fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED);
if ($object->id > 0) {
@@ -1691,7 +1691,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
- if (! empty($conf->projet->enabled))
+ if (! empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='
'.$langs->trans('Project') . ' ';
@@ -2055,7 +2055,7 @@ if ($action == 'create') {
print '
'.$langs->trans('LineNb').' ';
//print '
'.$langs->trans('Piece').' ';
print '
'.$langs->trans('Date').' ';
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print '
'.$langs->trans('Project').' ';
}
print '
'.$langs->trans('Type').' ';
@@ -2100,7 +2100,7 @@ if ($action == 'create') {
print '
'.dol_print_date($db->jdate($line->date), 'day').' ';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print '
';
if ($line->fk_project > 0) {
$projecttmp->id = $line->fk_project;
@@ -2261,7 +2261,7 @@ if ($action == 'create') {
if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) {
// Add line with link to add new file or attach line to an existing file
$colspan = 11;
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$colspan++;
}
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
@@ -2336,7 +2336,7 @@ if ($action == 'create') {
print ' ';
// Select project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print '
';
$formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print ' ';
@@ -2409,7 +2409,7 @@ if ($action == 'create') {
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
$colspan++;
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$colspan++;
}
if ($action != 'editline') {
@@ -2486,7 +2486,7 @@ if ($action == 'create') {
print '
';
print ' ';
print ''.$langs->trans('Date').' ';
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print ''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).' ';
}
print ''.$langs->trans('Type').' ';
@@ -2515,7 +2515,7 @@ if ($action == 'create') {
print '';
// Select project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print '';
$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print ' ';
diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php
index 1a289e61e2e..3f644b074bd 100644
--- a/htdocs/fichinter/card-rec.php
+++ b/htdocs/fichinter/card-rec.php
@@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -178,7 +178,6 @@ if ($action == 'add') {
$newinter->entity = $object->entity;
$newinter->duree = $object->duree;
- $newinter->datei = $object->date;
$newinter->description = $object->description;
$newinter->note_private = $object->note_private;
@@ -245,7 +244,7 @@ $companystatic = new Societe($db);
if (!empty($conf->contrat->enabled)) {
$contratstatic = new Contrat($db);
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$projectstatic = new Project($db);
}
@@ -273,7 +272,7 @@ if ($action == 'create') {
print dol_get_fiche_head();
$rowspan = 4;
- if (!empty($conf->projet->enabled) && $object->fk_project > 0) {
+ if (!empty($conf->project->enabled) && $object->fk_project > 0) {
$rowspan++;
}
if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) {
@@ -315,7 +314,7 @@ if ($action == 'create') {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
print " ".$langs->trans("Project")." ";
$projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
@@ -485,7 +484,7 @@ if ($action == 'create') {
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
@@ -804,7 +803,7 @@ if ($action == 'create') {
if (!empty($conf->contrat->enabled)) {
print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print_liste_field_titre("Project", $_SERVER['PHP_SELF'], "f.fk_project", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
}
print_liste_field_titre("Duration", $_SERVER['PHP_SELF'], 'f.duree', '', '', 'width="50px"', $sortfield, $sortorder, 'right ');
@@ -843,7 +842,7 @@ if ($action == 'create') {
}
print ' ';
}
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
print '';
if ($objp->fk_project > 0) {
$projectstatic->fetch($objp->fk_project);
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 4b7686449c7..fd07a30f648 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -787,7 +787,7 @@ $formfile = new FormFile($db);
if (!empty($conf->contrat->enabled)) {
$formcontract = new FormContract($db);
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -908,7 +908,7 @@ if ($action == 'create') {
print ' ';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
$langs->load("project");
@@ -1062,9 +1062,7 @@ if ($action == 'create') {
print '';
}
} elseif ($id > 0 || !empty($ref)) {
- /*
- * Affichage en mode visu
- */
+ // View mode
$object->fetch($id, $ref);
$object->fetch_thirdparty();
@@ -1161,7 +1159,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ficheinter->creer) {
@@ -1201,7 +1199,7 @@ if ($action == 'create') {
print '
';
print '
';
- print '
';
+ print '';
if (!empty($conf->global->FICHINTER_USE_PLANNED_AND_DONE_DATES)) {
// Date Start
@@ -1230,7 +1228,7 @@ if ($action == 'create') {
print '';
print $form->editfieldkey("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea');
print ' ';
- print $form->editfieldval("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea:8:80');
+ print $form->editfieldval("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea:8');
print ' ';
print ' ';
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index ac0f47ee4b3..b9f0264ad46 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -40,7 +40,7 @@ class Fichinter extends CommonObject
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>20),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20),
'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25),
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35),
@@ -1473,9 +1473,19 @@ class FichinterLigne extends CommonObjectLine
*/
public $fk_fichinter;
- public $desc; // Description ligne
- public $datei; // Date intervention
- public $duration; // Duree de l'intervention
+ public $desc; // Description ligne
+
+ /**
+ * @var int Date of intervention
+ */
+ public $date; // Date intervention
+ /**
+ * @var int Date of intervention
+ * @deprecated
+ */
+ public $datei; // Date intervention
+
+ public $duration; // Duration of intervention
public $rang = 0;
/**
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index f2f50963287..ef6ffc80881 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->ficheinter->creer) {
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 7fdcaa151a0..d0dd326df07 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -123,7 +123,7 @@ if ($object->id) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php
index e5eea9f846c..589f1901cd6 100644
--- a/htdocs/fichinter/info.php
+++ b/htdocs/fichinter/info.php
@@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -78,7 +78,7 @@ $morehtmlref = '';
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 125b88c5b8e..ef71f01e228 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
if (!empty($conf->contrat->enabled)) {
@@ -43,7 +43,7 @@ if (!empty($conf->contrat->enabled)) {
// Load translation files required by the page
$langs->loadLangs(array('companies', 'bills', 'interventions'));
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
}
if (!empty($conf->contrat->enabled)) {
@@ -120,7 +120,7 @@ $arrayfields = array(
'f.ref'=>array('label'=>'Ref', 'checked'=>1),
'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1),
's.nom'=>array('label'=>'ThirdParty', 'checked'=>1),
- 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
+ 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)),
'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)),
'f.description'=>array('label'=>'Description', 'checked'=>1),
'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500),
@@ -202,7 +202,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$objectstatic = new Fichinter($db);
$companystatic = new Societe($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$projetstatic = new Project($db);
}
if (!empty($conf->contrat->enabled)) {
@@ -234,7 +234,7 @@ if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines)
$sql .= " fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,";
}
$sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus";
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title";
}
if (!empty($conf->contrat->enabled)) {
@@ -251,7 +251,7 @@ $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."fichinter as f";
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid";
}
if (!empty($conf->contrat->enabled)) {
diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php
index 579760cf55f..be5f67da555 100644
--- a/htdocs/fichinter/note.php
+++ b/htdocs/fichinter/note.php
@@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -88,7 +88,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index c2962836fa2..e5b7c62aae4 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -294,8 +294,9 @@ $suburi = strstr($uri, '/'); // $suburi contains url without domain:port
if ($suburi == '/') {
$suburi = ''; // If $suburi is /, it is now ''
}
-define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
-
+if (!defined('DOL_URL_ROOT')) {
+ define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
+}
//print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n";
// Define prefix MAIN_DB_PREFIX
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 2d649589282..fb89cd2c455 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -70,7 +70,7 @@ $extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
-$hookmanager->initHooks(array('suppliercard', 'globalcard'));
+$hookmanager->initHooks(array('thirdpartysupplier', 'globalcard'));
// Security check
$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -147,6 +147,7 @@ if (empty($reshook)) {
if (!$error) {
$result = $object->insertExtraFields('COMPANY_MODIFY');
if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
@@ -170,6 +171,7 @@ if ($id > 0 && empty($object->id)) {
$res = $object->fetch($id);
if ($object->id <= 0) {
dol_print_error($db, $object->error);
+ exit(-1);
}
}
diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php
index 418d8fa6600..17146eecd35 100644
--- a/htdocs/fourn/class/api_supplier_invoices.class.php
+++ b/htdocs/fourn/class/api_supplier_invoices.class.php
@@ -473,7 +473,6 @@ class SupplierInvoices extends DolibarrApi
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
$paiement->paiementid = $payment_mode_id;
$paiement->paiementcode = dol_getIdFromCode($this->db, $payment_mode_id, 'c_paiement', 'id', 'code', 1);
- $paiement->oper = $paiement->paiementcode; // For backward compatibility
$paiement->num_payment = $num_payment;
$paiement->note_public = $comment;
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 1d0e370355f..00208d53a19 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -218,7 +218,7 @@ class CommandeFournisseur extends CommonOrder
'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35),
'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefOrderSupplierShort', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>1),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>45),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>45),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'date_approve' =>array('type'=>'datetime', 'label'=>'DateApprove', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
'date_approve2' =>array('type'=>'datetime', 'label'=>'DateApprove2', 'enabled'=>1, 'visible'=>3, 'position'=>64),
diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
index 5bfafff57b5..27c991e5896 100644
--- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
@@ -75,7 +75,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine
public $fk_product;
/**
- * @var int ID
+ * @var int ID. Should be named fk_origin_line ?
*/
public $fk_commandefourndet;
diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php
index 9464c06bd4c..31bc37b6e1a 100644
--- a/htdocs/fourn/class/fournisseur.facture-rec.class.php
+++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php
@@ -195,7 +195,7 @@ class FactureFournisseurRec extends CommonInvoice
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85),
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>175),
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
@@ -564,7 +564,7 @@ class FactureFournisseurRec extends CommonInvoice
$sql .= ', f.vat_src_code, f.localtax1, f.localtax2';
$sql .= ', f.total_tva, f.total_ht, f.total_ttc';
$sql .= ', f.fk_user_author, f.fk_user_modif';
- $sql .= ', f.fk_projet, f.fk_account';
+ $sql .= ', f.fk_projet as fk_project, f.fk_account';
$sql .= ', f.fk_mode_reglement, p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql .= ', f.fk_cond_reglement, c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
$sql .= ', f.date_lim_reglement';
@@ -610,7 +610,7 @@ class FactureFournisseurRec extends CommonInvoice
$this->total_ttc = $obj->total_ttc;
$this->user_author = $obj->fk_user_author;
$this->user_modif = $obj->fk_user_modif;
- $this->fk_project = $obj->fk_projet;
+ $this->fk_project = $obj->fk_project;
$this->fk_account = $obj->fk_account;
$this->mode_reglement_id = $obj->fk_mode_reglement;
$this->mode_reglement_code = $obj->mode_reglement_code;
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 948e1c01deb..df10ed07632 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -297,7 +297,7 @@ class FactureFournisseur extends CommonInvoice
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>130),
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
'fk_facture_source' =>array('type'=>'integer', 'label'=>'Fk facture source', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>145),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>145),
'fk_account' =>array('type'=>'integer', 'label'=>'Account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>150),
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155),
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
@@ -443,7 +443,8 @@ class FactureFournisseur extends CommonInvoice
$this->entity = $_facrec->entity; // Invoice created in same entity than template
// Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI
- $this->fk_projet = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_projet;
+ $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_projet;
+ $this->fk_projet = $this->fk_project;
$this->note_public = GETPOST('note_public', 'restricthtml') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public;
$this->note_private = GETPOST('note_private', 'restricthtml') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private;
$this->model_pdf = GETPOST('model', 'alpha') ? GETPOST('model', 'alpha') : $_facrec->model_pdf;
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 0417554f8fd..b1f746b2245 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -49,7 +49,7 @@ if (!empty($conf->supplier_proposal->enabled)) {
if (!empty($conf->product->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -160,7 +160,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede
// Project permission
$caneditproject = false;
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$caneditproject = empty($conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref));
}
@@ -1534,7 +1534,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formorder = new FormOrder($db);
$productstatic = new Product($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -1746,7 +1746,7 @@ if ($action == 'create') {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
$langs->load('projects');
@@ -2034,7 +2034,7 @@ if ($action == 'create') {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($usercancreate) {
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index e521caf1080..f05251993a7 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 362741e1641..7b352a01abc 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -553,7 +553,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index d54d5553efb..ca43b69fd5e 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -131,7 +131,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index 728986f5a88..771a6faf23f 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -139,7 +139,7 @@ $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index cc8bae4d907..22c4921b5b1 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -209,6 +209,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
$error = 0;
+$permissiontoread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
+$permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
+$permissiontodelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer);
+$permissiontovalidate = $permissiontoadd;
+$permissiontoapprove = ($user->rights->fournisseur->commande->approuver || $user->rights->supplier_order->approuver);
+
/*
* Actions
@@ -302,9 +308,6 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'CommandeFournisseur';
$objectlabel = 'SupplierOrders';
- $permissiontoread = $user->rights->fournisseur->commande->lire;
- $permissiontodelete = $user->rights->fournisseur->commande->supprimer;
- $permissiontovalidate = $user->rights->fournisseur->commande->creer;
$uploaddir = $conf->fournisseur->commande->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
@@ -321,7 +324,7 @@ if (empty($reshook)) {
$result = $objecttmp->valid($user);
if ($result >= 0) {
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
- if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) {
+ if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $permissiontoapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) {
$result = $objecttmp->approve($user);
setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref));
} else {
@@ -1096,7 +1099,7 @@ if ($resql) {
);
if ($permissiontovalidate) {
- if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) {
+ if ($permissiontoapprove && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) {
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove");
} else {
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
@@ -1106,7 +1109,7 @@ if ($resql) {
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier");
}
- if ($user->rights->fournisseur->commande->supprimer) {
+ if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) {
@@ -1119,7 +1122,7 @@ if ($resql) {
$url .= '&socid='.((int) $socid);
$url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid));
}
- $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer));
+ $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissitiontoadd);
// Lines of title fields
print '