dolibarr 24.0.0-beta
home.tpl.php
1<!-- file home.tpl.php -->
2<?php
3/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
5 */
6// Protection to avoid direct call of template
7if (empty($context) || !is_object($context)) {
8 print "Error, template page can't be called as URL";
9 exit(1);
10}
11'@phan-var-force Context $context';
17?>
18
19<main class="container">
20 <div class="home-links-grid grid">
21 <?php
22 if (isModEnabled('propal') && getDolGlobalInt('WEBPORTAL_PROPAL_LIST_ACCESS')) : ?>
23 <article class="home-links-card --propal-list">
24 <div class="home-links-card__icon" ></div>
25 <?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('propallist') . '" title="' . $langs->trans('WebPortalPropalListDesc') . '">' . $langs->trans('WebPortalPropalListTitle') . '</a>'; ?>
26 </article>
27 <?php endif; ?>
28 <?php if (isModEnabled('order') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS')) : ?>
29 <article class="home-links-card --order-list">
30 <div class="home-links-card__icon" ></div>
31 <?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('orderlist') . '" title="' . $langs->trans('WebPortalOrderListDesc') . '">' . $langs->trans('WebPortalOrderListTitle') . '</a>'; ?>
32 </article>
33 <?php endif; ?>
34 <?php if (isModEnabled('invoice') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS')) : ?>
35 <article class="home-links-card --invoice-list">
36 <div class="home-links-card__icon" ></div>
37 <?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('invoicelist') . '" title="' . $langs->trans('WebPortalInvoiceListDesc') . '">' . $langs->trans('WebPortalInvoiceListTitle') . '</a>'; ?>
38 </article>
39 <?php endif; ?>
40 <?php if (isModEnabled('member') && in_array(getDolGlobalString('WEBPORTAL_MEMBER_CARD_ACCESS'), ['visible', 'edit']) && $context->logged_member && $context->logged_member->id > 0) : ?>
41 <article class="home-links-card --membercard">
42 <div class="home-links-card__icon" ></div>
43 <?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('membercard') . '" title="' . $langs->trans('WebPortalMemberCardMenu') . '">' . $langs->trans('WebPortalMemberCardMenu') . '</a>'; ?>
44 </article>
45 <?php endif; ?>
46 </div>
47</main>
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
$context
@method int call_trigger(string $triggerName, ?User $user)
Definition logout.php:42