dolibarr  16.0.1
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) - 2013-2016 Jean-François FERRY <hello@librethic.io>
3  * Copyright (C) - 2019 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 if (!defined('NOREQUIREMENU')) {
26  define('NOREQUIREMENU', '1');
27 }
28 if (!defined('NOLOGIN')) {
29  define('NOLOGIN', '1'); // If this page is public (can be called outside logged session)
30 }
31 if (!defined('NOIPCHECK')) {
32  define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
33 }
34 if (!defined('NOBROWSERNOTIF')) {
35  define('NOBROWSERNOTIF', '1');
36 }
37 
38 // For MultiCompany module.
39 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
40 $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
41 if (is_numeric($entity)) {
42  define("DOLENTITY", $entity);
43 }
44 
45 require '../../main.inc.php';
46 require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
47 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
48 require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
49 require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
50 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
51 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
52 
53 // Load translation files required by the page
54 $langs->loadLangs(array('companies', 'other', 'ticket', 'errors'));
55 
56 // Get parameters
57 $track_id = GETPOST('track_id', 'alpha');
58 $action = GETPOST('action', 'aZ09');
59 
60 if (empty($conf->ticket->enabled)) {
61  accessforbidden('', 0, 0, 1);
62 }
63 
64 
65 /*
66  * View
67  */
68 
69 $form = new Form($db);
70 $formticket = new FormTicket($db);
71 
72 if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
73  print $langs->trans('TicketPublicInterfaceForbidden');
74  exit;
75 }
76 $arrayofjs = array();
77 $arrayofcss = array('/ticket/css/styles.css.php');
78 
79 llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
80 
81 print '<div class="ticketpublicarea">';
82 print '<p style="text-align: center">'.(!empty($conf->global->TICKET_PUBLIC_TEXT_HOME) ? $conf->global->TICKET_PUBLIC_TEXT_HOME : '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc")).'</span></p>';
83 print '<br>';
84 print '<div class="ticketform">';
85 print '<a href="create_ticket.php?action=create'.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_create bigrounded"><span class="fa fa-15 fa-plus-circle valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>';
86 print '<a href="list.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-15 fa-list-alt valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'</div></a>';
87 print '<a href="view.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded">'.img_picto('', 'ticket', 'class="fa-15"').'<br>'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>';
88 print '<div style="clear:both;"></div>';
89 print '</div>';
90 print '</div>';
91 
92 // End of page
93 htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object);
94 
95 llxFooter('', 'public');
96 
97 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
Definition: card.php:142
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
Class to manage generation of HTML components Only common components must be here.
llxHeaderTicket($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '')
Show header for public pages.
Definition: ticket.lib.php:206
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
llxFooter()
Empty footer.
Definition: wrapper.php:73