Commit 40e8f6b7 authored by tguillon's avatar tguillon
Browse files

Ajout : mise en place de la pagination (10 par page)

parent c87838e6
......@@ -84,9 +84,9 @@ class BanettesComponent extends Component {
'Valeur' => [
'conditions' => [
'champ_name' => [
'outilnom',
'outilnom',
'finaliteprincipale',
'declarantservice'
// 'declarantservice'
]
],
'fields' => [
......@@ -101,8 +101,8 @@ class BanettesComponent extends Component {
'numero',
'libelle',
'description',
'name_fichier',
'fichier'
// 'name_fichier',
// 'fichier'
]
],
'Referentiel' => [
......
......@@ -41,6 +41,7 @@ class PannelController extends AppController {
'Norme',
'Formulaire',
'Soustraitant',
'Referentiel',
'Responsable',
'Typage',
];
......@@ -313,7 +314,7 @@ class PannelController extends AppController {
// En cours de rédaction
$query = $this->Banettes->queryEnCoursRedaction();
$banettes['encours_redaction'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'nbUserValideur' => $nbUserValideur,
'nbUserConsultant' => $nbUserConsultant,
......@@ -340,7 +341,7 @@ class PannelController extends AppController {
// En cours de rédaction partager avec mes services
$query = $this->Banettes->queryPartageServices();
$banettes['service'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'nbUserValideur' => $nbUserValideur,
'nbUserConsultant' => $nbUserConsultant,
......@@ -369,7 +370,7 @@ class PannelController extends AppController {
// En attente
$query = $this->Banettes->queryAttente();
$banettes['attente'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'nbUserValideur' => $nbUserValideur,
'enumsNormes' => $this->_enumsNorme()
......@@ -393,7 +394,7 @@ class PannelController extends AppController {
// Traitement refusés
$query = $this->Banettes->queryRefuser();
$banettes['refuser'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'enumsNormes' => $this->_enumsNorme()
];
......@@ -422,7 +423,7 @@ class PannelController extends AppController {
// Traitement reçu pour validation
$query = $this->Banettes->queryRecuValidation();
$banettes['recuValidation'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'nbUserValideur' => $nbUserValideur,
'nbUserConsultant' => $nbUserConsultant,
......@@ -448,7 +449,7 @@ class PannelController extends AppController {
// Traitement reçu pour consultation
$query = $this->Banettes->queryRecuConsultation();
$banettes['recuConsultation'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'enumsNormes' => $this->_enumsNorme()
];
......@@ -468,7 +469,7 @@ class PannelController extends AppController {
// Mes traitements validés et insérés au registre
$query = $this->Banettes->queryArchives();
$banettes['archives'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'enumsNormes' => $this->_enumsNorme()
];
......@@ -569,7 +570,7 @@ class PannelController extends AppController {
// Etat des traitements passés en ma possession
$query = $this->Banettes->queryConsulte();
$banettes['consulte'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'nbUserValideur' => $nbUserValideur,
'enumsNormes' => $this->_enumsNorme()
......@@ -868,7 +869,7 @@ class PannelController extends AppController {
// Initialisation d'un traitement
$query = $this->Banettes->queryInitialisationTraitement();
$banettes['initialisation'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'nbUserValideur' => 0,
'nbUserConsultant' => 0,
......@@ -928,12 +929,16 @@ class PannelController extends AppController {
/**
* Visualisation de tous les traitements de l'entité
*
* @return type
* @return void
*
* @access public
*
* @created 12/12/2019
* @version V2.0.0
* @author Théo GUILLON <theo.guillon@libriciel.coop>
*
* @modified 21/01/2022
* @version V2.1.3
*/
public function all_traitements()
{
......@@ -989,6 +994,11 @@ class PannelController extends AppController {
$conditions['Fiche.norme_id'] = $this->request->data['Filtre']['norme'];
}
// Filtre sur un référentiel
if (!empty($this->request->data['Filtre']['referentiel'])) {
$condition['Fiche.referentiel_id'] = $this->request->data['Filtre']['referentiel'];
}
// Filtre sur les formulaires
if (!empty($this->request->data['Filtre']['formulaire'])) {
$conditions['Fiche.form_id'] = $this->request->data['Filtre']['formulaire'];
......@@ -1149,7 +1159,7 @@ class PannelController extends AppController {
$this->_optionsNormes();
$banettes['allTraitements'] = [
'results' => $this->Fiche->find('all', $query + ['limit' => 0]),
'results' => $this->getResultTraitement($query),
'count' => $this->Fiche->find('count', $query),
'enumsNormes' => $this->_enumsNorme(),
];
......@@ -1211,7 +1221,8 @@ class PannelController extends AppController {
{
$queryNormes = [
'conditions' => ['abroger' => false],
'fields' => ['id', 'norme', 'numero', 'libelle', 'description'],
// 'fields' => ['id', 'norme', 'numero', 'libelle', 'description'],
'fields' => ['id', 'norme', 'numero', 'libelle'],
'order' => ['norme', 'numero']
];
$normes = $this->Norme->find('all', $queryNormes);
......@@ -1227,6 +1238,34 @@ class PannelController extends AppController {
]
);
$this->set(compact('options_normes'));
$options_referentiels = $this->Referentiel->find('list', [
'fields' => [
'id',
'name'
],
'order' => [
'name ASC'
]
]);
$this->set(compact('options_normes', 'options_referentiels'));
}
/**
* @access private
*
* @param $query
* @param int $limit
* @return array
*
* @version V2.1.3
* @created 24/01/2022
* @author Théo GUILLON <theo.guillon@libriciel.coop>
*/
private function getResultTraitement ($query, $limit = 10)
{
$query['limit'] = $limit;
$this->paginate = $query;
return $this->paginate($this->Fiche);
}
}
......@@ -335,7 +335,7 @@ class RegistresController extends AppController {
'champ_name' => [
'outilnom',
'finaliteprincipale',
'declarantservice'
// 'declarantservice'
]
]
],
......
......@@ -9,6 +9,8 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$pagination = null;
// Bouton du filtre de la liste
echo $this->element('Buttons/filtre', [
'titleBtn' => __d('pannel', 'pannel.btnFiltreAllTraitements')
......@@ -31,6 +33,13 @@ echo $this->element('Filtres/filtresTraitements', [
'nameForm' => 'Filtre',
]);
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
echo $this->element('Fiches/modal/modalDupliquerTraitement');
$params = [
......@@ -43,3 +52,5 @@ echo $this->Banettes->allTraitement(
$banettes['allTraitements'],
$params
);
echo $pagination;
......@@ -5,11 +5,20 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette mes traitements validés et insérés au registre
echo $this->Banettes->archives($banettes['archives'], $params);
echo $this->Banettes->archives($banettes['archives']);
echo $pagination;
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette mes déclarations en attente
echo $this->Banettes->attente($banettes['attente'], $params);
echo $this->Banettes->attente($banettes['attente']);
echo $pagination;
// Pop-up reorientation du traitement
echo $this->element('Pannel/modalReorienter');
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette etat des traitements passés en ma possession
echo $this->Banettes->consulte($banettes['consulte'], $params);
echo $this->Banettes->consulte($banettes['consulte']);
echo $pagination;
// Pop-up reorientation du traitement
echo $this->element('Pannel/modalReorienter');
......
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette mes déclarations en cours de rédaction
echo $this->Banettes->encoursRedaction($banettes['encours_redaction'], $params);
echo $this->Banettes->encoursRedaction($banettes['encours_redaction']);
echo $pagination;
// Pop-up envoie consultation
echo $this->element('Pannel/modalEnvoieConsultation');
......
......@@ -5,10 +5,19 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// Banette mes déclarations en cours d'initialisation
echo $this->Banettes->initialisationTraitement($banettes['initialisation'], $params);
echo $this->Banettes->initialisationTraitement($banettes['initialisation']);
echo $pagination;
// Pop-up envoie redacteur
echo $this->element('Pannel/modalSendRedaction');
......
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette mes déclarations en cours de rédaction
echo $this->Banettes->partageServices($banettes['service'], $params);
echo $this->Banettes->partageServices($banettes['service']);
echo $pagination;
// Pop-up envoie consultation
echo $this->element('Pannel/modalEnvoieConsultation');
......
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette traitements reçus pour consultation
echo $this->Banettes->recuConsultation($banettes['recuConsultation'], $params);
echo $this->Banettes->recuConsultation($banettes['recuConsultation']);
echo $pagination;
?>
<script type="text/javascript">
......
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette traitements reçus pour validation
echo $this->Banettes->recuValidation($banettes['recuValidation'], $params);
echo $this->Banettes->recuValidation($banettes['recuValidation']);
echo $pagination;
// Pop-up envoie consultation
echo $this->element('Pannel/modalEnvoieConsultation');
......
......@@ -5,14 +5,23 @@ $this->Breadcrumbs->breadcrumbs([
$title => []
]);
$params = ['limit' => false];
$pagination = null;
$this->Paginator->options([
'url' => Hash::flatten( (array)$this->request->data, '.' )
]);
$pagination = $this->element('pagination');
echo $pagination;
// balise du scrollTo
$idFicheNotification = $this->Session->read('idFicheNotification');
unset($_SESSION['idFicheNotification']);
// Banette mes déclarations refusées
echo $this->Banettes->refuser($banettes['refuser'], $params);
echo $this->Banettes->refuser($banettes['refuser']);
echo $pagination;
?>
<script type="text/javascript">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment