30if (!defined(
'NOTOKENRENEWAL')) {
31 define(
'NOTOKENRENEWAL', 1);
33if (!defined(
'NOREQUIREMENU')) {
34 define(
'NOREQUIREMENU',
'1');
36if (!defined(
'NOREQUIREHTML')) {
37 define(
'NOREQUIREHTML',
'1');
40require
'../../main.inc.php';
48require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
52$element =
GETPOST(
'element',
'alpha');
53$action =
GETPOST(
'action',
'aZ09');
55if (! in_array($action, array(
'DOC_PREVIEW',
'DOC_DOWNLOAD'))) {
56 accessforbidden(
'Bad value for action. Must be DOC_PREVIEW or DOC_DOWNLOAD');
59if ($element ===
'facture') {
60 restrictedArea($user,
'facture', $id,
'',
'',
'fk_soc',
'rowid', 0);
71if ($facture->fetch($id) > 0) {
77 $facture->call_trigger($action, $user);
88if ($facture->errors) {
89 http_response_code(500);
90 print implode(
"\n", $facture->errors);
92 print
'Object '.$element.
' logged with action code = '.$action.
" pos_print_counter is now ".$facture->pos_print_counter;
$id
Support class for third parties, contacts, members, users or resources.
Class to manage invoices.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.