summaryrefslogtreecommitdiff
path: root/generator/after-bake/src/Controller/ServicesController.php
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2016-06-12 17:59:50 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2016-06-12 17:59:50 +0200
commit524c912d70cf0e33b1d4441081e36ead774d97dc (patch)
treed42b7aa17588c8ee80843a34432db03408decba4 /generator/after-bake/src/Controller/ServicesController.php
parent61256d532e8a0155aaa9c28977f542823073e4ec (diff)
downloadchd_gestion-524c912d70cf0e33b1d4441081e36ead774d97dc.zip
chd_gestion-524c912d70cf0e33b1d4441081e36ead774d97dc.tar.gz
chd_gestion-524c912d70cf0e33b1d4441081e36ead774d97dc.tar.bz2
Adherent/view : allow service termination if ServiceStatut is "Prévu"
Diffstat (limited to 'generator/after-bake/src/Controller/ServicesController.php')
-rw-r--r--generator/after-bake/src/Controller/ServicesController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/generator/after-bake/src/Controller/ServicesController.php b/generator/after-bake/src/Controller/ServicesController.php
index 57f9e5d..616385a 100644
--- a/generator/after-bake/src/Controller/ServicesController.php
+++ b/generator/after-bake/src/Controller/ServicesController.php
@@ -285,7 +285,7 @@ class ServicesController extends AppController
$this->Flash->error(__('The service could not be saved. Please, try again.'));
}
} else {
- $this->Flash->error(__('Can\'t terminate the service. Bad service state.'));
+ $this->Flash->error(__('Can\'t suspend the service. Bad service state.'));
}
return $this->redirect(['controller' => 'Adherents', 'action' => 'view', $service->adherent_id]);
}
@@ -296,7 +296,7 @@ class ServicesController extends AppController
$this->request->allowMethod(['post']);
$service = $this->Services->get($id);
if ( $service ) {
- if ( $service->service_statut_id === 4 /* Actif CHD */ ) {
+ if ( $service->service_statut_id === 4 /* Actif CHD */ || $service->service_statut_id === 1 /* Prévu */ ) {
$patch = array(
'service_statut_id' => 6, /* Actif CHD */
'date_fin' => new DateTime('now'),