mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix php8.2 warnings
This commit is contained in:
parent
4f4ede2e32
commit
b8c8e903c2
|
|
@ -995,7 +995,7 @@ class KnowledgeRecord extends CommonObject
|
|||
if (!empty($conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON)) {
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON.".php";
|
||||
$file = getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON') . ".php";
|
||||
$classname = $conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON;
|
||||
|
||||
// Include file with class
|
||||
|
|
|
|||
|
|
@ -761,7 +761,7 @@ if ($id > 0) {
|
|||
}
|
||||
|
||||
// Delete
|
||||
if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->delete) {
|
||||
if (($object->paid == 0 || $object->paid == 2) && $user->hasRight('loan', 'delete')) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.DOL_URL_ROOT.'/loan/card.php?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ if ($object->id) {
|
|||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
|
||||
if ($user->rights->loan->write) {
|
||||
if ($user->hasRight('loan', 'write')) {
|
||||
//if ($action != 'classify')
|
||||
// $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0
|
|||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
|
||||
if ($user->rights->loan->write) {
|
||||
if ($user->hasRight('loan', 'write')) {
|
||||
//if ($action != 'classify')
|
||||
// $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ if ($id > 0) {
|
|||
if (isModEnabled('project')) {
|
||||
$langs->loadLangs(array("projects"));
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
|
||||
if ($user->rights->loan->write) {
|
||||
if ($user->hasRight('loan', 'write')) {
|
||||
//if ($action != 'classify')
|
||||
// $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ if ($id > 0) {
|
|||
*/
|
||||
|
||||
// Delete payment
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->delete) {
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('loan', 'delete')) {
|
||||
$db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."loan_schedule SET fk_bank = 0 WHERE fk_bank = ".((int) $payment->fk_bank);
|
||||
|
|
@ -221,7 +221,7 @@ print '</div>';
|
|||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (empty($action) && !empty($user->rights->loan->delete)) {
|
||||
if (empty($action) && $user->hasRight('loan', 'delete')) {
|
||||
if (!$disable_delete) {
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ if ($user->socid > 0) {
|
|||
} elseif (GETPOSTISSET('socid')) {
|
||||
$socid = GETPOST('socid', 'int');
|
||||
}
|
||||
if (empty($user->rights->loan->write)) {
|
||||
if (!$user->hasRight('loan', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ if (GETPOSTISSET('socid')) {
|
|||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
if (empty($user->rights->loan->calc)) {
|
||||
if (!$user->hasRight('loan', 'calc')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0
|
|||
if (isModEnabled('project')) {
|
||||
$langs->loadLangs(array("projects"));
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
|
||||
if ($user->rights->loan->write) {
|
||||
if ($user->hasRight('loan', 'write')) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
if ($action == 'classify') {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ $pagenext = $page + 1;
|
|||
if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if ($user->rights->margins->read->all) {
|
||||
if ($user->hasRight('margins', 'read', 'all')) {
|
||||
$agentid = GETPOST('agentid', 'int');
|
||||
} else {
|
||||
$agentid = $user->id;
|
||||
|
|
@ -123,7 +123,7 @@ print '<table class="border centpercent">';
|
|||
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ContactOfInvoice').'</td>';
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print img_picto('', 'user').$form->select_dolusers($agentid, 'agentid', 1, '', $user->rights->margins->read->all ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print img_picto('', 'user').$form->select_dolusers($agentid, 'agentid', 1, '', $user->hasRight('margins', 'read', 'all') ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
|
||||
// Start date
|
||||
|
|
|
|||
|
|
@ -231,14 +231,14 @@ if (!empty($TSelectedCats)) {
|
|||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=d.fk_product';
|
||||
}
|
||||
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
if ($socid > 0) {
|
||||
$sql .= ' AND s.rowid = '.((int) $socid);
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " AND f.fk_statut NOT IN (".$db->sanitize(implode(', ', $invoice_status_except_list)).")";
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
if ($user->rights->produit->lire) {
|
||||
if ($user->hasRight('produit', 'lire')) {
|
||||
$page = 'productMargins';
|
||||
} elseif ($user->hasRight('societe', 'lire')) {
|
||||
$page = 'customerMargins';
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ function marges_prepare_head()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
if ($user->rights->produit->lire) {
|
||||
if ($user->hasRight('produit', 'lire')) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/margin/productMargins.php";
|
||||
$head[$h][1] = $langs->trans("ProductMargins");
|
||||
$head[$h][2] = 'productMargins';
|
||||
|
|
@ -78,7 +78,7 @@ function marges_prepare_head()
|
|||
$h++;
|
||||
}
|
||||
|
||||
if ($user->rights->margins->read->all) {
|
||||
if ($user->hasRight('margins', 'read', 'all')) {
|
||||
$title = 'UserMargins';
|
||||
} else {
|
||||
$title = 'SalesRepresentativeMargins';
|
||||
|
|
@ -89,7 +89,7 @@ function marges_prepare_head()
|
|||
$head[$h][2] = 'agentMargins';
|
||||
|
||||
|
||||
if ($user->rights->margins->creer) {
|
||||
if ($user->hasRight('margins', 'creer')) {
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/margin/checkMargins.php";
|
||||
$head[$h][1] = $langs->trans('CheckMargins');
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ if (!empty($user->socid)) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
|
||||
if (empty($user->rights->margins->liretous)) {
|
||||
if (!$user->hasRight('margins', 'liretous')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ if (!$sortfield) {
|
|||
|
||||
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
|
||||
|
||||
if (empty($user->rights->margins->liretous)) {
|
||||
if (!$user->hasRight('margins', 'liretous')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,";
|
||||
$sql .= " f.rowid as facid, f.ref, f.total_ht,";
|
||||
$sql .= " f.datef, f.paye, f.fk_statut as statut, f.type,";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " sc.fk_soc, sc.fk_user,";
|
||||
}
|
||||
$sql .= " sum(d.total_ht) as selling_price,"; // may be negative or positive
|
||||
|
|
@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
|
|
@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= " AND d.fk_facture = f.rowid";
|
||||
$sql .= " AND d.fk_product = ".((int) $object->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if (!empty($socid)) {
|
||||
|
|
@ -173,7 +173,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " AND d.buy_price_ht <> 0";
|
||||
}
|
||||
$sql .= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total_ht, f.datef, f.paye, f.fk_statut, f.type";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user";
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ $hookmanager->initHooks(array('thirdpartymargins', 'globalcard'));
|
|||
|
||||
$result = restrictedArea($user, 'societe', $object->id, '');
|
||||
|
||||
if (empty($user->rights->margins->liretous)) {
|
||||
if (!$user->hasRight('margins', 'liretous')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ if ($socid > 0) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) {
|
||||
if (((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) && $object->fournisseur) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
|||
);
|
||||
|
||||
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) {
|
||||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.$conf->global->MODULEBUILDER_SPECIFIC_AUTHOR;
|
||||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
}
|
||||
|
||||
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
||||
|
|
@ -1510,7 +1510,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
);
|
||||
|
||||
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) {
|
||||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.$conf->global->MODULEBUILDER_SPECIFIC_AUTHOR;
|
||||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
}
|
||||
|
||||
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
||||
|
|
|
|||
|
|
@ -937,7 +937,7 @@ class Mo extends CommonObject
|
|||
if (!empty($conf->global->MRP_MO_ADDON)) {
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->MRP_MO_ADDON.".php";
|
||||
$file = getDolGlobalString('MRP_MO_ADDON') . ".php";
|
||||
$classname = $conf->global->MRP_MO_ADDON;
|
||||
|
||||
// Include file with class
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT."/opensurvey/lib/opensurvey.lib.php";
|
|||
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->opensurvey->read)) {
|
||||
if (!$user->hasRight('opensurvey', 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ if (empty($reshook)) {
|
|||
// Delete
|
||||
if ($action == 'delete_confirm') {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ if (empty($reshook)) {
|
|||
// Update
|
||||
if ($action == 'update') {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ if (empty($reshook)) {
|
|||
$idcomment = GETPOST('idcomment', 'int');
|
||||
if ($idcomment > 0) {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'edit') {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
|
@ -372,7 +372,7 @@ print '</form>'."\n";
|
|||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($action != 'edit' && $user->rights->opensurvey->write) {
|
||||
if ($action != 'edit' && $user->hasRight('opensurvey', 'write')) {
|
||||
// Modify button
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
|
|
@ -411,7 +411,7 @@ $comments = $object->getComments();
|
|||
|
||||
if (!empty($comments)) {
|
||||
foreach ($comments as $comment) {
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<a class="reposition" href="'.DOL_URL_ROOT.'/opensurvey/card.php?action=deletecomment&token='.newToken().'&idcomment='.((int) $comment->id_comment).'&id='.urlencode($numsondage).'"> '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).'</a> ';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ if ($result <= 0) {
|
|||
}
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->opensurvey->read)) {
|
||||
if (!$user->hasRight('opensurvey', 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
|||
$langs->load("opensurvey");
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->opensurvey->read)) {
|
||||
if (!$user->hasRight('opensurvey', 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
|||
|
||||
if (!empty($conf->global->OPENSURVEY_IMAGE_PUBLIC_INTERFACE)) {
|
||||
print '<div class="backimagepublicopensurvey">';
|
||||
print '<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->OPENSURVEY_IMAGE_PUBLIC_INTERFACE.'">';
|
||||
print '<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('OPENSURVEY_IMAGE_PUBLIC_INTERFACE').'">';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ if (!$sortorder) {
|
|||
}
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->read) {
|
||||
if (!$user->hasRight('opensurvey', 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
|
|||
require_once DOL_DOCUMENT_ROOT."/opensurvey/lib/opensurvey.lib.php";
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->opensurvey->read)) {
|
||||
if (!$user->hasRight('opensurvey', 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ for ($i = 0; $i < $nblines; $i++) {
|
|||
}
|
||||
if ($testmodifier) {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ if ($testmodifier) {
|
|||
// Add column (not for date)
|
||||
if (GETPOST("ajoutercolonne") && GETPOST('nouvellecolonne') && $object->format == "A") {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ if (GETPOST("ajoutercolonne") && GETPOST('nouvellecolonne') && $object->format =
|
|||
// Add column (with format date)
|
||||
if (GETPOSTISSET("ajoutercolonne") && $object->format == "D") {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ if (GETPOSTISSET("ajoutercolonne") && $object->format == "D") {
|
|||
for ($i = 0; $i < $nblines; $i++) {
|
||||
if (GETPOST("effaceligne".$i) || GETPOST("effaceligne".$i."_x") || GETPOST("effaceligne".$i.".x")) { // effacelignei for chrome, effacelignei_x for firefox
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -572,7 +572,7 @@ print '</div>';
|
|||
// Show form to add a new field/column
|
||||
if (GETPOST('ajoutsujet')) {
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -657,7 +657,7 @@ if (GETPOST('ajoutsujet')) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<span class="opacitymedium">';
|
||||
$s = $langs->trans("PollAdminDesc", '{s1}', $langs->trans("Add"));
|
||||
print str_replace('{s1}', img_picto('', 'delete'), $s);
|
||||
|
|
@ -712,7 +712,7 @@ if ($object->format == "D") {
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<td class="annee">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?ajoutsujet=1&id='.$object->id_sondage.'">'.$langs->trans("Add").'</a></td>'."\n";
|
||||
}
|
||||
|
|
@ -742,7 +742,7 @@ if ($object->format == "D") {
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<td class="mois"><a href="'.$_SERVER["PHP_SELF"].'?ajoutsujet=1&id='.$object->id_sondage.'">'.$langs->trans("Add").'</a></td>'."\n";
|
||||
}
|
||||
|
||||
|
|
@ -769,7 +769,7 @@ if ($object->format == "D") {
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<td class="jour"><a href="'.$_SERVER["PHP_SELF"].'?ajoutsujet=1&id='.$object->id_sondage.'">'.$langs->trans("Add").'</a></td>'."\n";
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
|
@ -789,7 +789,7 @@ if ($object->format == "D") {
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<td class="heure"><a href="'.$_SERVER["PHP_SELF"].'?ajoutsujet=1&id='.$object->id_sondage.'">'.$langs->trans("Add").'</a></td>'."\n";
|
||||
}
|
||||
|
||||
|
|
@ -832,7 +832,7 @@ while ($compteur < $num) {
|
|||
|
||||
print '<tr><td>'."\n";
|
||||
|
||||
if ($user->rights->opensurvey->write) {
|
||||
if ($user->hasRight('opensurvey', 'write')) {
|
||||
print '<input type="image" class="reposition" name="effaceligne'.$compteur.'" src="'.img_picto('', 'delete.png', '', false, 1).'">'."\n";
|
||||
}
|
||||
|
||||
|
|
@ -993,7 +993,7 @@ while ($compteur < $num) {
|
|||
}
|
||||
|
||||
// Button edit at end of line
|
||||
if ($compteur != $ligneamodifier && ($user->rights->opensurvey->write)) {
|
||||
if ($compteur != $ligneamodifier && ($user->hasRight('opensurvey', 'write'))) {
|
||||
print '<td class="casevide"><input type="submit" class="button reposition" name="modifierligne'.$compteur.'" value="'.dol_escape_htmltag($langs->trans("Edit")).'"></td>'."\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
|||
require_once DOL_DOCUMENT_ROOT."/opensurvey/lib/opensurvey.lib.php";
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
|||
require_once DOL_DOCUMENT_ROOT."/opensurvey/lib/opensurvey.lib.php";
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php";
|
|||
require_once DOL_DOCUMENT_ROOT."/opensurvey/lib/opensurvey.lib.php";
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/opensurvey/lib/opensurvey.lib.php';
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->write) {
|
||||
if (!$user->hasRight('opensurvey', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1175,7 +1175,7 @@ class Partnership extends CommonObject
|
|||
if (!empty($conf->global->PARTNERSHIP_ADDON)) {
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->PARTNERSHIP_ADDON.".php";
|
||||
$file = getDolGlobalString('PARTNERSHIP_ADDON') . ".php";
|
||||
$classname = $conf->global->PARTNERSHIP_ADDON;
|
||||
|
||||
// Include file with class
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class PartnershipUtils
|
|||
|
||||
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
|
||||
$msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
|
||||
$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
|
||||
$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
|
||||
|
||||
// We are in the case of autocancellation subscription because of missing backlink
|
||||
$fk_partner = $object->fk_member;
|
||||
|
|
@ -389,7 +389,7 @@ class PartnershipUtils
|
|||
|
||||
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
|
||||
$msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
|
||||
$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
|
||||
$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
|
||||
|
||||
$sendto = $obj->email;
|
||||
|
||||
|
|
@ -524,7 +524,7 @@ class PartnershipUtils
|
|||
}
|
||||
}
|
||||
|
||||
if ($webcontent && !empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) && preg_match('/'.$conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK.'/', $webcontent)) {
|
||||
if ($webcontent && !empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) && preg_match('/' . getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
|
||||
$found = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,21 +164,21 @@ print "</tr>\n";
|
|||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<span class="fieldrequired">'.$langs->trans("PAYBOX_PBX_SITE").'</span></td><td>';
|
||||
print '<input size="32" type="text" name="PAYBOX_IBS_SITE" value="'.$conf->global->PAYBOX_IBS_SITE.'">';
|
||||
print '<input size="32" type="text" name="PAYBOX_IBS_SITE" value="' . getDolGlobalString('PAYBOX_IBS_SITE').'">';
|
||||
print '<span class="opacitymedium"><br>'.$langs->trans("Example").': 1999888 ('.$langs->trans("Test").')</span>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<span class="fieldrequired">'.$langs->trans("PAYBOX_PBX_RANG").'</span></td><td>';
|
||||
print '<input size="32" type="text" name="PAYBOX_IBS_RANG" value="'.$conf->global->PAYBOX_IBS_RANG.'">';
|
||||
print '<input size="32" type="text" name="PAYBOX_IBS_RANG" value="' . getDolGlobalString('PAYBOX_IBS_RANG').'">';
|
||||
print '<span class="opacitymedium"><br>'.$langs->trans("Example").': 99 ('.$langs->trans("Test").')</span>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<span class="fieldrequired">'.$langs->trans("PAYBOX_PBX_IDENTIFIANT").'</span></td><td>';
|
||||
print '<input size="32" type="text" name="PAYBOX_PBX_IDENTIFIANT" value="'.$conf->global->PAYBOX_PBX_IDENTIFIANT.'">';
|
||||
print '<input size="32" type="text" name="PAYBOX_PBX_IDENTIFIANT" value="' . getDolGlobalString('PAYBOX_PBX_IDENTIFIANT').'">';
|
||||
print '<span class="opacitymedium"><br>'.$langs->trans("Example").': 2 ('.$langs->trans("Test").')</span>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ print '</td></tr>';
|
|||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<span class="fieldrequired">'.$langs->trans("PAYBOX_CGI_URL_V2").'</span></td><td>';
|
||||
print '<input size="64" type="text" name="PAYBOX_CGI_URL_V2" value="'.$conf->global->PAYBOX_CGI_URL_V2.'">';
|
||||
print '<input size="64" type="text" name="PAYBOX_CGI_URL_V2" value="' . getDolGlobalString('PAYBOX_CGI_URL_V2').'">';
|
||||
print '<span class="opacitymedium"><br>'.$langs->trans("Example").' (preprod): https://preprod-tpeweb.paybox.com/php/';
|
||||
print '<br>'.$langs->trans("Example").' (prod): https://tpeweb.paybox.com/php/</span>';
|
||||
print '</td></tr>';
|
||||
|
|
@ -222,7 +222,7 @@ print '</td></tr>';
|
|||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("PublicVendorName").'</td><td>';
|
||||
print '<input type="text" class="minwidth300" name="ONLINE_PAYMENT_CREDITOR" value="'.$conf->global->ONLINE_PAYMENT_CREDITOR.'">';
|
||||
print '<input type="text" class="minwidth300" name="ONLINE_PAYMENT_CREDITOR" value="' . getDolGlobalString('ONLINE_PAYMENT_CREDITOR').'">';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("Example").': '.$mysoc->name.'</span>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ if (isModEnabled("banque")) {
|
|||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("CSSUrlForPaymentForm").'</td><td>';
|
||||
print '<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.'">';
|
||||
print '<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'">';
|
||||
print '<span class="opacitymedium"><br>'.$langs->trans("Example").': http://mysite/mycss.css</span>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -264,14 +264,14 @@ print '</td></tr>';
|
|||
|
||||
print '<tr class="oddeven"><td class="fieldrequired">';
|
||||
print $langs->trans("ONLINE_PAYMENT_SENDEMAIL").'</td><td>';
|
||||
print '<input size="32" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="'.$conf->global->ONLINE_PAYMENT_SENDEMAIL.'">';
|
||||
print '<input size="32" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'">';
|
||||
print ' <span class="opacitymedium">'.$langs->trans("Example").': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Payment token for URL
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("SecurityToken").'</td><td>';
|
||||
print '<input size="48" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="'.$conf->global->PAYMENT_SECURITY_TOKEN.'">';
|
||||
print '<input size="48" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="' . getDolGlobalString('PAYMENT_SECURITY_TOKEN').'">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ print '</tr>';
|
|||
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MultiPricesNumPrices").'</td>';
|
||||
print '<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.'"></td>';
|
||||
print '<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="' . getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
|
@ -661,7 +661,7 @@ print '</tr>';
|
|||
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NumberOfProductShowInSelect").'</td>';
|
||||
print '<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="'.$conf->global->PRODUIT_LIMIT_SIZE.'"></td>';
|
||||
print '<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="' . getDolGlobalString('PRODUIT_LIMIT_SIZE').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ if ($cancel) {
|
|||
}
|
||||
|
||||
$createbarcode = isModEnabled('barcode');
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->creer_advance)) {
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'creer_advance')) {
|
||||
$createbarcode = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1448,7 +1448,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
}
|
||||
|
||||
$showbarcode = isModEnabled('barcode');
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
|
||||
$showbarcode = 0;
|
||||
}
|
||||
|
||||
|
|
@ -2013,7 +2013,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
|
||||
// Barcode
|
||||
$showbarcode = isModEnabled('barcode');
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
|
||||
$showbarcode = 0;
|
||||
}
|
||||
|
||||
|
|
@ -2342,7 +2342,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Fiche en mode visu
|
||||
|
||||
$showbarcode = isModEnabled('barcode');
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
|
||||
$showbarcode = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1393,7 +1393,7 @@ class Product extends CommonObject
|
|||
$this->error = "Object must be fetched before calling delete";
|
||||
return -1;
|
||||
}
|
||||
if (($this->type == Product::TYPE_PRODUCT && empty($user->rights->produit->supprimer)) || ($this->type == Product::TYPE_SERVICE && empty($user->rights->service->supprimer))) {
|
||||
if (($this->type == Product::TYPE_PRODUCT && !$user->hasRight('produit', 'supprimer')) || ($this->type == Product::TYPE_SERVICE && !$user->hasRight('service', 'supprimer'))) {
|
||||
$this->error = "ErrorForbidden";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2802,7 +2802,7 @@ class Product extends CommonObject
|
|||
$sql .= " SUM(mp.qty) as qty";
|
||||
$sql .= " FROM ".$this->db->prefix()."mrp_mo as c";
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."mrp_production as mp ON mp.fk_mo=c.rowid";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."societe_commerciaux as sc ON sc.fk_soc=c.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " WHERE ";
|
||||
|
|
@ -2925,14 +2925,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."propaldet as pd";
|
||||
$sql .= ", ".$this->db->prefix()."propal as p";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE p.rowid = pd.fk_propal";
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
||||
$sql .= " AND pd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND pr.fk_statut != 0";
|
||||
|
|
@ -3000,14 +3000,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."supplier_proposaldet as pd";
|
||||
$sql .= ", ".$this->db->prefix()."supplier_proposal as p";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE p.rowid = pd.fk_supplier_proposal";
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.entity IN (".getEntity('supplier_proposal').")";
|
||||
$sql .= " AND pd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND pr.fk_statut != 0";
|
||||
|
|
@ -3056,14 +3056,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."commandedet as cd";
|
||||
$sql .= ", ".$this->db->prefix()."commande as c";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.rowid = cd.fk_commande";
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
|
||||
$sql .= " AND cd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3184,14 +3184,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."commande_fournisseurdet as cd";
|
||||
$sql .= ", ".$this->db->prefix()."commande_fournisseur as c";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.rowid = cd.fk_commande";
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
|
||||
$sql .= " AND cd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3247,7 +3247,7 @@ class Product extends CommonObject
|
|||
$sql .= ", ".$this->db->prefix()."commande as c";
|
||||
$sql .= ", ".$this->db->prefix()."expedition as e";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE e.rowid = ed.fk_expedition";
|
||||
|
|
@ -3256,7 +3256,7 @@ class Product extends CommonObject
|
|||
$sql .= " AND e.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")";
|
||||
$sql .= " AND ed.fk_origin_line = cd.rowid";
|
||||
$sql .= " AND cd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= " AND e.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3331,14 +3331,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."commande_fournisseur_dispatch as fd";
|
||||
$sql .= ", ".$this->db->prefix()."commande_fournisseur as cf";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE cf.rowid = fd.fk_commande";
|
||||
$sql .= " AND cf.fk_soc = s.rowid";
|
||||
$sql .= " AND cf.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
|
||||
$sql .= " AND fd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3392,13 +3392,13 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."mrp_production as mp";
|
||||
$sql .= ", ".$this->db->prefix()."mrp_mo as m";
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = m.fk_soc";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE m.rowid = mp.fk_mo";
|
||||
$sql .= " AND m.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mrp').")";
|
||||
$sql .= " AND mp.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
|
||||
$sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3488,14 +3488,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."contratdet as cd";
|
||||
$sql .= ", ".$this->db->prefix()."contrat as c";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.rowid = cd.fk_contrat";
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('contract').")";
|
||||
$sql .= " AND cd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND c.statut != 0";
|
||||
|
|
@ -3562,14 +3562,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."facturedet as fd";
|
||||
$sql .= ", ".$this->db->prefix()."facture as f";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.rowid = fd.fk_facture";
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= " AND fd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND f.fk_statut != 0";
|
||||
|
|
@ -3637,14 +3637,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet_rec as fd";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_rec as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.rowid = fd.fk_facture";
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= " AND fd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND f.fk_statut != 0";
|
||||
|
|
@ -3711,14 +3711,14 @@ class Product extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."facture_fourn_det as fd";
|
||||
$sql .= ", ".$this->db->prefix()."facture_fourn as f";
|
||||
$sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.rowid = fd.fk_facture_fourn";
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn').")";
|
||||
$sql .= " AND fd.fk_product = ".((int) $this->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND f.fk_statut != 0";
|
||||
|
|
@ -3849,7 +3849,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as p";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.rowid = d.fk_facture";
|
||||
|
|
@ -3863,7 +3863,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3903,7 +3903,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as p";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.rowid = d.fk_facture_fourn";
|
||||
|
|
@ -3917,7 +3917,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -3955,7 +3955,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as prod";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE p.rowid = d.fk_propal";
|
||||
|
|
@ -3969,7 +3969,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -4008,7 +4008,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as prod";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE p.rowid = d.fk_supplier_proposal";
|
||||
|
|
@ -4022,7 +4022,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.entity IN (".getEntity('supplier_proposal').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -4060,7 +4060,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as p";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.rowid = d.fk_commande";
|
||||
|
|
@ -4074,7 +4074,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -4112,7 +4112,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as p";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.rowid = d.fk_commande";
|
||||
|
|
@ -4126,7 +4126,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -4164,7 +4164,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as p";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
|
||||
|
|
@ -4181,7 +4181,7 @@ class Product extends CommonObject
|
|||
}
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -4218,7 +4218,7 @@ class Product extends CommonObject
|
|||
if ($filteronproducttype >= 0) {
|
||||
$sql .= ", ".$this->db->prefix()."product as p";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
|
||||
|
|
@ -4234,7 +4234,7 @@ class Product extends CommonObject
|
|||
$sql .= " AND p.rowid = d.fk_product AND p.fk_product_type = ".((int) $filteronproducttype);
|
||||
}
|
||||
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND d.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
@ -6101,7 +6101,7 @@ class Product extends CommonObject
|
|||
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
|
||||
$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
|
||||
foreach ($dirsociete as $dirroot) {
|
||||
$res = dol_include_once($dirroot.$conf->global->BARCODE_PRODUCT_ADDON_NUM.'.php');
|
||||
$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
|
||||
if ($res) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -769,7 +769,7 @@ class ProductFournisseurPrice extends CommonObject
|
|||
if (!empty($conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON)) {
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON.".php";
|
||||
$file = getDolGlobalString('BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON') . ".php";
|
||||
$classname = $conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON;
|
||||
|
||||
// Include file with class
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
/*
|
||||
* Product card
|
||||
*/
|
||||
if ($user->rights->produit->lire || $user->hasRight('service', 'lire')) {
|
||||
if ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')) {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$shownav = 1;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ if ($user->socid) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
if (empty($user->rights->fournisseur->lire) && (!isModEnabled('margin') && !$user->hasRight("margin", "liretous"))) {
|
||||
if (!$user->hasRight('fournisseur', 'lire') && (!isModEnabled('margin') && !$user->hasRight("margin", "liretous"))) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Close inventory by recording the stock movements
|
||||
if ($action == 'update' && !empty($user->rights->stock->mouvement->creer) && $object->status == $object::STATUS_VALIDATED) {
|
||||
if ($action == 'update' && $user->hasRight('stock', 'mouvement', 'creer') && $object->status == $object::STATUS_VALIDATED) {
|
||||
$stockmovment = new MouvementStock($db);
|
||||
$stockmovment->setOrigin($object->element, $object->id);
|
||||
|
||||
|
|
|
|||
|
|
@ -1945,7 +1945,7 @@ while ($i < $imaxinloop) {
|
|||
if ($product_static->status_buy && $obj->bestpurchaseprice != '' && $usercancreadprice) {
|
||||
if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) {
|
||||
if ($product_fourn->product_fourn_price_id > 0) {
|
||||
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) {
|
||||
if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
|
||||
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
|
||||
print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
|
||||
if ($action == 'delete' && $user->rights->produit->supprimer) {
|
||||
if ($action == 'delete' && $user->hasRight('produit', 'supprimer')) {
|
||||
$result = $object->log_price_delete($user, GETPOST('lineid', 'int'));
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
@ -726,7 +726,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete_customer_price' && ($user->rights->produit->supprimer || $user->rights->service->supprimer)) {
|
||||
if ($action == 'delete_customer_price' && ($user->hasRight('produit', 'supprimer') || $user->hasRight('service', 'supprimer'))) {
|
||||
// Delete price by customer
|
||||
$prodcustprice->id = GETPOST('lineid', 'int');
|
||||
$result = $prodcustprice->delete($user);
|
||||
|
|
@ -1060,7 +1060,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
|||
print '<input type="hidden" name="action" value="setlabelsellingprice">';
|
||||
print '<input type="hidden" name="pricelevel" value="'.$i.'">';
|
||||
print $langs->trans("SellingPrice").' '.$i.' - ';
|
||||
print '<input class="maxwidthonsmartphone" type="text" name="labelsellingprice" value="'.$conf->global->$keyforlabel.'">';
|
||||
print '<input class="maxwidthonsmartphone" type="text" name="labelsellingprice" value="' . getDolGlobalString($keyforlabel).'">';
|
||||
print ' <input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
|
|
@ -1134,7 +1134,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
|||
print '<td class="right">'.price($prices['unitprice']).'</td>';
|
||||
print '<td class="right">'.price($prices['remise_percent']).' %</td>';
|
||||
print '<td class="center">';
|
||||
if (($user->rights->produit->creer || $user->hasRight('service', 'creer'))) {
|
||||
if (($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer'))) {
|
||||
print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
|
||||
print img_edit().'</a>';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
|
||||
|
|
@ -1295,7 +1295,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
|||
print '<td class="right">'.price($prices['unitprice']).'</td>';
|
||||
print '<td class="right">'.price($prices['remise_percent']).' %</td>';
|
||||
print '<td class="center">';
|
||||
if (($user->rights->produit->creer || $user->hasRight('service', 'creer'))) {
|
||||
if (($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer'))) {
|
||||
print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
|
||||
print img_edit().'</a>';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
|
||||
|
|
@ -1726,7 +1726,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
|||
print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
|
||||
print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</td>';
|
||||
print '<td class="right">'.$langs->trans("ChangedBy").'</td>';
|
||||
if ($user->rights->produit->supprimer) {
|
||||
if ($user->hasRight('produit', 'supprimer')) {
|
||||
print '<td class="right"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
|
@ -1864,7 +1864,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
|||
print '</td>';
|
||||
|
||||
// Action
|
||||
if ($user->rights->produit->supprimer) {
|
||||
if ($user->hasRight('produit', 'supprimer')) {
|
||||
$candelete = 0;
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
||||
if (empty($notfirstlineforlevel[$objp->price_level])) {
|
||||
|
|
@ -2431,7 +2431,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||
|
||||
// Todo Edit or delete button
|
||||
// Action
|
||||
if ($user->rights->produit->supprimer || $user->rights->service->supprimer) {
|
||||
if ($user->hasRight('produit', 'supprimer') || $user->hasRight('service', 'supprimer')) {
|
||||
print '<td class="right nowraponall">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=showlog_customer_price&token='.newToken().'&id='.$object->id.'&socid='.$line->fk_soc.'">';
|
||||
print img_info($langs->trans('PriceByCustomerLog'));
|
||||
|
|
|
|||
|
|
@ -461,7 +461,7 @@ if ($result || !($id > 0)) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ($graphfiles == 'propal' && empty($user->rights->propal->lire)) {
|
||||
if ($graphfiles == 'propal' && !$user->hasRight('propal', 'lire')) {
|
||||
continue;
|
||||
}
|
||||
if ($graphfiles == 'order' && !$user->hasRight('commande', 'lire')) {
|
||||
|
|
@ -470,16 +470,16 @@ if ($result || !($id > 0)) {
|
|||
if ($graphfiles == 'invoices' && !$user->hasRight('facture', 'lire')) {
|
||||
continue;
|
||||
}
|
||||
if ($graphfiles == 'proposals_suppliers' && empty($user->rights->supplier_proposal->lire)) {
|
||||
if ($graphfiles == 'proposals_suppliers' && !$user->hasRight('supplier_proposal', 'lire')) {
|
||||
continue;
|
||||
}
|
||||
if ($graphfiles == 'invoices_suppliers' && empty($user->rights->fournisseur->facture->lire)) {
|
||||
if ($graphfiles == 'invoices_suppliers' && !$user->hasRight('fournisseur', 'facture', 'lire')) {
|
||||
continue;
|
||||
}
|
||||
if ($graphfiles == 'orders_suppliers' && empty($user->rights->fournisseur->commande->lire)) {
|
||||
if ($graphfiles == 'orders_suppliers' && !$user->hasRight('fournisseur', 'commande', 'lire')) {
|
||||
continue;
|
||||
}
|
||||
if ($graphfiles == 'mrp' && empty($user->rights->mrp->read)) {
|
||||
if ($graphfiles == 'mrp' && !$user->hasRight('mrp', 'read')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,13 +141,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " c.ref_client,";
|
||||
$sql .= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.rowid, d.qty";
|
||||
$sql .= ", c.date_livraison";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commandedet as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||
|
|
@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -136,18 +136,18 @@ if ($id > 0 || !empty($ref)) {
|
|||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
if ($user->rights->fournisseur->commande->lire) {
|
||||
if ($user->hasRight('fournisseur', 'commande', 'lire')) {
|
||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||
$sql .= " c.rowid, d.total_ht as total_ht, c.ref,";
|
||||
$sql .= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.rowid, d.qty";
|
||||
$sql .= ", c.date_livraison";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseurdet as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||
|
|
@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " c.rowid as rowid, c.ref, c.ref_customer, c.ref_supplier, c.date_contrat, c.statut as statut,";
|
||||
$sql .= " s.nom as name, s.rowid as socid, s.code_client";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
|
|
@ -144,7 +144,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('contract').")";
|
||||
$sql .= " AND cd.fk_product = ".((int) $product->id);
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -157,13 +157,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||
$sql .= " f.ref, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,";
|
||||
$sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
|
|
@ -176,7 +176,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(f.datef) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -140,13 +140,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
if ($user->hasRight('fournisseur', 'facture', 'lire')) {
|
||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, d.rowid, d.total_ht as line_total_ht,";
|
||||
$sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.datef, f.libelle as label, f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut as statut, d.qty";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn_det as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
|
|
@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(f.datef) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -158,13 +158,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||
$sql .= "f.titre, f.datec, f.rowid as facid, f.suspended as suspended,";
|
||||
$sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_rec as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facturedet_rec as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
|
|
@ -177,7 +177,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(f.datec) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -142,13 +142,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,";
|
||||
$sql .= " p.ref_client,";
|
||||
$sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ",".MAIN_DB_PREFIX."propal as p";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."propaldet as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE p.fk_soc = s.rowid";
|
||||
|
|
@ -161,7 +161,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(p.datep) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -141,13 +141,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,";
|
||||
//$sql .= " p.ref_supplier,";
|
||||
$sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ",".MAIN_DB_PREFIX."supplier_proposal as p";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."supplier_proposaldet as d";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE p.fk_soc = s.rowid";
|
||||
|
|
@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(p.datep) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Ajout entrepot
|
||||
if ($action == 'add' && $user->rights->stock->creer) {
|
||||
if ($action == 'add' && $user->hasRight('stock', 'creer')) {
|
||||
$object->ref = (string) GETPOST("ref", "alpha");
|
||||
$object->fk_parent = (int) GETPOST("fk_parent", "int");
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
|
|
@ -182,7 +182,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Delete warehouse
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->stock->supprimer) {
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('stock', 'supprimer')) {
|
||||
$object->fetch(GETPOST('id', 'int'));
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
|
|
@ -527,7 +527,7 @@ if ($action == 'create') {
|
|||
print "</td></tr>";
|
||||
|
||||
// Last movement
|
||||
if (!empty($user->rights->stock->mouvement->lire)) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'lire')) {
|
||||
$sql = "SELECT max(m.datem) as datem";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
|
||||
$sql .= " WHERE m.fk_entrepot = ".((int) $object->id);
|
||||
|
|
@ -579,13 +579,13 @@ if ($action == 'create') {
|
|||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if (empty($action) || $action == 'classin') {
|
||||
if ($user->rights->stock->creer) {
|
||||
if ($user->hasRight('stock', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->stock->supprimer) {
|
||||
if ($user->hasRight('stock', 'supprimer')) {
|
||||
print '<a class="butActionDelete" href="card.php?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Delete").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete").'</a>';
|
||||
|
|
@ -647,11 +647,11 @@ if ($action == 'create') {
|
|||
$totalarray['pos'][$totalarray['nbfield']] = 'totalvaluesell';
|
||||
$totalarray['type'][$totalarray['nbfield']] = '';
|
||||
}
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
print_liste_field_titre('');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if ($user->rights->stock->creer) {
|
||||
if ($user->hasRight('stock', 'creer')) {
|
||||
print_liste_field_titre('');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
|
@ -810,7 +810,7 @@ if ($action == 'create') {
|
|||
$totalvaluesell += price2num($pricemin * $objp->value, 'MT');
|
||||
|
||||
// Link to transfer
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
|
||||
print img_picto($langs->trans("TransferStock"), 'add', 'class="hideonsmartphone pictofixedwidth" style="color: #a69944"');
|
||||
print $langs->trans("TransferStock");
|
||||
|
|
@ -818,7 +818,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Link to stock
|
||||
if ($user->rights->stock->creer) {
|
||||
if ($user->hasRight('stock', 'creer')) {
|
||||
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=correction&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
|
||||
print img_picto($langs->trans("CorrectStock"), 'add', 'class="hideonsmartphone pictofixedwidth" style="color: #a69944"');
|
||||
print $langs->trans("CorrectStock");
|
||||
|
|
|
|||
|
|
@ -646,12 +646,12 @@ class Productlot extends CommonObject
|
|||
$sql .= " INNER JOIN ".$this->db->prefix()."expeditiondet as ed ON (ed.rowid = edb.fk_expeditiondet)";
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."expedition as exp ON (exp.rowid = ed.fk_expedition)";
|
||||
// $sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE exp.entity IN (".getEntity('expedition').")";
|
||||
$sql .= " AND edb.batch = '".($this->db->escape($this->batch))."'";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND exp.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND exp.fk_statut != 0";
|
||||
|
|
@ -721,12 +721,12 @@ class Productlot extends CommonObject
|
|||
$sql .= " INNER JOIN ".$this->db->prefix()."commande_fournisseurdet as cfd ON (cfd.rowid = cfdi.fk_commandefourndet)";
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."commande_fournisseur as cf ON (cf.rowid = cfd.fk_commande)";
|
||||
// $sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE cf.entity IN (".getEntity('expedition').")";
|
||||
$sql .= " AND cfdi.batch = '".($this->db->escape($this->batch))."'";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND cf.fk_statut != 0";
|
||||
|
|
@ -795,12 +795,12 @@ class Productlot extends CommonObject
|
|||
$sql .= " FROM ".$this->db->prefix()."commande_fournisseur_dispatch as cfdi";
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."reception as recep ON (recep.rowid = cfdi.fk_reception)";
|
||||
// $sql .= ", ".$this->db->prefix()."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE recep.entity IN (".getEntity('reception').")";
|
||||
$sql .= " AND cfdi.batch = '".($this->db->escape($this->batch))."'";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND recep.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
//$sql.= " AND exp.fk_statut != 0";
|
||||
|
|
@ -875,7 +875,7 @@ class Productlot extends CommonObject
|
|||
$sql .= " SUM(mp.qty) as qty";
|
||||
$sql .= " FROM ".$this->db->prefix()."mrp_mo as c";
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."mrp_production as mp ON mp.fk_mo=c.rowid";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= "INNER JOIN ".$this->db->prefix()."societe_commerciaux as sc ON sc.fk_soc=c.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " WHERE ";
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ $arrayofmassactions = array(
|
|||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
if (isModEnabled('category') && $user->rights->stock->creer) {
|
||||
if (isModEnabled('category') && $user->hasRight('stock', 'creer')) {
|
||||
$arrayofmassactions['preaffecttag'] = img_picto('', 'label', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
|
@ -471,7 +471,7 @@ $newcardbutton = '';
|
|||
$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('MenuNewWarehouse'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->stock->creer);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewWarehouse'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->hasRight('stock', 'creer'));
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if (!empty($_SESSION['massstockmove'])) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'addline' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
if ($action == 'addline' && $user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
if (!($id_sw > 0)) {
|
||||
//$error++;
|
||||
//setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors');
|
||||
|
|
@ -156,7 +156,7 @@ if ($action == 'addline' && !empty($user->rights->stock->mouvement->creer)) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'delline' && $idline != '' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
if ($action == 'delline' && $idline != '' && $user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
if (!empty($listofdata[$idline])) {
|
||||
unset($listofdata[$idline]);
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ if ($action == 'delline' && $idline != '' && !empty($user->rights->stock->mouvem
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
if ($action == 'createmovements' && $user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
$error = 0;
|
||||
|
||||
if (!GETPOST("label")) {
|
||||
|
|
@ -311,7 +311,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'importCSV' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
if ($action == 'importCSV' && $user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
dol_mkdir($conf->stock->dir_temp);
|
||||
$nowyearmonth = dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
|
||||
|
|
|
|||
|
|
@ -669,11 +669,11 @@ if ($resql) {
|
|||
if ((empty($action) || $action == 'list') && $id > 0) {
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=correction">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$result = restrictedArea($user, 'stock');
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->stock->mouvement->lire) {
|
||||
if (!$user->hasRight('stock', 'mouvement', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -936,11 +936,11 @@ if ((empty($action) || $action == 'list') && $id > 0) {
|
|||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if (empty($reshook)) {
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=correction">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -733,14 +733,14 @@ if ($id > 0 || $ref) {
|
|||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Stock alert threshold
|
||||
print '<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1), 'seuil_stock_alerte', $object->seuil_stock_alerte, $object, $user->rights->produit->creer).'</td><td>';
|
||||
print $form->editfieldval("StockLimit", 'seuil_stock_alerte', $object->seuil_stock_alerte, $object, $user->rights->produit->creer, 'string');
|
||||
print '<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1), 'seuil_stock_alerte', $object->seuil_stock_alerte, $object, $user->hasRight('produit', 'creer')).'</td><td>';
|
||||
print $form->editfieldval("StockLimit", 'seuil_stock_alerte', $object->seuil_stock_alerte, $object, $user->hasRight('produit', 'creer'), 'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// Desired stock
|
||||
print '<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1), 'desiredstock', $object->desiredstock, $object, $user->rights->produit->creer);
|
||||
print '<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1), 'desiredstock', $object->desiredstock, $object, $user->hasRight('produit', 'creer'));
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("DesiredStock", 'desiredstock', $object->desiredstock, $object, $user->rights->produit->creer, 'string');
|
||||
print $form->editfieldval("DesiredStock", 'desiredstock', $object->desiredstock, $object, $user->hasRight('produit', 'creer'), 'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// Real stock
|
||||
|
|
@ -874,7 +874,7 @@ if ($id > 0 || $ref) {
|
|||
print '</tr>';
|
||||
|
||||
// Last movement
|
||||
if (!empty($user->rights->stock->mouvement->lire)) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'lire')) {
|
||||
$sql = "SELECT max(m.datem) as datem";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
|
||||
$sql .= " WHERE m.fk_product = ".((int) $object->id);
|
||||
|
|
@ -934,7 +934,7 @@ if (empty($reshook)) {
|
|||
if (empty($action) && $object->id) {
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
|
||||
} else {
|
||||
|
|
@ -944,7 +944,7 @@ if (empty($reshook)) {
|
|||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->stock->mouvement->creer) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'creer')) {
|
||||
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=correction">'.$langs->trans("CorrectStock").'</a>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ $sql .= ' cf.rowid, cf.ref, cf.fk_statut, cf.total_ttc, cf.fk_user_author,';
|
|||
$sql .= ' u.login';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'commande_fournisseur as cf';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON cf.fk_user_author = u.rowid';
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ', '.MAIN_DB_PREFIX.'societe_commerciaux as sc';
|
||||
}
|
||||
$sql .= ' WHERE cf.fk_soc = s.rowid ';
|
||||
|
|
@ -138,7 +138,7 @@ if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
|
|||
} else {
|
||||
$sql .= ' AND cf.fk_statut < 5';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = '.((int) $user->id);
|
||||
}
|
||||
if ($sref) {
|
||||
|
|
|
|||
|
|
@ -211,19 +211,19 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
if ($showmessage && $nboflines > 1) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
|
||||
} elseif ($user->rights->fournisseur->commande->lire) {
|
||||
} elseif ($user->hasRight('fournisseur', 'commande', 'lire')) {
|
||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_fournisseur,";
|
||||
$sql .= " cf.ref, cf.date_commande, cf.date_livraison as delivery_date, cf.fk_statut as statut, cf.rowid as facid,";
|
||||
$sql .= " cfd.rowid, SUM(cfdi.qty) as qty";
|
||||
// $sql.= ", cfd.total_ht * SUM(cfdi.qty) / cfd.qty as total_ht_pondere";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseur as cf ON (cf.fk_soc = s.rowid)";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as cfd ON (cfd.fk_commande = cf.rowid)";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfdi ON (cfdi.fk_commandefourndet = cfd.rowid)";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE cf.entity IN (".getEntity('product').")";
|
||||
|
|
@ -234,7 +234,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(cf.date_commande) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -211,19 +211,19 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
if ($showmessage && $nboflines > 1) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
|
||||
} elseif ($user->rights->expedition->lire) {
|
||||
} elseif ($user->hasRight('expedition', 'lire')) {
|
||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||
$sql .= " exp.ref, exp.date_creation, exp.fk_statut as statut, exp.rowid as facid,";
|
||||
$sql .= " d.rowid, db.qty";
|
||||
// $sql.= ", d.total_ht as total_ht"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expedition as exp ON (exp.fk_soc = s.rowid)";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expeditiondet as d ON (d.fk_expedition = exp.rowid)";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as db ON (db.fk_expeditiondet = d.rowid)";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE exp.entity IN (".getEntity('product').")";
|
||||
|
|
@ -234,7 +234,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(exp.date_creation) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -211,18 +211,18 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
if ($showmessage && $nboflines > 1) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
|
||||
} elseif ($user->rights->reception->lire) {
|
||||
} elseif ($user->hasRight('reception', 'lire')) {
|
||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_fournisseur,";
|
||||
$sql .= " recep.ref, recep.date_creation, recep.fk_statut as statut, recep.rowid as facid,";
|
||||
$sql .= " d.qty";
|
||||
// $sql.= ", d.total_ht as total_ht"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."reception as recep ON (recep.fk_soc = s.rowid)";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as d ON (d.fk_reception = recep.rowid)";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE recep.entity IN (".getEntity('product').")";
|
||||
|
|
@ -233,7 +233,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
if (!empty($search_year)) {
|
||||
$sql .= ' AND YEAR(recep.date_creation) IN ('.$db->sanitize($search_year).')';
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ class StockTransfer extends CommonObject
|
|||
if (!empty($conf->global->STOCKTRANSFER_STOCKTRANSFER_ADDON)) {
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->STOCKTRANSFER_STOCKTRANSFER_ADDON.".php";
|
||||
$file = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADDON') . ".php";
|
||||
$classname = $conf->global->STOCKTRANSFER_STOCKTRANSFER_ADDON;
|
||||
|
||||
// Include file with class
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ class StockTransferLine extends CommonObjectLine
|
|||
if (!empty($conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON)) {
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON.".php";
|
||||
$file = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFERLINE_ADDON') . ".php";
|
||||
$classname = $conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON;
|
||||
|
||||
// Include file with class
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ if (!$error) {
|
|||
* Add a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->stocktransfer->stocktransfer->write) {
|
||||
if ($action == 'addcontact' && $user->hasRight('stocktransfer', 'stocktransfer', 'write')) {
|
||||
if ($object->id > 0) {
|
||||
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$result = $object->add_contact($contactid, !empty($_POST["typecontact"]) ? $_POST["typecontact"] : $_POST["type"], $_POST["source"]);
|
||||
|
|
@ -83,11 +83,11 @@ if ($action == 'addcontact' && $user->rights->stocktransfer->stocktransfer->writ
|
|||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->stocktransfer->stocktransfer->write) { // Toggle the status of a contact
|
||||
} elseif ($action == 'swapstatut' && $user->hasRight('stocktransfer', 'stocktransfer', 'write')) { // Toggle the status of a contact
|
||||
if ($object->id > 0) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne'));
|
||||
}
|
||||
} elseif ($action == 'deletecontact' && $user->rights->stocktransfer->stocktransfer->write) { // Deletes a contact
|
||||
} elseif ($action == 'deletecontact' && $user->hasRight('stocktransfer', 'stocktransfer', 'write')) { // Deletes a contact
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
|
@ -137,7 +137,7 @@ if ($object->id > 0) {
|
|||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->stocktransfer->stocktransfer->write) {
|
||||
if ($user->hasRight('stocktransfer', 'stocktransfer', 'write')) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ if ($user->socid > 0) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
//$result = restrictedArea($user, 'projet', $projectid);
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ llxHeader("", $title);
|
|||
|
||||
// Title for combo list see all projects
|
||||
$titleall = $langs->trans("AllAllowedProjects");
|
||||
if (!empty($user->rights->projet->all->lire) && !$socid) {
|
||||
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
|
||||
$titleall = $langs->trans("AllProjects");
|
||||
} else {
|
||||
$titleall = $langs->trans("AllAllowedProjects").'<br><br>';
|
||||
|
|
@ -422,7 +422,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
|
|||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ect";
|
||||
}
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||
if ($mine || empty($user->rights->projet->all->lire)) {
|
||||
if ($mine || !$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // project i have permission on
|
||||
}
|
||||
if ($mine) { // this may duplicate record if we are contact twice
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ if (GETPOST('submitdateselect')) {
|
|||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('assigntask') && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
$action = 'assigntask';
|
||||
|
||||
if ($taskid > 0) {
|
||||
|
|
@ -251,7 +251,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
$timespent_duration = array();
|
||||
|
||||
if (is_array($_POST)) {
|
||||
|
|
@ -456,7 +456,7 @@ if ($mine || ($usertoprocess->id == $user->id)) {
|
|||
print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
} else {
|
||||
if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
|
||||
if ($user->rights->projet->all->lire && !$socid) {
|
||||
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
|
||||
print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
} else {
|
||||
print $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
|
|
@ -507,10 +507,10 @@ $moreforfilter = '';
|
|||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
|
||||
$includeonly = 'hierarchyme';
|
||||
if (empty($user->rights->user->user->lire)) {
|
||||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->hasRight('user', 'user', 'lire') ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ if (GETPOST('submitdateselect')) {
|
|||
|
||||
$action = '';
|
||||
}
|
||||
if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')) {
|
||||
if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('assigntask')) {
|
||||
$action = 'assigntask';
|
||||
|
||||
if ($taskid > 0) {
|
||||
|
|
@ -198,7 +198,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->lire) {
|
||||
if ($action == 'addtime' && $user->hasRight('projet', 'lire')) {
|
||||
$timetoadd = GETPOST('task');
|
||||
if (empty($timetoadd)) {
|
||||
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
|
||||
|
|
@ -371,7 +371,7 @@ if ($mine || ($usertoprocess->id == $user->id)) {
|
|||
print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
} else {
|
||||
if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
|
||||
if ($user->rights->projet->all->lire && !$socid) {
|
||||
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
|
||||
print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
} else {
|
||||
print $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
|
|
@ -422,10 +422,10 @@ if (isModEnabled("categorie")) {
|
|||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
|
||||
$includeonly = 'hierarchyme';
|
||||
if (empty($user->rights->user->user->lire)) {
|
||||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->hasRight('user', 'user', 'lire') ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ if (GETPOST('submitdateselect')) {
|
|||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('assigntask') && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
$action = 'assigntask';
|
||||
|
||||
if ($taskid > 0) {
|
||||
|
|
@ -259,7 +259,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('formfilteraction') != 'listafterchangingselectedfields') {
|
||||
$timetoadd = GETPOST('task');
|
||||
if (empty($timetoadd)) {
|
||||
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
|
||||
|
|
@ -471,7 +471,7 @@ if ($mine || ($usertoprocess->id == $user->id)) {
|
|||
print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
} else {
|
||||
if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
|
||||
if ($user->rights->projet->all->lire && !$socid) {
|
||||
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
|
||||
print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
} else {
|
||||
print $langs->trans("ProjectsPublicTaskDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
|
|
@ -558,10 +558,10 @@ $moreforfilter = '';
|
|||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
|
||||
$includeonly = 'hierarchyme';
|
||||
if (empty($user->rights->user->user->lire)) {
|
||||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->hasRight('user', 'user', 'lire') ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
|
||||
|
|
|
|||
|
|
@ -801,7 +801,7 @@ print '<tr class="oddeven">';
|
|||
print '<td>'.$langs->trans("AllowToSelectProjectFromOtherCompany").'</td>';
|
||||
|
||||
print '<td class="right" width="60" colspan="2">';
|
||||
print '<input type="text" id="projectToSelect" name="projectToSelect" value="'.$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.'"/> ';
|
||||
print '<input type="text" id="projectToSelect" name="projectToSelect" value="' . getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY').'"/> ';
|
||||
print $form->textwithpicto('', $langs->trans('AllowToLinkFromOtherCompany'));
|
||||
print '<input type="submit" class="button small reposition" name="PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
|
|
@ -821,7 +821,7 @@ print '<tr class="oddeven">';
|
|||
print '<td>'.$langs->trans("TimesheetPreventAfterFollowingMonths").'</td>';
|
||||
|
||||
print '<td class="right" width="60" colspan="2">';
|
||||
print '<input type="number" class="width50" id="timesheetFreezeDuration" name="timesheetFreezeDuration" min="0" step="1" value="'.$conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS.'"/> ';
|
||||
print '<input type="number" class="width50" id="timesheetFreezeDuration" name="timesheetFreezeDuration" min="0" step="1" value="' . getDolGlobalString('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS').'"/> ';
|
||||
print '<input type="submit" class="button small reposition" name="PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ $socid = 0;
|
|||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
$result = restrictedArea($user, 'projet', $id, 'projet&project');
|
||||
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only
|
|||
$titlenew = $langs->trans("NewLead");
|
||||
}
|
||||
|
||||
if ($action == 'create' && $user->rights->projet->creer) {
|
||||
if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
||||
/*
|
||||
* Create
|
||||
*/
|
||||
|
|
@ -1249,7 +1249,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
@ -1551,7 +1551,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
}
|
||||
|
||||
// Close
|
||||
if ($object->statut == Project::STATUS_VALIDATED && $user->rights->projet->creer) {
|
||||
if ($object->statut == Project::STATUS_VALIDATED && $user->hasRight('projet', 'creer')) {
|
||||
if ($userWrite > 0) {
|
||||
print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.$object->id, '');
|
||||
} else {
|
||||
|
|
@ -1560,7 +1560,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
}
|
||||
|
||||
// Reopen
|
||||
if ($object->statut == Project::STATUS_CLOSED && $user->rights->projet->creer) {
|
||||
if ($object->statut == Project::STATUS_CLOSED && $user->hasRight('projet', 'creer')) {
|
||||
if ($userWrite > 0) {
|
||||
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1490,9 +1490,9 @@ class Project extends CommonObject
|
|||
{
|
||||
// To verify role of users
|
||||
$userAccess = 0;
|
||||
if (($mode == 'read' && !empty($user->rights->projet->all->lire)) || ($mode == 'write' && !empty($user->rights->projet->all->creer)) || ($mode == 'delete' && !empty($user->rights->projet->all->supprimer))) {
|
||||
if (($mode == 'read' && $user->hasRight('projet', 'all', 'lire')) || ($mode == 'write' && $user->hasRight('projet', 'all', 'creer')) || ($mode == 'delete' && $user->hasRight('projet', 'all', 'supprimer'))) {
|
||||
$userAccess = 1;
|
||||
} elseif ($this->public && (($mode == 'read' && !empty($user->rights->projet->lire)) || ($mode == 'write' && !empty($user->rights->projet->creer)) || ($mode == 'delete' && !empty($user->rights->projet->supprimer)))) {
|
||||
} elseif ($this->public && (($mode == 'read' && $user->hasRight('projet', 'lire')) || ($mode == 'write' && $user->hasRight('projet', 'creer')) || ($mode == 'delete' && $user->hasRight('projet', 'supprimer')))) {
|
||||
$userAccess = 1;
|
||||
} else { // No access due to permission to read all projects, so we check if we are a contact of project
|
||||
foreach (array('internal', 'external') as $source) {
|
||||
|
|
@ -1502,24 +1502,24 @@ class Project extends CommonObject
|
|||
$nblinks = 0;
|
||||
while ($nblinks < $num) {
|
||||
if ($source == 'internal' && $user->id == $userRole[$nblinks]['id']) { // $userRole[$nblinks]['id'] is id of user (llx_user) for internal contacts
|
||||
if ($mode == 'read' && $user->rights->projet->lire) {
|
||||
if ($mode == 'read' && $user->hasRight('projet', 'lire')) {
|
||||
$userAccess++;
|
||||
}
|
||||
if ($mode == 'write' && $user->rights->projet->creer) {
|
||||
if ($mode == 'write' && $user->hasRight('projet', 'creer')) {
|
||||
$userAccess++;
|
||||
}
|
||||
if ($mode == 'delete' && $user->rights->projet->supprimer) {
|
||||
if ($mode == 'delete' && $user->hasRight('projet', 'supprimer')) {
|
||||
$userAccess++;
|
||||
}
|
||||
}
|
||||
if ($source == 'external' && $user->socid > 0 && $user->socid == $userRole[$nblinks]['socid']) { // $userRole[$nblinks]['id'] is id of contact (llx_socpeople) or external contacts
|
||||
if ($mode == 'read' && $user->rights->projet->lire) {
|
||||
if ($mode == 'read' && $user->hasRight('projet', 'lire')) {
|
||||
$userAccess++;
|
||||
}
|
||||
if ($mode == 'write' && $user->rights->projet->creer) {
|
||||
if ($mode == 'write' && $user->hasRight('projet', 'creer')) {
|
||||
$userAccess++;
|
||||
}
|
||||
if ($mode == 'delete' && $user->rights->projet->supprimer) {
|
||||
if ($mode == 'delete' && $user->hasRight('projet', 'supprimer')) {
|
||||
$userAccess++;
|
||||
}
|
||||
}
|
||||
|
|
@ -2267,7 +2267,7 @@ class Project extends CommonObject
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " WHERE";
|
||||
$sql .= " p.entity IN (".getEntity('project').")";
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$projectsListId = $this->getProjectsAuthorizedForUser($user, 0, 1);
|
||||
$sql .= "AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class ProjectStats extends Stats
|
|||
// Get list of project id allowed to user (in a string list separated by coma)
|
||||
$object = new Project($this->db);
|
||||
$projectsListId = '';
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$projectsListId = $object->getProjectsAuthorizedForUser($user, 0, 1, $user->socid);
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ class ProjectStats extends Stats
|
|||
}
|
||||
}
|
||||
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sqlwhere[] = " t.rowid IN (".$this->db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1936,8 +1936,8 @@ class Task extends CommonObjectLine
|
|||
|
||||
$defaultref = '';
|
||||
$obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
|
||||
if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) {
|
||||
require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
|
||||
if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
|
||||
require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php';
|
||||
$modTask = new $obj;
|
||||
$defaultref = $modTask->getNextValue(0, $clone_task);
|
||||
}
|
||||
|
|
@ -2264,7 +2264,7 @@ class Task extends CommonObjectLine
|
|||
$sql .= " AND p.fk_statut = 1";
|
||||
$sql .= " AND t.fk_projet = p.rowid";
|
||||
$sql .= " AND (t.progress IS NULL OR t.progress < 100)"; // tasks to do
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
|
||||
}
|
||||
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
|
||||
|
|
@ -2329,13 +2329,13 @@ class Task extends CommonObjectLine
|
|||
$sql = "SELECT count(p.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
|
||||
}
|
||||
$sql .= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project', 0).')';
|
||||
$sql .= " AND t.fk_projet = p.rowid"; // tasks to do
|
||||
if ($mine || empty($user->rights->projet->all->lire)) {
|
||||
if ($mine || !$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
|
||||
}
|
||||
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
|
||||
|
|
@ -2343,7 +2343,7 @@ class Task extends CommonObjectLine
|
|||
if ($socid) {
|
||||
$sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")";
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id).") OR (s.rowid IS NULL))";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class TaskStats extends Stats
|
|||
$sql = "SELECT";
|
||||
$sql .= " COUNT(t.rowid), t.priority";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = t.fk_projet";
|
||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc=p.fk_soc AND sc.fk_user=".((int) $user->id);
|
||||
}
|
||||
$sql .= $this->buildWhere();
|
||||
|
|
@ -112,7 +112,7 @@ class TaskStats extends Stats
|
|||
|
||||
$sql = "SELECT date_format(t.datec,'%Y') as year, COUNT(t.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = t.fk_projet";
|
||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc=p.fk_soc AND sc.fk_user=".((int) $user->id);
|
||||
}
|
||||
$sql .= $this->buildWhere();
|
||||
|
|
@ -174,7 +174,7 @@ class TaskStats extends Stats
|
|||
|
||||
$sql = "SELECT date_format(t.datec,'%m') as dm, COUNT(t.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = t.fk_projet";
|
||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc=p.fk_soc AND sc.fk_user=".((int) $user->id);
|
||||
}
|
||||
$sql .= $this->buildWhere();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ $withproject = GETPOST('withproject', 'int');
|
|||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Add new contact
|
||||
if ($action == 'addcontact_confirm' && $user->rights->projet->creer) {
|
||||
if ($action == 'addcontact_confirm' && $user->hasRight('projet', 'creer')) {
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Change contact's status
|
||||
if ($action == 'swapstatut' && $user->rights->projet->creer) {
|
||||
if ($action == 'swapstatut' && $user->hasRight('projet', 'creer')) {
|
||||
if ($object->fetch($id)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
|
|
@ -229,7 +229,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Delete a contact
|
||||
if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->projet->creer) {
|
||||
if (($action == 'deleteline' || $action == 'deletecontact') && $user->hasRight('projet', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->delete_contact(GETPOST("lineid", 'int'));
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ if ($object->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "te.rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
@ -1045,7 +1045,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
if (!in_array($tablename, $array_of_element_linkable_with_different_thirdparty)) {
|
||||
$idtofilterthirdparty = empty($object->thirdparty->id) ? 0 : $object->thirdparty->id;
|
||||
if (!empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) {
|
||||
$idtofilterthirdparty .= ','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS;
|
||||
$idtofilterthirdparty .= ',' . getDolGlobalString('PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
|
|||
// Link to create task
|
||||
$linktocreatetaskParam = array();
|
||||
$linktocreatetaskUserRight = false;
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
|
||||
if ($user->hasRight('projet', 'all', 'creer') || $user->hasRight('projet', 'creer')) {
|
||||
if ($object->public || $userWrite > 0) {
|
||||
$linktocreatetaskUserRight = true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||
$sql .= " AND p.fk_statut = 1"; // Opend projects only
|
||||
if ($mine || empty($user->rights->projet->all->lire)) {
|
||||
if ($mine || !$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")";
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ llxHeader('', $title, $help_url);
|
|||
|
||||
// Title for combo list see all projects
|
||||
$titleall = $langs->trans("AllAllowedProjects");
|
||||
if (!empty($user->rights->projet->all->lire) && !$socid) {
|
||||
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
|
||||
$titleall = $langs->trans("AllProjects");
|
||||
} else {
|
||||
$titleall = $langs->trans("AllAllowedProjects").'<br><br>';
|
||||
|
|
@ -130,7 +130,7 @@ $morehtml .= '</form>';
|
|||
if ($mine) {
|
||||
$tooltiphelp = $langs->trans("MyProjectsDesc");
|
||||
} else {
|
||||
if (!empty($user->rights->projet->all->lire) && !$socid) {
|
||||
if ($user->hasRight('projet', 'all', 'lire') && !$socid) {
|
||||
$tooltiphelp = $langs->trans("ProjectsDesc");
|
||||
} else {
|
||||
$tooltiphelp = $langs->trans("ProjectsPublicDesc");
|
||||
|
|
@ -209,7 +209,7 @@ $sql .= ", s.canvas, s.status as thirdpartystatus";
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||
if ($mine || empty($user->rights->projet->all->lire)) {
|
||||
if ($mine || !$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // If we have this test true, it also means projectset is not 2
|
||||
}
|
||||
if ($socid) {
|
||||
|
|
@ -320,7 +320,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
|||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||
$sql .= " AND p.fk_statut = 1";
|
||||
if ($mine || empty($user->rights->projet->all->lire)) {
|
||||
if ($mine || !$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // If we have this test true, it also means projectset is not 2
|
||||
}
|
||||
if ($socid > 0) {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ if ($socid > 0) {
|
|||
$soc->fetch($socid);
|
||||
$title .= ' (<a href="list.php">'.$soc->name.'</a>)';
|
||||
}
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ $morecss = array();
|
|||
|
||||
// Get list of project id allowed to user (in a string list separated by comma)
|
||||
$projectsListId = '';
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$projectsListId = $object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
|
||||
}
|
||||
|
||||
|
|
@ -516,7 +516,7 @@ $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object
|
|||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project', (GETPOST('search_current_entity', 'int') ? 0 : 1)).')';
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
|
||||
}
|
||||
// No need to check if company is external user, as filtering of projects must be done by getProjectsAuthorizedForUser
|
||||
|
|
@ -1090,7 +1090,7 @@ $moreforfilter .= '<div class="divsearchfield">';
|
|||
$tmptitle = $langs->trans('ProjectsWithThisUserAsContact');
|
||||
//$includeonly = 'hierarchyme';
|
||||
$includeonly = '';
|
||||
if (empty($user->rights->user->user->lire)) {
|
||||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx');
|
||||
|
|
@ -1102,7 +1102,7 @@ $moreforfilter .= img_picto($tmptitle, 'contact', 'class="pictofixedwidth"').$fo
|
|||
$moreforfilter .= '</div>';
|
||||
|
||||
// If the user can view thirdparties other than his'
|
||||
if ($user->rights->user->user->lire) {
|
||||
if ($user->hasRight('user', 'user', 'lire')) {
|
||||
$langs->load("commercial");
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ $socid = 0;
|
|||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
$result = restrictedArea($user, 'projet', $id, 'projet&project');
|
||||
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ $endyear = $year;
|
|||
$langs->loadLangs(array('companies', 'projects'));
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ if (count($morewherefilterarray) > 0) {
|
|||
$morewherefilter = ' AND '.implode(' AND ', $morewherefilterarray);
|
||||
}
|
||||
|
||||
if ($action == 'createtask' && $user->rights->projet->creer) {
|
||||
if ($action == 'createtask' && $user->hasRight('projet', 'creer')) {
|
||||
$error = 0;
|
||||
|
||||
// If we use user timezone, we must change also view/list to use user timezone everywhere
|
||||
|
|
@ -584,7 +584,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
@ -695,7 +695,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
}
|
||||
|
||||
|
||||
if ($action == 'create' && $user->rights->projet->creer && (empty($object->thirdparty->id) || $userWrite > 0)) {
|
||||
if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object->thirdparty->id) || $userWrite > 0)) {
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
print '<br>';
|
||||
}
|
||||
|
|
@ -734,8 +734,8 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||
|
||||
$defaultref = '';
|
||||
$obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
|
||||
if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) {
|
||||
require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
|
||||
if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
|
||||
require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php';
|
||||
$modTask = new $obj;
|
||||
$defaultref = $modTask->getNextValue($object->thirdparty, null);
|
||||
}
|
||||
|
|
@ -1151,7 +1151,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||
|
||||
// Test if database is clean. If not we clean it.
|
||||
//print 'mode='.$_REQUEST["mode"].' $nboftaskshown='.$nboftaskshown.' count($tasksarray)='.count($tasksarray).' count($tasksrole)='.count($tasksrole).'<br>';
|
||||
if (!empty($user->rights->projet->all->lire)) { // We make test to clean only if user has permission to see all (test may report false positive otherwise)
|
||||
if ($user->hasRight('projet', 'all', 'lire')) { // We make test to clean only if user has permission to see all (test may report false positive otherwise)
|
||||
if ($search_user_id == $user->id) {
|
||||
if ($nboftaskshown < count($tasksrole)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
|||
*/
|
||||
|
||||
// Add new contact
|
||||
if ($action == 'addcontact' && $user->rights->projet->creer) {
|
||||
if ($action == 'addcontact' && $user->hasRight('projet', 'creer')) {
|
||||
$source = 'internal';
|
||||
if (GETPOST("addsourceexternal")) {
|
||||
$source = 'external';
|
||||
|
|
@ -103,7 +103,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) {
|
|||
}
|
||||
|
||||
// bascule du statut d'un contact
|
||||
if ($action == 'swapstatut' && $user->rights->projet->creer) {
|
||||
if ($action == 'swapstatut' && $user->hasRight('projet', 'creer')) {
|
||||
if ($object->fetch($id, $ref)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
|
|
@ -112,7 +112,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) {
|
|||
}
|
||||
|
||||
// Efface un contact
|
||||
if ($action == 'deleteline' && $user->rights->projet->creer) {
|
||||
if ($action == 'deleteline' && $user->hasRight('projet', 'creer')) {
|
||||
$object->fetch($id, $ref);
|
||||
$result = $object->delete_contact(GETPOST("lineid", 'int'));
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ if ($object->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ if ($id) {
|
|||
}
|
||||
|
||||
// Get list of project id allowed to user (in a string list separated by coma)
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
|
||||
}
|
||||
//var_dump($projectsListId);
|
||||
|
|
@ -382,7 +382,7 @@ if ($search_task_user > 0) {
|
|||
}
|
||||
$sql .= " WHERE t.fk_projet = p.rowid";
|
||||
$sql .= " AND p.entity IN (".getEntity('project').')';
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId ? $projectsListId : '0').")"; // public and assigned to projects, or restricted to company for external users
|
||||
}
|
||||
if (is_object($projectstatic) && $projectstatic->id > 0) {
|
||||
|
|
@ -790,7 +790,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
|
|||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('ProjectsWithThisUserAsContact');
|
||||
$includeonly = '';
|
||||
if (empty($user->rights->user->user->lire)) {
|
||||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250');
|
||||
|
|
@ -800,7 +800,7 @@ $moreforfilter .= '</div>';
|
|||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('TasksWithThisUserAsContact');
|
||||
$includeonly = '';
|
||||
if (empty($user->rights->user->user->lire)) {
|
||||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_task_user, 'search_task_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250');
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ $project_ref = GETPOST('project_ref', 'alpha');
|
|||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ if ($object->id > 0) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/projet/class/taskstats.class.php';
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
|||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
|
||||
if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('projet', 'creer')) {
|
||||
$error = 0;
|
||||
|
||||
if (empty($taskref)) {
|
||||
|
|
@ -155,7 +155,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') {
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) {
|
||||
if ($action == 'confirm_delete' && $confirm == "yes" && $user->hasRight('projet', 'supprimer')) {
|
||||
$result = $projectstatic->fetch($object->fk_project);
|
||||
$projectstatic->fetch_thirdparty();
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ if (!empty($project_ref) && !empty($withproject)) {
|
|||
}
|
||||
|
||||
// Build doc
|
||||
if ($action == 'builddoc' && $user->rights->projet->creer) {
|
||||
if ($action == 'builddoc' && $user->hasRight('projet', 'creer')) {
|
||||
// Save last template used to generate document
|
||||
if (GETPOST('model')) {
|
||||
$object->setDocModel($user, GETPOST('model', 'alpha'));
|
||||
|
|
@ -200,7 +200,7 @@ if ($action == 'builddoc' && $user->rights->projet->creer) {
|
|||
}
|
||||
|
||||
// Delete file in doc form
|
||||
if ($action == 'remove_file' && $user->rights->projet->creer) {
|
||||
if ($action == 'remove_file' && $user->hasRight('projet', 'creer')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$langs->load("other");
|
||||
|
|
@ -273,7 +273,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
|
@ -431,7 +431,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
$head = task_prepare_head($object);
|
||||
|
||||
if ($action == 'edit' && $user->rights->projet->creer) {
|
||||
if ($action == 'edit' && $user->hasRight('projet', 'creer')) {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ if ($id > 0 || $ref) {
|
|||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
if (!$user->rights->projet->lire) {
|
||||
if (!$user->hasRight('projet', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'addtimespent' && $user->rights->projet->time) {
|
||||
if ($action == 'addtimespent' && $user->hasRight('projet', 'time')) {
|
||||
$error = 0;
|
||||
|
||||
$timespent_durationhour = GETPOST('timespent_durationhour', 'int');
|
||||
|
|
@ -270,7 +270,7 @@ if ($action == 'addtimespent' && $user->rights->projet->time) {
|
|||
}
|
||||
}
|
||||
|
||||
if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $user->rights->projet->lire) {
|
||||
if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $user->hasRight('projet', 'lire')) {
|
||||
$error = 0;
|
||||
|
||||
if (!GETPOST("new_durationhour") && !GETPOST("new_durationmin")) {
|
||||
|
|
@ -286,7 +286,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||
$object->fetchTimeSpent(GETPOST('lineid', 'int'));
|
||||
|
||||
$result = 0;
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
$result = $object->delTimeSpent($user);
|
||||
}
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||
$object->timespent_invoicelineid = GETPOST("invoicelineid", 'int');
|
||||
|
||||
$result = 0;
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
$result = $object->addTimeSpent($user);
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
|
|
@ -337,7 +337,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||
$object->timespent_invoicelineid = GETPOST("invoicelineid", 'int');
|
||||
$result = 0;
|
||||
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
$result = $object->updateTimeSpent($user);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
|
@ -951,7 +951,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (empty($user->rights->projet->all->lire)) {
|
||||
if (!$user->hasRight('projet', 'all', 'lire')) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")";
|
||||
}
|
||||
|
|
@ -1071,7 +1071,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$linktocreatetimeBtnStatus = 0;
|
||||
$linktocreatetimeUrl = '';
|
||||
$linktocreatetimeHelpText = '';
|
||||
if (!empty($user->rights->projet->time)) {
|
||||
if ($user->hasRight('projet', 'time')) {
|
||||
if ($projectstatic->public || $userRead > 0) {
|
||||
$linktocreatetimeBtnStatus = 1;
|
||||
|
||||
|
|
@ -1392,7 +1392,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
print '<input type="hidden" name="action" value="updateline">';
|
||||
} elseif ($action == 'splitline') {
|
||||
print '<input type="hidden" name="action" value="updatesplitline">';
|
||||
} elseif ($action == 'createtime' && $user->rights->projet->time) {
|
||||
} elseif ($action == 'createtime' && $user->hasRight('projet', 'time')) {
|
||||
print '<input type="hidden" name="action" value="addtimespent">';
|
||||
} elseif ($massaction == 'generateinvoice' && $user->hasRight('facture', 'creer')) {
|
||||
print '<input type="hidden" name="action" value="confirm_generateinvoice">';
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
|||
|
||||
if (!empty($conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION)) {
|
||||
print '<div class="backimagepublicregistration">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . $conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION . '">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION') . '">';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -438,10 +438,10 @@ if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !e
|
|||
if (empty($conf->dol_use_jmobile)) {
|
||||
print '<div align="center">'."\n";
|
||||
print '<script><!--'."\n";
|
||||
print 'google_ad_client = "'.$conf->global->MAIN_GOOGLE_AD_CLIENT.'";'."\n";
|
||||
print 'google_ad_slot = "'.$conf->global->MAIN_GOOGLE_AD_SLOT.'";'."\n";
|
||||
print 'google_ad_width = '.$conf->global->MAIN_GOOGLE_AD_WIDTH.';'."\n";
|
||||
print 'google_ad_height = '.$conf->global->MAIN_GOOGLE_AD_HEIGHT.';'."\n";
|
||||
print 'google_ad_client = "' . getDolGlobalString('MAIN_GOOGLE_AD_CLIENT').'";'."\n";
|
||||
print 'google_ad_slot = "' . getDolGlobalString('MAIN_GOOGLE_AD_SLOT').'";'."\n";
|
||||
print 'google_ad_width = ' . getDolGlobalString('MAIN_GOOGLE_AD_WIDTH').';'."\n";
|
||||
print 'google_ad_height = ' . getDolGlobalString('MAIN_GOOGLE_AD_HEIGHT').';'."\n";
|
||||
print '//-->'."\n";
|
||||
print '</script>'."\n";
|
||||
print '<script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>'."\n";
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
|||
|
||||
if (!empty($conf->global->EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE)) {
|
||||
print '<div class="backimagepubliceventorganizationsubscription">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE.'">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||
|
||||
// If the registration has already been paid for this attendee
|
||||
if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) {
|
||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'master');
|
||||
$securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'master');
|
||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
|
||||
|
||||
$mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorded", $email);
|
||||
|
|
@ -599,7 +599,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode($sourcetouse).'&ref='.urlencode($reftouse);
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||
$redirection .= '&securekey='.dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||
} else {
|
||||
$redirection .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
|
|
@ -660,7 +660,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
|
||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
$securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2);
|
||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
|
||||
|
||||
Header("Location: ".$redirection);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ $error = 0;
|
|||
// Security check
|
||||
$id = GETPOST("id", 'int');
|
||||
$securekeyreceived = GETPOST("securekey");
|
||||
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2);
|
||||
|
||||
if ($securekeyreceived != $securekeytocompare) {
|
||||
print $langs->trans('MissingOrBadSecureKey');
|
||||
|
|
@ -104,7 +104,7 @@ dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment');
|
|||
|
||||
$head = '';
|
||||
if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) {
|
||||
$head = '<link rel="stylesheet" type="text/css" href="'.$conf->global->ONLINE_PAYMENT_CSS_URL.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
$head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
|
||||
}
|
||||
|
||||
$conf->dol_hide_topmenu = 1;
|
||||
|
|
@ -156,7 +156,7 @@ if ($urllogo) {
|
|||
|
||||
if (!empty($conf->global->EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE)) {
|
||||
print '<div class="backimagepubliceventorganizationsubscription">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE.'">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
|||
|
||||
if (!empty($conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION)) {
|
||||
print '<div class="backimagepublicregistration">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION.'">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION').'">';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ if (empty($reshook) && $action == 'add') {
|
|||
$to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||
$from = getDolGlobalString('ADHERENT_MAIL_FROM');
|
||||
$mailfile = new CMailFile(
|
||||
'['.$appli.'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
|
||||
'['.$appli.'] ' . getDolGlobalString('ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'),
|
||||
$to,
|
||||
$from,
|
||||
$adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
|
||||
|
|
@ -593,7 +593,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
|||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
|
||||
print '<input type="hidden" id="typeid" name="typeid" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">';
|
||||
print '<input type="hidden" id="typeid" name="typeid" value="' . getDolGlobalString('MEMBER_NEWFORM_FORCETYPE').'">';
|
||||
}
|
||||
|
||||
// Moral/Physic attribute
|
||||
|
|
@ -605,7 +605,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
|||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
//print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
|
||||
print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.'">';
|
||||
print '<input type="hidden" id="morphy" name="morphy" value="' . getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY').'">';
|
||||
}
|
||||
|
||||
// Company // TODO : optional hide
|
||||
|
|
@ -776,7 +776,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
|||
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
|
||||
print '<tr><td>'.$langs->trans("Subscription");
|
||||
if (!empty($conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO)) {
|
||||
print ' - <a href="'.$conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO.'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
|
||||
print ' - <a href="' . getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
|
||||
}
|
||||
print '</td><td class="nowrap">';
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ $extrafields = new ExtraFields($db);
|
|||
|
||||
$morehead = '';
|
||||
if (!empty($conf->global->MEMBER_PUBLIC_CSS)) {
|
||||
$morehead = '<link rel="stylesheet" type="text/css" href="'.$conf->global->MEMBER_PUBLIC_CSS.'">';
|
||||
$morehead = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MEMBER_PUBLIC_CSS').'">';
|
||||
} else {
|
||||
$morehead = '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/eldy/style.css.php">';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ $form = new Form($db);
|
|||
|
||||
$morehead = '';
|
||||
if (!empty($conf->global->MEMBER_PUBLIC_CSS)) {
|
||||
$morehead = '<link rel="stylesheet" type="text/css" href="'.$conf->global->MEMBER_PUBLIC_CSS.'">';
|
||||
$morehead = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MEMBER_PUBLIC_CSS').'">';
|
||||
} else {
|
||||
$morehead = '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/eldy/style.css.php">';
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user