diff options
Diffstat (limited to 'generator/after-bake/src/Template/Adherents')
-rw-r--r-- | generator/after-bake/src/Template/Adherents/edit.ctp | 106 | ||||
-rw-r--r-- | generator/after-bake/src/Template/Adherents/index.ctp | 102 | ||||
-rw-r--r-- | generator/after-bake/src/Template/Adherents/view.ctp | 235 |
3 files changed, 443 insertions, 0 deletions
diff --git a/generator/after-bake/src/Template/Adherents/edit.ctp b/generator/after-bake/src/Template/Adherents/edit.ctp new file mode 100644 index 0000000..388484c --- /dev/null +++ b/generator/after-bake/src/Template/Adherents/edit.ctp @@ -0,0 +1,106 @@ +<% +/** + * Copyright 2016 Ludovic Pouzenc <ludovic@pouzenc.fr> + * Copyright 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr> + * + * This file is part of CHD Gestion. + * + * CHD Gestion is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * CHD Gestion is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with CHD Gestion. If not, see <http://www.gnu.org/licenses/>. +**/ +%> +<nav class="large-2 medium-3 columns" id="actions-sidebar"> + <ul class="side-nav"> + <li class="heading"><?= __('Actions') ?></li> + <li><?= $this->Html->link(__('List Adherents'), ['action' => 'index']) ?></li> + <li><?= $this->Html->link(__('List Villes'), ['controller' => 'Villes', 'action' => 'index']) ?></li> + <li><?= $this->Html->link(__('New Ville'), ['controller' => 'Villes', 'action' => 'add']) ?></li> + <li><?= $this->Html->link(__('List Services'), ['controller' => 'Services', 'action' => 'index']) ?></li> + <li><?= $this->Html->link(__('New Service'), ['controller' => 'Services', 'action' => 'add']) ?></li> + </ul> +</nav> +<div class="adherents form large-10 medium-9 columns content"> + <?= $this->Form->create($adherent) ?> + <fieldset> + <legend><?= __('Edit Adherent') ?></legend> + <div class="columns medium-12 large-6"> + <?= $this->Form->input('adherent_statut_id', ['options' => $adherentStatuts]); ?> + </div> + <div class="columns medium-12 large-6"> + <?= $this->Form->input('num_adt_ttn'); ?> + </div> + <div class="clearfix"></div> + <div class="columns medium-12 large-6"> + <?php + echo $this->Form->input('adherent_type_id', ['options' => $adherentTypes]); + echo $this->Form->input('civilite_id', ['options' => $civilites]); + echo $this->Form->input('nom'); + echo $this->Form->input('prenom'); + echo $this->Form->input('raison'); + echo $this->Form->input('tel_fixe1'); + echo $this->Form->input('tel_mobile1'); + ?> + </div> + <div class="columns medium-12 large-6"> + <?php + echo $this->Form->input('adresse1'); + echo $this->Form->input('adresse2'); + echo $this->Form->input('ville_id', ['options' => $villes]); + echo $this->Form->input('mail1'); + echo $this->Form->input('mail2'); + echo $this->Form->input('tel_fixe2'); + echo $this->Form->input('tel_mobile2'); + ?> + </div> + <div class="clearfix"></div> + <div class="columns medium-12 large-6"> + <?php + echo $this->Form->input('proprio'); + echo $this->Form->input('nom2'); + echo $this->Form->input('prenom2'); + ?> + </div> + <div class="columns medium-12 large-6"> + <?= $this->Form->input('notes', ['rows' => 7]); ?> + </div> + </fieldset> + <?= $this->Form->button(__('Submit')) ?> + <?= $this->Form->end() ?> + <div class="related"> + <h4><?= __('Related Services') ?></h4> + <?php if (!empty($adherent->services)): ?> + <table cellpadding="0" cellspacing="0"> + <tr> + <th><?= __('Id') ?></th> + <th><?= __('Service Type') ?></th> + <th><?= __('Relais') ?></th> + <th><?= __('Service Statut') ?></th> + <th><?= __('Ippublique') ?></th> + <th><?= __('Date Debut') ?></th> + <th><?= __('Date Fin') ?></th> + </tr> + <?php foreach ($adherent->services as $services): ?> + <tr> + <td><?= h($services->title) ?></td> + <td><?= h($services->service_type->title) ?></td> + <td><?= $services->has('relais')?h($services->relais->title):'' ?></td> + <td><?= h($services->service_statut->title) ?></td> + <td><?= h($services->ippublique_id) ?></td> + <td><?= h($services->date_debut) ?></td> + <td><?= h($services->date_fin) ?></td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> + </div> +</div> diff --git a/generator/after-bake/src/Template/Adherents/index.ctp b/generator/after-bake/src/Template/Adherents/index.ctp new file mode 100644 index 0000000..3a5fbaf --- /dev/null +++ b/generator/after-bake/src/Template/Adherents/index.ctp @@ -0,0 +1,102 @@ +<% +/** + * Copyright 2016 Ludovic Pouzenc <ludovic@pouzenc.fr> + * Copyright 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr> + * + * This file is part of CHD Gestion. + * + * CHD Gestion is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * CHD Gestion is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with CHD Gestion. If not, see <http://www.gnu.org/licenses/>. +**/ +%> +<nav class="large-2 medium-3 columns" id="actions-sidebar"> + <ul class="side-nav"> + <li class="heading"><?= __('Actions') ?></li> + <li><?= $this->Html->link(__('New Adherent'), ['action' => 'add']) ?></li> + <li><?= $this->Html->link(__('List Villes'), ['controller' => 'Villes', 'action' => 'index']) ?></li> + <li><?= $this->Html->link(__('New Ville'), ['controller' => 'Villes', 'action' => 'add']) ?></li> + <li><?= $this->Html->link(__('List Services'), ['controller' => 'Services', 'action' => 'index']) ?></li> + <li><?= $this->Html->link(__('New Service'), ['controller' => 'Services', 'action' => 'add']) ?></li> + <li><?= $this->Form->postLink(__('Apply routing'), + 'https://priv.chd.sx/api/gen_conf.php', + ['confirm' => __('Are you sure you want to globally apply routing?')] + ) ?> + <li> + </ul> +</nav> +<div class="adherents index large-10 medium-9 columns content"> + <!-- TODO : quick'n' dirty, à reprendre --> + <div style="float:right"> + <h5>Progression : <?= $score ?> %</h5> + </div> + <h3><?= __('Adherents') ?></h3> + <table cellpadding="0" cellspacing="0"> + <?= $this->Form->create(null) . "\n" ?> + <thead> + <tr class="filter"> + <th colspan="5"> + <?= $this->Form->input('q', [ + 'placeholder' => __('Rechercher...'), + 'empty' => __('Rechercher...') + ]) ?> + </th> + <th colspan="2"> + <?= $this->Form->input('ville_id', [ + 'placeholder' => __('Villes'), + 'empty' => __('Villes') + ]) ?> + </th> + <th class="actions"> + <?= $this->Form->button('Filter', ['type' => 'submit']) . "\n" ?> + <?= $this->Html->link('Reset', ['action' => 'index']) . "\n" ?> + </th> + </tr> + <tr> + <th><?= $this->Paginator->sort('nom') ?></th> + <th><?= $this->Paginator->sort('prenom') ?></th> + <th><?= $this->Paginator->sort('raison') ?></th> + <th><?= $this->Paginator->sort('tel_mobile1') ?></th> + <th><?= $this->Paginator->sort('adherent_type_id') ?></th> + <th><?= $this->Paginator->sort('ville_id') ?></th> + <th><?= $this->Paginator->sort('adherent_statut_id') ?></th> + <th class="actions"><?= __('Actions') ?></th> + </tr> + </thead> + <?= $this->Form->end() . "\n" ?> + <tbody> + <?php foreach ($adherents as $adherent): ?> + <tr> + <td><?= h($adherent->nom) ?></td> + <td><?= h($adherent->prenom) ?></td> + <td><?= h($adherent->raison) ?></td> + <td><?= h($adherent->tel_mobile1) ?></td> + <td><?= $adherent->has('adherent_type') ? h($adherent->adherent_type->title) : '' ?></td> + <td><?= $adherent->has('ville') ? $this->Html->link($adherent->ville->title, ['controller' => 'Villes', 'action' => 'view', $adherent->ville->id]) : '' ?></td> + <td><?= $adherent->has('adherent_statut') ? h($adherent->adherent_statut->title) : '' ?></td> + <td class="actions"> + <?= $this->Html->link(__('View'), ['action' => 'view', $adherent->id]) ?> + <?= $this->Html->link(__('Edit'), ['action' => 'edit', $adherent->id]) ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <div class="paginator"> + <ul class="pagination"> + <?= $this->Paginator->prev('< ' . __('previous')) ?> + <?= $this->Paginator->numbers() ?> + <?= $this->Paginator->next(__('next') . ' >') ?> + </ul> + </div> + +</div> diff --git a/generator/after-bake/src/Template/Adherents/view.ctp b/generator/after-bake/src/Template/Adherents/view.ctp new file mode 100644 index 0000000..74b6326 --- /dev/null +++ b/generator/after-bake/src/Template/Adherents/view.ctp @@ -0,0 +1,235 @@ +<% +/** + * Copyright 2016 Ludovic Pouzenc <ludovic@pouzenc.fr> + * Copyright 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr> + * + * This file is part of CHD Gestion. + * + * CHD Gestion is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * CHD Gestion is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with CHD Gestion. If not, see <http://www.gnu.org/licenses/>. +**/ +%> +<nav class="large-2 medium-3 columns" id="actions-sidebar"> + <ul class="side-nav"> + <li class="heading"><?= __('Actions') ?></li> + <li><?= $this->Html->link(__('Edit Adherent'), ['action' => 'edit', $adherent->id]) ?> </li> + <li><?= $this->Html->link(__('List Adherents'), ['action' => 'index']) ?> </li> + <li><?= $this->Html->link(__('New AdherentRole'), ['controller' => 'AdherentRoles', 'action' => 'add', 'a' => $adherent->id]) ?> </li> + <li><?= $this->Html->link(__('New Service'), ['controller' => 'Services', 'action' => 'add', 'a' => $adherent->id]) ?> </li> + <li><?= $this->Form->postLink(__('Apply routing'), + 'https://priv.chd.sx/api/gen_conf.php', + ['confirm' => __('Are you sure you want to globally apply routing?')] + ) ?> + <li> + </ul> +</nav> +<div class="adherents view large-10 medium-9 columns content"> + <h3><?= h($adherent->title) ?></h3> + <table class="vertical-table columns medium-12 large-6"> + <tr> + <th><?= __('Adherent Statut') ?></th> + <td><?= $adherent->adherent_statut->title ?></td> + </tr> + </table> + <table class="vertical-table columns medium-12 large-6"> + <tr> + <th><?= __('Num Adt Ttn') ?></th> + <td><?= h($adherent->num_adt_ttn) ?></td> + </tr> + </table> + <div style="clear: both"></div> + <table class="vertical-table columns medium-12 large-6"> + <tr> + <th><?= __('Adherent Type') ?></th> + <td><?= $adherent->adherent_type->title ?></td> + </tr> + <tr> + <th><?= __('Civilite') ?></th> + <td><?= $adherent->civilite->title ?></td> + </tr> + <tr> + <th><?= __('Nom') ?></th> + <td><?= h($adherent->nom) ?></td> + </tr> + <tr> + <th><?= __('Prenom') ?></th> + <td><?= h($adherent->prenom) ?></td> + </tr> + <tr> + <th><?= __('Raison') ?></th> + <td><?= h($adherent->raison) ?></td> + </tr> + <tr> + <th><?= __('Tel Fixe1') ?></th> + <td><?= h($adherent->tel_fixe1) ?></td> + </tr> + <tr> + <th><?= __('Tel Mobile1') ?></th> + <td><?= h($adherent->tel_mobile1) ?></td> + </tr> + </table> + <table class="vertical-table columns medium-12 large-6"> + <tr> + <th><?= __('Adresse1') ?></th> + <td><?= h($adherent->adresse1) ?></td> + </tr> + <tr> + <th><?= __('Adresse2') ?></th> + <td><?= h($adherent->adresse2) ?></td> + </tr> + <tr> + <th><?= __('Ville') ?></th> + <td><?= $adherent->has('ville') ? $this->Html->link($adherent->ville->title, ['controller' => 'Villes', 'action' => 'view', $adherent->ville->id]) : '' ?></td> + </tr> + <tr> + <th><?= __('Mail1') ?></th> + <td><?= h($adherent->mail1) ?></td> + </tr> + <tr> + <th><?= __('Mail2') ?></th> + <td><?= h($adherent->mail2) ?></td> + </tr> + <tr> + <th><?= __('Tel Fixe2') ?></th> + <td><?= h($adherent->tel_fixe2) ?></td> + </tr> + <tr> + <th><?= __('Tel Mobile2') ?></th> + <td><?= h($adherent->tel_mobile2) ?></td> + </tr> + </table> + <div style="clear: both"></div> + <table class="vertical-table columns medium-12 large-6"> + <tr> + <th><?= __('Proprio') ?></th> + <td><?= h($adherent->proprio) ?></td> + </tr> + <tr> + <th><?= __('Nom2') ?></th> + <td><?= h($adherent->nom2) ?></td> + </tr> + <tr> + <th><?= __('Prenom2') ?></th> + <td><?= h($adherent->prenom2) ?></td> + </tr> + <tr> + <th><?= __('Created') ?></th> + <td><?= h($adherent->created) ?></td> + </tr> + <tr> + <th><?= __('Modified') ?></th> + <td><?= h($adherent->modified) ?></td> + </tr> + </table> + <?php if (!empty($adherent->adherent_roles)): ?> + <table class="vertical-table columns medium-12 large-6"> + <?php foreach ($adherent->adherent_roles as $k => $adherentRole): ?> + <tr> + <th><?= __('Role {0}', $k+1) ?></th> + <td><?= h($adherentRole->adherent_role_type->title) ?> + <?= $adherentRole->has('ville') ? h($adherentRole->ville->title) : '' ?> + <?= $this->Form->postLink(__('Delete'), ['controller' => 'AdherentRoles', 'action' => 'delete', $adherentRole->id], ['confirm' => __('Are you sure you want to delete # {0}?', $adherentRole->id)]) ?> + </td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> + <div style="clear: both"></div> + <div class="row"> + <h4><?= __('Notes') ?></h4> + <?= $this->Text->autoParagraph(h($adherent->notes)); ?> + </div> + <div class="related"> + <h4><?= __('Related Services') ?></h4> + <?php if (!empty($adherent->services)): ?> + <table cellpadding="0" cellspacing="0"> + <tr> + <th><?= __('Id') ?></th> + <th><?= __('Service Type') ?></th> + <th><?= __('Service Statut') ?></th> + <th><?= __('Ippublique') ?></th> + <th><?= __('Date Debut') ?></th> + <th><?= __('Date Fin') ?></th> + <th class="actions"><?= __('Actions') ?></th> + </tr> + <?php foreach ($adherent->services as $services): ?> + <tr> + <td><?= h($services->title) ?></td> + <td><?= h($services->service_type->title) ?></td> + <td><?= h($services->service_statut->title) ?></td> + <td><?= h($services->ippublique_id) ?></td> + <td><?= h($services->date_debut) ?></td> + <td><?= h($services->date_fin) ?></td> + <td class="actions"> + <?= $this->Html->link(__('View'), ['controller' => 'Services', 'action' => 'view', $services->id]) ?> + <?= $this->Html->link(__('Edit'), ['controller' => 'Services', 'action' => 'edit', $services->id]) ?> + <?php + if ( $services->service_type_id === 1 /* Adhésion */ ) { + switch ($services->service_statut_id) { + case 4: /* Actif CHD */ + 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 6: /* Résilié */ + break; + } + } else /* Internet ... */ { + switch ($services->service_statut_id) { + case 1: /* Prévu */ + echo $this->Form->postLink( + __('Activate'), ['controller' => 'Services', 'action' => 'activate', $services->id], + ['confirm' => __('Are you sure you want to activate # {0}?', $services->id)] + ) . "\n"; + break; + case 2: /* Actif TTN */ + echo $this->Form->postLink( + __('Migrate'), ['controller' => 'Services', 'action' => 'migrate', $services->id], + ['confirm' => __('Are you sure you want to migrate # {0}?', $services->id)] + ) . "\n"; + break; + case 3: /* Migré */ + break; + case 4: /* Actif CHD */ + echo $this->Form->postLink( + __('Suspend'), ['controller' => 'Services', 'action' => 'suspend', $services->id], + ['confirm' => __('Are you sure you want to suspend # {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 5: /* Suspendu */ + echo $this->Form->postLink( + __('Unsuspend'), ['controller' => 'Services', 'action' => 'unsuspend', $services->id], + ['confirm' => __('Are you sure you want to suspend # {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 6: /* Résilié */ + break; + } + } + ?> + </td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> + </div> +</div> |