diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 744db6998d4..89f03fde211 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -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; } diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 3c0cebfb2fd..05ec0178d62 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -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'; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 303611960df..590aa9163db 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -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 '
'; @@ -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 ''; // 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 ''; } print ''; @@ -2230,7 +2230,7 @@ if ($action == 'create') { print ''; // 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 ''; print '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 '
id.'">'.$langs->trans('Modify').'
'; @@ -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 '
id.'">'.$langs->trans('Modify').'
'; @@ -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 '
id.'">'.$langs->trans('SetToDraft').'
'; @@ -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 '
id.'">'.$langs->trans('Deny').'
'; } // 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 '
'.$langs->trans('DoPayment').'
'; @@ -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 '
'.$langs->trans("ClassifyPaid")."
"; } } - 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 '
id.'">'.$langs->trans("Cancel").'
'; } // 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 '
id.'">'.$langs->trans("Cancel").'
'; } - 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 '
id.'">'.$langs->trans('ClassifyUnPaid').'
'; } // Clone - if ($user->rights->expensereport->creer) { + if ($user->hasRight('expensereport', 'creer')) { print '
'.$langs->trans("ToClone").'
'; } /* 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 '
id.'">'.$langs->trans('Delete').'
'; } elseif ($candelete && $object->status != ExpenseReport::STATUS_CLOSED) { @@ -2835,7 +2835,7 @@ if ($action != 'presend') { print '
'; print ''; // 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; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 809eb6382d8..13ba6ec2db5 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -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))."))"; diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index e36b1c1e49e..eb21fa63fd1 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -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)).")"; diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index a4572c9a169..83df9cc5197 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -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) { diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 4efebd3e3e0..ca0a38bc0d5 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -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"; diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php index c2216185b5c..f25781295a5 100644 --- a/htdocs/expensereport/info.php +++ b/htdocs/expensereport/info.php @@ -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) { diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index b91811d68aa..acdda81605b 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -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 ''; print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); print ''; diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index 18c99dfd229..3b10af46bc5 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -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) { diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 8c5f603d03f..67f6e472036 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -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 '
'; // 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 { diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 89f40868b68..6928144a170 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -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"; } diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 5203b9d51bc..49fbfd41140 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -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 ''; // User print ''.$langs->trans("User").''; $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"'); diff --git a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php index f97099e57dc..dd215f15873 100644 --- a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php @@ -42,7 +42,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { date_debut, 'day'); ?> rights->expensereport->lire) { + if ($user->hasRight('expensereport', 'lire')) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } ?> diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 40ebbac70ea..040396f59f7 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -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 ''; diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 0eaef6bcd47..6140530e8a9 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -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; diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index f9658743acb..d44ea90122b 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -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 '.$res->nom.''; } 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, ''); diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index b86c04e9a74..327514a1ffd 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -339,7 +339,7 @@ if ($action == 'create') { print ''.$langs->trans('NotePrivate').''; print ''; - $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 ''; @@ -348,7 +348,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePublic').''; print ''; - $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 ''; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index a12d9a1b936..45958e06837 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -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).'"'; } diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 1df01fc6047..3ddc66ed305 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -282,7 +282,7 @@ if ($action == 'create') { print ''.$langs->trans("Date").''; 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; } diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index eee804c1015..ca47a61e3e2 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -116,7 +116,7 @@ print ''.$langs->trans("Value").''; print "\n"; -if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // What is use case of this 2 options ? print ''; @@ -148,7 +148,7 @@ print ''; print ''.$langs->trans("UseSpecificFamily").''; print ''; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index c1e0b5fae5b..1268d4dbd59 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -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; } diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 02f711d5f6e..d7421bde63a 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -281,7 +281,7 @@ print ''; print ''; $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); diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 290bcbd30df..ace7a095e95 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -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; } diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 32b7394ce4f..8520f471196 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -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 ''.$module->name."\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 ''.$module->name."\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; } diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 3ad253f4b93..d542a589513 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -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; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 701be978c15..9f6d810d3d0 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -841,7 +841,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $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; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 2b6d6c01063..7af04f40257 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -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; } diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index d38382a0bb2..b8eb24d1608 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -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); } diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index a2828b7e3dc..a686ecf5440 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -127,7 +127,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) { print '
'; - print ''; + print ''; print '
'; }