Merge pull request #23167 from Hystepik/develop#2
Fix : php 8.1 warnings
This commit is contained in:
commit
5b31882ce3
@ -101,14 +101,14 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
// Define variables to know what current user can do on users
|
// 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
|
// Define variables to know what current user can do on properties of user linked to edited member
|
||||||
if ($object->user_id) {
|
if ($object->user_id) {
|
||||||
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
|
// $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)
|
$caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight("user", "self", "creer"))
|
||||||
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
|
|| (($user->id != $object->user_id) && $user->hasRight("user", "user", "creer")));
|
||||||
$caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|
$caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight("user", "self", "password"))
|
||||||
|| (($user->id != $object->user_id) && $user->rights->user->user->password));
|
|| (($user->id != $object->user_id) && $user->hasRight("user", "user", "password")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ if ($rowid > 0) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
|
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($user->rights->user->user->creer) {
|
if ($user->hasRight("user", "user", "creer")) {
|
||||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -1433,7 +1433,7 @@ class ActionComm extends CommonObject
|
|||||||
$response->label = $langs->trans("ActionsToDo");
|
$response->label = $langs->trans("ActionsToDo");
|
||||||
$response->labelShort = $langs->trans("ActionsToDoShort");
|
$response->labelShort = $langs->trans("ActionsToDoShort");
|
||||||
$response->url = DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&actioncode=0&status=todo&mainmenu=agenda';
|
$response->url = DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&actioncode=0&status=todo&mainmenu=agenda';
|
||||||
if ($user->rights->agenda->allactions->read) {
|
if ($user->hasRight("agenda", "allactions", "read")) {
|
||||||
$response->url .= '&filtert=-1';
|
$response->url .= '&filtert=-1';
|
||||||
}
|
}
|
||||||
$response->img = img_object('', "action", 'class="inline-block valigntextmiddle"');
|
$response->img = img_object('', "action", 'class="inline-block valigntextmiddle"');
|
||||||
|
|||||||
@ -76,7 +76,7 @@ class box_bookmarks extends ModeleBoxes
|
|||||||
'text' => $langs->trans("BoxMyLastBookmarks", $max),
|
'text' => $langs->trans("BoxMyLastBookmarks", $max),
|
||||||
'sublink' => DOL_URL_ROOT.'/bookmarks/list.php',
|
'sublink' => DOL_URL_ROOT.'/bookmarks/list.php',
|
||||||
);
|
);
|
||||||
if ($user->rights->bookmark->creer) {
|
if ($user->hasRight("bookmark", "creer")) {
|
||||||
$this->info_box_head['subpicto'] = 'bookmark';
|
$this->info_box_head['subpicto'] = 'bookmark';
|
||||||
$this->info_box_head['subtext'] = $langs->trans("BookmarksManagement");
|
$this->info_box_head['subtext'] = $langs->trans("BookmarksManagement");
|
||||||
} else {
|
} else {
|
||||||
@ -121,7 +121,7 @@ class box_bookmarks extends ModeleBoxes
|
|||||||
|
|
||||||
if ($num == 0) {
|
if ($num == 0) {
|
||||||
$mytxt = $langs->trans("NoRecordedBookmarks");
|
$mytxt = $langs->trans("NoRecordedBookmarks");
|
||||||
if ($user->rights->bookmark->creer) {
|
if ($user->hasRight("bookmark", "creer")) {
|
||||||
$mytxt .= ' '.$langs->trans("ClickToAdd");
|
$mytxt .= ' '.$langs->trans("ClickToAdd");
|
||||||
}
|
}
|
||||||
$this->info_box_contents[$line][0] = array(
|
$this->info_box_contents[$line][0] = array(
|
||||||
|
|||||||
@ -807,11 +807,11 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
|
|||||||
|
|
||||||
$i = -1;
|
$i = -1;
|
||||||
|
|
||||||
if (isModEnabled('project') && $user->rights->projet->lire) {
|
if (isModEnabled('project') && $user->hasRight('projet', 'lire')) {
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if (isModEnabled('project') && $user->rights->projet->creer && empty($nocreatelink)) {
|
if (isModEnabled('project') && $user->hasRight('projet', 'creer') && empty($nocreatelink)) {
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1062,7 +1062,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if ($user->rights->societe->contact->creer) {
|
if ($user->hasRight('societe', 'contact', 'creer')) {
|
||||||
$addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
$addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
||||||
$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
|
$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
|
||||||
}
|
}
|
||||||
@ -1363,14 +1363,14 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|
||||||
// Add to agenda
|
// Add to agenda
|
||||||
if (isModEnabled('agenda')&& $user->rights->agenda->myactions->create) {
|
if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||||
print img_object($langs->trans("Event"), "action");
|
print img_object($langs->trans("Event"), "action");
|
||||||
print '</a> ';
|
print '</a> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if ($user->rights->societe->contact->creer) {
|
if ($user->hasRight('societe', 'contact', 'creer')) {
|
||||||
print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -2240,7 +2240,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($object->element == 'societe') {
|
if ($object->element == 'societe') {
|
||||||
if (!empty($conf->use_javascript_ajax) && $user->rights->societe->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if (!empty($conf->use_javascript_ajax) && $user->hasRight('societe', 'creer') && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
$morehtmlstatus .= ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
$morehtmlstatus .= ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
||||||
} else {
|
} else {
|
||||||
$morehtmlstatus .= $object->getLibStatut(6);
|
$morehtmlstatus .= $object->getLibStatut(6);
|
||||||
@ -3072,7 +3072,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
|
|||||||
$newemail .= img_warning($langs->trans("ErrorBadEMail", $email));
|
$newemail .= img_warning($langs->trans("ErrorBadEMail", $email));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
|
if (($cid || $socid) && isModEnabled('agenda') && $user->hasRight("agenda", "myactions", "create")) {
|
||||||
$type = 'AC_EMAIL';
|
$type = 'AC_EMAIL';
|
||||||
$link = '';
|
$link = '';
|
||||||
if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) {
|
if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) {
|
||||||
@ -3515,7 +3515,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
//if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||||
if (isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
|
if (isModEnabled('agenda') && $user->hasRight("agenda", "myactions", "create")) {
|
||||||
$type = 'AC_TEL';
|
$type = 'AC_TEL';
|
||||||
$link = '';
|
$link = '';
|
||||||
if ($addlink == 'AC_FAX') {
|
if ($addlink == 'AC_FAX') {
|
||||||
@ -11844,7 +11844,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||||
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||||
$tododone = '';
|
$tododone = '';
|
||||||
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) {
|
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->dp > $now)) {
|
||||||
$tododone = 'todo';
|
$tododone = 'todo';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -232,9 +232,9 @@ if ($object->id > 0) {
|
|||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
|
print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->hasRight('societe', 'creer'));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $form->editfieldval("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
|
print $form->editfieldval("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->hasRight('societe', 'creer'));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ if ($object->id > 0) {
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
print $langs->trans('PaymentConditions');
|
print $langs->trans('PaymentConditions');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editconditions') && $user->rights->societe->creer) {
|
if (($action != 'editconditions') && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -290,7 +290,7 @@ if ($object->id > 0) {
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editmode') && $user->rights->societe->creer) {
|
if (($action != 'editmode') && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -309,7 +309,7 @@ if ($object->id > 0) {
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('PaymentBankAccount');
|
print $langs->trans('PaymentBankAccount');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) {
|
if (($action != 'editbankaccount') && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -328,7 +328,7 @@ if ($object->id > 0) {
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans("CustomerRelativeDiscountShort");
|
print $langs->trans("CustomerRelativeDiscountShort");
|
||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer && !$user->socid > 0) {
|
if ($user->hasRight('societe', 'creer') && !$user->socid > 0) {
|
||||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@ -341,7 +341,7 @@ if ($object->id > 0) {
|
|||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer && !$user->socid > 0) {
|
if ($user->hasRight('societe', 'creer') && !$user->socid > 0) {
|
||||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@ -881,7 +881,7 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
if ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')) {
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
if ($object->status == 1) {
|
if ($object->status == 1) {
|
||||||
print dolGetButtonAction('', $langs->trans('AddSupplierOrderShort'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&token='.newToken().'&socid='.$object->id, '');
|
print dolGetButtonAction('', $langs->trans('AddSupplierOrderShort'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&token='.newToken().'&socid='.$object->id, '');
|
||||||
@ -890,7 +890,7 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
if ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')) {
|
||||||
if (!empty($orders2invoice) && $orders2invoice > 0) {
|
if (!empty($orders2invoice) && $orders2invoice > 0) {
|
||||||
if ($object->status == 1) {
|
if ($object->status == 1) {
|
||||||
// Company is open
|
// Company is open
|
||||||
@ -903,7 +903,7 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
if ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
if ($object->status == 1) {
|
if ($object->status == 1) {
|
||||||
print dolGetButtonAction('', $langs->trans('AddBill'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id, '');
|
print dolGetButtonAction('', $langs->trans('AddBill'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id, '');
|
||||||
|
|||||||
@ -2123,7 +2123,7 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
$projectsListId = null;
|
$projectsListId = null;
|
||||||
if (!$user->rights->projet->all->lire) {
|
if (!$user->hasRight("projet", "all", "lire")) {
|
||||||
$response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project';
|
$response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project';
|
||||||
$projectsListId = $this->getProjectsAuthorizedForUser($user, 0, 1);
|
$projectsListId = $this->getProjectsAuthorizedForUser($user, 0, 1);
|
||||||
if (empty($projectsListId)) {
|
if (empty($projectsListId)) {
|
||||||
|
|||||||
@ -2226,7 +2226,7 @@ class Task extends CommonObjectLine
|
|||||||
$response = new WorkboardResponse();
|
$response = new WorkboardResponse();
|
||||||
$response->warning_delay = $conf->project->task->warning_delay / 60 / 60 / 24;
|
$response->warning_delay = $conf->project->task->warning_delay / 60 / 60 / 24;
|
||||||
$response->label = $langs->trans("OpenedTasks");
|
$response->label = $langs->trans("OpenedTasks");
|
||||||
if ($user->rights->projet->all->lire) {
|
if ($user->hasRight("projet", "all", "lire")) {
|
||||||
$response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mainmenu=project';
|
$response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mainmenu=project';
|
||||||
} else {
|
} else {
|
||||||
$response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mode=mine&mainmenu=project';
|
$response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mode=mine&mainmenu=project';
|
||||||
|
|||||||
@ -138,10 +138,10 @@ if (!empty($canvas)) {
|
|||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
$permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
|
$permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
|
||||||
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
|
||||||
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
|
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -978,7 +978,7 @@ if (empty($reshook)) {
|
|||||||
// Actions to build doc
|
// Actions to build doc
|
||||||
$id = $socid;
|
$id = $socid;
|
||||||
$upload_dir = !empty($conf->societe->multidir_output[$object->entity])?$conf->societe->multidir_output[$object->entity]:$conf->societe->dir_output;
|
$upload_dir = !empty($conf->societe->multidir_output[$object->entity])?$conf->societe->multidir_output[$object->entity]:$conf->societe->dir_output;
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->hasRight('societe', 'creer');
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3018,7 +3018,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
// Third-Party Type
|
// Third-Party Type
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('ThirdPartyType').'</td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('ThirdPartyType').'</td>';
|
||||||
if ($action != 'editthirdpartytype' && $user->rights->societe->creer) {
|
if ($action != 'editthirdpartytype' && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdpartytype&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdpartytype&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -3087,7 +3087,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (isModEnabled('incoterm')) {
|
if (isModEnabled('incoterm')) {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans('IncotermLabel').'</td>';
|
print '<table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans('IncotermLabel').'</td>';
|
||||||
if ($action != 'editincoterm' && $user->rights->societe->creer) {
|
if ($action != 'editincoterm' && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit('', 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit('', 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -3151,7 +3151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) {
|
if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('ParentCompany').'</td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('ParentCompany').'</td>';
|
||||||
if ($action != 'editparentcompany' && $user->rights->societe->creer) {
|
if ($action != 'editparentcompany' && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editparentcompany&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editparentcompany&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -3279,7 +3279,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id;
|
$filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id;
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id;
|
||||||
$genallowed = $user->hasRight('societe', 'lire');
|
$genallowed = $user->hasRight('societe', 'lire');
|
||||||
$delallowed = $user->rights->societe->creer;
|
$delallowed = $user->hasRight('societe', 'creer');
|
||||||
|
|
||||||
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -204,13 +204,13 @@ if ($object->fournisseur) {
|
|||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$nbCmdsFourn = $obj->nb;
|
$nbCmdsFourn = $obj->nb;
|
||||||
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
||||||
if ((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && $user->rights->supplier_invoice->lire)) {
|
if ((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'facture', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
|
||||||
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
||||||
}
|
}
|
||||||
if ((isModEnabled('fournisseur') && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && $user->rights->supplier_order->lire)) {
|
if ((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'commande', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire'))) {
|
||||||
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
||||||
}
|
}
|
||||||
if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
|
if (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire')) {
|
||||||
$elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals');
|
$elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -399,6 +399,7 @@ $typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPO
|
|||||||
$button = '<input type="submit" class="button buttonform small" name="button_third" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
$button = '<input type="submit" class="button buttonform small" name="button_third" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
|
|
||||||
$total_qty = 0;
|
$total_qty = 0;
|
||||||
|
$param = '';
|
||||||
|
|
||||||
if ($sql_select) {
|
if ($sql_select) {
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('thirdpartydocument', 'globalcard'));
|
$hookmanager->initHooks(array('thirdpartydocument', 'globalcard'));
|
||||||
|
|
||||||
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
@ -187,8 +187,8 @@ print '</div>';
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
$modulepart = 'societe';
|
$modulepart = 'societe';
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->hasRight('societe', 'creer');
|
||||||
$permtoedit = $user->rights->societe->creer;
|
$permtoedit = $user->hasRight('societe', 'creer');
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -385,7 +385,7 @@ if (empty($reshook)) {
|
|||||||
$objectlabel = 'ThirdParty';
|
$objectlabel = 'ThirdParty';
|
||||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->hasRight("societe", "creer");
|
||||||
$uploaddir = $conf->societe->dir_output;
|
$uploaddir = $conf->societe->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
@ -922,16 +922,16 @@ $arrayofmassactions = array(
|
|||||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
if (isModEnabled('category') && $user->rights->societe->creer) {
|
if (isModEnabled('category') && $user->hasRight("societe", "creer")) {
|
||||||
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->creer) {
|
if ($user->hasRight("societe", "creer")) {
|
||||||
$arrayofmassactions['preenable'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SetToEnabled");
|
$arrayofmassactions['preenable'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SetToEnabled");
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->creer) {
|
if ($user->hasRight("societe", "creer")) {
|
||||||
$arrayofmassactions['predisable'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SetToDisabled");
|
$arrayofmassactions['predisable'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SetToDisabled");
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->creer) {
|
if ($user->hasRight("societe", "creer")) {
|
||||||
$arrayofmassactions['presetcommercial'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("AllocateCommercial");
|
$arrayofmassactions['presetcommercial'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("AllocateCommercial");
|
||||||
}
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'preenable', 'preclose'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'preenable', 'preclose'))) {
|
||||||
@ -969,8 +969,8 @@ if ($contextpage != 'poslist') {
|
|||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
$url .= '&socid='.$socid;
|
$url .= '&socid='.$socid;
|
||||||
}
|
}
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url, '', $user->rights->societe->creer);
|
$newcardbutton = dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url, '', $user->hasRight("societe", "creer"));
|
||||||
} elseif ($user->rights->societe->creer) {
|
} elseif ($user->hasRight("societe", "creer")) {
|
||||||
$url = DOL_URL_ROOT.'/societe/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
|
$url = DOL_URL_ROOT.'/societe/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
|
||||||
$label = 'MenuNewCustomer';
|
$label = 'MenuNewCustomer';
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url);
|
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if ($id > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('thirdpartynote', 'globalcard'));
|
$hookmanager->initHooks(array('thirdpartynote', 'globalcard'));
|
||||||
|
|||||||
@ -306,7 +306,7 @@ if ($result > 0) {
|
|||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$contactstatic->id = $obj->contact_id;
|
$contactstatic->id = $obj->contactid;
|
||||||
$contactstatic->lastname = $obj->lastname;
|
$contactstatic->lastname = $obj->lastname;
|
||||||
$contactstatic->firstname = $obj->firstname;
|
$contactstatic->firstname = $obj->firstname;
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ $hookmanager->initHooks(array('thirdpartybancard', 'globalcard'));
|
|||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php
|
$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php
|
||||||
|
|
||||||
$permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write)));
|
$permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write)));
|
||||||
|
|
||||||
@ -111,6 +111,7 @@ if ($cancel) {
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$morehtmlright = '';
|
||||||
$parameters = array('id'=>$socid);
|
$parameters = array('id'=>$socid);
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ print '<tr><td>';
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $langs->trans('SalesRepresentatives');
|
print $langs->trans('SalesRepresentatives');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editsalesrepresentatives' && $user->rights->societe->creer) {
|
if ($action != 'editsalesrepresentatives' && $user->hasRight('societe', 'creer')) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editsalesrepresentatives&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>';
|
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editsalesrepresentatives&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user