Fix warning

This commit is contained in:
Laurent Destailleur 2023-11-27 12:32:53 +01:00
parent b69059af76
commit 06736918de
30 changed files with 111 additions and 111 deletions

View File

@ -228,10 +228,10 @@ if (is_resource($handle)) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -47,7 +47,7 @@ function conferenceorboothPrepareHead($object, $with_project = 0)
$head[$h][2] = 'card';
$h++;
if (getDolGlobalString('MAIN_FEATURES_LEVEL') && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalString('MAIN_FEATURES_LEVEL') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl;
$head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact';

View File

@ -125,10 +125,10 @@ $fileRequired = getDolGlobalString('EXPENSEREPORT_FILE_IS_REQUIRED');
if ($object->id > 0) {
// Check current user can read this expense report
$canread = 0;
if (!empty($user->rights->expensereport->readall)) {
if ($user->hasRight('expensereport', 'readall')) {
$canread = 1;
}
if (!empty($user->rights->expensereport->lire) && in_array($object->fk_user_author, $childids)) {
if ($user->hasRight('expensereport', 'lire') && in_array($object->fk_user_author, $childids)) {
$canread = 1;
}
if (!$canread) {
@ -137,7 +137,7 @@ if ($object->id > 0) {
}
$candelete = 0;
if (!empty($user->rights->expensereport->supprimer)) {
if ($user->hasRight('expensereport', 'supprimer')) {
$candelete = 1;
}
if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->hasRight('expensereport', 'write') && in_array($object->fk_user_author, $childids)) {
@ -218,7 +218,7 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->expensereport->creer) {
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->hasRight('expensereport', 'creer')) {
if (1 == 0 && !GETPOST('clone_content', 'alpha') && !GETPOST('clone_receivers', 'alpha')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {
@ -251,7 +251,7 @@ if (empty($reshook)) {
}
}
if ($action == 'add' && $user->rights->expensereport->creer) {
if ($action == 'add' && $user->hasRight('expensereport', 'creer')) {
$error = 0;
$object = new ExpenseReport($db);
@ -265,13 +265,13 @@ if (empty($reshook)) {
}
// Check that expense report is for a user inside the hierarchy, or that advanced permission for all is set
if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && empty($user->rights->expensereport->creer))
|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) {
if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('expensereport', 'creer'))
|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('expensereport', 'creer') && !$user->hasRight('expensereport', 'writeall_advance'))) {
$error++;
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors');
}
if (!$error) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || empty($user->rights->expensereport->writeall_advance)) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance')) {
if (!in_array($object->fk_user_author, $childids)) {
$error++;
setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors');
@ -325,7 +325,7 @@ if (empty($reshook)) {
}
}
if (($action == 'update' || $action == 'updateFromRefuse') && $user->rights->expensereport->creer) {
if (($action == 'update' || $action == 'updateFromRefuse') && $user->hasRight('expensereport', 'creer')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -373,7 +373,7 @@ if (empty($reshook)) {
}
}
if ($action == "confirm_validate" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $user->rights->expensereport->creer) {
if ($action == "confirm_validate" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $user->hasRight('expensereport', 'creer')) {
$error = 0;
$db->begin();
@ -488,7 +488,7 @@ if (empty($reshook)) {
}
}
if ($action == "confirm_save_from_refuse" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $user->rights->expensereport->creer) {
if ($action == "confirm_save_from_refuse" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $user->hasRight('expensereport', 'creer')) {
$object = new ExpenseReport($db);
$object->fetch($id);
$result = $object->set_save_from_refuse($user);
@ -597,7 +597,7 @@ if (empty($reshook)) {
}
// Approve
if ($action == "confirm_approve" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $user->rights->expensereport->approve) {
if ($action == "confirm_approve" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $user->hasRight('expensereport', 'approve')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -710,7 +710,7 @@ if (empty($reshook)) {
}
}
if ($action == "confirm_refuse" && GETPOST('confirm', 'alpha') == "yes" && $id > 0 && $user->rights->expensereport->approve) {
if ($action == "confirm_refuse" && GETPOST('confirm', 'alpha') == "yes" && $id > 0 && $user->hasRight('expensereport', 'approve')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -820,7 +820,7 @@ if (empty($reshook)) {
}
//var_dump($user->id == $object->fk_user_validator);exit;
if ($action == "confirm_cancel" && GETPOST('confirm', 'alpha') == "yes" && $id > 0 && $user->rights->expensereport->creer) {
if ($action == "confirm_cancel" && GETPOST('confirm', 'alpha') == "yes" && $id > 0 && $user->hasRight('expensereport', 'creer')) {
if (!GETPOST('detail_cancel', 'alpha')) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors');
} else {
@ -937,7 +937,7 @@ if (empty($reshook)) {
}
}
if ($action == "confirm_setdraft" && GETPOST('confirm', 'alpha') == "yes" && $id > 0 && $user->rights->expensereport->creer) {
if ($action == "confirm_setdraft" && GETPOST('confirm', 'alpha') == "yes" && $id > 0 && $user->hasRight('expensereport', 'creer')) {
$object = new ExpenseReport($db);
$object->fetch($id);
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) {
@ -976,7 +976,7 @@ if (empty($reshook)) {
}
}
if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid) {
if ($action == 'set_unpaid' && $id > 0 && $user->hasRight('expensereport', 'to_paid')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -1005,7 +1005,7 @@ if (empty($reshook)) {
}
}
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid) {
if ($action == 'set_paid' && $id > 0 && $user->hasRight('expensereport', 'to_paid')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -1102,7 +1102,7 @@ if (empty($reshook)) {
}
}
if ($action == "addline" && $user->rights->expensereport->creer) {
if ($action == "addline" && $user->hasRight('expensereport', 'creer')) {
$error = 0;
// First save uploaded file
@ -1226,7 +1226,7 @@ if (empty($reshook)) {
}
}
if ($action == 'confirm_delete_line' && GETPOST("confirm", 'alpha') == "yes" && $user->rights->expensereport->creer) {
if ($action == 'confirm_delete_line' && GETPOST("confirm", 'alpha') == "yes" && $user->hasRight('expensereport', 'creer')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -1266,7 +1266,7 @@ if (empty($reshook)) {
}
}
if ($action == "updateline" && $user->rights->expensereport->creer) {
if ($action == "updateline" && $user->hasRight('expensereport', 'creer')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@ -1440,7 +1440,7 @@ if ($action == 'create') {
$defaultselectuser = GETPOST('fk_user_author', 'int');
}
$include_users = 'hierarchyme';
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->expensereport->writeall_advance)) {
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expensereport', 'writeall_advance')) {
$include_users = array();
}
$s = $form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users, '', '0,'.$conf->entity);
@ -1525,8 +1525,8 @@ if ($action == 'create') {
if ($result > 0) {
if (!in_array($object->fk_user_author, $user->getAllChildIds(1))) {
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || empty($user->rights->expensereport->writeall_advance))) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance'))) {
print load_fiche_titre($langs->trans('TripCard'), '', 'trip');
print '<div class="tabBar">';
@ -1649,7 +1649,7 @@ if ($action == 'create') {
if ($action == 'clone') {
// Create an array for form
$criteriaforfilter = 'hierarchyme';
if (!empty($user->rights->expensereport->readall)) {
if ($user->hasRight('expensereport', 'readall')) {
$criteriaforfilter = '';
}
$formquestion = array(
@ -2068,7 +2068,7 @@ if ($action == 'create') {
print '</td>';
// Ajout des boutons de modification/suppression
if (($object->status < 2 || $object->status == 99) && $user->rights->expensereport->creer) {
if (($object->status < 2 || $object->status == 99) && $user->hasRight('expensereport', 'creer')) {
print '<td class="right"></td>';
}
print '</tr>';
@ -2230,7 +2230,7 @@ if ($action == 'create') {
print '</td>';
// Ajout des boutons de modification/suppression
if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer) {
if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->hasRight('expensereport', 'creer')) {
print '<td class="nowrap right linecolaction">';
print '<a class="editfielda reposition paddingrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&token='.newToken().'&rowid='.$line->rowid.'">';
@ -2392,7 +2392,7 @@ if ($action == 'create') {
}
// Add a new line
if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) {
if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->hasRight('expensereport', 'creer')) {
$colspan = 12;
if (getDolGlobalString('MAIN_USE_EXPENSE_IK')) {
$colspan++;
@ -2696,8 +2696,8 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') {
* ET fk_user_author == user courant
* Afficher : "Enregistrer" / "Modifier" / "Supprimer"
*/
if ($user->rights->expensereport->creer && $object->status == ExpenseReport::STATUS_DRAFT) {
if (in_array($object->fk_user_author, $user->getAllChildIds(1)) || !empty($user->rights->expensereport->writeall_advance)) {
if ($user->hasRight('expensereport', 'creer') && $object->status == ExpenseReport::STATUS_DRAFT) {
if (in_array($object->fk_user_author, $user->getAllChildIds(1)) || $user->hasRight('expensereport', 'writeall_advance')) {
// Modify
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Modify').'</a></div>';
@ -2713,7 +2713,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') {
* ET fk_user_author == user courant
* Afficher : "Enregistrer" / "Modifier" / "Supprimer"
*/
if ($user->rights->expensereport->creer && $object->status == ExpenseReport::STATUS_REFUSED) {
if ($user->hasRight('expensereport', 'creer') && $object->status == ExpenseReport::STATUS_REFUSED) {
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) {
// Modify
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Modify').'</a></div>';
@ -2725,7 +2725,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') {
}
}
if ($user->rights->expensereport->to_paid && $object->status == ExpenseReport::STATUS_APPROVED) {
if ($user->hasRight('expensereport', 'to_paid') && $object->status == ExpenseReport::STATUS_APPROVED) {
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) {
// setdraft
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=setdraft&token='.newToken().'&id='.$object->id.'">'.$langs->trans('SetToDraft').'</a></div>';
@ -2744,7 +2744,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') {
}
}
if ($user->rights->expensereport->approve && $object->status == ExpenseReport::STATUS_VALIDATED) {
if ($user->hasRight('expensereport', 'approve') && $object->status == ExpenseReport::STATUS_VALIDATED) {
//if($object->fk_user_validator==$user->id)
//{
// Validate
@ -2763,12 +2763,12 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') {
// If status is Approved
// ---------------------
if ($user->rights->expensereport->approve && $object->status == ExpenseReport::STATUS_APPROVED) {
if ($user->hasRight('expensereport', 'approve') && $object->status == ExpenseReport::STATUS_APPROVED) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=refuse&id='.$object->id.'">'.$langs->trans('Deny').'</a></div>';
}
// If bank module is used
if ($user->rights->expensereport->to_paid && isModEnabled("banque") && $object->status == ExpenseReport::STATUS_APPROVED) {
if ($user->hasRight('expensereport', 'to_paid') && isModEnabled("banque") && $object->status == ExpenseReport::STATUS_APPROVED) {
// Pay
if ($remaintopay == 0) {
print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPayment').'</span></div>';
@ -2778,36 +2778,36 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') {
}
// If bank module is not used
if (($user->rights->expensereport->to_paid || empty(isModEnabled("banque"))) && $object->status == ExpenseReport::STATUS_APPROVED) {
if (($user->hasRight('expensereport', 'to_paid') || empty(isModEnabled("banque"))) && $object->status == ExpenseReport::STATUS_APPROVED) {
//if ((round($remaintopay) == 0 || !isModEnabled("banque")) && $object->paid == 0)
if ($object->paid == 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=set_paid&token='.newToken().'">'.$langs->trans("ClassifyPaid")."</a></div>";
}
}
if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->status == ExpenseReport::STATUS_APPROVED) {
if ($user->hasRight('expensereport', 'creer') && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->status == ExpenseReport::STATUS_APPROVED) {
// Cancel
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Cancel").'</a></div>';
}
// TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled.
if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->status == ExpenseReport::STATUS_CLOSED) {
if (($user->hasRight('expensereport', 'approve') || $user->hasRight('expensereport', 'to_paid')) && $object->status == ExpenseReport::STATUS_CLOSED) {
// Cancel
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Cancel").'</a></div>';
}
if ($user->rights->expensereport->to_paid && $object->paid && $object->status == ExpenseReport::STATUS_CLOSED) {
if ($user->hasRight('expensereport', 'to_paid') && $object->paid && $object->status == ExpenseReport::STATUS_CLOSED) {
// Set unpaid
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=set_unpaid&token='.newToken().'&id='.$object->id.'">'.$langs->trans('ClassifyUnPaid').'</a></div>';
}
// Clone
if ($user->rights->expensereport->creer) {
if ($user->hasRight('expensereport', 'creer')) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'">'.$langs->trans("ToClone").'</a></div>';
}
/* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */
if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->status < ExpenseReport::STATUS_APPROVED) {
if ($user->hasRight('expensereport', 'creer') && $user->id == $object->fk_user_author && $object->status < ExpenseReport::STATUS_APPROVED) {
// Delete
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
} elseif ($candelete && $object->status != ExpenseReport::STATUS_CLOSED) {
@ -2835,7 +2835,7 @@ if ($action != 'presend') {
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
if ($user->rights->expensereport->creer && $action != 'create' && $action != 'edit') {
if ($user->hasRight('expensereport', 'creer') && $action != 'create' && $action != 'edit') {
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;

View File

@ -948,7 +948,7 @@ class ExpenseReport extends CommonObject
$langs->load('trips');
if ($user->rights->expensereport->lire) {
if ($user->hasRight('expensereport', 'lire')) {
$sql = "SELECT de.fk_expensereport, de.date, de.comments, de.total_ht, de.total_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as de";
$sql .= " WHERE de.fk_projet = ".((int) $projectid);
@ -1660,7 +1660,7 @@ class ExpenseReport extends CommonObject
if (getDolGlobalString('EXPENSEREPORT_ADDON')) {
$mybool = false;
$file = $conf->global->EXPENSEREPORT_ADDON.".php";
$file = getDolGlobalString('EXPENSEREPORT_ADDON') . ".php";
$classname = $conf->global->EXPENSEREPORT_ADDON;
// Include file with class
@ -2491,7 +2491,7 @@ class ExpenseReport extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as ex";
$sql .= " WHERE ex.fk_statut > 0";
$sql .= " AND ex.entity IN (".getEntity('expensereport').")";
if (empty($user->rights->expensereport->readall)) {
if (!$user->hasRight('expensereport', 'readall')) {
$userchildids = $user->getAllChildIds(1);
$sql .= " AND (ex.fk_user_author IN (".$this->db->sanitize(join(',', $userchildids)).")";
$sql .= " OR ex.fk_user_validator IN (".$this->db->sanitize(join(',', $userchildids))."))";
@ -2538,7 +2538,7 @@ class ExpenseReport extends CommonObject
$sql .= " WHERE ex.fk_statut = ".self::STATUS_APPROVED;
}
$sql .= " AND ex.entity IN (".getEntity('expensereport').")";
if (empty($user->rights->expensereport->readall)) {
if (!$user->hasRight('expensereport', 'readall')) {
$userchildids = $user->getAllChildIds(1);
$sql .= " AND (ex.fk_user_author IN (".$this->db->sanitize(join(',', $userchildids)).")";
$sql .= " OR ex.fk_user_validator IN (".$this->db->sanitize(join(',', $userchildids))."))";

View File

@ -75,7 +75,7 @@ class ExpenseReportStats extends Stats
}
// Only me and subordinates
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')) {
$childids = $user->getAllChildIds();
$childids[] = $user->id;
$this->where .= " AND e.fk_user_author IN (".$this->db->sanitize(join(',', $childids)).")";

View File

@ -84,10 +84,10 @@ $result = restrictedArea($user, 'expensereport', $id, 'expensereport');
if ($object->id > 0) {
// Check current user can read this expense report
$canread = 0;
if (!empty($user->rights->expensereport->readall)) {
if ($user->hasRight('expensereport', 'readall')) {
$canread = 1;
}
if (!empty($user->rights->expensereport->lire) && in_array($object->fk_user_author, $childids)) {
if ($user->hasRight('expensereport', 'lire') && in_array($object->fk_user_author, $childids)) {
$canread = 1;
}
if (!$canread) {

View File

@ -88,8 +88,8 @@ $sql = "SELECT tf.code, tf.label, count(de.rowid) as nb, sum(de.total_ht) as km"
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."expensereport_det as de, ".MAIN_DB_PREFIX."c_type_fees as tf";
$sql .= " WHERE de.fk_expensereport = d.rowid AND d.entity IN (".getEntity('expensereport').") AND de.fk_c_type_fees = tf.id";
// RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || empty($user->rights->expensereport->writeall_advance))) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance'))) {
$childids = $user->getAllChildIds();
$childids[] = $user->id;
$sql .= " AND d.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n";
@ -198,8 +198,8 @@ $sql .= " d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_cre
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = d.fk_user_author";
// RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || empty($user->rights->expensereport->writeall_advance))) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance'))) {
$childids = $user->getAllChildIds();
$childids[] = $user->id;
$sql .= " AND d.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n";

View File

@ -51,10 +51,10 @@ if (!$object->fetch($id, $ref) > 0) {
if ($object->id > 0) {
// Check current user can read this expense report
$canread = 0;
if (!empty($user->rights->expensereport->readall)) {
if ($user->hasRight('expensereport', 'readall')) {
$canread = 1;
}
if (!empty($user->rights->expensereport->lire) && in_array($object->fk_user_author, $childids)) {
if ($user->hasRight('expensereport', 'lire') && in_array($object->fk_user_author, $childids)) {
$canread = 1;
}
if (!$canread) {

View File

@ -67,10 +67,10 @@ if ($id > 0) {
if ($id == $user->id) {
$canread = 1;
}
if (!empty($user->rights->expensereport->readall)) {
if ($user->hasRight('expensereport', 'readall')) {
$canread = 1;
}
if (!empty($user->rights->expensereport->lire) && in_array($id, $childids)) {
if ($user->hasRight('expensereport', 'lire') && in_array($id, $childids)) {
$canread = 1;
}
if (!$canread) {
@ -333,8 +333,8 @@ if ($search_status != '' && $search_status >= 0) {
$sql .= " AND d.fk_statut IN (".$db->sanitize($search_status).")";
}
// RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || empty($user->rights->expensereport->writeall_advance))) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance'))) {
$sql .= " AND d.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n";
}
// Add where from extra fields
@ -456,7 +456,7 @@ if ($resql) {
'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
if ($user->rights->expensereport->supprimer) {
if ($user->hasRight('expensereport', 'supprimer')) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (in_array($massaction, array('presend', 'predelete'))) {
@ -487,7 +487,7 @@ if ($resql) {
print dol_get_fiche_head($head, 'expensereport', $title, -1, 'user');
dol_banner_tab($fuser, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
dol_banner_tab($fuser, 'id', $linkback, $user->hasRight('user', 'user', 'lire') || $user->admin);
print dol_get_fiche_end();
@ -521,7 +521,7 @@ if ($resql) {
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitleSeparator();
$newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->rights->expensereport->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('expensereport', 'creer'));
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1);
}
@ -578,7 +578,7 @@ if ($resql) {
}
// User
if (!empty($arrayfields['user']['checked'])) {
if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous) {
if ($user->hasRight('expensereport', 'readall') || $user->hasRight('expensereport', 'lire_tous')) {
print '<td class="liste_titre maxwidthonspartphone" align="left">';
print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
print '</td>';

View File

@ -60,10 +60,10 @@ $permissionnote = $user->rights->expensereport->creer; // Used by the include of
if ($object->id > 0) {
// Check current user can read this expense report
$canread = 0;
if (!empty($user->rights->expensereport->readall)) {
if ($user->hasRight('expensereport', 'readall')) {
$canread = 1;
}
if (!empty($user->rights->expensereport->lire) && in_array($object->fk_user_author, $childids)) {
if ($user->hasRight('expensereport', 'lire') && in_array($object->fk_user_author, $childids)) {
$canread = 1;
}
if (!$canread) {

View File

@ -60,7 +60,7 @@ if ($id > 0) {
*/
// Delete payment
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expensereport->supprimer) {
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('expensereport', 'supprimer')) {
$db->begin();
$result = $object->delete($user);
@ -240,7 +240,7 @@ print '<div class="tabsAction">';
// Delete
if ($action == '') {
if ($user->rights->expensereport->supprimer) {
if ($user->hasRight('expensereport', 'supprimer')) {
if (!$disable_delete) {
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
} else {

View File

@ -125,7 +125,7 @@ if ($user->socid) {
// require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
// $object = new PaiementFourn($db);
// restrictedArea($user, $object->element);
if (empty($user->rights->expensereport->lire)) {
if (!$user->hasRight('expensereport', 'lire')) {
accessforbidden();
}
@ -189,8 +189,8 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.ro
$sql .= ' WHERE ndf.entity IN ('.getEntity("expensereport").')';
// RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || empty($user->rights->expensereport->writeall_advance))) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance'))) {
$sql .= " AND ndf.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n";
}

View File

@ -147,7 +147,7 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (empty($user->rights->societe->client->voir) || $user->socid) {
if (!$user->hasRight('societe', 'client', 'voir') || $user->socid) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png';
@ -231,7 +231,7 @@ print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'</td><td>';
$include = '';
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')) {
$include = 'hierarchy';
}
print img_picto('', 'user', 'class="pictofixedwidth"');

View File

@ -42,7 +42,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
<td></td>
<td class="center"><?php echo dol_print_date($objectlink->date_debut, 'day'); ?></td>
<td class="right"><?php
if ($user->rights->expensereport->lire) {
if ($user->hasRight('expensereport', 'lire')) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>

View File

@ -1667,7 +1667,7 @@ if ($action == 'create') {
}
// Create intervention model
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->hasRight('ficheinter', 'creer') && (count($object->lines) > 0)) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->hasRight('ficheinter', 'creer') && (count($object->lines) > 0)) {
print '<div class="inline-block divButAction">';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans("ChangeIntoRepeatableIntervention").'</a>';
print '</div>';

View File

@ -686,7 +686,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$includedocgeneration = 1;
// Documents
if ($user->rights->hrm->evaluation->read) {
if ($user->hasRight('hrm', 'evaluation', 'read')) {
$objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;

View File

@ -254,7 +254,7 @@ class IntracommReport extends CommonObject
return 0;
}
if ($exporttype == 'deb' && $conf->global->INTRACOMMREPORT_CATEG_FRAISDEPORT > 0) {
if ($exporttype == 'deb' && getDolGlobalInt('INTRACOMMREPORT_CATEG_FRAISDEPORT') > 0) {
$categ_fraisdeport = new Categorie($this->db);
$categ_fraisdeport->fetch($conf->global->INTRACOMMREPORT_CATEG_FRAISDEPORT);
$TLinesFraisDePort = array();
@ -268,7 +268,7 @@ class IntracommReport extends CommonObject
// We don't stop the loop because we want to know all the third parties who don't have an informed country
$this->errors[] = 'Country not filled in for the third party <a href="'.dol_buildpath('/societe/soc.php', 1).'?socid='.$res->id_client.'">'.$res->nom.'</a>';
} else {
if ($conf->global->INTRACOMMREPORT_CATEG_FRAISDEPORT > 0 && $categ_fraisdeport->containsObject('product', $res->id_prod)) {
if (getDolGlobalInt('INTRACOMMREPORT_CATEG_FRAISDEPORT') > 0 && $categ_fraisdeport->containsObject('product', $res->id_prod)) {
$TLinesFraisDePort[] = $res;
} else {
$this->addItemXMl($declaration, $res, $i, '');

View File

@ -339,7 +339,7 @@ if ($action == 'create') {
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
print '<td>';
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_6, '90%');
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_6, '90%');
print $doleditor->Create(1);
print '</td></tr>';
@ -348,7 +348,7 @@ if ($action == 'create') {
print '<tr>';
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
print '<td>';
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_6, '90%');
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_6, '90%');
print $doleditor->Create(1);
print '</td></tr>';

View File

@ -569,7 +569,7 @@ class Loan extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}

View File

@ -282,7 +282,7 @@ if ($action == 'create') {
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
if (empty($datepaid)) {
if (empty($ts_temppaid)) {
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : dol_now();
$datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ?-1 : dol_now();
} else {
$datepayment = $ts_temppaid;
}

View File

@ -116,7 +116,7 @@ print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
// What is use case of this 2 options ?
print '<tr class="oddeven">';
@ -148,7 +148,7 @@ print '<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_URL" value="'.getD
print '</td>';
print '</tr>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseSpecificFamily").'</td>';
print '<td>';

View File

@ -127,7 +127,7 @@ $form = new Form($db);
$dirsrootforscan = array($dirread);
// Add also the core modules into the list of modules to show/edit
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || getDolGlobalString('MODULEBUILDER_ADD_DOCUMENT_ROOT'))) {
if ($dirread != DOL_DOCUMENT_ROOT && (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || getDolGlobalString('MODULEBUILDER_ADD_DOCUMENT_ROOT'))) {
$dirsrootforscan[] = DOL_DOCUMENT_ROOT;
}

View File

@ -281,7 +281,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php', '', $user->rights->opensurvey->write);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php', '', $user->hasRight('opensurvey', 'write'));
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'poll', 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@ -60,11 +60,11 @@ $select_pricing_rules = array(
'PRODUIT_CUSTOMER_PRICES'=>$langs->trans('PriceByCustomer'), // Different price for each customer
);
$keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY';
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 || !empty($conf->global->$keyforparam)) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 || !empty($conf->global->$keyforparam)) {
$select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans('PriceByQuantity').' ('.$langs->trans("VersionExperimental").')'; // TODO If this is enabled, price must be hidden when price by qty is enabled, also price for quantity must be used when adding product into order/propal/invoice
}
$keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->$keyforparam)) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->$keyforparam)) {
$select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'] = $langs->trans('MultiPricesAbility').'+'.$langs->trans('PriceByQuantity').' ('.$langs->trans("VersionExperimental").')';
}
@ -324,10 +324,10 @@ foreach ($dirproduct as $dirroot) {
$modCodeProduct = new $file;
// Show modules according to features level
if ($modCodeProduct->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($modCodeProduct->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($modCodeProduct->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($modCodeProduct->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -427,10 +427,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -209,8 +209,8 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) continue;
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) continue;
if ($module->isEnabled()) {
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
@ -301,8 +301,8 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) continue;
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) continue;
if ($module->isEnabled()) {
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
@ -419,10 +419,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -685,7 +685,7 @@ $filtertype = 0;
if (getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$filtertype = '';
}
if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {
if (getDolGlobalInt('PRODUIT_LIMIT_SIZE') <= 0) {
$limit = '';
} else {
$limit = $conf->global->PRODUIT_LIMIT_SIZE;

View File

@ -841,7 +841,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="titlefield">';
$filtertype = 0;
if (getDolGlobalString('STOCK_SUPPORTS_SERVICES')) $filtertype = '';
if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {
if (getDolGlobalInt('PRODUIT_LIMIT_SIZE') <= 0) {
$limit = '';
} else {
$limit = $conf->global->PRODUIT_LIMIT_SIZE;

View File

@ -321,10 +321,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file;
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -417,10 +417,10 @@ if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
$module = new $file;
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -546,10 +546,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}
@ -686,10 +686,10 @@ if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -515,7 +515,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$productforinvoicerow->id = 0;
$resultprod = 0;
if ($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION > 0) {
if (getDolGlobalInt('SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION') > 0) {
$resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION);
}

View File

@ -127,7 +127,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) {
print '<div class="backimagepubliceventorganizationsubscription">';
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE.'">';
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">';
print '</div>';
}