';
$tmptitle = $langs->trans('IncludingProductWithTag');
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index b90f3c8ebd0..506a1465fdc 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -137,14 +137,14 @@ if ($action == 'add' && !empty($permissiontoadd)) {
$result = $object->create($user);
if ($result > 0) {
// Creation OK
- if ($conf->categorie->enabled && method_exists($object, 'setCategories')) {
+ if (isModEnabled('categorie') && method_exists($object, 'setCategories')) {
$categories = GETPOST('categories', 'array:int');
$object->setCategories($categories);
}
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
- if (!empty($noback)) {
+ if (empty($noback)) {
header("Location: " . $urltogo);
exit;
}
@@ -244,7 +244,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
}
}
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
$categories = GETPOST('categories', 'array');
if (method_exists($object, 'setCategories')) {
$object->setCategories($categories);
@@ -266,7 +266,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
$action = 'view';
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
- if ($urltogo) {
+ if ($urltogo && !$noback) {
header("Location: " . $urltogo);
exit;
}
@@ -320,7 +320,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
- if (!empty($noback)) {
+ if (empty($noback)) {
header("Location: " . $backurlforlist);
exit;
}
@@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs');
- if (!empty($noback)) {
+ if (empty($noback)) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
exit;
}
@@ -507,7 +507,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd))
$newid = $result;
}
- if (!empty($noback)) {
+ if (empty($noback)) {
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object
exit;
}
diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php
index c813e8af4a0..69d46dae51c 100644
--- a/htdocs/core/actions_builddoc.inc.php
+++ b/htdocs/core/actions_builddoc.inc.php
@@ -26,7 +26,7 @@
// $id must be defined
// $object must be defined and must have a method generateDocument().
// $permissiontoadd must be defined
-// $upload_dir must be defined (example $conf->projet->dir_output . "/";)
+// $upload_dir must be defined (example $conf->project->dir_output . "/";)
// $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not.
if (!empty($permissioncreate) && empty($permissiontoadd)) {
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 5acc6b22ee2..9ec4db2bd11 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.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
@@ -455,7 +455,7 @@ if (!$error && $massaction == 'confirm_presend') {
//var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref);
foreach ($looparray as $objectid => $objecttmp) { // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
// Make substitution in email content
- if (!empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) {
+ if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) {
$objecttmp->fetch_projet();
}
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp);
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index c4b79d89920..ce47cc3568f 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -252,9 +252,9 @@ if ($type == 'directory') {
} elseif ($module == 'salaries') {
$upload_dir = $conf->salaries->dir_output;
} elseif ($module == 'project') {
- $upload_dir = $conf->projet->dir_output;
+ $upload_dir = $conf->project->dir_output;
} elseif ($module == 'project_task') {
- $upload_dir = $conf->projet->dir_output;
+ $upload_dir = $conf->project->dir_output;
} elseif ($module == 'fichinter') {
$upload_dir = $conf->ficheinter->dir_output;
} elseif ($module == 'user') {
diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php
index ae4f7c41515..c1199477f58 100644
--- a/htdocs/core/ajax/selectsearchbox.php
+++ b/htdocs/core/ajax/selectsearchbox.php
@@ -89,10 +89,10 @@ if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->glob
$arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
-if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) {
+if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) {
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
-if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) {
+if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) {
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
@@ -105,7 +105,7 @@ if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUS
if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) {
$arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
-if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
+if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
$arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
@@ -120,7 +120,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
}
// Customer payments
-if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
+if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
$arrayresult['searchintocustomerpayments'] = array(
'position'=>170,
'img'=>'object_payment',
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index 02b5070a96c..ea43eff12fc 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -62,7 +62,7 @@ class box_activity extends ModeleBoxes
// FIXME: Pb into some status
$this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
- $this->hidden = !((!empty($conf->facture->enabled) && $user->rights->facture->lire)
+ $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire)
|| (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|| (!empty($conf->propal->enabled) && $user->rights->propale->lire)
);
@@ -278,7 +278,7 @@ class box_activity extends ModeleBoxes
// list the summary of the bills
- if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
+ if (isModEnabled('facture') && $user->rights->facture->lire) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic = new Facture($this->db);
diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php
index 24be4100dab..b25a42228e7 100644
--- a/htdocs/core/boxes/box_dolibarr_state_board.php
+++ b/htdocs/core/boxes/box_dolibarr_state_board.php
@@ -126,14 +126,14 @@ class box_dolibarr_state_board extends ModeleBoxes
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,
- 'invoices' => !empty($conf->facture->enabled) && $user->rights->facture->lire,
+ 'invoices' => isModEnabled('facture') && $user->rights->facture->lire,
'donations' => !empty($conf->don->enabled) && $user->rights->don->lire,
'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire,
'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
- 'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire,
+ 'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire,
'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read,
'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read,
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index adcc750a6a8..afed778912f 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -60,7 +60,7 @@ class box_graph_product_distribution extends ModeleBoxes
$this->db = $db;
$this->hidden = !(
- (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire))
+ (isModEnabled('facture') && !empty($user->rights->facture->lire))
|| (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire))
|| (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire))
);
@@ -107,7 +107,7 @@ class box_graph_product_distribution extends ModeleBoxes
$showinvoicenb = 1;
$showordernb = 1;
}
- if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) {
+ if (!isModEnabled('facture') || empty($user->rights->facture->lire)) {
$showinvoicenb = 0;
}
if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) {
@@ -278,7 +278,7 @@ class box_graph_product_distribution extends ModeleBoxes
}
- if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
+ if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showinvoicenb) {
$langs->load("bills");
@@ -372,7 +372,7 @@ class box_graph_product_distribution extends ModeleBoxes
if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) {
$stringtoshow .= '
'.$langs->trans("ForCustomersOrders");
}
- if (!empty($conf->facture->enabled) || !empty($user->rights->facture->lire)) {
+ if (isModEnabled('facture') || !empty($user->rights->facture->lire)) {
$stringtoshow .= '
'.$langs->trans("ForCustomersInvoices");
$stringtoshow .= ' ';
}
diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php
index 6b4a033f1a2..91ce3c93c36 100644
--- a/htdocs/core/boxes/box_members_last_modified.php
+++ b/htdocs/core/boxes/box_members_last_modified.php
@@ -109,7 +109,7 @@ class box_members_last_modified extends ModeleBoxes
while ($line < $num) {
$objp = $this->db->fetch_object($result);
$datec = $this->db->jdate($objp->datec);
- $datem = $this->db->jdate($objp->tms);
+ $datem = $this->db->jdate($objp->datem);
$memberstatic->lastname = $objp->lastname;
$memberstatic->firstname = $objp->firstname;
diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php
index 63a4e90cdd0..909ff32acb9 100644
--- a/htdocs/core/boxes/box_project.php
+++ b/htdocs/core/boxes/box_project.php
@@ -84,6 +84,7 @@ class box_project extends ModeleBoxes
$textHead = $langs->trans("OpenedProjects");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
+ $i = 0;
// list the summary of the orders
if ($user->rights->projet->lire) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -113,7 +114,6 @@ class box_project extends ModeleBoxes
if ($result) {
$num = $this->db->num_rows($result);
- $i = 0;
while ($i < min($num, $max)) {
$objp = $this->db->fetch_object($result);
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 06d352441be..14b19023420 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -168,17 +168,18 @@ abstract class CommonInvoice extends CommonObject
/**
* Return amount (with tax) of all deposits invoices used by invoice.
- * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended).
+ * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended),
+ * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended).
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return float <0 and set ->error if KO, Sum of deposits amount otherwise
*/
public function getSumDepositsUsed($multicurrency = 0)
{
- if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
+ /*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
// FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case.
return 0.0;
- }
+ }*/
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index b39facd16a4..71ecd3f75d1 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -186,6 +186,12 @@ abstract class CommonObject
*/
public $projet;
+ /**
+ * @deprecated
+ * @see fk_project
+ */
+ public $fk_projet;
+
/**
* @var Contact a related contact
* @see fetch_contact()
@@ -1659,13 +1665,13 @@ abstract class CommonObject
// phpcs:enable
global $conf;
- if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) {
+ if (empty($this->socid) && empty($this->fk_soc) && empty($force_thirdparty_id)) {
return 0;
}
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
- $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : $this->fk_thirdparty);
+ $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : 0);
if ($force_thirdparty_id) {
$idtofetch = $force_thirdparty_id;
}
@@ -6148,7 +6154,7 @@ abstract class CommonObject
//var_dump($this->oldcopy);exit;
if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
//var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]);
- if ($this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update.
+ if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update.
$new_array_options[$key] = $this->array_options[$key]; // Value is kept
} else {
// var_dump($algo);
@@ -7556,11 +7562,15 @@ abstract class CommonObject
if ($classname && class_exists($classname)) {
$object = new $classname($this->db);
if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong
- $object->fetch($value, '', '', '', 0, 1, 1);
+ $result = $object->fetch($value, '', '', '', 0, 1, 1);
} else {
- $object->fetch($value);
+ $result = $object->fetch($value);
+ }
+ if ($result > 0) {
+ $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
+ } else {
+ $value = '';
}
- $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
}
} else {
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php
index 410bf41a601..870d4c1d8df 100644
--- a/htdocs/core/class/commonorder.class.php
+++ b/htdocs/core/class/commonorder.class.php
@@ -72,11 +72,23 @@ abstract class CommonOrderLine extends CommonObjectLine
*/
public $product_label;
+ /**
+ * Boolean that indicates whether the product is available for sale '1' or not '0'
+ * @var int
+ */
+ public $product_tosell=0;
+
+ /**
+ * Boolean that indicates whether the product is available for purchase '1' or not '0'
+ * @var int
+ */
+ public $product_tobuy=0;
+
/**
* Product description
* @var string
*/
- public $product_desc;
+ public $product_desc;
/**
* Product use lot
diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php
index ccd495bb623..c42612afda8 100644
--- a/htdocs/core/class/evalmath.class.php
+++ b/htdocs/core/class/evalmath.class.php
@@ -144,6 +144,10 @@ class EvalMath
*/
public function evaluate($expr)
{
+ if (empty($expr)) {
+ return false;
+ }
+
$this->last_error = null;
$this->last_error_code = null;
$expr = trim($expr);
@@ -366,18 +370,14 @@ class EvalMath
}
/**
- * evaluate postfix notation
+ * Evaluate postfix notation
*
- * @param string $tokens Expression
+ * @param string $tokens An array of expression to evaluate ('operators'). The operand are into ->stack.
* @param array $vars Array
* @return string Output
*/
private function pfx($tokens, $vars = array())
{
- if ($tokens == false) {
- return false;
- }
-
$stack = new EvalMathStack();
foreach ($tokens as $token) { // nice and easy
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index c7651c81d26..625e473e7e6 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -60,6 +60,11 @@ class ExtraFields
*/
public $attribute_choice;
+ /**
+ * @var array array to store extrafields definition
+ * @deprecated
+ */
+ public $attribute_list;
/**
* @var array New array to store extrafields definition
@@ -1709,7 +1714,9 @@ class ExtraFields
$toprint = array();
if (is_array($value_arr)) {
foreach ($value_arr as $keyval => $valueval) {
- $toprint[] = '
';
@@ -2066,7 +2073,7 @@ class ExtraFields
} elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) {
$value_arr = GETPOST("options_".$key, 'array'); // check if an array
if (!empty($value_arr)) {
- $value_key = implode($value_arr, ',');
+ $value_key = implode(',', $value_arr);
} else {
$value_key = '';
}
diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php
index 8e325fd13e2..b1e085fbff7 100644
--- a/htdocs/core/class/fileupload.class.php
+++ b/htdocs/core/class/fileupload.class.php
@@ -72,7 +72,7 @@ class FileUpload
} elseif ($element == 'project_task') {
$pathname = 'projet';
$filename = 'task';
- $dir_output = $conf->projet->dir_output;
+ $dir_output = $conf->project->dir_output;
$parentForeignKey = 'fk_project';
$parentClass = 'Project';
$parentElement = 'projet';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c5c9f7164ec..56990effeb2 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4362,6 +4362,7 @@ class Form
print ' selected';
}
print '>';
+ $value = '';
if ($format == 0) {
$value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
} elseif ($format == 1) {
@@ -8501,13 +8502,13 @@ class Form
// To work with non standard path
if ($objecttype == 'facture') {
$tplpath = 'compta/'.$element;
- if (empty($conf->facture->enabled)) {
+ if (!isModEnabled('facture')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'facturerec') {
$tplpath = 'compta/facture';
$tplname = 'linkedobjectblockForRec';
- if (empty($conf->facture->enabled)) {
+ if (!isModEnabled('facture')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'propal') {
@@ -8643,12 +8644,12 @@ class Form
'label'=>'LinkToOrder',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'),
'invoice'=>array(
- 'enabled'=>(!empty($conf->facture->enabled) ? $conf->facture->enabled : 0),
+ 'enabled'=>isModEnabled('facture'),
'perms'=>1,
'label'=>'LinkToInvoice',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
'invoice_template'=>array(
- 'enabled'=>(!empty($conf->facture->enabled) ? $conf->facture->enabled : 0),
+ 'enabled'=>isModEnabled('facture'),
'perms'=>1,
'label'=>'LinkToTemplateInvoice',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
@@ -9374,16 +9375,16 @@ class Form
/**
* Return select list of groups
*
- * @param string $selected Id group preselected
- * @param string $htmlname Field name in form
- * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
- * @param string $exclude Array list of groups id to exclude
- * @param int $disabled If select list must be disabled
- * @param string $include Array list of groups id to include
- * @param int $enableonly Array list of groups id to be enabled. All other must be disabled
- * @param string $force_entity '0' or Ids of environment to force
- * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter)
- * @param string $morecss More css to add to html component
+ * @param string $selected Id group preselected
+ * @param string $htmlname Field name in form
+ * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
+ * @param string|array $exclude Array list of groups id to exclude
+ * @param int $disabled If select list must be disabled
+ * @param string|array $include Array list of groups id to include
+ * @param int $enableonly Array list of groups id to be enabled. All other must be disabled
+ * @param string $force_entity '0' or Ids of environment to force
+ * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter)
+ * @param string $morecss More css to add to html component
* @return string
* @see select_dolusers()
*/
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 1bc009491d1..242c1476736 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -226,7 +226,7 @@ class FormActions
}
$newcardbutton = '';
- if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) {
+ if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) {
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage);
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url);
}
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index ad6a6c12508..27ef700cd09 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -116,6 +116,7 @@ class FormMail extends Form
* @var int|string|array
*/
public $withto; // Show recipient emails
+ public $withreplyto;
/**
* @var int|string 0 = Do not Show free text for recipient emails
@@ -395,7 +396,7 @@ class FormMail extends Form
// Define output language
$outputlangs = $langs;
$newlang = '';
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
+ if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $this->param['langsmodels'];
}
if (!empty($newlang)) {
@@ -584,7 +585,10 @@ class FormMail extends Form
}
// Add also company main email
- $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
+ if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
+ $liste['company'] = !empty($conf->global->MAIN_INFO_SOCIETE_NOM)?$conf->global->MAIN_INFO_SOCIETE_NOM:$conf->global->MAIN_INFO_SOCIETE_MAIL;
+ $liste['company'].=' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
+ }
// Add also email aliases if there is some
$listaliases = array(
@@ -1540,7 +1544,7 @@ class FormMail extends Form
$extrafields->fetch_name_optionals_label($product->table_element, true);
- if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) {
+ if (!empty($extrafields->attributes[$product->table_element]['label']) && is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) {
foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) {
$substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key];
}
@@ -1618,7 +1622,7 @@ class FormMail extends Form
if (!empty($conf->don->enabled)) {
$tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation';
}
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice';
}
if (!empty($conf->commande->enabled)) {
@@ -1635,7 +1639,7 @@ class FormMail extends Form
if (!empty($conf->don->enabled)) {
$tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation';
}
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice';
}
if (!empty($conf->commande->enabled)) {
@@ -1672,6 +1676,8 @@ class FormMail extends Form
/**
* ModelMail
+ *
+ * Object of table llx_c_email_templates
*/
class ModelMail
{
@@ -1685,6 +1691,16 @@ class ModelMail
*/
public $label;
+ /**
+ * @var int Owner of email template
+ */
+ public $fk_user;
+
+ /**
+ * @var int Is template private
+ */
+ public $private;
+
/**
* @var string Model mail topic
*/
@@ -1702,4 +1718,9 @@ class ModelMail
* @var string Module the template is dedicated for
*/
public $module;
+
+ /**
+ * @var int Position of template in a combo list
+ */
+ public $position;
}
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index 31a48f38cf4..f1c6e12e925 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -47,6 +47,9 @@ class FormTicket
*/
public $db;
+ /**
+ * @var string The track_id of the ticket. Used also for the $keytoavoidconflict to name session vars to upload files.
+ */
public $track_id;
/**
@@ -433,7 +436,7 @@ class FormTicket
}
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
@@ -612,7 +615,7 @@ class FormTicket
}
if ($subelement != 'project') {
- if (!empty($conf->projet->enabled) && !$this->ispublic) {
+ if (!empty($conf->project->enabled) && !$this->ispublic) {
$formproject = new FormProjets($this->db);
print '
';
}
// Customer invoices
- if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
+ if (isModEnabled('facture') && $user->rights->facture->lire) {
$nblines++;
$ret = $product->load_stats_facture($socid);
if ($ret < 0) {
@@ -468,6 +468,25 @@ function show_stats_for_company($product, $socid)
print '';
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 14b25a517c6..d53870128fc 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|| !empty($conf->propal->enabled) || !empty($conf->commande->enabled)
- || !empty($conf->facture->enabled) || !empty($conf->contrat->enabled)
+ || isModEnabled('facture') || !empty($conf->contrat->enabled)
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) {
$nbElements = 0;
// Enable caching of thirdrparty count Contacts
@@ -144,10 +144,10 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->commande->enabled)) {
$nbElements += $project->getElementCount('order', 'commande');
}
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$nbElements += $project->getElementCount('invoice', 'facture');
}
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$nbElements += $project->getElementCount('invoice_predefined', 'facture_rec');
}
if (!empty($conf->supplier_proposal->enabled)) {
@@ -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;
@@ -313,7 +313,7 @@ function project_prepare_head(Project $project, $moreparam = '')
$head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
@@ -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)$'));
diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php
index 29cd8a5b089..f222857b9d8 100644
--- a/htdocs/core/lib/resource.lib.php
+++ b/htdocs/core/lib/resource.lib.php
@@ -87,7 +87,7 @@ function resource_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/resource/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 19b4d01f9d9..056d28ab2cd 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -774,7 +774,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 1;
}
if (in_array($feature, $checkproject)) {
- if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) {
+ if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) {
$projectid = $objectid;
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -795,7 +795,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 1;
}
if (in_array($feature, $checktask)) {
- if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) {
+ if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) {
$task = new Task($db);
$task->fetch($objectid);
$projectid = $task->fk_project;
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index 5b220553bfe..e1544e763df 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -126,7 +126,7 @@ function ticket_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id;
}
$head[$h][1] = $langs->trans('Events');
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
@@ -304,7 +304,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
}
$sortfield_new = implode(',', $sortfield_new_list);
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
// Search histo on actioncomm
if (is_object($objcon) && $objcon->id > 0) {
$sql = "SELECT DISTINCT a.id, a.label as label,";
@@ -565,7 +565,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning');
}
- if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) {
+ if (isModEnabled('agenda') || (!empty($conf->mailing->enabled) && !empty($objcon->email))) {
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index dac412f92a6..538fc299564 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -72,7 +72,7 @@ function user_prepare_head(User $object)
$head[$h][2] = 'guisetup';
$h++;
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (empty($conf->global->AGENDA_EXT_NB)) {
$conf->global->AGENDA_EXT_NB = 5;
}
@@ -372,7 +372,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '';
}
- 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/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index ea6d21fe457..adc4f8d487c 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -229,7 +229,7 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode)
*/
function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget)
{
- global $langs;
+ global $langs, $conf;
$classnameimg = str_replace('class="', 'class="tmenuimage ', $classname);
$classnametxt = str_replace('class="', 'class="tmenulabel ', $classname);
@@ -339,7 +339,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid ? 1 : 0), 'auguria', $tabMenu);
// We update newmenu for special dynamic menus
- if (!empty($conf->banque->enabled) && $user->rights->banque->lire && $mainmenu == 'bank') { // Entry for each bank account
+ if (isModEnabled('banque') && $user->rights->banque->lire && $mainmenu == 'bank') { // Entry for each bank account
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example
$sql = "SELECT rowid, label, courant, rappro, courant";
@@ -371,7 +371,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$db->free($resql);
}
- if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account
+ if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account
$newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', 'accountancy', 'accountancy', 10);
// Multi journal
@@ -393,18 +393,18 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$nature = '';
// Must match array $sourceList defined into journals_list.php
- if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
+ if ($objp->nature == 2 && isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
$nature = "sells";
}
if ($objp->nature == 3
- && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))
+ && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))
&& empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
$nature = "purchases";
}
- if ($objp->nature == 4 && !empty($conf->banque->enabled)) {
+ if ($objp->nature == 4 && isModEnabled('banque')) {
$nature = "bank";
}
- if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
+ if ($objp->nature == 5 && isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
$nature = "expensereports";
}
if ($objp->nature == 1) {
@@ -441,7 +441,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$db->free($resql);
}
- if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP
+ if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP
$MAXFTP = 20;
$i = 1;
while ($i <= $MAXFTP) {
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 0c5662437b5..9e88d4dda3d 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -94,7 +94,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Members
$tmpentry = array(
- 'enabled' => (!empty($conf->adherent->enabled)),
+ 'enabled' => (isModEnabled('adherent')),
'perms' => (!empty($user->rights->adherent->lire)),
'module' => 'adherent'
);
@@ -119,10 +119,10 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Third parties
$tmpentry = array(
- 'enabled'=> ((!empty($conf->societe->enabled) &&
+ 'enabled'=> ((isModEnabled('societe') &&
(empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
)
- || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
+ || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice'))
),
'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)),
'module'=>'societe|fournisseur'
@@ -148,16 +148,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Products-Services
$tmpentry = array(
- 'enabled'=> (!empty($conf->product->enabled) || !empty($conf->service->enabled) || !empty($conf->expedition->enabled)),
+ 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')),
'perms'=> (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire) || !empty($user->rights->expedition->lire)),
'module'=>'product|service'
);
$menu_arr[] = array(
'name' => 'Products',
'link' => '/product/index.php?mainmenu=products&leftmenu=',
- 'title' => (!empty($conf->product->enabled) && !empty($conf->service->enabled))
+ 'title' => (isModEnabled('product') && isModEnabled('service'))
? (array("TMenuProducts", " | ", "TMenuServices"))
- : (!empty($conf->product->enabled) ? "TMenuProducts" : "TMenuServices"),
+ : (isModEnabled('product') ? "TMenuProducts" : "TMenuServices"),
'level' => 0,
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
'target' => $atarget,
@@ -175,7 +175,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// MRP - GPAO
$tmpentry = array(
- 'enabled'=>(!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)),
+ 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')),
'perms'=>(!empty($user->rights->bom->read) || !empty($user->rights->mrp->read)),
'module'=>'bom|mrp'
);
@@ -200,7 +200,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Projects
$tmpentry = array(
- 'enabled'=> (!empty($conf->projet->enabled) ? 1 : 0),
+ 'enabled'=> (isModEnabled('projet') ? 1 : 0),
'perms'=> (!empty($user->rights->projet->lire) ? 1 : 0),
'module'=>'projet'
);
@@ -225,13 +225,13 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Commercial (propal, commande, supplier_proposal, supplier_order, contrat, ficheinter)
$tmpentry = array(
- 'enabled'=>(!empty($conf->propal->enabled)
- || !empty($conf->commande->enabled)
- || !empty($conf->fournisseur->enabled)
- || !empty($conf->supplier_proposal->enabled)
- || !empty($conf->supplier_order->enabled)
- || !empty($conf->contrat->enabled)
- || !empty($conf->ficheinter->enabled)
+ 'enabled'=>(isModEnabled('propal')
+ || isModEnabled('commande')
+ || isModEnabled('fournisseur')
+ || isModEnabled('supplier_proposal')
+ || isModEnabled('supplier_order')
+ || isModEnabled('contrat')
+ || isModEnabled('ficheinter')
) ? 1 : 0,
'perms'=>(!empty($user->rights->propal->lire)
|| !empty($user->rights->commande->lire)
@@ -274,13 +274,13 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Billing - Financial
$tmpentry = array(
- 'enabled'=>(!empty($conf->facture->enabled) ||
- !empty($conf->don->enabled) ||
- !empty($conf->tax->enabled) ||
- !empty($conf->salaries->enabled) ||
- !empty($conf->supplier_invoice->enabled) ||
- !empty($conf->loan->enabled) ||
- !empty($conf->margins->enabled)
+ 'enabled'=>(isModEnabled('facture') ||
+ isModEnabled('don') ||
+ isModEnabled('tax') ||
+ isModEnabled('salaries') ||
+ isModEnabled('supplier_invoice') ||
+ isModEnabled('loan') ||
+ isModEnabled('margins')
) ? 1 : 0,
'perms'=>(!empty($user->rights->facture->lire) || !empty($user->rights->don->contact->lire)
|| !empty($user->rights->tax->charges->lire) || !empty($user->rights->salaries->read)
@@ -308,7 +308,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Bank
$tmpentry = array(
- 'enabled'=>(!empty($conf->banque->enabled) || !empty($conf->prelevement->enabled)),
+ 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')),
'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)),
'module'=>'banque|prelevement|paymentbybanktransfer'
);
@@ -333,7 +333,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Accounting
$tmpentry = array(
- 'enabled'=>(!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->asset->enabled) || !empty($conf->intracommreport->enabled)),
+ 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')),
'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->comptarapport->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)),
'module'=>'comptabilite|accounting|asset|intracommreport'
);
@@ -358,7 +358,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// HRM
$tmpentry = array(
- 'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)),
+ 'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')),
'perms'=>(!empty($user->rights->user->user->lire) || !empty($user->rights->holiday->read) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)),
'module'=>'hrm|holiday|deplacement|expensereport|recruitment'
);
@@ -384,12 +384,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Tickets and knowledge base
$tmpentry = array(
- 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)),
+ 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')),
'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)),
'module'=>'ticket|knowledgemanagement'
);
$link = '';
- if (!empty($conf->ticket->enabled)) {
+ if (isModEnabled('ticket')) {
$link = '/ticket/index.php?mainmenu=ticket&leftmenu=';
} else {
$link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu=';
@@ -827,7 +827,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, (empty($user->socid) ? 0 : 1), 'eldy', $tabMenu);
//var_dump($newmenu->liste); //
- if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP
+ if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP
$MAXFTP = 20;
$i = 1;
while ($i <= $MAXFTP) {
@@ -1142,7 +1142,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$newmenu->add("/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"), 1);
$newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1);
- if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
+ if (isModEnabled('product') || isModEnabled('service')) {
$langs->load("products");
$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
}
@@ -1152,16 +1152,16 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
if ($user->rights->user->user->lire) {
if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") {
$newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin);
- $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home');
+ $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home');
$newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin);
$newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin);
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat');
}
- $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
- $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
- $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
+ $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
+ $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
+ $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
}
}
}
@@ -1183,7 +1183,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
if ($mainmenu == 'companies') {
// Societes
- if (!empty($conf->societe->enabled)) {
+ if (isModEnabled('societe')) {
$langs->load("companies");
$newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"'));
@@ -1198,7 +1198,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
$newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"), 1);
// Prospects
- if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
+ if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
$langs->load("commercial");
$newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'prospects');
/* no more required, there is a filter that can do more
@@ -1212,7 +1212,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
}
// Customers/Prospects
- if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
+ if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
$langs->load("commercial");
$newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'customers');
@@ -1220,14 +1220,14 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
}
// Suppliers
- if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) {
+ if (isModEnabled('societe') && (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) || isModEnabled('supplier_proposal'))) {
$langs->load("suppliers");
$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers');
$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire));
}
// Categories
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
// Categories prospects/customers
@@ -1241,7 +1241,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
}
// Categories suppliers
- if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
+ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
$newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire);
}
}
@@ -1257,14 +1257,14 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire);
}
- if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
+ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
$newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire);
}
$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire);
//$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire);
// Categories
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
// Categories Contact
$newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
@@ -1290,7 +1290,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
$langs->load("companies");
// Customer proposal
- if (!empty($conf->propal->enabled)) {
+ if (isModEnabled('propal')) {
$langs->load("propal");
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
@@ -1307,7 +1307,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
}
// Customers orders
- if (!empty($conf->commande->enabled)) {
+ if (isModEnabled('commande')) {
$langs->load("orders");
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
@@ -1315,7 +1315,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") {
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
- if (!empty($conf->expedition->enabled)) {
+ if (isModEnabled('expedition')) {
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire);
}
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire);
@@ -1326,7 +1326,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
}
// Supplier proposal
- if (!empty($conf->supplier_proposal->enabled)) {
+ if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal");
$newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->rights->supplier_proposal->creer);
@@ -1335,7 +1335,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
}
// Suppliers orders
- if (!empty($conf->supplier_order->enabled)) {
+ if (isModEnabled('supplier_order')) {
$langs->load("orders");
$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->rights->fournisseur->commande->creer);
@@ -1360,7 +1360,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
}
// Contrat
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$langs->load("contracts");
$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer);
@@ -1375,7 +1375,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
}
// Interventions
- if (!empty($conf->ficheinter->enabled)) {
+ if (isModEnabled('ficheinter')) {
$langs->load("interventions");
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
@@ -1406,7 +1406,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
$langs->load("companies");
// Customers invoices
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$langs->load("bills");
$newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer);
@@ -1433,7 +1433,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
}
// Suppliers invoices
- if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) {
+ if (isModEnabled('societe') && isModEnabled('supplier_invoice')) {
$langs->load("bills");
$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create');
@@ -1457,16 +1457,16 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
}
// Orders
- if (!empty($conf->commande->enabled)) {
+ if (isModEnabled('commande')) {
$langs->load("orders");
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
}
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
}
// Supplier Orders to bill
- if (!empty($conf->supplier_invoice->enabled)) {
+ if (isModEnabled('supplier_invoice')) {
if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) {
$langs->load("supplier");
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
@@ -1476,7 +1476,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
// Donations
- if (!empty($conf->don->enabled)) {
+ if (isModEnabled('don')) {
$langs->load("donations");
$newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") {
@@ -1487,7 +1487,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
}
// Taxes and social contributions
- if (!empty($conf->tax->enabled)) {
+ if (isModEnabled('tax')) {
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire);
@@ -1536,7 +1536,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
}
// Salaries
- if (!empty($conf->salaries->enabled)) {
+ if (isModEnabled('salaries')) {
$langs->load("salaries");
$newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) {
@@ -1548,7 +1548,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
}
// Loan
- if (!empty($conf->loan->enabled)) {
+ if (isModEnabled('loan')) {
$langs->load("loan");
$newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->rights->loan->read, '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) {
@@ -1558,7 +1558,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
}
// Various payment
- if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
+ if (isModEnabled('banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
$langs->load("banks");
$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) {
@@ -1588,8 +1588,8 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
$langs->load("companies");
// Accounting (Double entries)
- if (!empty($conf->accounting->enabled)) {
- //$permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
+ if (isModEnabled('accounting')) {
+ //$permtoshowmenu = (isModEnabled('accounting') || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
//$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
// Configuration
@@ -1609,16 +1609,16 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
$newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41);
$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 50);
$newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 60);
- if (!empty($conf->banque->enabled)) {
+ if (isModEnabled('banque')) {
$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70);
}
- if (!empty($conf->facture->enabled) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) {
+ if (isModEnabled('facture') || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) {
$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80);
}
- if (!empty($conf->tax->enabled)) {
+ if (isModEnabled('tax')) {
$newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 90);
}
- if (!empty($conf->expensereport->enabled)) {
+ if (isModEnabled('expensereport')) {
$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 100);
}
$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 110);
@@ -1633,21 +1633,21 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
// Binding
// $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch');
- if (!empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
+ if (isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
$newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) {
$newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write);
$newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write);
}
}
- if (!empty($conf->supplier_invoice->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
+ if (isModEnabled('supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
$newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) {
$newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write);
$newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write);
}
}
- if (!empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
+ if (isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
$newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) {
$newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write);
@@ -1656,7 +1656,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
// Journals
- if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
+ if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
$newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', '', '');
// Multi journal
@@ -1678,21 +1678,21 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
$nature = '';
// Must match array $sourceList defined into journals_list.php
- if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
+ if ($objp->nature == 2 && isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
$nature = "sells";
}
if ($objp->nature == 3
- && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))
+ && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))
&& empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
$nature = "purchases";
}
- if ($objp->nature == 4 && !empty($conf->banque->enabled)) {
+ if ($objp->nature == 4 && isModEnabled('banque')) {
$nature = "bank";
}
- if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
+ if ($objp->nature == 5 && isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
$nature = "expensereports";
}
- if ($objp->nature == 1 && !empty($conf->asset->enabled)) {
+ if ($objp->nature == 1 && isModEnabled('asset')) {
$nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists.
}
if ($objp->nature == 8) {
@@ -1757,7 +1757,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
$modecompta = 'CREANCES-DETTES';
- if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
+ if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
$modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
}
if ($modecompta) {
@@ -1771,7 +1771,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
$modecompta = 'RECETTES-DEPENSES';
- //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
+ //if (isModEnabled('accounting') && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
if ($modecompta) {
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire);
@@ -1783,10 +1783,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
$modecompta = 'CREANCES-DETTES';
- if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
+ if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
$modecompta = 'BOOKKEEPING'; // Not yet implemented.
}
- if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) {
+ if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) {
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire);
$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire);
@@ -1795,10 +1795,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
$modecompta = 'RECETTES-DEPENSES';
- if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
+ if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
$modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented.
}
- if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) {
+ if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) {
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire);
$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire);
@@ -1807,7 +1807,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
// Accountancy (simple)
- if (!empty($conf->comptabilite->enabled)) {
+ if (isModEnabled('comptabilite')) {
// Files
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files');
@@ -1826,7 +1826,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
/*
$newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire);
- if (! empty($conf->propal->enabled)) {
+ if (isModEnabled('propal')) {
$newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire);
}
@@ -1865,7 +1865,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
// Intracomm report
- if (!empty($conf->intracommreport->enabled)) {
+ if (isModEnabled('intracommreport')) {
$newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->rights->intracommreport->read, '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) {
// DEB / DES
@@ -1875,7 +1875,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
}
// Assets
- if (!empty($conf->asset->enabled)) {
+ if (isModEnabled('asset')) {
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write);
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read);
@@ -1907,7 +1907,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$langs->loadLangs(array("withdrawals", "banks", "bills", "categories"));
// Bank-Cash account
- if (!empty($conf->banque->enabled)) {
+ if (isModEnabled('banque')) {
$newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer);
@@ -1918,14 +1918,14 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer);
}
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
$newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags');
$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->banque->configurer, '', $mainmenu, 'tags');
}
// Direct debit order
- if (!empty($conf->prelevement->enabled)) {
+ if (isModEnabled('prelevement')) {
$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") {
@@ -1939,7 +1939,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
}
// Bank transfer order
- if (!empty($conf->paymentbybanktransfer->enabled)) {
+ if (isModEnabled('paymentbybanktransfer')) {
$newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") {
@@ -1953,7 +1953,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
}
// Management of checks
- if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) {
+ if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled('banque') && (isModEnabled('facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) {
$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
if (preg_match('/checks/', $leftmenu)) {
$newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque);
@@ -1962,7 +1962,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
}
// Cash Control
- if (!empty($conf->takepos->enabled) || !empty($conf->cashdesk->enabled)) {
+ if (isModEnabled('takepos') || isModEnabled('cashdesk')) {
$permtomakecashfence = ($user->hasRight('cashdesk', 'run')|| $user->hasRight('takepos', 'run'));
$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"'));
$newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence);
@@ -1987,27 +1987,27 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
if ($mainmenu == 'products') {
// Products
- if (!empty($conf->product->enabled)) {
+ if (isModEnabled('product')) {
$newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
$newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
- if (!empty($conf->stock->enabled)) {
+ if (isModEnabled('stock')) {
$newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
}
- if (!empty($conf->productbatch->enabled)) {
+ if (isModEnabled('productbatch')) {
$langs->load("stocks");
$newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
$newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
}
- if (!empty($conf->variants->enabled)) {
+ if (isModEnabled('variants')) {
$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire);
}
- if (!empty($conf->propal->enabled) || (!empty($conf->commande->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
+ if (isModEnabled('propal') || (isModEnabled('commande') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('facture') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire);
}
// Categories
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
@@ -2015,15 +2015,15 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
}
// Services
- if (!empty($conf->service->enabled)) {
+ if (isModEnabled('service')) {
$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
$newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire);
- if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_oder->enabled) || !empty($conf->supplier_invoice->enabled)) {
+ if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire);
}
// Categories
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
@@ -2057,7 +2057,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
}
// Inventory
- if (!empty($conf->stock->enabled)) {
+ if (isModEnabled('stock')) {
$langs->load("stocks");
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"'));
@@ -2075,7 +2075,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
}
// Shipments
- if (!empty($conf->expedition->enabled)) {
+ if (isModEnabled('expedition')) {
$langs->load("sendings");
$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"'));
$newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer);
@@ -2089,7 +2089,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
}
// Receptions
- if (!empty($conf->reception->enabled)) {
+ if (isModEnabled('reception')) {
$langs->load("receptions");
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"'));
$newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer);
@@ -2124,7 +2124,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
if ($mainmenu == 'mrp') {
// BOM
- if (!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)) {
+ if (isModEnabled('bom') || isModEnabled('mrp')) {
$langs->load("mrp");
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingrightonly pictofixedwidth"'));
@@ -2132,7 +2132,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom');
}
- if (!empty($conf->mrp->enabled)) {
+ if (isModEnabled('mrp')) {
$langs->load("mrp");
$newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo', 0, '', '', '', img_picto('', 'mrp', 'class="paddingrightonly pictofixedwidth"'));
@@ -2157,13 +2157,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
global $user, $conf, $langs;
if ($mainmenu == 'project') {
- if (!empty($conf->projet->enabled)) {
+ if (isModEnabled('projet')) {
$langs->load("projects");
$search_project_user = GETPOST('search_project_user', 'int');
$tmpentry = array(
- 'enabled'=>(!empty($conf->projet->enabled)),
+ 'enabled'=>(isModEnabled('projet')),
'perms'=>(!empty($user->rights->projet->lire)),
'module'=>'projet'
);
@@ -2198,7 +2198,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
// Categories
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
}
@@ -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);
}
}
}
@@ -2232,7 +2233,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
if ($mainmenu == 'hrm') {
// HRM module
- if (!empty($conf->hrm->enabled)) {
+ if (isModEnabled('hrm')) {
$langs->load("hrm");
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
@@ -2264,7 +2265,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
}
// Leave/Holiday/Vacation module
- if (!empty($conf->holiday->enabled)) {
+ if (isModEnabled('holiday')) {
// Load translation files required by the page
$langs->loadLangs(array("holiday", "trips"));
@@ -2284,7 +2285,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
}
// Trips and expenses (old module)
- if (!empty($conf->deplacement->enabled)) {
+ if (isModEnabled('deplacement')) {
$langs->load("trips");
$newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="pictofixedwidth"'));
$newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer);
@@ -2293,7 +2294,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
}
// Expense report
- if (!empty($conf->expensereport->enabled)) {
+ if (isModEnabled('expensereport')) {
$langs->loadLangs(array("trips", "bills"));
$newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="pictofixedwidth"'));
$newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer);
@@ -2310,7 +2311,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire);
}
- if (!empty($conf->projet->enabled)) {
+ if (isModEnabled('projet')) {
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
$langs->load("projects");
@@ -2343,20 +2344,20 @@ function get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu
$newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"'));
}
- if (!empty($conf->mailing->enabled)) {
+ if (isModEnabled('mailing')) {
$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer);
$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire);
}
- if (!empty($conf->export->enabled)) {
+ if (isModEnabled('export')) {
$langs->load("exports");
$newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer);
//$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire);
}
- if (!empty($conf->import->enabled)) {
+ if (isModEnabled('import')) {
$langs->load("exports");
$newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run);
@@ -2379,7 +2380,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
global $user, $conf, $langs;
if ($mainmenu == 'members') {
- if (!empty($conf->adherent->enabled)) {
+ if (isModEnabled('adherent')) {
// Load translation files required by the page
$langs->loadLangs(array("members", "compta"));
@@ -2399,7 +2400,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
$newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export);
}
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
}
@@ -2410,7 +2411,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
$newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire);
//$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->rights->adherent->export, '', $mainmenu, 'export');
- //if (! empty($conf->export->enabled) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
+ //if (isModEnabled('export') && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
// Type
$newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"'));
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 b2d0c1c0f30..8930481d219 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.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/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/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/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 1bb5400acc7..09f1a0b27e8 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -795,6 +795,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..9210946128e 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -929,6 +929,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..9a80484f83b 100644
--- a/htdocs/core/modules/mailings/xinputfile.modules.php
+++ b/htdocs/core/modules/mailings/xinputfile.modules.php
@@ -151,10 +151,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/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php
index 9e138c6ccef..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)) {
@@ -157,7 +157,7 @@ class modCategorie extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."9=Warehouse";
}
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
$typeexample .= ($typeexample ? " / " : "")."10=Agenda event";
}
if (!empty($conf->website->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/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 69a7a3f6232..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
@@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
}
if (!empty($conf->commande->enabled)) {
@@ -64,7 +64,7 @@ if (!empty($conf->ficheinter->enabled)) {
if (!empty($conf->deplacement->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.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 fc83ab505d2..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
@@ -41,10 +41,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
}
if (!empty($conf->commande->enabled)) {
@@ -65,7 +65,7 @@ if (!empty($conf->ficheinter->enabled)) {
if (!empty($conf->deplacement->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.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/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/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
index 7d234e6bd95..61fab1ab02d 100644
--- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php
+++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
@@ -538,6 +538,9 @@ class pdf_squille extends ModelePdfReception
$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) {
if ($pagenb == 1) {
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/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/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/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php
index 06d93e5ea5f..e40f360051e 100644
--- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php
+++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php
@@ -52,7 +52,7 @@ if (!empty($conf->commande->enabled)) {
}
print ' ';
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
print '
';
print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice", $servicename).': ';
print ''.getOnlinePaymentUrl(1, 'invoice')." \n";
diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
index 1d46aec1008..8bd1e0d647d 100644
--- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
+++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
@@ -91,7 +91,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// Order to invoice
if ($action == 'ORDER_CLOSE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
- if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE)) {
+ if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE)) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$newobject = new Facture($this->db);
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/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 3b906883c00..1fcdac35b0f 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -325,7 +325,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (!empty($conf->commande->enabled)) {
$rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
}
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
$rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
if (!empty($conf->supplier_proposal->enabled)) {
@@ -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 42b8efba42f..27a76d2ae6e 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -128,7 +128,7 @@ if (!empty($conf->contrat->enabled)) {
if (!empty($conf->commande->enabled)) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
if (!empty($conf->supplier_proposal->enabled)) {
@@ -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_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index 0d14811ef67..0d5991bb0ac 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -299,7 +299,7 @@ if (!empty($withproject)) {
print '
';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php
index 67cb2c659ee..57f2a76c042 100644
--- a/htdocs/eventorganization/conferenceorbooth_contact.php
+++ b/htdocs/eventorganization/conferenceorbooth_contact.php
@@ -282,7 +282,7 @@ if (!empty($withproject)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
print " ";
@@ -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/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php
index 742585ffb16..739e6f81036 100644
--- a/htdocs/eventorganization/conferenceorbooth_document.php
+++ b/htdocs/eventorganization/conferenceorbooth_document.php
@@ -257,7 +257,7 @@ if (!empty($withproject)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index 6d42d881ab8..958d1ab897d 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -382,7 +382,7 @@ if ($projectid > 0) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
index c60c0418d43..b02edfc4a34 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_card.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -327,7 +327,7 @@ if (!empty($withproject)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 878b1baf992..972e546255f 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
-if ($conf->categorie->enabled) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -510,7 +510,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
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 d341f293827..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) {
@@ -2477,7 +2480,7 @@ if ($action == 'create') {
// TODO add alternative status
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) {
- if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
+ if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
} else {
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
@@ -2496,7 +2499,7 @@ if ($action == 'create') {
}
// Create bill
- if (!empty($conf->facture->enabled) && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) {
+ if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) {
if ($user->rights->facture->creer) {
// TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
// If we do that, we must also make this option official.
@@ -2514,7 +2517,7 @@ if ($action == 'create') {
if ($user->rights->expedition->creer && $object->statut > 0 && !$object->billed) {
$label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
- if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
+ if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
$label = "ClassifyBilled";
$paramaction = 'classifybilled';
}
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 6e2bee75e6e..09411f29d50 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -36,11 +36,11 @@ 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';
}
-if ($conf->contrat->enabled) {
+if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php";
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.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");
@@ -928,7 +928,7 @@ if ($action == 'create') {
}
// Contract
- if ($conf->contrat->enabled) {
+ if (isModEnabled('contrat')) {
$langs->load("contracts");
print '
'.$langs->trans("Contract").' ';
$numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1, 1);
@@ -1161,7 +1161,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) {
@@ -1659,7 +1659,7 @@ if ($action == 'create') {
}
// Invoicing
- if (!empty($conf->facture->enabled) && $object->statut > Fichinter::STATUS_DRAFT) {
+ if (isModEnabled('facture') && $object->statut > Fichinter::STATUS_DRAFT) {
$langs->load("bills");
if ($object->statut < Fichinter::STATUS_BILLED) {
if ($user->rights->facture->creer) {
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 8ad44d198a8..2d649589282 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -881,7 +881,7 @@ if ($object->id > 0) {
}
// Add action
- if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) {
+ if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) {
if ($user->rights->agenda->myactions->create) {
print dolGetButtonAction('', $langs->trans('AddAction'), 'default', DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id, '');
} else {
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 6ab316edb56..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) {
@@ -2573,7 +2573,7 @@ if ($action == 'create') {
}
// Create bill
- //if (! empty($conf->facture->enabled))
+ //if (isModEnabled('facture'))
//{
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
@@ -2584,7 +2584,7 @@ if ($action == 'create') {
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved
- if (empty($conf->facture->enabled)) {
+ if (!isModEnabled('facture')) {
print '
id.'&action=classifybilled&token='.newToken().'">'.$langs->trans("ClassifyBilled").' ';
} else {
if (!empty($object->linkedObjectsIds['invoice_supplier'])) {
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 6c64672ee84..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) {
@@ -201,7 +201,7 @@ if ($permok) {
print '
';
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
id).'">'.$langs->trans("AddAction").' ';
} else {
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 '
';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$projectid = $object->fk_project;
$langs->load('projects');
print '
'.$langs->trans('Project').' ';
@@ -919,7 +919,7 @@ if ($action == 'create') {
}
// Tags-Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print ' '.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 5d1da2b22ab..fb8c8d55768 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -129,7 +129,7 @@ class Entrepot extends CommonObject
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1),
'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>2, 'searchall'=>1),
'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41),
- 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>25),
+ 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25),
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1),
'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'searchall'=>1),
'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-2, 'position'=>55, 'searchall'=>1),
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 735fc3bfa64..b913fd0cf38 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -119,7 +119,7 @@ class MouvementStock extends CommonObject
'fk_origin' =>array('type'=>'integer', 'label'=>'Fk origin', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'origintype' =>array('type'=>'varchar(32)', 'label'=>'Origintype', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>70),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75),
'inventorycode' =>array('type'=>'varchar(128)', 'label'=>'InventoryCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'eatby' =>array('type'=>'date', 'label'=>'Eatby', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index db6560a9970..de9f72fbcd6 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -59,7 +59,7 @@ $morehtmlref = '';
$morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate) {
diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php
index 9dc82c7d09a..d7830d49615 100644
--- a/htdocs/product/stock/movement_card.php
+++ b/htdocs/product/stock/movement_card.php
@@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.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.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -425,7 +425,7 @@ $userstatic = new User($db);
$form = new Form($db);
$formother = new FormOther($db);
$formproduct = new FormProduct($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 2ad77fca49e..34a2a074ec5 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.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';
}
@@ -593,7 +593,7 @@ $movement = new MouvementStock($db);
$userstatic = new User($db);
$form = new Form($db);
$formproduct = new FormProduct($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -800,7 +800,7 @@ if ($object->id > 0) {
$morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate && 1 == 2) {
@@ -903,7 +903,7 @@ if ($object->id > 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1);
print " ";
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index b9fc1a201e5..3054e6785bd 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class.
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.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -524,7 +524,7 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans("Save")) {
$form = new Form($db);
$formproduct = new FormProduct($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
index f649e46cc27..ed494bb58b5 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
@@ -148,7 +148,7 @@ if ($object->id > 0) {
// 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') . ' ';
@@ -214,7 +214,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").' ';
} else {
@@ -224,7 +224,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php
index 0c97674191e..b88df4e1da1 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php
@@ -592,11 +592,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref = '
';
// Thirdparty
- if ($conf->societe->enabled) {
+ if (isModEnabled('societe')) {
$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') . ' ';
if ($permissiontoadd) {
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php
index d2cb095932b..691d2ea2f9d 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php
@@ -143,7 +143,7 @@ if ($object->id > 0) {
$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->stocktransfer->stocktransfer->write) {
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php
index ab4b45b6864..e4675378d20 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php
@@ -136,7 +136,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/product/stock/stocktransfer/stocktransfer_note.php b/htdocs/product/stock/stocktransfer/stocktransfer_note.php
index 41842d07ee5..1932b685e24 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_note.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_note.php
@@ -109,7 +109,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/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 6afea0abe54..481b6c0fde3 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -156,8 +156,8 @@ if (!empty($conf->productbatch->enabled) &&
// Purchase price and project
print '
';
print ''.$langs->trans("UnitPurchaseValue").' ';
-print ' ';
-if (!empty($conf->projet->enabled)) {
+print ' ';
+if (!empty($conf->project->enabled)) {
print ''.$langs->trans('Project').' ';
print '';
print img_picto('', 'project');
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 4f30054155a..c191b3baeaa 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -431,7 +431,7 @@ $nav .= dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "%A").' ';
$nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "day")." \n";
$nav .= ''.img_next($langs->trans("Next"))." \n";
$nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' ';
-$nav .= ' ';
+$nav .= ' ';
$picto = 'clock';
diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php
index 156080eefb3..79ee8c6172e 100644
--- a/htdocs/projet/activity/permonth.php
+++ b/htdocs/projet/activity/permonth.php
@@ -347,7 +347,7 @@ $nav = '".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%Y").", ".$langs->trans(date('F', mktime(0, 0, 0, $month, 10)))." \n";
$nav .= ' '.img_next($langs->trans("Next"))." \n";
$nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' ';
-$nav .= ' ';
+$nav .= ' ';
$picto = 'clock';
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 4f7cb3ce7a0..0cfe126d69b 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -390,7 +390,7 @@ if (empty($reshook)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other");
- $upload_dir = $conf->projet->dir_output;
+ $upload_dir = $conf->project->dir_output;
$file = $upload_dir.'/'.GETPOST('file');
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
@@ -602,7 +602,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
}
// Thirdparty
- if ($conf->societe->enabled) {
+ if (isModEnabled('societe')) {
print ' ';
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '');
print $langs->trans("ThirdParty");
@@ -898,7 +898,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ' ';
// Thirdparty
- if ($conf->societe->enabled) {
+ if (isModEnabled('societe')) {
print '
';
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '');
print $langs->trans("ThirdParty");
@@ -1001,7 +1001,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ' ';
// Tags-Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
@@ -1170,7 +1170,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ' ';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
@@ -1326,7 +1326,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$langs->load("orders");
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '');
}
- if (!empty($conf->facture->enabled) && $user->rights->facture->creer) {
+ if (isModEnabled('facture') && $user->rights->facture->creer) {
$langs->load("bills");
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '');
}
@@ -1394,7 +1394,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
* Generated documents
*/
$filename = dol_sanitizeFileName($object->ref);
- $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref);
+ $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = ($user->rights->projet->lire && $userAccess > 0);
$delallowed = ($user->rights->projet->creer && $userWrite > 0);
@@ -1418,7 +1418,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Presend form
$modelmail = 'project';
$defaulttopic = 'SendProjectRef';
- $diroutput = $conf->projet->dir_output;
+ $diroutput = $conf->project->dir_output;
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
$trackid = 'proj'.$object->id;
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index b66452b2c5f..0c56ecf0677 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -6,6 +6,7 @@
* Copyright (C) 2014-2017 Marcos García
* Copyright (C) 2017 Ferran Marcet
* Copyright (C) 2019 Juanjo Menent
+ * 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
@@ -545,9 +546,9 @@ class Project extends CommonObject
if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) {
// We remove directory
- if ($conf->projet->dir_output) {
- $olddir = $conf->projet->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref);
- $newdir = $conf->projet->dir_output."/".dol_sanitizeFileName($this->ref);
+ if ($conf->project->dir_output) {
+ $olddir = $conf->project->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref);
+ $newdir = $conf->project->dir_output."/".dol_sanitizeFileName($this->ref);
if (file_exists($olddir)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$res = @rename($olddir, $newdir);
@@ -908,8 +909,8 @@ class Project extends CommonObject
if (empty($error)) {
// We remove directory
$projectref = dol_sanitizeFileName($this->ref);
- if ($conf->projet->dir_output) {
- $dir = $conf->projet->dir_output."/".$projectref;
+ if ($conf->project->dir_output) {
+ $dir = $conf->project->dir_output."/".$projectref;
if (file_exists($dir)) {
$res = @dol_delete_dir_recursive($dir);
if (!$res) {
@@ -1212,11 +1213,11 @@ class Project extends CommonObject
if (!empty($this->thirdparty_name)) {
$label .= ($label ? ' ' : '').''.$langs->trans('ThirdParty').': '.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto
}
- if (!empty($this->dateo)) {
- $label .= ($label ? ' ' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
+ if (!empty($this->date_start)) {
+ $label .= ($label ? ' ' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->date_start, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
}
- if (!empty($this->datee)) {
- $label .= ($label ? ' ' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
+ if (!empty($this->date_end)) {
+ $label .= ($label ? ' ' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->date_end, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
}
if ($moreinpopup) {
$label .= ' '.$moreinpopup;
@@ -1642,8 +1643,8 @@ class Project extends CommonObject
if ($clone_project_file) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- $clone_project_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($defaultref);
- $ori_project_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($orign_project_ref);
+ $clone_project_dir = $conf->project->dir_output."/".dol_sanitizeFileName($defaultref);
+ $ori_project_dir = $conf->project->dir_output."/".dol_sanitizeFileName($orign_project_ref);
if (dol_mkdir($clone_project_dir) >= 0) {
$filearray = dol_dir_list($ori_project_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1);
@@ -2057,7 +2058,7 @@ class Project extends CommonObject
$project_static = new Project($this->db);
$response = new WorkboardResponse();
- $response->warning_delay = $conf->projet->warning_delay / 60 / 60 / 24;
+ $response->warning_delay = $conf->project->warning_delay / 60 / 60 / 24;
$response->label = $langs->trans("OpenedProjects");
$response->labelShort = $langs->trans("Opened");
if ($user->rights->projet->all->lire) {
@@ -2073,7 +2074,7 @@ class Project extends CommonObject
$project_static->statut = $obj->status;
$project_static->opp_status = $obj->fk_opp_status;
- $project_static->datee = $this->db->jdate($obj->datee);
+ $project_static->date_end = $this->db->jdate($obj->datee);
if ($project_static->hasDelay()) {
$response->nbtodolate++;
@@ -2155,13 +2156,13 @@ class Project extends CommonObject
if (!($this->statut == self::STATUS_VALIDATED)) {
return false;
}
- if (!$this->datee && !$this->date_end) {
+ if (!$this->date_end) {
return false;
}
$now = dol_now();
- return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay);
+ return ($this->date_end) < ($now - $conf->project->warning_delay);
}
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 79152c6cfb9..ba31845592a 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -85,6 +85,11 @@ class Task extends CommonObjectLine
public $date_end;
public $progress;
+ /**
+ * @deprecated Use date_end instead
+ */
+ public $datee;
+
/**
* @var int ID
*/
@@ -473,12 +478,12 @@ class Task extends CommonObjectLine
if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) {
// We remove directory
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
$project = new Project($this->db);
$project->fetch($this->fk_project);
- $olddir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref);
- $newdir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref);
+ $olddir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref);
+ $newdir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref);
if (file_exists($olddir)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$res = dol_move_dir($olddir, $newdir);
@@ -600,11 +605,11 @@ class Task extends CommonObjectLine
return -1 * $error;
} else {
//Delete associated link file
- if ($conf->projet->dir_output) {
+ if ($conf->project->dir_output) {
$projectstatic = new Project($this->db);
$projectstatic->fetch($this->fk_project);
- $dir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($this->id);
+ $dir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($this->id);
dol_syslog(get_class($this)."::delete dir=".$dir, LOG_DEBUG);
if (file_exists($dir)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -1957,8 +1962,8 @@ class Task extends CommonObjectLine
$clone_project_ref = $ori_project_ref;
}
- $clone_task_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($clone_project_ref)."/".dol_sanitizeFileName($clone_task_ref);
- $ori_task_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($ori_project_ref)."/".dol_sanitizeFileName($fromid);
+ $clone_task_dir = $conf->project->dir_output."/".dol_sanitizeFileName($clone_project_ref)."/".dol_sanitizeFileName($clone_task_ref);
+ $ori_task_dir = $conf->project->dir_output."/".dol_sanitizeFileName($ori_project_ref)."/".dol_sanitizeFileName($fromid);
$filearray = dol_dir_list($ori_task_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1);
foreach ($filearray as $key => $file) {
@@ -2205,7 +2210,7 @@ class Task extends CommonObjectLine
$task_static = new Task($this->db);
$response = new WorkboardResponse();
- $response->warning_delay = $conf->projet->task->warning_delay / 60 / 60 / 24;
+ $response->warning_delay = $conf->project->task->warning_delay / 60 / 60 / 24;
$response->label = $langs->trans("OpenedTasks");
if ($user->rights->projet->all->lire) {
$response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mainmenu=project';
@@ -2306,6 +2311,6 @@ class Task extends CommonObjectLine
$datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0);
- return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay)));
+ return ($datetouse > 0 && ($datetouse < ($now - $conf->project->task->warning_delay)));
}
}
diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php
index 3bea4b5db03..997f45a39d0 100644
--- a/htdocs/projet/comment.php
+++ b/htdocs/projet/comment.php
@@ -167,7 +167,7 @@ print nl2br($object->description);
print ' ';
// Categories
-if ($conf->categorie->enabled) {
+if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index 3230c325039..be130572704 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
-if ($conf->categorie->enabled) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -421,7 +421,7 @@ if ($id > 0 || !empty($ref)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index 2301017edd9..588043a56dc 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -49,7 +49,7 @@ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
}
if ($id > 0 || !empty($ref)) {
- $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref);
}
// Get parameters
@@ -109,7 +109,7 @@ llxHeader('', $title, $help_url);
$form = new Form($db);
if ($object->id > 0) {
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref);
// To verify role of users
//$userAccess = $object->restrictedProjectArea($user,'read');
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index caad4374da0..16b67dd4876 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -42,7 +42,7 @@ if (!empty($conf->stock->enabled)) {
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
}
@@ -73,7 +73,7 @@ if (!empty($conf->deplacement->enabled)) {
if (!empty($conf->expensereport->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
}
if (!empty($conf->don->enabled)) {
@@ -104,7 +104,7 @@ if (!empty($conf->mrp->enabled)) {
// Load translation files required by the page
$langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta'));
-if (!empty($conf->facture->enabled)) {
+if (isModEnabled('facture')) {
$langs->load("bills");
}
if (!empty($conf->commande->enabled)) {
@@ -343,7 +343,7 @@ print nl2br($object->description);
print '';
// Categories
-if ($conf->categorie->enabled) {
+if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
@@ -579,7 +579,7 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->rights->projet->creer,
- 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
+ 'test'=>($conf->project->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
'stock_mouvement'=>array(
'name'=>"MouvementStockAssociated",
'title'=>"ListMouvementStockProject",
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index c0dd96537a6..dda13754d31 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -216,7 +216,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index 9b0544bccf6..19897bf2859 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -167,7 +167,7 @@ if ($permok) {
//print '
';
$morehtmlcenter = '';
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
$addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
$morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight);
}
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 31f74118261..eaf9c5022a3 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -67,7 +67,7 @@ if (!$user->rights->projet->lire) {
accessforbidden();
}
-$diroutputmassaction = $conf->projet->dir_output.'/temp/massgeneration/'.$user->id;
+$diroutputmassaction = $conf->project->dir_output.'/temp/massgeneration/'.$user->id;
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", "aZ09comma");
@@ -297,7 +297,7 @@ if (empty($reshook)) {
$permissiontoread = $user->rights->projet->lire;
$permissiontodelete = $user->rights->projet->supprimer;
$permissiontoadd = $user->rights->projet->creer;
- $uploaddir = $conf->projet->dir_output;
+ $uploaddir = $conf->project->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
// Close records
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index c08880e44ea..f2e514afe56 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -137,7 +137,7 @@ $socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
-$diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$user->id;
+$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id;
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('projecttaskscard', 'globalcard'));
@@ -234,7 +234,7 @@ if (empty($reshook)) {
$objectlabel = 'Tasks';
$permissiontoread = $user->rights->projet->lire;
$permissiontodelete = $user->rights->projet->supprimer;
- $uploaddir = $conf->projet->dir_output.'/tasks';
+ $uploaddir = $conf->project->dir_output.'/tasks';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -648,7 +648,7 @@ if ($id > 0 || !empty($ref)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index e2686ded9f2..82628d5136b 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -258,7 +258,7 @@ if ($id > 0 || !empty($ref)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 327d8783256..9718a0ffccb 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -289,7 +289,7 @@ if ($id > 0 || !empty($ref)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index 0e520989d8c..ad0a2c0b628 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
$object->project = clone $projectstatic;
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
}
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
@@ -245,7 +245,7 @@ if ($object->id > 0) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 6d9e44c3799..bfda3ad31be 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -113,7 +113,7 @@ if (!$user->rights->projet->lire) {
accessforbidden();
}
-$diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$user->id;
+$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id;
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -237,7 +237,7 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'Task';
$objectlabel = 'Tasks';
- $uploaddir = $conf->projet->dir_output.'/tasks';
+ $uploaddir = $conf->project->dir_output.'/tasks';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index 652b195afd4..206a92afb36 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -235,7 +235,7 @@ if ($object->id > 0) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 9fce4072183..3df3cf8928e 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -177,7 +177,7 @@ if ($action == 'remove_file' && $user->rights->projet->creer) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other");
- $upload_dir = $conf->projet->dir_output;
+ $upload_dir = $conf->project->dir_output;
$file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
$ret = dol_delete_file($file);
@@ -333,7 +333,7 @@ if ($id > 0 || !empty($ref)) {
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
@@ -647,7 +647,7 @@ if ($id > 0 || !empty($ref)) {
* Generated documents
*/
$filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = ($user->rights->projet->lire);
$delallowed = ($user->rights->projet->creer);
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 4c7a65c9d54..d0db633658a 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -869,7 +869,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id, 'project', 1);
print " ";
@@ -919,15 +919,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$massactionbutton = '';
$arrayofmassactions = array();
- if ($projectstatic->usage_bill_time) {
- $arrayofmassactions = array(
- 'generateinvoice'=>$langs->trans("GenerateBill"),
- //'builddoc'=>$langs->trans("PDFMerge"),
- );
- }
- if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
- $langs->load("interventions");
- $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter");
+
+ if ($projectstatic->id > 0) {
+ // If we are on a given project.
+ if ($projectstatic->usage_bill_time) {
+ $arrayofmassactions = array(
+ 'generateinvoice'=>$langs->trans("GenerateBill"),
+ //'builddoc'=>$langs->trans("PDFMerge"),
+ );
+ }
+ if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
+ $langs->load("interventions");
+ $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter");
+ }
}
//if ($user->rights->projet->creer) $arrayofmassactions['predelete']='
'.$langs->trans("Delete");
if (in_array($massaction, array('presend', 'predelete', 'generateinvoice', 'generateinter'))) {
@@ -1251,7 +1255,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '
';
if ($projectstatic->thirdparty->id > 0) {
- print '
';
+ print '';
print '';
print '';
print $langs->trans('InterToUse');
@@ -1347,7 +1351,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($search_valuebilled == '0') {
$sql .= ' AND (t.invoice_id = 0 OR t.invoice_id IS NULL)';
}
+
$sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year);
+
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
@@ -1567,7 +1573,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print ' ';
}
if (!empty($allprojectforuser)) {
- print ' ';
+ print ' ';
}
// Task
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
@@ -1869,26 +1875,24 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Action column
print '';
- if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid) {
- print ' ';
+ if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
+ print ' ';
print ' ';
- print ' ';
+ print ' ';
print ' ';
- } elseif ($user->rights->projet->time || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks
- if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) {
- if ($conf->MAIN_FEATURES_LEVEL >= 2) {
+ } elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks
+ if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
+ if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
print ' ';
print 'fk_task.'&action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
- print img_split();
+ print img_split('', 'class="pictofixedwidth"');
print ' ';
}
- print ' ';
print 'fk_task.'&action=editline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
- print img_edit();
+ print img_edit('default', 0, 'class="pictofixedwidth paddingleft"');
print ' ';
- print ' ';
print 'fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_delete('default', 'class="pictodelete paddingleft"');
print ' ';
diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php
index 40e082c6f2e..661ae6accfe 100644
--- a/htdocs/public/eventorganization/attendee_new.php
+++ b/htdocs/public/eventorganization/attendee_new.php
@@ -67,7 +67,7 @@ $action = GETPOST('action', 'aZ09');
$email = GETPOST("email");
$societe = GETPOST("societe");
$emailcompany = GETPOST("emailcompany");
-$note_public = GETPOST('note_public', "nohtml");
+$note_public = GETPOST('note_public', "restricthtml");
// Getting id from Post and decoding it
$type = GETPOST('type', 'aZ09');
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 7a27ae14b62..31f1fa9f952 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -563,8 +563,8 @@ print ' global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print ' '.$langs->trans("Login").' * '."\n";
- print ''.$langs->trans("Password").' * '."\n";
- print ''.$langs->trans("PasswordAgain").' * '."\n";
+ print ''.$langs->trans("Password").' * '."\n";
+ print ''.$langs->trans("PasswordAgain").' * '."\n";
}
// Gender
print ''.$langs->trans("Gender").' ';
diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php
index 02ee2df87e2..acf1fb01b56 100644
--- a/htdocs/public/opensurvey/studs.php
+++ b/htdocs/public/opensurvey/studs.php
@@ -112,7 +112,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo
}
//Si le nom est bien entré
- if (GETPOST('nom', 'nohtml')) {
+ if (GETPOST('nom', 'alphanohtml')) {
$nouveauchoix = '';
for ($i = 0; $i < $nbcolonnes; $i++) {
if (GETPOSTISSET("choix$i") && GETPOST("choix$i") == '1') {
@@ -124,7 +124,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo
}
}
- $nom = substr(GETPOST("nom", 'nohtml'), 0, 64);
+ $nom = substr(GETPOST("nom", 'alphanohtml'), 0, 64);
// Check if vote already exists
$sql = 'SELECT id_users, nom as name';
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 5553ee464c7..c0b88736ce3 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -533,11 +533,11 @@ if ($ispaymentok) {
$emetteur_banque = '';
// Define default choice for complementary actions
$option = '';
- if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
+ if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
$option = 'bankviainvoice';
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) {
$option = 'bankdirect';
- } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
+ } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
$option = 'invoiceonly';
}
if (empty($option)) {
@@ -927,7 +927,7 @@ if ($ispaymentok) {
}
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
- if (!empty($conf->facture->enabled)) {
+ if (isModEnabled('facture')) {
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) {
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
$invoice = new Facture($db);
diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php
index 0add64bb700..e5dfeb59a8e 100644
--- a/htdocs/public/project/index.php
+++ b/htdocs/public/project/index.php
@@ -83,7 +83,7 @@ if ($resultproject < 0) {
}
// Security check
-if (empty($conf->projet->enabled)) {
+if (empty($conf->project->enabled)) {
accessforbidden('', 0, 0, 1);
}
diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php
index 4838c88c5a1..5b0c35c10f3 100644
--- a/htdocs/public/project/new.php
+++ b/htdocs/public/project/new.php
@@ -81,7 +81,7 @@ $object = new Project($db);
$user->loadDefaultValues();
// Security check
-if (empty($conf->projet->enabled)) {
+if (empty($conf->project->enabled)) {
accessforbidden('', 0, 0, 1);
}
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 243135fbf6a..9c0d3b01136 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -57,7 +57,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
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';
}
@@ -101,11 +101,13 @@ $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
$object = new Reception($db);
+$objectorder = new CommandeFournisseur($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
$extrafields->fetch_name_optionals_label($object->table_element_line);
+$extrafields->fetch_name_optionals_label($objectorder->table_element_line);
// Load object. Make an object->fetch
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
@@ -710,7 +712,7 @@ llxHeader('', $langs->trans('Reception'), 'Reception');
$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);
}
@@ -795,7 +797,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($objectsrc->fk_project)) {
$projectid = $objectsrc->fk_project;
@@ -1237,30 +1239,26 @@ if ($action == 'create') {
print "\n";
- $extralabelslines = $extrafields->attributes[$line->table_element];
- //Display lines extrafields
- if (is_array($extralabelslines) && count($extralabelslines) > 0) {
+ // Display lines for extrafields of the Reception line
+ // $line is a 'CommandeFournisseurLigne', $dispatchLines contains values of Reception lines so properties of CommandeFournisseurDispatch
+ if (!empty($extrafields)) {
+ //var_dump($line);
$colspan = 5;
if ($conf->productbatch->enabled) {
$colspan += 3;
}
+ $recLine = new CommandeFournisseurDispatch($db);
$srcLine = new CommandeFournisseurLigne($db);
- $line = new CommandeFournisseurDispatch($db);
-
- $extrafields->fetch_name_optionals_label($srcLine->table_element);
- $extrafields->fetch_name_optionals_label($line->table_element);
-
$srcLine->id = $line->id;
$srcLine->fetch_optionals(); // fetch extrafields also available in orderline
- $line->fetch_optionals();
- if (empty($line->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) {
- $line->array_options = $dispatchLines[$indiceAsked]['array_options'];
+ if (empty($recLine->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) {
+ $recLine->array_options = $dispatchLines[$indiceAsked]['array_options'];
}
- $line->array_options = array_merge($line->array_options, $srcLine->array_options);
+ $recLine->array_options = array_merge($recLine->array_options, $srcLine->array_options);
- print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked);
+ print $recLine->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
}
$indiceAsked++;
@@ -1383,7 +1381,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 reception
@@ -2084,7 +2082,7 @@ if ($action == 'create') {
// TODO add alternative status
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) {
- if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
+ if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").' ';
} else {
print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").' ';
diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php
index 872d6845a96..a27f458d01a 100644
--- a/htdocs/reception/class/receptionstats.class.php
+++ b/htdocs/reception/class/receptionstats.class.php
@@ -82,12 +82,13 @@ class ReceptionStats extends Stats
}
/**
- * Return reception number by month for a year
+ * Return reception number by month for a year
*
- * @param int $year Year to scan
- * @return array Array with number by month
+ * @param int $year Year to scan
+ * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
+ * @return array Array with number by month
*/
- public function getNbByMonth($year)
+ public function getNbByMonth($year, $format = 0)
{
global $user;
@@ -101,7 +102,7 @@ class ReceptionStats extends Stats
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
- $res = $this->_getNbByMonth($year, $sql);
+ $res = $this->_getNbByMonth($year, $sql, $format);
return $res;
}
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index a7cec515e29..4e04bdd2926 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.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';
}
@@ -147,7 +147,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 reception
diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php
index f592dba452a..c349a25fd8b 100644
--- a/htdocs/reception/document.php
+++ b/htdocs/reception/document.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -120,7 +120,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/reception/list.php b/htdocs/reception/list.php
index b3b039c2f68..5cdbb201d87 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -640,6 +640,22 @@ if ($search_array_options) {
foreach ($search_array_options as $key => $val) {
$crit = $val;
$tmpkey = preg_replace('/search_options_/', '', $key);
+ if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) {
+ // date range from list filters is stored as array('start' => , 'end' => )
+ // start date
+ $param .= '&search_options_'.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y');
+ $param .= '&search_options_'.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m');
+ $param .= '&search_options_'.$tmpkey.'_startday='.dol_print_date($val['start'], '%d');
+ $param .= '&search_options_'.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H');
+ $param .= '&search_options_'.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M');
+ // end date
+ $param .= '&search_options_'.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y');
+ $param .= '&search_options_'.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m');
+ $param .= '&search_options_'.$tmpkey.'_endday='.dol_print_date($val['end'], '%d');
+ $param .= '&search_options_'.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H');
+ $param .= '&search_options_'.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M');
+ $val = '';
+ }
if ($val != '') {
$param .= '&search_options_'.$tmpkey.'='.urlencode($val);
}
diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php
index 725c23ae738..46e10002d76 100644
--- a/htdocs/reception/note.php
+++ b/htdocs/reception/note.php
@@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php';
dol_include_once('/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';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -124,7 +124,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 reception
diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php
index 42279fe3a97..89351997596 100644
--- a/htdocs/recruitment/class/recruitmentjobposition.class.php
+++ b/htdocs/recruitment/class/recruitmentjobposition.class.php
@@ -104,7 +104,7 @@ class RecruitmentJobPosition extends CommonObject
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object", 'css'=>'nowraponall'),
'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'2', 'autofocusoncreate'=>1),
'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'),
'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'),
'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail', 'picto'=>'email'),
'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'),
diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php
index 22f2eda511b..61ae610fb3b 100644
--- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php
+++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php
@@ -643,6 +643,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
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/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php
index 74a48994f71..bfe70deb075 100644
--- a/htdocs/recruitment/recruitmentcandidature_agenda.php
+++ b/htdocs/recruitment/recruitmentcandidature_agenda.php
@@ -150,7 +150,7 @@ if ($object->id > 0) {
$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') . ' ';
@@ -218,7 +218,7 @@ if ($object->id > 0) {
print '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").' ';
} else {
@@ -228,7 +228,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php
index 93b43c99cc6..0da5badd7bc 100644
--- a/htdocs/recruitment/recruitmentcandidature_card.php
+++ b/htdocs/recruitment/recruitmentcandidature_card.php
@@ -448,7 +448,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// 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/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php
index 22e011daf42..38715f412f2 100644
--- a/htdocs/recruitment/recruitmentcandidature_document.php
+++ b/htdocs/recruitment/recruitmentcandidature_document.php
@@ -131,7 +131,7 @@ if ($object->id) {
$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/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php
index 9a0a21484b1..3f537003fb7 100644
--- a/htdocs/recruitment/recruitmentcandidature_list.php
+++ b/htdocs/recruitment/recruitmentcandidature_list.php
@@ -444,7 +444,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action !=
$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').' ';
if ($permissiontoadd) {
diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php
index d35edaa3b91..c6fedf6fcea 100644
--- a/htdocs/recruitment/recruitmentcandidature_note.php
+++ b/htdocs/recruitment/recruitmentcandidature_note.php
@@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) {
$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/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php
index b4d943584cd..f028f2f8243 100644
--- a/htdocs/recruitment/recruitmentindex.php
+++ b/htdocs/recruitment/recruitmentindex.php
@@ -331,11 +331,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid";
- if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
+ if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
- if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
+ if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
@@ -402,11 +402,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";
- if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
+ if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
- if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
+ if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php
index 45c84005743..07cecb0070e 100644
--- a/htdocs/recruitment/recruitmentjobposition_agenda.php
+++ b/htdocs/recruitment/recruitmentjobposition_agenda.php
@@ -150,7 +150,7 @@ if ($object->id > 0) {
$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').' ';
if ($permissiontoadd) {
@@ -217,7 +217,7 @@ if ($object->id > 0) {
print '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").' ';
} else {
@@ -227,7 +227,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php
index c6e462161ed..16e19066be3 100644
--- a/htdocs/recruitment/recruitmentjobposition_applications.php
+++ b/htdocs/recruitment/recruitmentjobposition_applications.php
@@ -271,7 +271,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$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').' ';
if ($permissiontoadd) {
diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php
index 65b6f0e8885..b2172aca80d 100644
--- a/htdocs/recruitment/recruitmentjobposition_card.php
+++ b/htdocs/recruitment/recruitmentjobposition_card.php
@@ -343,7 +343,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$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').' ';
if ($permissiontoadd) {
diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php
index e3e79a5482e..43f90ca1fdd 100644
--- a/htdocs/recruitment/recruitmentjobposition_document.php
+++ b/htdocs/recruitment/recruitmentjobposition_document.php
@@ -131,7 +131,7 @@ if ($object->id) {
$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').' ';
if ($permissiontoadd) {
diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php
index 883f5612b97..c5d8cc29533 100644
--- a/htdocs/recruitment/recruitmentjobposition_note.php
+++ b/htdocs/recruitment/recruitmentjobposition_note.php
@@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) {
$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').' ';
if ($permissiontoadd) {
diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php
index 363f334a7eb..cb13ce78e7d 100644
--- a/htdocs/resource/agenda.php
+++ b/htdocs/resource/agenda.php
@@ -164,7 +164,7 @@ if ($object->id > 0) {
print dol_get_fiche_end();
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 6926983915b..09c7befc664 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -29,7 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.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';
}
@@ -349,7 +349,7 @@ if (!$ret) {
// 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') . ' ';
$morehtmlref .= $langs->trans('Project').': ';
@@ -517,7 +517,7 @@ if (!$ret) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$fichinter->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/salaries/card.php b/htdocs/salaries/card.php
index 00591b5a32f..7d57575dacd 100644
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.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';
}
// Load translation files required by the page
$langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips"));
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
}
@@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) {
$form = new Form($db);
$formfile = new FormFile($db);
-if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
+if (!empty($conf->project->enabled)) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Card');
$help_url = "";
@@ -559,7 +559,7 @@ if ($action == 'create') {
print '';
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
print ''.$langs->trans("Project").' ';
@@ -794,7 +794,7 @@ if ($id) {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php
index 1f4d2920914..a7e96741862 100644
--- a/htdocs/salaries/class/salary.class.php
+++ b/htdocs/salaries/class/salary.class.php
@@ -56,8 +56,9 @@ class Salary extends CommonObject
public $datep;
public $datev;
- public $amount;
+ public $salary;
+ public $amount;
/**
* @var int ID
*/
diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php
index 045b77ca0a4..971291580bf 100644
--- a/htdocs/salaries/document.php
+++ b/htdocs/salaries/document.php
@@ -35,7 +35,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/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.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';
}
@@ -132,7 +132,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) {
*/
$form = new Form($db);
-if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
+if (!empty($conf->project->enabled)) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Documents');
$help_url = "";
@@ -176,7 +176,7 @@ if ($object->id) {
$morehtmlref .= ' '.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
@@ -191,7 +191,7 @@ if ($object->id) {
$morehtmlref .= ' ';
$morehtmlref .= '';
} else {
- $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (!empty($object->fk_project)) {
diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php
index a43d9010d8d..a2f05b791a6 100644
--- a/htdocs/salaries/info.php
+++ b/htdocs/salaries/info.php
@@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -100,7 +100,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) {
* View
*/
-if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
+if (!empty($conf->project->enabled)) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Info');
$help_url = "";
@@ -139,7 +139,7 @@ if ($action != 'editlabel') {
$morehtmlref .= ' '.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index bebe542a6f9..89b69bda83c 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -157,13 +157,13 @@ if ($socid > 0) {
}
$newcardbutton = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print ' ';
$param = '&socid='.urlencode($socid);
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 311eea6bc8e..b2f41589544 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1154,6 +1154,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->country = $tmparray['label'];
}
$object->forme_juridique_code = GETPOST('forme_juridique_code');
+
+ // We set multicurrency_code if enabled
+ if (!empty($conf->multicurrency->enabled)) {
+ $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency;
+ }
/* Show create form */
$linkback = "";
@@ -1717,8 +1722,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Capital
print ' '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' ';
print ' ';
- print ''.$langs->trans("Currency".$conf->currency).' ';
-
+ if (!empty($conf->multicurrency->enabled)) {
+ print ''.$langs->trans("Currency".$object->multicurrency_code).' ';
+ } else {
+ print ''.$langs->trans("Currency".$conf->currency).' ';
+ }
if (!empty($conf->global->MAIN_MULTILANGS)) {
print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).' '."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
@@ -1766,7 +1774,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
- print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1);
+ print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1);
print ' ';
}
@@ -1974,6 +1982,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->country_code = $tmparray['code'];
$object->country = $tmparray['label'];
}
+
+ // We set multicurrency_code if enabled
+ if (!empty($conf->multicurrency->enabled)) {
+ $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code;
+ }
}
if ($object->localtax1_assuj == 0) {
@@ -2242,19 +2255,20 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Phone / Fax
print ''.$form->editfieldkey('Phone', 'phone', GETPOST('phone', 'alpha'), $object, 0).' ';
- print ''.img_picto('', 'object_phoning').' ';
+ print ''.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' ';
if ($conf->browser->layout == 'phone') {
print '';
}
print ''.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).' ';
- print ''.img_picto('', 'object_phoning_fax').' ';
+ print ''.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' ';
// EMail / Web
print ''.$form->editfieldkey('EMail', 'email', GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).' ';
- print ''.img_picto('', 'object_email').' ';
+ print ''.img_picto('', 'object_email', 'class="pictofixedwidth"').' ';
print ''.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).' ';
- print ''.img_picto('', 'globe').' ';
+ print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' ';
+ // Social network
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
@@ -2262,9 +2276,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$form->editfieldkey($value['label'], $key, '', $object, 0).' ';
print '';
if (!empty($value['icon'])) {
- print ' ';
+ print ' ';
}
- print ' ';
+ print ' ';
print ' ';
print '';
} elseif (!empty($object->socialnetworks[$key])) {
@@ -2407,7 +2421,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$form->editfieldkey('Capital', 'capital', '', $object, 0).' ';
print ' '.$langs->trans("Currency".$conf->currency).' ';
+ if (!empty($conf->multicurrency->enabled)) {
+ print '"> '.$langs->trans("Currency".$object->multicurrency_code).' ';
+ } else {
+ print '"> '.$langs->trans("Currency".$conf->currency).' ';
+ }
// Default language
if (!empty($conf->global->MAIN_MULTILANGS)) {
@@ -2462,7 +2480,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
- print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1);
+ print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1);
print ' ';
}
@@ -2887,7 +2905,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Capital
print ''.$langs->trans('Capital').' ';
if ($object->capital) {
- print price($object->capital, '', $langs, 0, -1, -1, $conf->currency);
+ if (!empty($conf->multicurrency->enabled) && !empty($object->multicurrency_code)) {
+ print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code);
+ } else {
+ print price($object->capital, '', $langs, 0, -1, -1, $conf->currency);
+ }
} else {
print ' ';
}
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 5f997a37e9c..f74758296a9 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -168,7 +168,7 @@ if ($object->client) {
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
}
- if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
+ if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
@@ -199,13 +199,13 @@ if ($object->fournisseur) {
$obj = $db->fetch_object($resql);
$nbCmdsFourn = $obj->nb;
$thirdTypeArray['supplier'] = $langs->trans("supplier");
- if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
+ if ((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
}
- if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
+ if ((isModEnabled('fournisseur') && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
}
- if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) {
+ if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals');
}
}
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 597fc4b80ea..f4637186b4d 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -118,16 +118,16 @@ $result = $db->query($sql);
if ($result) {
while ($objp = $db->fetch_object($result)) {
$found = 0;
- if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) {
+ if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) {
$found = 1; $third['prospect']++;
}
- if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) {
+ if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) {
$found = 1; $third['customer']++;
}
- if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) {
+ if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) {
$found = 1; $third['supplier']++;
}
- if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) {
+ if (isModEnabled('societe') && $objp->client == 0 && $objp->fournisseur == 0) {
$found = 1; $third['other']++;
}
if ($found) {
@@ -144,16 +144,16 @@ $thirdpartygraph .= ' '.$langs->trans("St
if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) {
$thirdpartygraph .= ' ';
$dataseries = array();
- if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
+ if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
$dataseries[] = array($langs->trans("Prospects"), round($third['prospect']));
}
- if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
+ if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
$dataseries[] = array($langs->trans("Customers"), round($third['customer']));
}
- if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
+ if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
$dataseries[] = array($langs->trans("Suppliers"), round($third['supplier']));
}
- if (!empty($conf->societe->enabled)) {
+ if (isModEnabled('societe')) {
$dataseries[] = array($langs->trans("Others"), round($third['other']));
}
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
@@ -167,18 +167,18 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
$thirdpartygraph .= $dolgraph->show();
$thirdpartygraph .= ' '."\n";
} else {
- if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
+ if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
$statstring = "";
$statstring .= ''.$langs->trans("Prospects").' '.round($third['prospect']).' ';
$statstring .= " ";
}
- if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
+ if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
$statstring .= "";
$statstring .= ''.$langs->trans("Customers").' '.round($third['customer']).' ';
$statstring .= " ";
}
$statstring2 = '';
- if (((!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
+ if (((isModEnabled('societe') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
$statstring2 = "";
$statstring2 .= ''.$langs->trans("Suppliers").' '.round($third['supplier']).' ';
$statstring2 .= " ";
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index e2ac40f8770..d623e5699de 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -784,7 +784,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
}
- if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
+ if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
@@ -838,16 +838,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$obj = $db->fetch_object($resql);
$nbFactsClient = $obj->nb;
$thirdTypeArray['customer'] = $langs->trans("customer");
- if ($conf->propal->enabled && $user->rights->propal->lire) {
+ if (isModEnabled('propal') && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
}
- if ($conf->commande->enabled && $user->rights->commande->lire) {
+ if (isModEnabled('commande') && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
}
- if ($conf->facture->enabled && $user->rights->facture->lire) {
+ if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
- if ($conf->contrat->enabled && $user->rights->contrat->lire) {
+ if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
}
}
diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php
index d411796aba8..2cd61bfe5d0 100644
--- a/htdocs/stripe/charge.php
+++ b/htdocs/stripe/charge.php
@@ -53,7 +53,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
$result = restrictedArea($user, 'banque');
-
+$optioncss = GETPOST('optioncss', 'alpha');
/*
* View
@@ -162,15 +162,15 @@ if (!$rowid) {
$status = $form->textwithpicto(img_picto($langs->trans((string) $charge->status), 'statut8'), $label, -1);
}
- if ($charge->payment_method_details->type == 'card') {
+ if (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'card') {
$type = $langs->trans("card");
- } elseif ($charge->source->type == 'card') {
+ } elseif (isset($charge->source->type) && $charge->source->type == 'card') {
$type = $langs->trans("card");
- } elseif ($charge->payment_method_details->type == 'three_d_secure') {
+ } elseif (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'three_d_secure') {
$type = $langs->trans("card3DS");
- } elseif ($charge->payment_method_details->type == 'sepa_debit') {
+ } elseif (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'sepa_debit') {
$type = $langs->trans("sepadebit");
- } elseif ($charge->payment_method_details->type == 'ideal') {
+ } elseif (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'ideal') {
$type = $langs->trans("iDEAL");
}
@@ -206,6 +206,8 @@ if (!$rowid) {
if (!empty($stripeacc)) {
$connect = $stripeacc.'/';
+ } else {
+ $connect = '';
}
// Ref
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 5f11b6e3c02..366b510737b 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier
require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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';
}
@@ -1131,7 +1131,7 @@ $formother = new FormOther($db);
$formfile = new FormFile($db);
$formmargin = new FormMargin($db);
$companystatic = new Societe($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -1312,7 +1312,7 @@ if ($action == 'create') {
print "";
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$formproject = new FormProjets($db);
@@ -1555,7 +1555,7 @@ if ($action == 'create') {
$morehtmlref .= ' ('.$langs->trans("OtherProposals").' )';
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($usercancreate) {
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index f1756f17814..bc5e555fa99 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -134,7 +134,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 ($permissiontoedit) {
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index fa73ec22fa8..af2353c4d8f 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
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/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';
}
// Load translation files required by the page
@@ -121,7 +121,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->supplier_proposal->creer) {
diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php
index 0b796937d2e..7bb6d4f7682 100644
--- a/htdocs/supplier_proposal/info.php
+++ b/htdocs/supplier_proposal/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.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -76,7 +76,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->supplier_proposal->creer) {
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index a0e404dbd89..96f8a2b2cca 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php
index 5a19a94b402..4ef46594e0e 100644
--- a/htdocs/supplier_proposal/note.php
+++ b/htdocs/supplier_proposal/note.php
@@ -29,7 +29,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
// Load translation files required by the page
@@ -105,7 +105,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->supplier_proposal->creer) {
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index b4111094063..35855b60e23 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -595,7 +595,7 @@ if (empty($reshook)) {
$localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr);
- $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0);
+ $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') ? 'HT' : 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0);
$invoice->fetch($placeid);
}
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 930d28550c3..5eda12f56de 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -2377,6 +2377,9 @@ img.photoref, div.photoref {
width: 80px;
object-fit: contain;
}
+img.photokanban, div.photokanban {
+ padding: 0;
+}
div.photoref .fa, div.photoref .fas, div.photoref .far {
font-size: 2.5em;
}
@@ -5339,11 +5342,11 @@ td.cal_other_month {
/* ============================================================================== */
/* CSS for treeview */
-.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 2px !important; }
-.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; }
+.treeview ul { background-color: transparent !important; margin-top: 0 !important; /* margin-bottom: 4px !important; padding-top: 2px !important; */ }
+.treeview li { background-color: transparent !important; padding: 0 0 0 20px !important; min-height: 30px; }
+.treeview .hitarea { width: 20px !important; margin-left: -20px !important; margin-top: 3px; }
.treeview li table { min-height: 30px; }
.treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; }
-.treeview .hitarea { margin-top: 3px; }
/* ============================================================================== */
diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php
index 77270b9d818..f1f82b757c0 100644
--- a/htdocs/theme/eldy/info-box.inc.php
+++ b/htdocs/theme/eldy/info-box.inc.php
@@ -489,6 +489,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
.box-flex-container {
margin: 0 0 0 0px !important;
width: 100% !important;
+ justify-content: space-between;
}
.info-box-module {
width: 100%;
diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php
index 8ffd6fc3f93..daf3c409397 100644
--- a/htdocs/theme/md/info-box.inc.php
+++ b/htdocs/theme/md/info-box.inc.php
@@ -193,7 +193,9 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
filter: saturate(global->THEME_SATURATE_RATIO; ?>);
}
+
.info-box-sm .info-box-icon {
+ height: 80px;
width: 80px;
font-size: 25px;
line-height: 92px;
diff --git a/htdocs/theme/md/main_menu_fa_icons.inc.php b/htdocs/theme/md/main_menu_fa_icons.inc.php
index 34827384139..0e0b144d187 100644
--- a/htdocs/theme/md/main_menu_fa_icons.inc.php
+++ b/htdocs/theme/md/main_menu_fa_icons.inc.php
@@ -22,8 +22,8 @@
font-size: 1.5em;
}
-div.mainmenu {
- background-image: none !important;
+div.mainmenu.menu {
+ background-image: none;
}
div.mainmenu.menu::before {
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 298b8b5c46a..c99482d6415 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -394,7 +394,7 @@ textarea:focus {
/* v6 box-shadow: 0 0 4px #8091BF; */
border: 1px solid #aaa !important;
}
-input:focus, textarea:focus, button:focus, select:focus {
+input:focus, textarea:focus, button:focus:not(.button_search_x):not(.button_search):not(.button_removefilter), select:focus {
border-bottom: 1px solid #666;
}
@@ -2399,6 +2399,11 @@ img.photoref, div.photoref {
object-fit: contain;
}
+img.photokanban, div.photokanban {
+ padding: 0;
+ border: none;
+}
+
div.photoref .fa, div.photoref .fas, div.photoref .far {
font-size: 2.5em;
}
@@ -4110,7 +4115,8 @@ tr.liste_titre_topborder td {
background: transparent;
}
tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_titre_sel, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */
- border-bottom: 1px solid var(--colortopbordertitle1);
+ /* border-bottom: 1px solid var(--colortopbordertitle1); */
+ border-bottom: none;
}
div.liste_titre {
@@ -4961,7 +4967,7 @@ span[phptag] {
color: #000 !important;
text-shadow: none;
}
-.bordertransp {
+.bordertransp:not(.nobordertransp) {
background-color: transparent;
background-image: none;
border: 1px solid #aaa;
@@ -5180,11 +5186,11 @@ td.gtaskname {
/* ============================================================================== */
/* CSS for treeview */
-.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; }
-.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; }
+.treeview ul { background-color: transparent !important; margin-top: 0 !important; /* margin-bottom: 4px !important; padding-top: 2px !important; */ }
+.treeview li { background-color: transparent !important; padding: 0 0 0 20px !important; min-height: 30px; }
+.treeview .hitarea { width: 20px !important; margin-left: -20px !important; margin-top: 3px; }
.treeview li table { min-height: 30px; }
.treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; }
-.treeview .hitarea { margin-top: 3px; }
@@ -6112,6 +6118,17 @@ ul.select2-results__options li {
font-size: 0.95em;
}
+@media only screen and (min-width: 767px)
+{
+ .select2-container.select2-container--open .select2-dropdown.ui-dialog {
+ min-width: 200px !important;
+ }
+ .select2-container--open .select2-dropdown--below {
+ border-top: 1px solid var(--inputbordercolor);
+ /* border-top: 1px solid #aaaaaa; */
+ }
+}
+
/* ============================================================================== */
/* For categories */
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index 76e136c1fd7..72c19c217b3 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -184,7 +184,7 @@ if (!empty($conf->societe->enabled)) {
}
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project');
if ($user->rights->ticket->write) {
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index efa2eba0999..e7fc3abba34 100755
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.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';
include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
@@ -696,7 +696,7 @@ if (empty($reshook)) {
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicket($db);
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@@ -949,7 +949,7 @@ if ($action == 'create' || $action == 'presend') {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
@@ -1125,7 +1125,7 @@ if ($action == 'create' || $action == 'presend') {
print '
';
// Categories
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php
index 5de60a48d85..558faf1775a 100644
--- a/htdocs/ticket/class/cticketcategory.class.php
+++ b/htdocs/ticket/class/cticketcategory.class.php
@@ -274,9 +274,6 @@ class CTicketCategory extends CommonObject
if (property_exists($object, 'label')) {
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
}
- if (property_exists($object, 'status')) {
- $object->status = self::STATUS_DRAFT;
- }
if (property_exists($object, 'date_creation')) {
$object->date_creation = dol_now();
}
@@ -488,155 +485,6 @@ class CTicketCategory extends CommonObject
}
- /**
- * Validate object
- *
- * @param User $user User making status change
- * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
- */
- public function validate($user, $notrigger = 0)
- {
- global $conf, $langs;
-
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
- $error = 0;
-
- // Protection
- if ($this->status == self::STATUS_VALIDATED) {
- dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING);
- return 0;
- }
-
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->write))
- || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->myobject_advance->validate))))
- {
- $this->error='NotEnoughPermissions';
- dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
- return -1;
- }*/
-
- $now = dol_now();
-
- $this->db->begin();
-
- // Define new ref
- if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life
- $num = $this->getNextNumRef();
- } else {
- $num = $this->ref;
- }
- $this->newref = $num;
-
- if (!empty($num)) {
- // Validate
- $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
- $sql .= " SET ref = '".$this->db->escape($num)."',";
- $sql .= " status = ".self::STATUS_VALIDATED;
- if (!empty($this->fields['date_validation'])) {
- $sql .= ", date_validation = '".$this->db->idate($now)."'";
- }
- if (!empty($this->fields['fk_user_valid'])) {
- $sql .= ", fk_user_valid = ".((int) $user->id);
- }
- $sql .= " WHERE rowid = ".((int) $this->id);
-
- dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
- $resql = $this->db->query($sql);
- if (!$resql) {
- dol_print_error($this->db);
- $this->error = $this->db->lasterror();
- $error++;
- }
-
- if (!$error && !$notrigger) {
- // Call trigger
- $result = $this->call_trigger('CTICKETCATEGORY_VALIDATE', $user);
- if ($result < 0) {
- $error++;
- }
- // End call triggers
- }
- }
-
- if (!$error) {
- $this->oldref = $this->ref;
-
- // Rename directory if dir was a temporary ref
- if (preg_match('/^[\(]?PROV/i', $this->ref)) {
- // Now we rename also files into index
- $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'myobject/".$this->db->escape($this->newref)."'";
- $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'myobject/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
- $resql = $this->db->query($sql);
- if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
- }
-
- // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
- $oldref = dol_sanitizeFileName($this->ref);
- $newref = dol_sanitizeFileName($num);
- $dirsource = $conf->mymodule->dir_output.'/myobject/'.$oldref;
- $dirdest = $conf->mymodule->dir_output.'/myobject/'.$newref;
- if (!$error && file_exists($dirsource)) {
- dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest);
-
- if (@rename($dirsource, $dirdest)) {
- dol_syslog("Rename ok");
- // Rename docs starting with $oldref with $newref
- $listoffiles = dol_dir_list($conf->mymodule->dir_output.'/myobject/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
- foreach ($listoffiles as $fileentry) {
- $dirsource = $fileentry['name'];
- $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
- $dirsource = $fileentry['path'].'/'.$dirsource;
- $dirdest = $fileentry['path'].'/'.$dirdest;
- @rename($dirsource, $dirdest);
- }
- }
- }
- }
- }
-
- // Set new ref and current status
- if (!$error) {
- $this->ref = $num;
- $this->status = self::STATUS_VALIDATED;
- }
-
- if (!$error) {
- $this->db->commit();
- return 1;
- } else {
- $this->db->rollback();
- return -1;
- }
- }
-
-
- /**
- * Set cancel status
- *
- * @param User $user Object user that modify
- * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
- */
- public function cancel($user, $notrigger = 0)
- {
- // Protection
- if ($this->status != self::STATUS_VALIDATED) {
- return 0;
- }
-
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write))
- || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate))))
- {
- $this->error='Permission denied';
- return -1;
- }*/
-
- return $this->setStatusCommon($user, self::STATUS_DISABLED, $notrigger, 'CTICKETCATEGORY_CANCEL');
- }
-
/**
* Return a link to the object card (with optionaly the picto)
*
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index 3ac3727af13..67fb1772ac4 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -267,7 +267,7 @@ class Ticket extends CommonObject
'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'),
'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"),
//'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ?
'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1),
'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1),
@@ -2594,7 +2594,7 @@ class Ticket extends CommonObject
if (is_array($internal_contacts) && count($internal_contacts) > 0) {
// altairis: set default subject
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
- $subject = GETPOST('subject', 'nohtml') ? GETPOST('subject', 'nohtml') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
+ $subject = GETPOST('subject', 'alphanohtml') ? GETPOST('subject', 'alphanohtml') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
$message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id);
$message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE;
@@ -2871,7 +2871,7 @@ class Ticket extends CommonObject
$sql = "SELECT p.rowid, p.ref, p.datec as datec";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
- if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$user->socid) {
+ if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
$clause = " AND";
diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php
index 2af0b789c3d..41fc4b0f69a 100644
--- a/htdocs/ticket/class/ticketstats.class.php
+++ b/htdocs/ticket/class/ticketstats.class.php
@@ -89,12 +89,13 @@ class TicketStats extends Stats
}
/**
- * Renvoie le nombre de facture par mois pour une annee donnee
+ * Return the number of tickets per month for a given year
*
- * @param string $year Year to scan
- * @return array Array of values
+ * @param string $year Year to scan
+ * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
+ * @return array Array of values
*/
- public function getNbByMonth($year)
+ public function getNbByMonth($year, $format = 0)
{
$sql = "SELECT MONTH(datec) as dm, count(*)";
$sql .= " FROM ".$this->from;
@@ -103,18 +104,19 @@ class TicketStats extends Stats
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
- $res = $this->_getNbByMonth($year, $sql);
+ $res = $this->_getNbByMonth($year, $sql, $format);
//var_dump($res);print ' ';
return $res;
}
/**
- * Renvoie le montant de facture par mois pour une annee donnee
+ * Return th eamount of tickets for a month and a given year
*
- * @param int $year Year to scan
- * @return array Array of values
+ * @param int $year Year to scan
+ * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
+ * @return array Array of values
*/
- public function getAmountByMonth($year)
+ public function getAmountByMonth($year, $format = 0)
{
$sql = "SELECT date_format(datec,'%m') as dm, sum(".$this->field.")";
$sql .= " FROM ".$this->from;
@@ -123,7 +125,7 @@ class TicketStats extends Stats
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
- $res = $this->_getAmountByMonth($year, $sql);
+ $res = $this->_getAmountByMonth($year, $sql, $format);
//var_dump($res);print ' ';
return $res;
}
diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php
index ee76045ffec..5b1b73799f2 100644
--- a/htdocs/ticket/contact.php
+++ b/htdocs/ticket/contact.php
@@ -221,7 +221,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php
index d0c2d0a4a60..bf2b1c51fc4 100644
--- a/htdocs/ticket/document.php
+++ b/htdocs/ticket/document.php
@@ -156,7 +156,7 @@ if ($object->id) {
}
// Project
- if (!empty($conf->projet->enabled)) {
+ if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index a3bf03467ce..4b887691f01 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -182,7 +182,7 @@ if (!empty($conf->societe->enabled)) {
}
// Project
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project');
if ($user->rights->ticket->write) {
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 4ec919358e1..b7a9ea4ef2c 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -446,7 +446,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
print "\n";
// Date of birth
- if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
print '';
print '';
print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer);
@@ -457,7 +457,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// Personal email
- if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
print ' ';
print '';
print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
@@ -468,7 +468,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// Personal phone
- if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
print ' ';
print '';
print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
@@ -533,7 +533,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// Employee Number
- if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
print ' ';
print '';
print $form->editfieldkey("RefEmployee", 'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
@@ -544,7 +544,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// National registration number
- if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
print ' ';
print '';
print $form->editfieldkey("NationalRegistrationNumber", 'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index f0b362b383e..36807533a66 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -997,11 +997,11 @@ if ($action == 'create' || $action == 'adduserldap') {
}
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
if (!empty($ldap_pass)) { // For very old system comaptibilty. Now clear password can't be viewed from LDAP read
- $valuetoshow .= ($valuetoshow ? ', ' : '').' '; // Dolibarr password is preffiled with LDAP known password
+ $valuetoshow .= ($valuetoshow ? ', ' : '').' '; // Dolibarr password is preffiled with LDAP known password
$valuetoshow .= preg_replace('/./i', '*', $ldap_pass);
} else {
// We do not use a field password but a field text to show new password to use.
- $valuetoshow .= ($valuetoshow ? ', ' : '').' ';
+ $valuetoshow .= ($valuetoshow ? ', ' : '').' ';
}
}
@@ -1154,7 +1154,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// User color
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
print ' '.$langs->trans("ColorUser").' ';
print '';
print $formother->selectColor(GETPOSTISSET('color') ?GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
@@ -1605,7 +1605,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '';
// Color user
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
print ''.$langs->trans("ColorUser").' ';
print '';
print $formother->showColor($object->color, '');
@@ -2348,7 +2348,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
if ($caneditpassword) {
- $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').' ';
+ $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').' ';
} else {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass);
}
@@ -2505,7 +2505,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' ';
}
if ($caneditfield && empty($object->ldap_sid)) {
- print ' ';
+ print ' ';
} else {
print ' ';
print $object->socialnetworks[$key];
@@ -2513,7 +2513,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' ';
} else {
// if social network is not active but value exist we do not want to loose it
- print ' ';
+ print ' ';
}
}
}
@@ -2544,7 +2544,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// User color
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
print ''.$langs->trans("ColorUser").' ';
print '';
if ($caneditfield) {
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 11d21f4e957..c073937b048 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2964,7 +2964,18 @@ class User extends CommonObject
$return = '';
$return .= '
';
$return .= '
';
- $return .= img_picto('', $this->picto);
+
+ $label = '';
+ if (!empty($this->photo)) {
+ //$label .= '';
+ $label .= Form::showphoto('userphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); // Force height to 60 so we total height of tooltip can be calculated and collision can be managed
+ //$label .= '
';
+ //$label .= '
';
+ $return .= $label;
+ } else {
+ $return .= img_picto('', $this->picto);
+ }
+
//$return .= ' '; // Can be image
$return .= ' ';
$return .= '
';
@@ -2972,6 +2983,9 @@ class User extends CommonObject
if (property_exists($this, 'label')) {
$return .= '
'.$this->label.' ';
}
+ if ($this->email) {
+ $return .= '
'.img_picto('', 'email').' '.$this->email.' ';
+ }
if (method_exists($this, 'getLibStatut')) {
$return .= '
'.$this->getLibStatut(5).'
';
}
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index 2207e3358ae..0dd38cc057b 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -139,7 +139,7 @@ if ($id > 0) {
print '
ClickToDial '.$langs->trans("Password").' ';
print '';
- print ' ';
+ print ' ';
print "\n";
print '
';
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index fa9a438e350..1acfa858663 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -122,11 +122,11 @@ if (empty($reshook)) {
// Action add group
if ($action == 'add') {
if ($caneditperms) {
- if (!GETPOST("nom", "nohtml")) {
+ if (!GETPOST("nom", "alphanohtml")) {
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
$action = "create"; // Go back to create page
} else {
- $object->name = GETPOST("nom", 'nohtml');
+ $object->name = GETPOST("nom", 'alphanohtml');
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
// Fill array 'array_options' with data from add form
@@ -206,7 +206,7 @@ if (empty($reshook)) {
$object->oldcopy = clone $object;
- $object->name = GETPOST("nom", 'nohtml');
+ $object->name = GETPOST("nom", 'alphanohtml');
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
// Fill array 'array_options' with data from add form
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index f92afe53a4f..7916f4650d2 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -186,7 +186,7 @@ $tmparray = array('index.php'=>'Dashboard');
if (!empty($conf->societe->enabled)) {
$tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea';
}
-if (!empty($conf->projet->enabled)) {
+if (!empty($conf->project->enabled)) {
$tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
}
if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
@@ -204,7 +204,7 @@ if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled))
if (!empty($conf->adherent->enabled)) {
$tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
$tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
}
if (!empty($conf->ticket->enabled)) {
@@ -341,7 +341,35 @@ if ($action == 'edit') {
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
+ print '';
+
print '
';
+ print '
';
+
+ // Login
+ print ''.$langs->trans("Login").' ';
+ if (!empty($object->ldap_sid) && $object->statut == 0) {
+ print '';
+ print $langs->trans("LoginAccountDisableInDolibarr");
+ print ' ';
+ } else {
+ print '';
+ $addadmin = '';
+ if (property_exists($object, 'admin')) {
+ if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
+ $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
+ } elseif (!empty($object->admin)) {
+ $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
+ }
+ }
+ print showValueWithClipboardCPButton($object->login).$addadmin;
+ print ' ';
+ }
+ print ' '."\n";
+
+ print '
';
+
+ print '
';
print dol_get_fiche_end();
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 55876016680..e8a4ed41a1c 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -282,7 +282,7 @@ print ' '."\n";
print '
';
print '
';
-
+print '
';
if ($user->admin) {
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 9e1d791a626..b6ffd948bd6 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -915,7 +915,7 @@ if (!empty($id) || !empty($ref)) {
print '
id.'">'.img_delete().' ';
print '';
print '
';
- if ($productCombinations || $massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ if (!empty($productCombinations) || $massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($prodstatic->id, $arrayofselected)) {
$selected = 1;
diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php
index f70a990ee95..14af2e88b3f 100644
--- a/htdocs/webservices/admin/index.php
+++ b/htdocs/webservices/admin/index.php
@@ -108,7 +108,7 @@ $webservices = array(
'supplier_invoice' => '!empty($conf->fournisseur->enabled)',
'actioncomm' => '!empty($conf->agenda->enabled)',
'category' => '!empty($conf->categorie->enabled)',
- 'project' => '!empty($conf->projet->enabled)',
+ 'project' => '!empty($conf->project->enabled)',
'other' => ''
);
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 164f327a52d..0a58c0bcf44 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -3323,7 +3323,7 @@ if ($action == 'editcss') {
// Clean the php htaccesscontent file to remove php code and get only html part
$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htaccesscontent);
} else {
- $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');
+ $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
}
if (!trim($htaccesscontent)) {
$htaccesscontent .= "# Order allow,deny\n";
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index 118627f19ea..249398c322e 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -222,7 +222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// 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') . ' ';
diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php
index 78140eddd40..ff30d062f38 100644
--- a/htdocs/workstation/workstation_agenda.php
+++ b/htdocs/workstation/workstation_agenda.php
@@ -147,7 +147,7 @@ if ($object->id > 0) {
// 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/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php
index 37f24a38437..9e859dcc2d0 100644
--- a/htdocs/workstation/workstation_card.php
+++ b/htdocs/workstation/workstation_card.php
@@ -340,7 +340,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// 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') . ' ';
if ($permissiontoadd) {
diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php
index f52ef1fe796..50331b4b231 100644
--- a/htdocs/workstation/workstation_document.php
+++ b/htdocs/workstation/workstation_document.php
@@ -128,7 +128,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/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php
index 3685b7daf4e..dc230dd38ff 100644
--- a/htdocs/workstation/workstation_note.php
+++ b/htdocs/workstation/workstation_note.php
@@ -101,7 +101,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/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php
index 25ea4b4d415..820db6746ee 100755
--- a/scripts/cron/cron_run_jobs.php
+++ b/scripts/cron/cron_run_jobs.php
@@ -81,6 +81,8 @@ $userlogin = $argv[2];
$version = DOL_VERSION;
$error = 0;
+$hookmanager->initHooks(array('cli'));
+
/*
* Main
diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php
index 18a737ec50b..81b05486c72 100644
--- a/test/phpunit/BuildDocTest.php
+++ b/test/phpunit/BuildDocTest.php
@@ -121,7 +121,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
if (! $conf->propal->enabled) {
print __METHOD__." propal module not enabled\n"; die(1);
}
- if (! $conf->projet->enabled) {
+ if (! $conf->project->enabled) {
print __METHOD__." project module not enabled\n"; die(1);
}
if (! $conf->expedition->enabled) {
@@ -377,7 +377,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
- $conf->projet->dir_output.='/temp';
+ $conf->project->dir_output.='/temp';
$localobject=new Project($this->savdb);
$localobject->initAsSpecimen();
diff --git a/test/phpunit/EvalMathTest.php b/test/phpunit/EvalMathTest.php
new file mode 100644
index 00000000000..1346538668c
--- /dev/null
+++ b/test/phpunit/EvalMathTest.php
@@ -0,0 +1,151 @@
+
+ * Copyright (C) 2022 Quatadah Nasdami
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ * or see https://www.gnu.org/
+ */
+
+/**
+ * \file test/phpunit/InventoryTest.php
+ * \ingroup test
+ * \brief PHPUnit test
+ * \remarks To run this script as CLI: phpunit filename.php
+ */
+
+global $conf,$user,$langs,$db;
+require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
+require_once dirname(__FILE__).'/../../htdocs/core/class/evalmath.class.php';
+
+if (empty($user->id)) {
+ print "Load permissions for admin user nb 1\n";
+ $user->fetch(1);
+ $user->getrights();
+}
+$conf->global->MAIN_DISABLE_ALL_MAILS=1;
+
+
+/**
+ * Class for PHPUnit tests
+ *
+ * @backupGlobals disabled
+ * @backupStaticAttributes enabled
+ * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
+ */
+class InventoryTest extends PHPUnit\Framework\TestCase
+{
+ protected $savconf;
+ protected $savuser;
+ protected $savlangs;
+ protected $savdb;
+
+ /**
+ * Constructor
+ * We save global variables into local variables
+ *
+ * @return InventoryTest
+ */
+ public function __construct()
+ {
+ parent::__construct();
+
+ //$this->sharedFixture
+ global $conf,$user,$langs,$db;
+ $this->savconf=$conf;
+ $this->savuser=$user;
+ $this->savlangs=$langs;
+ $this->savdb=$db;
+
+ print __METHOD__." db->type=".$db->type." user->id=".$user->id;
+ //print " - db ".$db->db;
+ print "\n";
+ }
+
+ /**
+ * setUpBeforeClass
+ *
+ * @return void
+ */
+ public static function setUpBeforeClass()
+ {
+ global $conf,$user,$langs,$db;
+
+ $db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
+
+ print __METHOD__."\n";
+ }
+
+ /**
+ * tearDownAfterClass
+ *
+ * @return void
+ */
+ public static function tearDownAfterClass()
+ {
+ global $conf,$user,$langs,$db;
+ $db->rollback();
+
+ print __METHOD__."\n";
+ }
+
+ /**
+ * Init phpunit tests
+ *
+ * @return void
+ */
+ protected function setUp()
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ print __METHOD__."\n";
+ }
+
+ /**
+ * End phpunit tests
+ *
+ * @return void
+ */
+ protected function tearDown()
+ {
+ print __METHOD__."\n";
+ }
+
+ /**
+ * test postfix evaluation function
+ * @return void
+ */
+ public function testEvaluate()
+ {
+ $localobject = new EvalMath();
+ $result = $localobject->evaluate('1+1');
+ $this->assertEquals($result, 2);
+ print __METHOD__." result=".$result."\n";
+
+ $result = $localobject->evaluate('10-4/4');
+ $this->assertEquals($result, 9);
+ print __METHOD__." result=".$result."\n";
+
+ $result = $localobject->evaluate('3^3');
+ $this->assertEquals($result, 27);
+ print __METHOD__." result=".$result."\n";
+
+ $result = $localobject->evaluate('');
+ $this->assertEquals($result, '');
+ print __METHOD__." result=".$result."\n";
+ }
+}
diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php
index efa7d43a269..e40ed6aa2e7 100644
--- a/test/phpunit/FactureTest.php
+++ b/test/phpunit/FactureTest.php
@@ -83,7 +83,7 @@ class FactureTest extends PHPUnit\Framework\TestCase
{
global $conf,$user,$langs,$db;
- if (empty($conf->facture->enabled)) {
+ if (!isModEnabled('facture')) {
print __METHOD__." module customer invoice must be enabled.\n"; die(1);
}
if (! empty($conf->ecotaxdeee->enabled)) {