forked from Evarisk/Digirisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdigiriskdolibarrindex.php
250 lines (226 loc) · 10.9 KB
/
digiriskdolibarrindex.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?php
/* Copyright (C) 2021 EOXIA <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file digiriskdolibarrindex.php
* \ingroup digiriskdolibarr
* \brief Home page of digiriskdolibarr top menu
*/
// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if ( ! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
if ( ! $res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
if ( ! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
// Try main.inc.php using relative path
if ( ! $res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
if ( ! $res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
if ( ! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/modules/project/mod_project_simple.php';
require_once './core/modules/modDigiriskDolibarr.class.php';
global $user, $langs, $conf, $db;
// Load translation files required by the page
$langs->loadLangs(array("digiriskdolibarr@digiriskdolibarr"));
// Initialize technical objects
$digirisk = new modDigiriskdolibarr($db);
$project = new Project($db);
$third_party = new Societe($db);
$projectRef = new $conf->global->PROJECT_ADDON();
// Security check
if ( ! $user->rights->digiriskdolibarr->lire) accessforbidden();
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$value = GETPOST('value', 'alpha');
$error = 0;
require_once './core/tpl/digiriskdolibarr_projectcreation_action.tpl.php';
/*
* View
*/
$help_url = 'FR:Module_DigiriskDolibarr';
$morejs = array("/digiriskdolibarr/js/tiny-slider.min.js", "/digiriskdolibarr/js/digiriskdolibarr.js.php");
$morecss = array("/digiriskdolibarr/css/tiny-slider.min.css", "/digiriskdolibarr/css/digiriskdolibarr.css");
llxHeader("", $langs->trans("DigiriskDolibarrArea") . ' ' . $digirisk->version, $help_url, '', '', '', $morejs, $morecss);
print load_fiche_titre($langs->trans("DigiriskDolibarrArea") . ' ' . $digirisk->version, '', 'digiriskdolibarr32px.png@digiriskdolibarr');
?>
<?php if ($conf->global->DIGIRISKDOLIBARR_VERSION < $digirisk->version) : ?>
<div class="wpeo-notice notice-warning">
<div class="notice-content">
<div class="notice-subtitle"><?php echo $langs->trans("WarningDigiriskNotUpdated"); ?>
<a href="<?php echo DOL_URL_ROOT . '/admin/modules.php?mainmenu=home'?>" target="_blank"><?php echo DOL_URL_ROOT . '/admin/modules.php?mainmenu=home'?></a>
</div>
</div>
</div>
<?php endif; ?>
<div class="wpeo-notice notice-info">
<div class="notice-content">
<div class="notice-subtitle"><?php echo $langs->trans("DigiriskIndexNotice1"); ?></div>
</div>
</div>
<div class="wpeo-carousel">
<div class="slide-element bloc-1">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2><?php echo $langs->trans("PresentationSlide1Content1"); ?></h2>
<p><a href="https://www.legifrance.gouv.fr/affichTexte.do?cidTexte=JORFTEXT000000408526&categorieLien=id" class="center" target="_blank"><?php echo $langs->trans("PresentationSlide1Content2"); ?></a></p>
<p class="light oversize center"><?php echo $langs->trans("PresentationSlide1Content3"); ?></p>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-1.jpg'?>" alt="01" />
</div>
</div>
</div>
<div class="slide-element bloc-2">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2><?php echo $langs->trans("PresentationSlide2Content1"); ?></h2>
<p><?php echo $langs->trans("PresentationSlide2Content2"); ?></p>
<p><?php echo $langs->trans("PresentationSlide2Content3"); ?></p>
<p><?php echo $langs->trans("PresentationSlide2Content4"); ?></p>
<p><?php echo $langs->trans("PresentationSlide2Content5"); ?></p>
<ul>
<li><a href="http://www.inrs.fr/media.html?refINRS=ED%20887" target="_blank"><?php echo $langs->trans("PresentationSlide2Content6"); ?></a></li>
<li><a href="http://travail-emploi.gouv.fr/publications/picts/bo/05062002/A0100004.htm" target="_blank"><?php echo $langs->trans("PresentationSlide2Content7"); ?></a></li>
</ul>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-2.jpg'?>" alt="02" />
</div>
</div>
</div>
<div class="slide-element bloc-3">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2 class="center"><?php echo $langs->trans("PresentationSlide3Content1"); ?></h2>
<p class="center"><a href="http://www.larousse.fr/dictionnaires/francais/risque/69557#8VAKqHCtvXCADLK3.99" target="_blank"><?php echo $langs->trans("PresentationSlide3Content2"); ?></a></p>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-3.jpg'?>" alt="03" />
</div>
</div>
</div>
<div class="slide-element bloc-4">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h3><?php echo $langs->trans("PresentationSlide4Content1"); ?></h3>
<p><?php echo $langs->trans("PresentationSlide4Content2"); ?></p>
<h3><?php echo $langs->trans("PresentationSlide4Content3"); ?></h3>
<p><?php echo $langs->trans("PresentationSlide4Content4"); ?></p>
<h2 class="center"><?php echo $langs->trans("PresentationSlide4Content5"); ?></h2>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-4.jpg'?>" alt="04" />
</div>
</div>
</div>
<div class="slide-element bloc-5">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2><?php echo $langs->trans("PresentationSlide5Content1"); ?></h2>
<p><?php echo $langs->trans("PresentationSlide5Content2"); ?></p>
<ul>
<li><?php echo $langs->trans("PresentationSlide5Content3"); ?></li>
<li><?php echo $langs->trans("PresentationSlide5Content4"); ?></li>
<li><?php echo $langs->trans("PresentationSlide5Content5"); ?></li>
</ul>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-5.jpg'?>" alt="05" />
</div>
</div>
</div>
<div class="slide-element bloc-6">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2><?php echo $langs->trans("PresentationSlide6Content1"); ?></h2>
<p><?php echo $langs->trans("PresentationSlide6Content2"); ?></p>
<h3><?php echo $langs->trans("PresentationSlide6Content3"); ?></h3>
<p><?php echo $langs->trans("PresentationSlide6Content4"); ?></p>
<ul>
<li><?php echo $langs->trans("PresentationSlide6Content5"); ?></li>
<li><?php echo $langs->trans("PresentationSlide6Content6"); ?></li>
<li><?php echo $langs->trans("PresentationSlide6Content7"); ?></li>
<li><?php echo $langs->trans("PresentationSlide6Content8"); ?></li>
<li><?php echo $langs->trans("PresentationSlide6Content9"); ?></li>
</ul>
<p><?php echo $langs->trans("PresentationSlide6Content10"); ?></p>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-6.jpg'?>" alt="06" />
</div>
</div>
</div>
<div class="slide-element bloc-7">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2>
<?php echo $langs->trans("PresentationSlide7Content1"); ?> <a href="http://www.inrs.fr/media.html?refINRS=ED%20840" target="_blank"><?php echo $langs->trans("PresentationSlide7Content2"); ?></a>
</h2>
<p><?php echo $langs->trans("PresentationSlide7Content3"); ?></p>
<ul>
<li><?php echo $langs->trans("PresentationSlide7Content4"); ?></li>
<li><?php echo $langs->trans("PresentationSlide7Content5"); ?></li>
<li><?php echo $langs->trans("PresentationSlide7Content6"); ?></li>
</ul>
<p><?php echo $langs->trans("PresentationSlide7Content7"); ?></p>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-7.jpg'?>" alt="07" />
</div>
</div>
</div>
<div class="slide-element bloc-8">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2><?php echo $langs->trans("PresentationSlide8Content1"); ?></h2>
<ul>
<li><?php echo $langs->trans("PresentationSlide8Content2"); ?></li>
<li><?php echo $langs->trans("PresentationSlide8Content3"); ?></li>
</ul>
<p><a href="http://www.inrs.fr/media.html?refINRS=outil10" target="_blank"><?php echo $langs->trans("PresentationSlide8Content4"); ?></a></p>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-8.jpg'?>" alt="08" />
</div>
</div>
</div>
<div class="slide-element bloc-9">
<div class="wpeo-gridlayout grid-gap-0 padding grid-2">
<div class="content">
<h2><?php echo $langs->trans("PresentationSlide9Content1"); ?></h2>
<p><?php echo $langs->trans("PresentationSlide9Content2"); ?></p>
<ul>
<li><a href="https://fr.libreoffice.org/" target="_blank"><?php echo $langs->trans("PresentationSlide9Content3"); ?></a> <?php echo $langs->trans("PresentationSlide9Content4"); ?></li>
<li><a href="https://www.service-public.fr/professionnels-entreprises/vosdroits/F23106" target="_blank"><?php echo $langs->trans("PresentationSlide9Content5"); ?></a></li>
</ul>
</div>
<div>
<img src="<?php echo DOL_URL_ROOT . '/custom/digiriskdolibarr/img/install/slide-9.jpg'?>" alt="09" />
</div>
</div>
</div>
</div>
<?php
// End of page
llxFooter();
$db->close();