diff options
-rw-r--r-- | generator/after-bake/src/Controller/ServicesController.php | 4 | ||||
-rw-r--r-- | generator/after-bake/src/Template/Adherents/view.ctp | 4 |
2 files changed, 6 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'), diff --git a/generator/after-bake/src/Template/Adherents/view.ctp b/generator/after-bake/src/Template/Adherents/view.ctp index e93b234..9beccb2 100644 --- a/generator/after-bake/src/Template/Adherents/view.ctp +++ b/generator/after-bake/src/Template/Adherents/view.ctp @@ -192,6 +192,10 @@ __('Activate'), ['controller' => 'Services', 'action' => 'activate', $services->id], ['confirm' => __('Are you sure you want to activate # {0}?', $services->id)] ) . "\n"; + echo $this->Form->postLink( + __('Terminate'), ['controller' => 'Services', 'action' => 'terminate', $services->id], + ['confirm' => __('Are you sure you want to terminate # {0}?', $services->id)] + ) . "\n"; break; case 2: /* Actif TTN */ echo $this->Form->postLink( |