Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0
This commit is contained in:
commit
283ad1abcf
@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir) {
|
|||||||
if (in_array($name, $def)) {
|
if (in_array($name, $def)) {
|
||||||
print '<td class="center">'."\n";
|
print '<td class="center">'."\n";
|
||||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
|
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
} else {
|
} else {
|
||||||
@ -401,8 +401,7 @@ foreach ($dirmodels as $reldir) {
|
|||||||
// Default
|
// Default
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
|
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
|
||||||
// print img_picto($langs->trans("Default"), 'on');
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2023 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -147,6 +148,9 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
|
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
|
||||||
}
|
}
|
||||||
|
if ($fuser->statut == 0) {
|
||||||
|
throw new RestException(503, 'Error when fetching user. This user has been locked or disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
|
|
||||||
|
|||||||
@ -731,6 +731,8 @@ class ActionComm extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -605,6 +605,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1487,6 +1487,8 @@ class Propal extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -464,6 +464,7 @@ if (empty($reshook)) {
|
|||||||
// Note that $action and $object may be modified by hook
|
// Note that $action and $object may be modified by hook
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action);
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1280,6 +1280,8 @@ class Commande extends CommonOrder
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1435,6 +1437,8 @@ class Commande extends CommonOrder
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1336,6 +1336,8 @@ class Facture extends CommonInvoice
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1469,6 +1471,8 @@ class Facture extends CommonInvoice
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,11 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'contrat', $id, '');
|
|
||||||
|
// Security check
|
||||||
|
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||||
|
$fieldtype = (!empty($id) ? 'rowid' : 'ref');
|
||||||
|
$result = restrictedArea($user, 'contrat', $fieldvalue, '', '', '', $fieldtype);
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
@ -73,6 +77,13 @@ if (!$sortorder) {
|
|||||||
$sortorder = 'DESC,DESC';
|
$sortorder = 'DESC,DESC';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$object = new Contrat($db);
|
||||||
|
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$result = $object->fetch($id, $ref);
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('agendacontract', 'globalcard'));
|
$hookmanager->initHooks(array('agendacontract', 'globalcard'));
|
||||||
|
|
||||||
@ -81,7 +92,7 @@ $hookmanager->initHooks(array('agendacontract', 'globalcard'));
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters = array('id'=>$id);
|
$parameters = array('id' => $id, 'ref' => $ref);
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
@ -102,8 +113,6 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -114,7 +123,7 @@ if (!empty($conf->project->enabled)) {
|
|||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id > 0) {
|
if ($object->id > 0) {
|
||||||
// Load object modContract
|
// Load object modContract
|
||||||
$module = (!empty($conf->global->CONTRACT_ADDON) ? $conf->global->CONTRACT_ADDON : 'mod_contract_serpis');
|
$module = (!empty($conf->global->CONTRACT_ADDON) ? $conf->global->CONTRACT_ADDON : 'mod_contract_serpis');
|
||||||
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') {
|
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') {
|
||||||
@ -128,8 +137,6 @@ if ($id > 0) {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||||
|
|
||||||
$object = new Contrat($db);
|
|
||||||
$result = $object->fetch($id);
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$title = $langs->trans("Agenda");
|
$title = $langs->trans("Agenda");
|
||||||
@ -205,13 +212,13 @@ if ($id > 0) {
|
|||||||
}
|
}
|
||||||
$morehtmlref .= '</div>';
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'ref', 'none', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
$object->info($id);
|
$object->info($object->id);
|
||||||
dol_print_object_info($object, 1);
|
dol_print_object_info($object, 1);
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -254,7 +261,7 @@ if ($id > 0) {
|
|||||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$param = '&id='.$id;
|
$param = '&id='.$object->id;
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.$contextpage;
|
$param .= '&contextpage='.$contextpage;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -369,6 +369,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2580,6 +2580,8 @@ class Contrat extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -345,6 +345,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
|
|||||||
$filearray[$key]['position_name'] = ($filearrayindatabase[$key2]['position'] ? $filearrayindatabase[$key2]['position'] : '0').'_'.$filearrayindatabase[$key2]['name'];
|
$filearray[$key]['position_name'] = ($filearrayindatabase[$key2]['position'] ? $filearrayindatabase[$key2]['position'] : '0').'_'.$filearrayindatabase[$key2]['name'];
|
||||||
$filearray[$key]['position'] = $filearrayindatabase[$key2]['position'];
|
$filearray[$key]['position'] = $filearrayindatabase[$key2]['position'];
|
||||||
$filearray[$key]['cover'] = $filearrayindatabase[$key2]['cover'];
|
$filearray[$key]['cover'] = $filearrayindatabase[$key2]['cover'];
|
||||||
|
$filearray[$key]['keywords'] = $filearrayindatabase[$key2]['keywords'];
|
||||||
$filearray[$key]['acl'] = $filearrayindatabase[$key2]['acl'];
|
$filearray[$key]['acl'] = $filearrayindatabase[$key2]['acl'];
|
||||||
$filearray[$key]['rowid'] = $filearrayindatabase[$key2]['rowid'];
|
$filearray[$key]['rowid'] = $filearrayindatabase[$key2]['rowid'];
|
||||||
$filearray[$key]['label'] = $filearrayindatabase[$key2]['label'];
|
$filearray[$key]['label'] = $filearrayindatabase[$key2]['label'];
|
||||||
|
|||||||
@ -462,6 +462,8 @@ class ExpenseReport extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1228,6 +1228,8 @@ class Fichinter extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1702,6 +1702,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1373,6 +1373,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -425,6 +425,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1173,6 +1173,8 @@ class SupplierProposal extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user