Commit 450a51a5d3250ce8d158ee89d8edc3333ea29ee9

Authored by Etienne Pallier
1 parent d7a08925
Exists in master and in 1 other branch dev

bugfix (en cours) pour PHP 5 !!!!!!!!!!!!!!!!!

src/Controller/MaterielsController.php
@@ -1595,6 +1595,27 @@ class MaterielsController extends AppController { @@ -1595,6 +1595,27 @@ class MaterielsController extends AppController {
1595 $materiel = $this->Materiels->patchEntity($materiel, $this->request->getData()); 1595 $materiel = $this->Materiels->patchEntity($materiel, $this->request->getData());
1596 //debug($materiel); exit; 1596 //debug($materiel); exit;
1597 1597
  1598 + // AVIRER
  1599 + // BUGFIX temporaire pour php5 !!!
  1600 + if ($this->isLabinventDebugMode()) {
  1601 + $d2 = $materiel->date_reception;
  1602 + $d1 = $materiel->date_acquisition;
  1603 + $tz = new \DateTimeZone('Europe/Paris');
  1604 + $d1 = new \DateTime(strtr($d1,'/','-'),$tz);
  1605 + $d2 = new \DateTime(strtr($d2,'/','-'),$tz);
  1606 + debug("d1 achat:"); debug($d1);
  1607 + debug("d2 recep:"); debug($d2);
  1608 + if ($d2 < $d1) debug("d2 < d1 !!!");
  1609 + // $d2 > $d1 oui mais pas trop...
  1610 + $diff = $d2->diff($d1);
  1611 + //debug($diff->y);
  1612 + debug("diff:"); debug($diff);
  1613 + debug("diff->y:"); debug($diff->y);
  1614 + debug("diff->days:"); debug($diff->days);
  1615 + exit;
  1616 + }
  1617 + // FIN BUGFIX
  1618 +
1598 // ADD : Set the user_id from the session. 1619 // ADD : Set the user_id from the session.
1599 //$materiel->user_id = $this->Auth->user('id'); 1620 //$materiel->user_id = $this->Auth->user('id');
1600 // EDIT : Added: Disable modification of user_id. 1621 // EDIT : Added: Disable modification of user_id.
src/Template/Projets/view.ctp
@@ -6,7 +6,12 @@ @@ -6,7 +6,12 @@
6 $projet = $projet; 6 $projet = $projet;
7 //debug($projet); 7 //debug($projet);
8 ?> 8 ?>
9 -<?= $this->Html->link(__('Edit Projet'), ['action' => 'edit', $projet->id]) ?> </li> 9 +
  10 +<?= $this->Html->link("Voir tous les projets (liste)", ['action'=>'index']) ?>
  11 +<br />
  12 +<br />
  13 +
  14 +<?= $this->Html->link(__('Editer Projet'), ['action' => 'edit', $projet->id]) ?> </li>
10 <!-- 15 <!--
11 <nav class="large-3 medium-4 columns" id="actions-sidebar"> 16 <nav class="large-3 medium-4 columns" id="actions-sidebar">
12 <ul class="side-nav"> 17 <ul class="side-nav">