dolibarr 25.0.0-alpha
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
4 * Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
6 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2025 Vincent Maury <vmaury@timgroup.fr>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
32// Load Dolibarr environment
33require '../../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
42require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
43require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
44require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
45require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
46
47// Load translation files required by the page
48$langs->loadLangs(array('banks', 'bills', 'companies', 'suppliers'));
49
50
51// Get Parameters
52$id = GETPOSTINT('id');
53$action = GETPOST('action', 'alpha');
54$confirm = GETPOST('confirm', 'alpha');
55
56$socid = 0;
57
58// Initialize objects
60
61// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
62$hookmanager->initHooks(array('supplierpaymentcard', 'globalcard'));
63
64// Load object
65include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
66
67$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); // This also test permission on read invoice
68
69// Security check
70if ($user->isExternalUser()) {
71 $socid = $user->isExternalUser();
72}
73// Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
74// It should be enough because all payments are done on invoices of the same thirdparty.
75if ($socid && $socid != $object->thirdparty->id) {
77}
78
79$permissiontoadd = ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "write"));
80$permissiontovalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "write"))) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_invoice_advance", "validate")));
81$permissiontodelete = ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "delete"));
82
83
84/*
85 * Actions
86 */
87
88if ($action == 'setnote' && $permissiontoadd) {
89 $db->begin();
90
91 $object->fetch($id);
92 $result = $object->update_note(GETPOST('note', 'restricthtml'));
93 if ($result > 0) {
94 $db->commit();
95 $action = '';
96 } else {
97 setEventMessages($object->error, $object->errors, 'errors');
98 $db->rollback();
99 }
100}
101
102if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontodelete) {
103 $db->begin();
104
105 $object->fetch($id);
106 $result = $object->delete($user);
107 if ($result > 0) {
108 $db->commit();
109 header('Location: '.DOL_URL_ROOT.'/fourn/paiement/list.php');
110 exit;
111 } else {
112 setEventMessages($object->error, $object->errors, 'errors');
113 $db->rollback();
114 }
115}
116
117if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontovalidate) {
118 $db->begin();
119
120 $object->fetch($id);
121 if ($object->validate() >= 0) {
122 $db->commit();
123 header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
124 exit;
125 } else {
126 setEventMessages($object->error, $object->errors, 'errors');
127 $db->rollback();
128 }
129}
130
131if ($action == 'setnum_paiement' && GETPOST('num_paiement') && $permissiontoadd) {
132 $object->fetch($id);
133 $res = $object->update_num(GETPOST('num_paiement'));
134 if ($res === 0) {
135 setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs');
136 } else {
137 setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors');
138 }
139}
140
141if ($action == 'setdatep' && GETPOST('datepday') && $permissiontoadd) {
142 $object->fetch($id);
143 $datepaye = dol_mktime(GETPOSTINT('datephour'), GETPOSTINT('datepmin'), GETPOSTINT('datepsec'), GETPOSTINT('datepmonth'), GETPOSTINT('datepday'), GETPOSTINT('datepyear'));
144 $res = $object->update_date($datepaye);
145 if ($res === 0) {
146 setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
147 } else {
148 setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
149 }
150}
151
152// Build document
153$upload_dir = $conf->fournisseur->payment->dir_output;
154include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
155
156// Actions to send emails
157$triggersendname = 'PAYMENTRECEIPT_SENTBYMAIL';
158$paramname = 'id';
159$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
160$trackid = 'pre'.$object->id;
161include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
162
163
164/*
165 * View
166 */
167
168llxHeader();
169
170$result = $object->fetch($id);
171
172$form = new Form($db);
173$formfile = new FormFile($db);
174
175$head = payment_supplier_prepare_head($object);
176
177// The tabs are printed before the result of the fetch is checked below, so we must not offer a drop area
178// when the object was not loaded: the upload could only fail.
179print dol_get_fiche_head($head, 'payment', $langs->trans('SupplierPayment'), -1, 'payment', 0, '', '', 0, '', ($result > 0 ? 1 : 0));
180
181if ($result > 0) {
182 /*
183 * Confirmation of payment's delete
184 */
185 if ($action == 'delete') {
186 print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
187 }
188
189 /*
190 * Confirmation of payment's validation
191 */
192 if ($action == 'validate') {
193 print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_validate');
194 }
195
196 $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
197
198 $morehtmlref = '';
199
200 dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
201
202 print '<div class="fichecenter">';
203 print '<div class="underbanner clearboth"></div>';
204
205 print '<table class="border centpercent">';
206
207 /*print '<tr>';
208 print '<td width="20%">'.$langs->trans('Ref').'</td><td>';
209 print $form->showrefnav($object,'id','',1,'rowid','ref');
210 print '</td></tr>';*/
211
212 // Date of payment
213 print '<tr><td class="titlefield">'.$form->editfieldkey("Date", 'datep', $object->date, $object, (int) ($object->statut == 0 && ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")))).'</td>';
214 print '<td>';
215 print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'));
216 print '</td></tr>';
217
218 // Payment mode
219 $labeltype = $langs->trans("PaymentType".$object->type_code) != "PaymentType".$object->type_code ? $langs->trans("PaymentType".$object->type_code) : $object->type_label;
220 print '<tr><td>'.$langs->trans('PaymentMode').'</td>';
221 print '<td>'.$labeltype;
222 print $object->num_payment ? ' - '.$object->num_payment : '';
223 print '</td></tr>';
224
225 // Payment numero
226 /* TODO Add field num_payment into payment table and save it
227 print '<tr><td>'.$form->editfieldkey("Numero",'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->hasRight("fournisseur", "facture", "creer")).'</td>';
228 print '<td>';
229 print $form->editfieldval("Numero",'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->hasRight("fournisseur", "facture", "creer"),'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
230 print '</td></tr>';
231 */
232
233 // Amount
234 print '<tr><td>'.$langs->trans('Amount').'</td>';
235 print '<td><span class="amount">'.price($object->amount, 0, $langs, 0, 0, -1, $conf->currency).'</span></td></tr>';
236
237 // Status of validation of payment
238 if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) {
239 print '<tr><td>'.$langs->trans('Status').'</td>';
240 print '<td>'.$object->getLibStatut(4).'</td></tr>';
241 }
242
243 $allow_delete = 1;
244 $title_button = '';
245 // Bank account
246 if (isModEnabled("bank")) {
247 if ($object->fk_account) {
248 $bankline = new AccountLine($db);
249 $bankline->fetch($object->bank_line);
250 if ($bankline->rappro) {
251 $allow_delete = 0;
252 $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
253 }
254
255 print '<tr>';
256 print '<td>'.$langs->trans('BankAccount').'</td>';
257 print '<td>';
258 $accountstatic = new Account($db);
259 $accountstatic->fetch($bankline->fk_account);
260 print $accountstatic->getNomUrl(1);
261 print '</td>';
262 print '</tr>';
263
264 print '<tr>';
265 print '<td>'.$langs->trans('BankTransactionLine').'</td>';
266 print '<td>';
267 print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
268 print '</td>';
269 print '</tr>';
270 }
271 }
272
273 // Note
274 print '<tr><td>'.$form->editfieldkey("Comments", 'note', $object->note_private, $object, (int) ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer"))).'</td>';
275 print '<td>';
276 print $form->editfieldval("Note", 'note', $object->note_private, $object, ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")), 'textarea');
277 print '</td></tr>';
278
279 print '</table>';
280
281 print '</div>';
282
283
284 print '<br><br>';
285
286
290 $sql = 'SELECT f.rowid, f.rowid as facid, f.ref, f.ref_supplier, f.type, f.paye, f.total_ht, f.total_tva, f.total_ttc, f.datef as date, f.fk_statut as status,';
291 $sql .= ' pf.amount, s.nom as name, s.rowid as socid';
292 $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
293 $sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid';
294 $sql .= ' AND pf.fk_paiementfourn = '.((int) $object->id);
295 $resql = $db->query($sql);
296 if ($resql) {
297 $num = $db->num_rows($resql);
298
299 $i = 0;
300 $total = 0;
301
302 print '<table class="noborder centpercent">';
303 print '<tr class="liste_titre">';
304 print '<td>'.$langs->trans('Invoice').'</td>';
305 print '<td>'.$langs->trans('RefSupplier').'</td>';
306 print '<td>'.$langs->trans('Company').'</td>';
307 print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
308 print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
309 print '<td class="right">'.$langs->trans('Status').'</td>';
310 print "</tr>\n";
311
312 if ($num > 0) {
313 $facturestatic = new FactureFournisseur($db);
314
315 while ($i < $num) {
316 $objp = $db->fetch_object($resql);
317
318 $facturestatic->id = $objp->facid;
319 $facturestatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
320 $facturestatic->date = $db->jdate($objp->date);
321 $facturestatic->type = $objp->type;
322 $facturestatic->total_ht = $objp->total_ht;
323 $facturestatic->total_tva = $objp->total_tva;
324 $facturestatic->total_ttc = $objp->total_ttc;
325 $facturestatic->statut = $objp->status;
326 $facturestatic->status = $objp->status;
327 $facturestatic->alreadypaid = -1; // unknown
328
329 print '<tr class="oddeven">';
330 // Ref
331 print '<td>';
332 print $facturestatic->getNomUrl(1);
333 print "</td>\n";
334 // Ref supplier
335 print '<td>'.$objp->ref_supplier."</td>\n";
336 // Third party
337 print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'), 'company').' '.$objp->name.'</a></td>';
338 // Expected to pay
339 print '<td class="right">'.price($objp->total_ttc).'</td>';
340 // Paid
341 print '<td class="right">'.price($objp->amount).'</td>';
342 // Status
343 print '<td class="right">'.$facturestatic->LibStatut($objp->paye, $objp->status, 6, 1).'</td>';
344 print "</tr>\n";
345
346 if ($objp->paye == 1) {
347 $allow_delete = 0;
348 $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
349 }
350 $total += $objp->amount;
351 $i++;
352 }
353 }
354
355
356 print "</table>\n";
357 $db->free($resql);
358 } else {
360 }
361
362 print '</div>';
363
364
365 /*
366 * Actions Buttons
367 */
368
369 print '<div class="tabsAction">';
370
371 // Send by mail
372 if ($user->socid == 0 && $action != 'presend') {
373 $usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_invoice_advance", "send")));
374 if ($usercansend) {
375 print dolGetButtonAction('', $langs->trans('SendMail'), 'email', dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'presend', 'mode' => 'init'], true).'#formmailbeforetitle', '');
376 } else {
377 print dolGetButtonAction('', $langs->trans('SendMail'), 'email', '#', '', false);
378 }
379 }
380
381 // Payment validation
382 if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) {
383 if ($user->socid == 0 && $object->statut == 0 && $action == '') {
384 if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")))
385 || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_invoice_advance", "validate"))) {
386 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=validate&token='.newToken().'">'.$langs->trans('Valid').'</a>';
387 }
388 }
389 }
390
391 // Delete payment
392 if ($user->socid == 0 && $action != 'presend') {
393 if ($user->hasRight('fournisseur', 'facture', 'supprimer')) {
394 if ($allow_delete) {
395 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
396 } else {
397 print dolGetButtonAction($title_button, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
398 }
399 }
400 }
401 print '</div>';
402
403 // Select mail models is same action as presend
404 if (GETPOST('modelselected')) {
405 $action = 'presend';
406 }
407
408 if ($action != 'presend') {
409 print '<div class="fichecenter"><div class="fichehalfleft">';
410
411 // Generated documents
412 include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_payment/modules_supplier_payment.php';
414 if (is_array($modellist)) {
415 $ref = dol_sanitizeFileName($object->ref);
416 $filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref);
417 $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
418 $genallowed = ($user->hasRight("fournisseur", "facture", "lire") || $user->hasRight("supplier_invoice", "lire"));
419 $delallowed = ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer"));
420 $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : getDolGlobalString('SUPPLIER_PAYMENT_ADDON_PDF'));
421 if (empty($modelpdf) && !empty($modellist)) {
422 $tmpkeys = array_keys($modellist);
423 $modelpdf = (string) $tmpkeys[0];
424 }
425 if (empty($modelpdf)) {
426 $modelpdf = 'standard_supplierpayment';
427 }
428
429 print $formfile->showdocuments('supplier_payment', $ref, $filedir, $urlsource, (int) $genallowed, (int) $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $object->thirdparty->default_lang);
430 $somethingshown = $formfile->numoffiles;
431 }
432
433 print '</div><div class="fichehalfright">';
434 //print '<br>';
435
436 // List of actions on element
437 /*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
438 $formactions=new FormActions($db);
439 $somethingshown = $formactions->showactions($object,'supplier_payment',$socid,1,'listaction'.($genallowed?'largetitle':''));
440 */
441
442 print '</div></div>';
443 }
444
445 // Ensure we have a PDF model to generate/attach the receipt on presend
446 if ($action == 'presend' && empty($object->model_pdf)) {
447 $defaultpdfmodel = getDolGlobalString('SUPPLIER_PAYMENT_ADDON_PDF');
448 if (!empty($defaultpdfmodel)) {
449 $object->model_pdf = $defaultpdfmodel;
450 } else {
451 include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_payment/modules_supplier_payment.php';
453 if (!empty($modellist)) {
454 $tmpkeys = array_keys($modellist);
455 $object->model_pdf = (string) $tmpkeys[0];
456 }
457 }
458 if (empty($object->model_pdf)) {
459 $object->model_pdf = 'standard_supplierpayment';
460 }
461 }
462
463 // Presend form
464 $modelmail = 'supplier_payment_send';
465 $defaulttopic = 'SendPaymentReceipt';
466 $diroutput = $conf->fournisseur->payment->dir_output;
467 $autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
468 $trackid = 'pre'.$object->id;
469
470 include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
471} else {
472 recordNotFound('', 0);
473}
474
475print dol_get_fiche_end();
476
477// End of page
478llxFooter();
479$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage suppliers invoices.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Class to manage payments for supplier invoices.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
recordNotFound($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Displays an error page when a record is not found.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
Definition html.lib.php:519
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition html.lib.php:717
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
Definition html.lib.php:172
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
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.