fix : php 8.1 warnings

This commit is contained in:
lmarcouiller 2022-11-15 15:18:17 +01:00
parent 54a6dc5545
commit 9002d5002f
17 changed files with 66 additions and 65 deletions

View File

@ -98,14 +98,14 @@ if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
// Define variables to know what current user can do on users
$canadduser = ($user->admin || $user->rights->user->user->creer);
$canadduser = ($user->admin || $user->hasRight('user', 'user', 'creer'));
// Define variables to know what current user can do on properties of user linked to edited member
if ($object->user_id) {
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
$caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|| (($user->id != $object->user_id) && $user->rights->user->user->password));
$caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'creer'))
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'creer')));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'password'))
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'password')));
}
}
@ -154,9 +154,9 @@ if (empty($reshook)) {
$action = '';
}
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) {
if ($action == 'setuserid' && ($user->hasRight('user', 'self', 'creer') || $user->hasRight('user', 'user', 'creer'))) {
$error = 0;
if (empty($user->rights->user->user->creer)) { // If can edit only itself user, we can link to itself only
if (empty($user->hasRight('user', 'user', 'creer'))) { // If can edit only itself user, we can link to itself only
if ($userid != $user->id && $userid != $object->user_id) {
$error++;
setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors');
@ -206,7 +206,7 @@ if (empty($reshook)) {
}
// Create user from a member
if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user->user->creer) {
if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->hasRight('user', 'user', 'creer')) {
if ($result > 0) {
// Creation user
$nuser = new User($db);
@ -230,7 +230,7 @@ if (empty($reshook)) {
}
// Create third party from a member
if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) {
if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->hasRight('societe', 'creer')) {
if ($result > 0) {
// User creation
$company = new Societe($db);
@ -617,7 +617,7 @@ if (empty($reshook)) {
}
}
if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes') {
if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_delete' && $confirm == 'yes') {
$result = $object->delete($id, $user);
if ($result > 0) {
if (!empty($backtopage)) {
@ -706,7 +706,7 @@ if (empty($reshook)) {
$action = '';
}
if ($user->rights->adherent->supprimer && $action == 'confirm_resiliate') {
if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_resiliate') {
$error = 0;
if ($confirm == 'yes') {
@ -777,7 +777,7 @@ if (empty($reshook)) {
}
}
if ($user->rights->adherent->supprimer && $action == 'confirm_exclude') {
if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_exclude') {
$error = 0;
if ($confirm == 'yes') {
@ -849,7 +849,7 @@ if (empty($reshook)) {
}
// SPIP Management
if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes') {
if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_del_spip' && $confirm == 'yes') {
if (!count($object->errors)) {
if (!$mailmanspip->del_to_spip($object)) {
setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors');
@ -1118,7 +1118,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</td></tr>\n";
// Categories
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
print '<tr><td>'.$form->editfieldkey("Categories", 'memcats', '', $object, 0).'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
@ -1367,7 +1367,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</td></tr>\n";
// Categories
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
print '<tr><td>'.$form->editfieldkey("Categories", 'memcats', '', $object, 0).'</td>';
print '<td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
@ -1793,7 +1793,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<table class="border tableforfield centpercent">';
// Tags / Categories
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
print '<tr><td>'.$langs->trans("Categories").'</td>';
print '<td colspan="2">';
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
@ -1862,7 +1862,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Login Dolibarr - Link to user
print '<tr><td>';
$editenable = $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer;
$editenable = $user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer');
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
print '</td><td colspan="2" class="valeur">';
if ($action == 'editlogin') {
@ -1944,7 +1944,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Resiliate
if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($user->rights->adherent->supprimer) {
if ($user->hasRight('adherent', 'supprimer')) {
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=resiliate">'.$langs->trans("Resiliate")."</a></span>\n";
} else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate").'</span>'."\n";
@ -1953,7 +1953,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Exclude
if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($user->rights->adherent->supprimer) {
if ($user->hasRight('adherent', 'supprimer')) {
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=exclude">'.$langs->trans("Exclude")."</a></span>\n";
} else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Exclude").'</span>'."\n";
@ -1962,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Create third party
if (isModEnabled('societe') && !$object->socid) {
if ($user->rights->societe->creer) {
if ($user->hasRight('societe', 'creer')) {
if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.((int) $object->id).'&amp;action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
} else {
@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Create user
if (!$user->socid && !$object->user_id) {
if ($user->rights->user->user->creer) {
if ($user->hasRight('user', 'user', 'creer')) {
if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.((int) $object->id).'&amp;action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
} else {
@ -1999,7 +1999,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Delete
if ($user->rights->adherent->supprimer) {
if ($user->hasRight('adherent', 'supprimer')) {
print '<a class="butActionDelete" href="card.php?rowid='.((int) $object->id).'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";
} else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete").'</span>'."\n";
@ -2026,7 +2026,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire;
$genallowed = $user->hasRight('adherent', 'lire');
$delallowed = $user->hasRight('adherent', 'creer');
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);

View File

@ -76,14 +76,14 @@ if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
// Define variables to know what current user can do on users
$canadduser = ($user->admin || $user->rights->user->user->creer);
$canadduser = ($user->admin || $user->hasRight('user', 'user', 'creer'));
// Define variables to know what current user can do on properties of user linked to edited member
if ($object->user_id) {
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
$caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|| (($user->id != $object->user_id) && $user->rights->user->user->password));
$caneditfielduser = ((($user->id == $object->user_id) && $$user->hasRight('user', 'self', 'creer'))
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'creer')));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'password'))
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'password')));
}
}

View File

@ -300,8 +300,8 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'Adherent';
$objectlabel = 'Members';
$permissiontoread = $user->rights->adherent->lire;
$permissiontodelete = $user->rights->adherent->supprimer;
$permissiontoread = $user->hasRight('adherent', 'lire');
$permissiontodelete = $user->hasRight('adherent', 'supprimer');
$permissiontoadd = $user->hasRight('adherent', 'creer');
$uploaddir = $conf->adherent->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
@ -614,13 +614,13 @@ $arrayofmassactions = array(
if ($user->hasRight('adherent', 'creer')) {
$arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate");
}
if ($user->rights->adherent->supprimer) {
if ($user->hasRight('adherent', 'supprimer')) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (isModEnabled('category') && $user->rights->adherent->creer) {
if (isModEnabled('category') && $user->hasRight('adherent', 'creer')) {
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
}
if ($user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
if ($user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer')) {
$arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
@ -661,7 +661,7 @@ if ($sall) {
// Filter on categories
$moreforfilter = '';
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort"));

View File

@ -59,14 +59,14 @@ if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
// Define variables to know what current user can do on users
$canadduser = ($user->admin || $user->rights->user->user->creer);
$canadduser = ($user->admin || $user->hasRight('user', 'user', 'creer'));
// Define variables to know what current user can do on properties of user linked to edited member
if ($object->user_id) {
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
$caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|| (($user->id != $object->user_id) && $user->rights->user->user->password));
$caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'creer'))
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'creer')));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'password'))
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'password')));
}
}

View File

@ -118,7 +118,7 @@ if ($cancel) {
}
}
if ($action == 'add' && $user->rights->adherent->configurer) {
if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
$object->label = trim($label);
$object->morphy = trim($morphy);
$object->status = (int) $status;
@ -505,19 +505,19 @@ if ($rowid > 0) {
print '<div class="tabsAction">';
// Edit
if ($user->rights->adherent->configurer) {
if ($user->hasRight('adherent', 'configurer')) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
}
// Add
if ($user->rights->adherent->configurer && !empty($object->status)) {
if ($user->hasRight('adherent', 'configurer')&& !empty($object->status)) {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
}
// Delete
if ($user->rights->adherent->configurer) {
if ($user->hasRight('adherent', 'configurer')) {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("DeleteType").'</a></div>';
}
@ -758,7 +758,7 @@ if ($rowid > 0) {
if ($user->hasRight('adherent', 'creer')) {
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
}
if ($user->rights->adherent->supprimer) {
if ($user->hasRight('adherent', 'supprimer')) {
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
}
print "</td>";

View File

@ -190,7 +190,7 @@ print dol_get_fiche_end();
print "\n<div class=\"tabsAction\">\n";
if ($action == '') {
if ($user->rights->produit->creer || $user->rights->service->creer) {
if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=create&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
if ($cnt_trans > 0) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
@ -271,7 +271,7 @@ if ($action == 'edit') {
* Form to add a new translation
*/
if ($action == 'create' && $user->rights->adherent->configurer) {
if ($action == 'create' && $user->hasRight('adherent', 'configurer')) {
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';

View File

@ -366,7 +366,7 @@ if (empty($reshook)) {
// List of values
$i = 0;
foreach ($listfieldinsert as $f => $value) {
$keycode = $listfieldvalue[$i];
$keycode = isset($listfieldvalue[$i]) ? $listfieldvalue[$i] : "";
if ($value == 'lang') {
$keycode = 'langcode';
}

View File

@ -60,7 +60,7 @@ class box_birthdays_members extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->rights->adherent->lire && empty($user->socid));
$this->hidden = !($user->hasRight("adherent", "lire") && empty($user->socid));
}
/**

View File

@ -113,12 +113,12 @@ class box_dolibarr_state_board extends ModeleBoxes
);
$conditions = array(
'users' => $user->hasRight('user', 'user', 'lire'),
'members' => isModEnabled('adherent') && $user->rights->adherent->lire,
'members' => isModEnabled('adherent') && $user->hasRight('adherent', 'lire'),
'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
'suppliers' => ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire)
|| (isModEnabled("supplier_order") && $user->rights->supplier_order->lire)
|| (isModEnabled("supplier_invoice") && $user->rights->supplier_invoice->lire)
'suppliers' => ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'lire'))
|| (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire'))
|| (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))
)
&& empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'),
@ -130,9 +130,9 @@ class box_dolibarr_state_board extends ModeleBoxes
'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'),
'contracts' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire'),
'interventions' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'),
'supplier_orders' => isModEnabled('supplier_order') && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
'supplier_invoices' => isModEnabled('supplier_invoice') && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
'supplier_proposals' => isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
'supplier_orders' => isModEnabled('supplier_order') && $user->hasRight('fournisseur', 'commande', 'lire') && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
'supplier_invoices' => isModEnabled('supplier_invoice') && $user->hasRight('fournisseur', 'facture', 'lire') && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
'supplier_proposals' => isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire') && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
'projects' => isModEnabled('project') && $user->hasRight('projet', 'lire'),
'expensereports' => isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire'),
'holidays' => isModEnabled('holiday') && $user->hasRight('holiday', 'read'),

View File

@ -85,7 +85,7 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes
'limit' => dol_strlen($text)
);
if ($user->rights->ticket->read) {
if ($user->hasRight('ticket', 'read')) {
$data = array();
$totalnb = 0;
$sql = "SELECT COUNT(t.datec) as nb";

View File

@ -99,7 +99,7 @@ class box_graph_ticket_by_severity extends ModeleBoxes
$listofopplabel = array();
$listofoppcode = array();
$colorseriesstat = array();
if ($user->rights->ticket->read) {
if ($user->hasRight('ticket', 'read')) {
$sql = "SELECT cts.rowid, cts.label, cts.code";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_severity as cts";
$sql .= " WHERE cts.active = 1";

View File

@ -84,7 +84,7 @@ class box_last_modified_ticket extends ModeleBoxes
'text' => $langs->trans("BoxLastModifiedTicketContent"),
);
if ($user->rights->ticket->read) {
if ($user->hasRight('ticket', 'read')) {
$sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.tms as datem, t.date_read, t.date_close, t.origin_email ";
$sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
$sql .= ", s.nom as company_name, s.email as socemail, s.client, s.fournisseur";

View File

@ -1262,13 +1262,13 @@ class Cronjob extends CommonObject
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$errmsg, LOG_ERR);
$this->error = $errmsg;
$this->lastoutput = ($object->output ? $object->output."\n" : "").$errmsg;
$this->lastoutput = (!empty($object->output) ? $object->output."\n" : "").$errmsg;
$this->lastresult = is_numeric($result) ? $result : -1;
$retval = $this->lastresult;
$error++;
} else {
dol_syslog(get_class($this)."::run_jobs END");
$this->lastoutput = $object->output;
$this->lastoutput = (!empty($object->output) ? $object->output : "");
$this->lastresult = var_export($result, true);
$retval = $this->lastresult;
}

View File

@ -187,7 +187,7 @@ print '</div><div class="fichetwothirdright">';
// Latest leave requests
if (isModEnabled('holiday') && $user->rights->holiday->read) {
if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
$sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";

View File

@ -74,8 +74,8 @@ $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hoo
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
$permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontoread = $user->hasRight('hrm', 'all', 'read');
$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
// Security check (enable the most restrictive one)
if ($user->socid > 0) accessforbidden();

View File

@ -502,7 +502,7 @@ if (empty($reshook) && $action == 'added') {
$form = new Form($db);
$formcompany = new FormCompany($db);
$extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels
llxHeaderVierge($langs->trans("NewPartnershipRequest"));
@ -518,7 +518,7 @@ print '<div class="center subscriptionformhelptext justify">';
if (!empty($conf->global->PARTNERSHIP_NEWFORM_TEXT)) {
print $langs->trans($conf->global->PARTNERSHIP_NEWFORM_TEXT)."<br>\n";
} else {
print $langs->trans("NewPartnershipRequestDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."<br>\n";
print $langs->trans("NewPartnershipRequestDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."<br>\n";
}
print '</div>';

View File

@ -171,6 +171,7 @@ if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) {
$results = $object->fetchAll($sortfield, $sortorder, 0, 0, array('status' => 1));
$now = dol_now();
if (is_array($results)) {
if (empty($results)) {