view.ctp
12.1 KB
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
<?php
//use App\View\Helper\MyHelperHelper;
// Variables passees a la vue :
$configurationObj = $configurationObj;
//debug($configurationObj);
// Ces sections sont affichées ou cachées en cliquant dessus
// Ce comportement est géré par le javascript webroot/js/script.js
// qui contient une fonction pour chaque section (avec le nom "t_<nom de la section>")
// Ex pour la section "emprunts" : $('#t_emprunts').click(function()...
//function $this->MyHelper->echoSectionStart($title, $section) {
/*
function $this->MyHelper->echoSectionStart($title) {
//echo '<h3 id="t_'.$section.'" style="cursor: pointer;">';
//echo "<h3 id='t_$section' class='toggle' style='cursor: pointer;'>";
echo "<h3 id='t_$title' class='toggle' style='cursor: pointer;'>";
//echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_'.$section.'"></i>';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_'.$title.'"></i>';
echo '<span style="text-decoration: underline;">'.$title.'</span>';
echo '</h3>';
//echo '<div id="'.$section.'" style="margin-bottom: 20px;">';
echo '<div id="'.$title.'" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
}
function $this->MyHelper->echoSectionStop() {
echo '</table>';
echo '</div>';
}
*/
?>
<div class="configurations view">
<h2>Configuration générale de l'application</h2>
<?php
echo $this->Html->link(__('<i class="icon-pencil"></i> Editer la configuration'), [
'action' => 'edit',
//$configurationObj->id // inutile car vaut toujours 1
], [
'escape' => false,
'onclick' => 'return true;'
]);
echo '<br><br>';
//$this->MyHelper->echoSectionStart("Modes", "informations");
$this->MyHelper->echoSectionStart("Modes");
/*
echo '<h3 id="t_informations" style="cursor: pointer;">';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_informations"></i>';
echo '<span style="text-decoration: underline;">Modes</span>';
echo '</h3>';
echo '<div id="informations" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
*/
//$this->MyHelper->displayElement(__('Mode install'), $install);
//$this->MyHelper->displayElement(__('Mode install'), $configurationObj->mode_install==1?"Oui":"Non");
//MyHelperHelper::displayElement(__('Mode install'), $configurationObj->mode_install==1?"Oui":"Non");
$this->MyHelper->displayElement(__('Mode install'), $configurationObj->mode_install==1?"Oui":"Non");
//$this->MyHelper->displayElement(__('Mode debug'), $debug);
$this->MyHelper->displayElement(__('Mode debug'), $configurationObj->mode_debug==1?"Oui":"Non");
$this->MyHelper->echoSectionStop();
//$this->MyHelper->echoSectionStart("Laboratoire", "informations_admin");
$this->MyHelper->echoSectionStart("Laboratoire");
/*
echo '<h3 id="t_informations_admin" style="cursor: pointer;">';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_informations_admin"></i>';
echo '<span style="text-decoration: underline;">Laboratoire</span>';
echo '</h3>';
echo '<div id="informations_admin" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
*/
$this->MyHelper->displayElement(__('Nom complet du Labo'), h($configurationObj->labName));
$this->MyHelper->displayElement(__('Nom court du Labo'), h($configurationObj->labNameShort));
$this->MyHelper->displayElement(__('Liaison présentation nom du Labo'), h($configurationObj->labPresent));
$this->MyHelper->displayElement(__('UMR du Labo'), h($configurationObj->labUmr));
$this->MyHelper->echoSectionStop();
//$this->MyHelper->echoSectionStart("Divers", "suivis");
$this->MyHelper->echoSectionStart("Divers");
/*
echo '<h3 id="t_suivis" style="cursor: pointer;">';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_suivis"></i>';
echo '<span style="text-decoration: underline;">Divers</span>';
echo '</h3>';
echo '<div id="suivis" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
*/
$this->MyHelper->displayElement(__('Librairie pdf utilisée'), $configurationObj->pdf_engine);
$this->MyHelper->displayElement(__('Afficher la procédure à suivre sur l\'écran d\'accueil'), $configurationObj->procedure_sur_accueil?'Oui':'Non');
$this->MyHelper->displayElement(__('Imprimante disponible'), h($configurationObj->hasPrinter)?"Oui":"Non");
$this->MyHelper->displayElement(__('Numéro format étiquette'), h($configurationObj->label_format_num));
$this->MyHelper->displayElement(__('Seuil (prix) Matériel administratif'), h($configurationObj->prix_inventaire_administratif));
$this->MyHelper->displayElement(__('Taille max documents (octets)'), substr($configurationObj->taille_max_doc / (1024 * 1024), 0, 4) . ' Mo');
$this->MyHelper->displayElement(__('Numero labo sans année'), $configurationObj->numero_labo_sans_annee?'Oui':'Non');
$this->MyHelper->displayElement(__('Champ date commande facultatif'), $configurationObj->date_commande_facultative?'Oui':'Non');
$this->MyHelper->displayElement(__('Label groupe thématique'), h($configurationObj->nom_groupe_thematique));
$this->MyHelper->displayElement(__('Label groupe métier'), h($configurationObj->nom_groupe_metier));
$this->MyHelper->displayElement(__('Module métrologie'), $configurationObj->metrologie?'Oui':'Non');
$this->MyHelper->echoSectionStop();
//$this->MyHelper->echoSectionStart("Emails", "emprunts");
$this->MyHelper->echoSectionStart("Emails");
/*
echo '<h3 id="t_emprunts" style="cursor: pointer;">';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_emprunts"></i>';
echo '<span style="text-decoration: underline;">Emails</span>';
echo '</h3>';
echo '<div id="emprunts" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
*/
$this->MyHelper->displayElement(__("Attribut 'sender' (expéditeur)"), h($configurationObj->sender_mail));
$this->MyHelper->displayElement(__("Activer l'envoi 'général' des mails"), h($configurationObj->envoi_mail)?'Oui':'Non');
$this->MyHelper->displayElement(__("Activer l'envoi 'spécifique' des mails pour la liste ci-dessous"), h($configurationObj->envoi_mail_guests)?'Oui':'Non');
// (EP202009) non mais, faudrait arrêter d'être fainénant aussi...
for ($i=1 ; $i<=10; $i++) {
$dest = "emailGuest$i";
$this->MyHelper->displayElement( __("Destinataire $i"), h($configurationObj->$dest) );
}
/*
$this->MyHelper->displayElement(__('Mail guest 1'), h($configurationObj->emailGuest1));
$this->MyHelper->displayElement(__('Mail guest 2'), h($configurationObj->emailGuest2));
$this->MyHelper->displayElement(__('Mail guest 3'), h($configurationObj->emailGuest3));
$this->MyHelper->displayElement(__('Mail guest 4'), h($configurationObj->emailGuest4));
$this->MyHelper->displayElement(__('Mail guest 5'), h($configurationObj->emailGuest5));
$this->MyHelper->displayElement(__('Mail guest 6'), h($configurationObj->emailGuest6));
$this->MyHelper->displayElement(__('Mail guest 7'), h($configurationObj->emailGuest7));
$this->MyHelper->displayElement(__('Mail guest 8'), h($configurationObj->emailGuest8));
$this->MyHelper->displayElement(__('Mail guest 9'), h($configurationObj->emailGuest9));
$this->MyHelper->displayElement(__('Mail guest 10'), h($configurationObj->emailGuest10));
*/
$this->MyHelper->echoSectionStop();
/*
*********
* LDAP
********
*/
//if ($configuration->use_ldap) :
//$this->MyHelper->echoSectionStart("LDAP", "fichiers");
$this->MyHelper->echoSectionStart("LDAP");
/*
echo '<h3 id="t_fichiers" style="cursor: pointer;">';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_fichiers"></i>';
echo '<span style="text-decoration: underline;">LDAP</span>';
echo '</h3>';
echo '<div id="fichiers" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
*/
$this->MyHelper->displayElement(__('Utilisation du LDAP'), h($configurationObj->ldap_used?"Oui":"Non"));
$this->MyHelper->displayElement(__('Host'), h($configurationObj->ldap_host));
$this->MyHelper->displayElement(__('Port'), h($configurationObj->ldap_port));
$this->MyHelper->displayElement(__('Type d\'authentification du LDAP'), h($configurationObj->ldap_authenticationType));
$this->MyHelper->displayElement(__('Base DN du LDAP'), h($configurationObj->ldap_baseDn));
$this->MyHelper->displayElement(__('Filtre du LDAP'), h($configurationObj->ldap_filter));
$this->MyHelper->displayElement(__('LDAP authentifié (non anonyme)'), h($configurationObj->ldap_authentified)?"Oui":"Non" );
$this->MyHelper->displayElement(__('Bind du LDAP'), h($configurationObj->ldap_bindDn));
// Inutile d'afficher le pass
//$this->MyHelper->displayElement(__('Password Bind du LDAP'), h($configurationObj->ldap_bindPass));
$this->MyHelper->echoSectionStop();
/*
*********
* OPTIMISATION LISTE UTILISATEURS
********
*/
$this->MyHelper->echoSectionStart("Optimisation");
/* LDAP optimisation */
if (is_null($configurationObj->ldap_cache_last_update)) $ldap_cache_elapsed_time = '';
else {
$date_now = date("Y-m-d H:i:s");
$date_now = new \DateTime($date_now);
$date_cached = $configurationObj->ldap_cache_last_update;
/* bugfixing $date_cached pour Inventirap (IRAP) (php5 ou vieux mysql ou pb de config ???) :
* Inventirap affiche l'année sur 2 chiffres : 'cached :05/06/19 15:36'
* Ma version perso affiche l'année sur 4 chiffres : 'cached :05/06/2019 15:36'
* => Il faut donc remettre l'année sur 4 chiffres si besoin
*/
if ( strpos($date_cached,'/')!==FALSE ) {
$year = substr(strrchr($date_cached, '/'), 0,4); // '/19 ' ou '/201'
if (substr($year,-1) == ' ')
//$year = '20'.substr($y,1,2); // '2019'
$date_cached = substr($date_cached,0,6)."20".substr($year,1,2).substr($date_cached,8); // '05/06/19 15:36';
}
$date_cached = \DateTime::createFromFormat('d/m/Y H:i',$date_cached);
//$ldap_cache_elapsed_time = $date_now->diff($date_cached)->format('%i mn %s sec');
//$ldap_cache_elapsed_time = $date_now->diff($date_cached)->format('%hh %imn %ssec');
$ldap_cache_elapsed_time = $date_now->diff($date_cached)->format('%d jour(s) %hh %imn %ss');
}
$this->MyHelper->displayElement(__('Optimisation liste utilisateurs (utilisation Cache en BD)'), h($configurationObj->ldap_cached)?"Oui":"Non" );
$this->MyHelper->displayElement(__('Durée validité cache (mn)'), h($configurationObj->ldap_cache_validity_duration));
$this->MyHelper->displayElement(__('Date dernière mise à jour cache (UTC)'), h($configurationObj->ldap_cache_last_update));
$this->MyHelper->displayElement(__('Temps écoulé depuis dernière mise à jour'), $ldap_cache_elapsed_time);
$this->MyHelper->echoSectionStop();
//$this->MyHelper->echoSectionStart("Affichage", "affichage");
$this->MyHelper->echoSectionStart("Affichage");
/*
echo '<h3 id="t_emprunts" style="cursor: pointer;">';
echo '<i class="icon-chevron-down" style="font-size: 14px;" id="i_emprunts"></i>';
echo '<span style="text-decoration: underline;">Affichage</span>';
echo '</h3>';
echo '<div id="emprunts" style="margin-bottom: 20px;">';
echo '<table>';
echo '<tr><th style="width: 250px;"></th><th></th></tr>';
*/
$this->MyHelper->displayElement(__('Nombre de matériels affichés par défaut (pagination)'), h($configurationObj->aff_par_defaut));
$this->MyHelper->echoSectionStop();
?>
</div>
<script type="text/javascript"> toggle_all_sections(); </script>
<!--
<div class="actions">
<php
echo $this->element('menu')?>
</div>
-->