Commit 1f42188e39faa419bf05af2c4967d3fa1daa69e3
1 parent
8b121bd7
Exists in
master
and in
3 other branches
Version: 2.4.4.4
!!! Exécuter les lignes suivantes (à la racine) : cp -p config/app.php ../config/app.php.ORIG cp config/app.default.php ../config/app.php Puis completez app.php (datasources => default & test (username, password, database)) avec app.php.ORIG !!! Qrcode (url) + modele script update bd & cache + script copie app.php Demande (terminé) : https://projects.irap.omp.eu/issues/3841 Demande (en cours) : https://projects.irap.omp.eu/issues/3843 Version majeure en cours (2.4): https://projects.irap.omp.eu/versions/107 ROADMAP: https://projects.irap.omp.eu/projects/labinvent/roadmap
Showing
12 changed files
with
98 additions
and
30 deletions
Show diff stats
README-LABINVENT.md
... | ... | @@ -50,10 +50,23 @@ Logiciel testé et validé sur les configurations suivantes : |
50 | 50 | |
51 | 51 | VERSION ACTUELLE |
52 | 52 | |
53 | -Date: 16/06/2016 | |
54 | -Version: 2.4.4.3 | |
53 | +Date: 17/06/2016 | |
54 | +Version: 2.4.4.4 | |
55 | 55 | |
56 | -Demande (en terminé) : bugfixes users (mail et login auto) | |
56 | +!!! | |
57 | +Exécuter les lignes suivantes (à la racine) : | |
58 | +cp -p config/app.php ../config/app.php.ORIG | |
59 | +cp config/app.default.php ../config/app.php | |
60 | + | |
61 | +Puis completez app.php (datasources => default & test (username, password, database)) avec app.php.ORIG | |
62 | +!!! | |
63 | + | |
64 | +Qrcode (url) + modele script update bd & cache + script copie app.php | |
65 | + | |
66 | +Demande (terminé) : https://projects.irap.omp.eu/issues/3841 | |
67 | + | |
68 | +Demande (en cours) : https://projects.irap.omp.eu/issues/3843 | |
69 | + | |
57 | 70 | |
58 | 71 | Version majeure en cours (2.4): https://projects.irap.omp.eu/versions/107 |
59 | 72 | |
... | ... | @@ -89,7 +102,11 @@ Liste complète des évolutions: https://gitlab.irap.omp.eu/epallier/labinvent/c |
89 | 102 | |
90 | 103 | MODIFICATIONS STRUCTURELLES A FAIRE MANUELLEMENT APRES LA MISE A JOUR (git pull) |
91 | 104 | |
92 | -Note: après chaque mise à jour de la BD, il faut repasser l'application en mode debug = true (au début du fichier config/app.php) pour mettre à jour le cache (puis repasser ensuite en mode debug = false) | |
105 | +17/06/16 (v2.4.4.4) (Exceptionnel) Exécuter les lignes suivantes (à la racine) : | |
106 | + cp -p config/app.php ../config/app.php.ORIG | |
107 | + cp config/app.default.php ../config/app.php | |
108 | + Puis completez app.php (datasources => default & test (username, password, database)) avec app.php.ORIG | |
109 | + | |
93 | 110 | |
94 | 111 | 15/06/16 (v2.4.4.0) Adapter la BD en exécutant le script sql database/update/db-update-2016-06-15.sql |
95 | 112 | ... | ... |
config/app.default.php
... | ... | @@ -240,9 +240,9 @@ return [ |
240 | 240 | * the following line and set the port accordingly |
241 | 241 | */ |
242 | 242 | //'port' => 'non_standard_port_number', |
243 | - 'username' => 'username', | |
244 | - 'password' => 'password', | |
245 | - 'database' => 'database', | |
243 | + /*d*/'username' => 'username', | |
244 | + /*d*/'password' => 'password', | |
245 | + /*d*/'database' => 'database', | |
246 | 246 | 'encoding' => 'utf8', |
247 | 247 | 'timezone' => 'UTC', |
248 | 248 | 'flags' => [], |
... | ... | @@ -280,9 +280,9 @@ return [ |
280 | 280 | 'persistent' => false, |
281 | 281 | 'host' => 'localhost', |
282 | 282 | //'port' => 'non_standard_port_number', |
283 | - 'username' => 'test_username', | |
284 | - 'password' => 'test_password', | |
285 | - 'database' => 'test_database', | |
283 | + /*t*/'username' => 'test_username', | |
284 | + /*t*/'password' => 'test_password', | |
285 | + /*t*/'database' => 'test_database', | |
286 | 286 | 'encoding' => 'utf8', |
287 | 287 | 'timezone' => 'UTC', |
288 | 288 | 'cacheMetadata' => true, | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +username=$(grep "/\*d\*/'username'" ../../config/app.php.ORIG | cut -d"'" -f4) | |
4 | +password=$(grep "/\*d\*/'password'" ../../config/app.php.ORIG | cut -d"'" -f4) | |
5 | +database=$(grep "/\*d\*/'database'" ../../config/app.php.ORIG | cut -d"'" -f4) | |
6 | + | |
7 | +mysql --user=$username --password=$password -h $database < ./db-update-xxxx-xx-xx.sql | |
8 | + | |
9 | +rm ../../tmp/cache/models/* | |
10 | +rm ../../tmp/cache/persistent/* | ... | ... |
... | ... | @@ -0,0 +1,23 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +cp -p ../config/app.php ../config/app.php.ORIG | |
4 | +cp ../config/app.default.php ../config/app.php | |
5 | + | |
6 | +username=$(grep "/\*d\*/'username'" ../config/app.php.ORIG | cut -d"'" -f4) | |
7 | +password=$(grep "/\*d\*/'password'" ../config/app.php.ORIG | cut -d"'" -f4) | |
8 | +database=$(grep "/\*d\*/'database'" ../config/app.php.ORIG | cut -d"'" -f4) | |
9 | + | |
10 | +usernameTEST=$(grep "/\*t\*/'username'" ../config/app.php.ORIG | cut -d"'" -f4) | |
11 | +passwordTEST=$(grep "/\*t\*/'password'" ../config/app.php.ORIG | cut -d"'" -f4) | |
12 | +databaseTEST=$(grep "/\*t\*/'database'" ../config/app.php.ORIG | cut -d"'" -f4) | |
13 | + | |
14 | +sed -e "s/'database' => 'database'/'database' => '$database'/" -i ../config/app.php | |
15 | +sed -e "s/'username' => 'username'/'username' => '$username'/" -i ../config/app.php | |
16 | +sed -e "s/'password' => 'password'/'password' => '$password'/" -i ../config/app.php | |
17 | + | |
18 | +sed -e "s/'database' => 'test_database'/'database' => '$databaseTEST'/" -i ../config/app.php | |
19 | +sed -e "s/'username' => 'test_username'/'username' => '$usernameTEST'/" -i ../config/app.php | |
20 | +sed -e "s/'password' => 'test_password'/'password' => '$passwordTEST'/" -i ../config/app.php | |
21 | + | |
22 | +sed -e "s/'debug' => filter_var(env('DEBUG', true/'debug' => filter_var(env('DEBUG', false/" -i ../config/app.php | |
23 | + | ... | ... |
src/Controller/MaterielsController.php
... | ... | @@ -219,7 +219,13 @@ class MaterielsController extends AppController |
219 | 219 | $organismes = $this->Materiels->Organismes->find('list', [ 'keyField' => 'id', 'valueField' => 'nom', 'order' => 'Organismes.nom']); |
220 | 220 | $sites = $this->Materiels->Sites->find('list', [ 'keyField' => 'id', 'valueField' => 'nom', 'order' => 'Sites.nom']); |
221 | 221 | |
222 | - $utilisateurs = TableRegistry::get('LdapConnections')->getListUsers(); | |
222 | + $users = TableRegistry::get('LdapConnections')->getListUsers(); | |
223 | + //tri des utilisateurs par nom | |
224 | + sort($users); | |
225 | + $utilisateurs = []; | |
226 | + for($i = 0; $i < sizeof($users); $i++) { | |
227 | + $utilisateurs[$users[$i]] = $users[$i]; | |
228 | + } | |
223 | 229 | |
224 | 230 | $mail_responsable = TableRegistry::get('Users')->find()->select('email')->where(['username =' => $this->LdapAuth->user($this->request->session()->read('authType'))[0]])->first()['email']; |
225 | 231 | |
... | ... | @@ -263,7 +269,13 @@ class MaterielsController extends AppController |
263 | 269 | $organismes = $this->Materiels->Organismes->find('list', [ 'keyField' => 'id', 'valueField' => 'nom', 'order' => 'Organismes.nom']); |
264 | 270 | $sites = $this->Materiels->Sites->find('list', [ 'keyField' => 'id', 'valueField' => 'nom', 'order' => 'Sites.nom']); |
265 | 271 | |
266 | - $utilisateurs = TableRegistry::get('LdapConnections')->getListUsers(); | |
272 | + $users = TableRegistry::get('LdapConnections')->getListUsers(); | |
273 | + //tri des utilisateurs par nom | |
274 | + sort($users); | |
275 | + $utilisateurs = []; | |
276 | + for($i = 0; $i < sizeof($users); $i++) { | |
277 | + $utilisateurs[$users[$i]] = $users[$i]; | |
278 | + } | |
267 | 279 | |
268 | 280 | if(!empty($materiel->get('nom_responsable'))){ |
269 | 281 | if(!in_array($materiel->get('nom_responsable'), $utilisateurs)){ | ... | ... |
src/Controller/QrCodesController.php
... | ... | @@ -7,16 +7,21 @@ use QRcode; |
7 | 7 | class QrCodesController extends AppController |
8 | 8 | { |
9 | 9 | |
10 | - public function creer($message) { | |
10 | + public function creer($message = null) { | |
11 | 11 | |
12 | 12 | $fileName = $this->request->session()->id().'.png'; |
13 | 13 | $cakephpPath = str_replace('webroot/index.php', '', $_SERVER['SCRIPT_FILENAME']); |
14 | 14 | $qrCodePath = $cakephpPath . 'webroot/img/qrcodes/' . $fileName; |
15 | 15 | |
16 | - | |
17 | 16 | $this->request->session()->write('filename', $fileName); |
18 | 17 | $this->request->session()->write('qrCodePath', $qrCodePath); |
19 | - return QRcode::png($message, $qrCodePath); | |
18 | + | |
19 | + if($message == null) { | |
20 | + return QRcode::png($this->request->session()->read('qrUrl'), $qrCodePath); | |
21 | + } else { | |
22 | + return QRcode::png($message, $qrCodePath); | |
23 | + } | |
24 | + | |
20 | 25 | } |
21 | 26 | |
22 | 27 | } |
23 | 28 | \ No newline at end of file | ... | ... |
src/Controller/UsersController.php
... | ... | @@ -127,7 +127,13 @@ class UsersController extends AppController |
127 | 127 | $groupesMetiers = $this->Users->GroupesMetiers->find('list', [ 'keyField' => 'id', 'valueField' => 'nom']); |
128 | 128 | $groupesThematiques = $this->Users->GroupesThematiques->find('list', [ 'keyField' => 'id', 'valueField' => 'nom']); |
129 | 129 | |
130 | - $utilisateurs = TableRegistry::get('LdapConnections')->getListUsers(); | |
130 | + $users = TableRegistry::get('LdapConnections')->getListUsers(); | |
131 | + //tri des utilisateurs par nom | |
132 | + sort($users); | |
133 | + $utilisateurs = []; | |
134 | + for($i = 0; $i < sizeof($users); $i++) { | |
135 | + $utilisateurs[$users[$i]] = $users[$i]; | |
136 | + } | |
131 | 137 | |
132 | 138 | $this->set(compact('user', 'groupesMetiers', 'utilisateurs', 'groupesThematiques')); |
133 | 139 | $this->set('_serialize', ['user']); | ... | ... |
src/Model/Table/LdapConnectionsTable.php
... | ... | @@ -188,15 +188,7 @@ class LdapConnectionsTable extends AppTable { |
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | - //tri des utilisateurs par nom | |
192 | - sort($utilisateurs); | |
193 | - | |
194 | - $users = []; | |
195 | - for($i = 0; $i < sizeof($utilisateurs); $i++) { | |
196 | - $users[$utilisateurs[$i]] = $utilisateurs[$i]; | |
197 | - } | |
198 | - | |
199 | - return $users; | |
191 | + return $utilisateurs; | |
200 | 192 | } |
201 | 193 | |
202 | 194 | /** | ... | ... |
src/Template/Documents/fiche_materiel.ctp
... | ... | @@ -7,7 +7,7 @@ $this->layout = 'pdf_print'; |
7 | 7 | // Nouvelle page de document |
8 | 8 | $fpdf->AddPage(); |
9 | 9 | |
10 | -$this->requestAction('/QrCodes/creer/'.$materiel->numero_laboratoire); | |
10 | +$this->requestAction('/QrCodes/creer/'); | |
11 | 11 | $qrCode=$this->request->session()->read("qrCodePath"); |
12 | 12 | $fpdf->Image($qrCode,180,10,-100); |
13 | 13 | ... | ... |
src/Template/Layout/default.ctp
... | ... | @@ -94,7 +94,7 @@ $cakeDescription = 'Labinvent 2.0'; |
94 | 94 | </i></td> |
95 | 95 | <td id="version"> |
96 | 96 | <!-- VERSION M.m.f.b (version (M)ajeure, version (m)ineure, numero de nouvelle (f)onctionnalite, numero de (b)ugfix) --> |
97 | - <font color="black">VERSION 2.4.4.3 (16/06/2016)</font> | |
97 | + <font color="black">VERSION 2.4.4.4 (17/06/2016)</font> | |
98 | 98 | </td> |
99 | 99 | </tr> |
100 | 100 | </table> | ... | ... |
src/Template/Materiels/view.ctp
... | ... | @@ -9,12 +9,14 @@ |
9 | 9 | <?php if (h($materiel->status) == 'ARCHIVED') echo ' (Archivé)'; ?> |
10 | 10 | </span> |
11 | 11 | <?php |
12 | + //Url transformé en QrCode | |
13 | + $this->request->session()->write("qrUrl", $this->request->env('SERVER_NAME').$this->request->env('REQUEST_URI')); | |
12 | 14 | |
13 | - $this->requestAction('/QrCodes/creer/'.$materiel->numero_laboratoire); | |
15 | + $this->requestAction('/QrCodes/creer/'); | |
14 | 16 | echo $this->Html->image('qrcodes/'.$this->request->session()->read("filename"), [ |
15 | 17 | 'alt' => 'QrCode : '.$materiel->numero_laboratoire, |
16 | 18 | 'style' => 'float: right']); |
17 | - | |
19 | + | |
18 | 20 | ?> |
19 | 21 | </h2> |
20 | 22 | |
... | ... | @@ -126,7 +128,7 @@ |
126 | 128 | |
127 | 129 | echo $this->Html->link('<i class="icon-file"></i> Fiche matériel', |
128 | 130 | ['controller' => 'documents', 'action' => 'ficheMateriel', $materiel->numero_laboratoire], |
129 | - ['title' => 'Voir la fichedu materiel', 'style' => 'margin-right: 10px', 'escape' => false]); | |
131 | + ['title' => 'Voir la fiche du materiel', 'style' => 'margin-right: 10px', 'escape' => false]); | |
130 | 132 | |
131 | 133 | // BOUTON ETIQUETTE POSEE |
132 | 134 | if ($configuration->hasPrinter && in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) { | ... | ... |