dolibarr  19.0.0-dev
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
4  * Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
26 // Load Dolibarr environment
27 require '../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
29 require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
30 
31 // Load translation files required by the page
32 $langs->load("opensurvey");
33 
34 // Security check
35 if (empty($user->rights->opensurvey->read)) {
37 }
38 
39 $hookmanager = new HookManager($db);
40 
41 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
42 $hookmanager->initHooks(array('opensurveyindex'));
43 
44 
45 /*
46  * View
47  */
48 
49 $nbsondages = 0;
50 $sql = 'SELECT COUNT(*) as nb';
51 $sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
52 $sql .= ' WHERE entity IN ('.getEntity('survey').')';
53 $resql = $db->query($sql);
54 if ($resql) {
55  $obj = $db->fetch_object($resql);
56  $nbsondages = $obj->nb;
57 } else {
58  dol_print_error($db, '');
59 }
60 
61 
62 $title = $langs->trans("OpenSurveyArea");
63 llxHeader('', $title);
64 
65 print load_fiche_titre($title, '', 'poll');
66 
67 
68 print '<div class="fichecenter"><div class="fichethirdleft">';
69 
70 print '<div class="div-table-responsive-no-min">';
71 print '<table class="noborder centpercent">';
72 print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
73 print '<tr class="oddeven">';
74 print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
75 print "</tr>";
76 //print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
77 //print $total;
78 //print '</td></tr>';
79 print '</table>';
80 print '</div>';
81 
82 print '</div></div>';
83 
84 $parameters = array('user' => $user);
85 $reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
86 
87 // End of page
88 llxFooter();
89 $db->close();
Class to manage hooks.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
llxFooter()
Footer empty.
Definition: index.php:71
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.