issue #0001643: Add a paginator for "ciblage" and "enrichissements"
This commit is contained in:
parent
e930a8bbeb
commit
0b1512f9b1
@ -15,14 +15,16 @@ class DashboardController extends Zend_Controller_Action
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam('type', null);
|
||||
$this->view->type = $type;
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limit(5);
|
||||
->order('dateAjout DESC');
|
||||
//->limit(5);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
|
||||
@ -51,7 +53,17 @@ class DashboardController extends Zend_Controller_Action
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//paginate results list
|
||||
$paginator = Zend_Paginator::factory($results);
|
||||
$this->view->paginator = $paginator;
|
||||
$itemCount = 5;
|
||||
$page = $this->_getParam('page', 1);
|
||||
$paginator->setCurrentPageNumber($page);
|
||||
$paginator->setItemCountPerPage($itemCount);
|
||||
$this->view->assign('itemCount', $itemCount);
|
||||
//end
|
||||
$this->view->comptages = $results;
|
||||
|
||||
//
|
||||
@ -70,8 +82,17 @@ class DashboardController extends Zend_Controller_Action
|
||||
->where('c.login = ?', $user->username)
|
||||
->order('i.dateAdded DESC');
|
||||
|
||||
$this->view->enrichissements = $enrichissements->fetchAll($sql);
|
||||
$enrichissements = $enrichissements->fetchAll($sql);
|
||||
|
||||
//paginate results list
|
||||
$paginatorEnrichissements = Zend_Paginator::factory($enrichissements);
|
||||
$this->view->enrichissements = $paginatorEnrichissements;
|
||||
$itemCountEnrichissements = 2;
|
||||
$pageEnrichissements = $this->_getParam('pageEnrichissements', 1);
|
||||
$paginatorEnrichissements->setCurrentPageNumber($pageEnrichissements);
|
||||
$paginatorEnrichissements->setItemCountPerPage($itemCountEnrichissements);
|
||||
$this->view->assign('itemCountEnrichissements', $itemCountEnrichissements);
|
||||
//end
|
||||
}
|
||||
|
||||
public function ciblagesAction()
|
||||
|
BIN
application/languages/fr.mo
Normal file
BIN
application/languages/fr.mo
Normal file
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
<?php if ($this->pageCount) { ?>
|
||||
<!-- First page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->first)); ?>"><img src="/themes/default/images/pagination/first.png" title='Première page'/></a>
|
||||
<?php } ?>
|
||||
<!-- Previous page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->previous)); ?>"><img src="/themes/default/images/pagination/prev.png" title='Page précédente'/></a>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Next page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->next)); ?>"><img src="/themes/default/images/pagination/next.png" title='Page suivante'/></a>
|
||||
<?php } ?>
|
||||
<!-- Last page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->last)); ?>"><img src="/themes/default/images/pagination/last.png" title='Dernière page'/></a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
@ -0,0 +1,19 @@
|
||||
<?php if ($this->pageCount) { ?>
|
||||
<!-- First page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->first)); ?>"><img src="/themes/default/images/pagination/first.png" title='Première page'/></a>
|
||||
<?php } ?>
|
||||
<!-- Previous page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->previous)); ?>"><img src="/themes/default/images/pagination/prev.png" title='Page précédente'/></a>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Next page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->next)); ?>"><img src="/themes/default/images/pagination/next.png" title='Page suivante'/></a>
|
||||
<?php } ?>
|
||||
<!-- Last page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->last)); ?>"><img src="/themes/default/images/pagination/last.png" title='Dernière page'/></a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
@ -39,7 +39,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->comptages as $name => $item):?>
|
||||
<?php foreach($this->paginator as $name => $item):?>
|
||||
<tr>
|
||||
<td class="reference"><?=$item['reference']?></td>
|
||||
<td class="update resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
@ -51,6 +51,7 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo $this->paginationControl($this->paginator,'Sliding','dashboard/controlsCiblages.phtml'); ?>
|
||||
<?php else:?>
|
||||
<p><?=$this->translate('Aucun ciblage')?>.<p>
|
||||
<?php endif;?>
|
||||
@ -70,8 +71,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i=0;foreach($this->enrichissements as $item):?>
|
||||
<?php if($i++ == 5)break;?>
|
||||
<?php foreach($this->enrichissements as $item):?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
@ -89,6 +89,7 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo $this->paginationControl($this->enrichissements,'Sliding','dashboard/controlsEnrichissements.phtml'); ?>
|
||||
<?php else:?>
|
||||
<p><?=$this->translate('Aucun enrichissement')?>.<p>
|
||||
<?php endif;?>
|
||||
|
BIN
public/themes/default/images/pagination/first.png
Normal file
BIN
public/themes/default/images/pagination/first.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
public/themes/default/images/pagination/last.png
Normal file
BIN
public/themes/default/images/pagination/last.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
public/themes/default/images/pagination/next.png
Normal file
BIN
public/themes/default/images/pagination/next.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
public/themes/default/images/pagination/prev.png
Normal file
BIN
public/themes/default/images/pagination/prev.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Loading…
Reference in New Issue
Block a user