From e1052278ef479a7fa4fd502abe5f0069449dbb01 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sat, 26 May 2012 19:39:35 +0200 Subject: [PATCH] Navegation ads index: parameter page. --- apps/companyfront/modules/ad/actions/actions.class.php | 7 +++++++ apps/companyfront/modules/ad/templates/_form.php | 4 ++-- apps/companyfront/modules/ad/templates/editSuccess.php | 2 +- apps/companyfront/modules/ad/templates/indexSuccess.php | 13 +++++++++++-- apps/companyfront/modules/ad/templates/newSuccess.php | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/apps/companyfront/modules/ad/actions/actions.class.php b/apps/companyfront/modules/ad/actions/actions.class.php index 4c70479..9919373 100644 --- a/apps/companyfront/modules/ad/actions/actions.class.php +++ b/apps/companyfront/modules/ad/actions/actions.class.php @@ -67,6 +67,7 @@ class adActions extends sfActions $userId = $this->getUser()->getGuardUser()->getId(); $this->form = new AdForm(null, array('company_user_id' => CompanyTable::getInstance()->findOneByUserId($userId)->getId())); + $this->page = $request->getParameter('page', 1); } public function executeCreate(sfWebRequest $request) @@ -83,6 +84,8 @@ class adActions extends sfActions $this->form = new AdForm($adInit, array('company_user_id' => $companyUserId)); + $this->page = $request->getParameter('page', 1); + $this->processForm($request, $this->form); $this->setTemplate('new'); @@ -105,6 +108,8 @@ class adActions extends sfActions $this->forward404Unless($companyId == $companyUserId, sprintf('Ad does not exist (%s).', $request->getParameter('id'))); + $this->page = $request->getParameter('page', 1); + $this->form = new AdForm($ad, array('company_user_id' => $companyUserId)); } @@ -128,6 +133,8 @@ class adActions extends sfActions $this->form = new AdForm($ad, array('company_user_id' => $companyUserId)); + $this->page = $request->getParameter('page', 1); + $this->processForm($request, $this->form); $this->setTemplate('edit'); diff --git a/apps/companyfront/modules/ad/templates/_form.php b/apps/companyfront/modules/ad/templates/_form.php index 66bba95..6ef22b0 100644 --- a/apps/companyfront/modules/ad/templates/_form.php +++ b/apps/companyfront/modules/ad/templates/_form.php @@ -1,7 +1,7 @@ -
isMultipart() and print 'enctype="multipart/form-data" ' ?>> +isMultipart() and print 'enctype="multipart/form-data" ' ?>> getObject()->isNew()): ?> @@ -10,7 +10,7 @@ renderHiddenFields(false) ?> -  Back to list +   diff --git a/apps/companyfront/modules/ad/templates/editSuccess.php b/apps/companyfront/modules/ad/templates/editSuccess.php index 0cdbaf0..4ccd9da 100644 --- a/apps/companyfront/modules/ad/templates/editSuccess.php +++ b/apps/companyfront/modules/ad/templates/editSuccess.php @@ -1,4 +1,4 @@

- $form)) ?> + $form, 'page' => $page)) ?> diff --git a/apps/companyfront/modules/ad/templates/indexSuccess.php b/apps/companyfront/modules/ad/templates/indexSuccess.php index 810802e..7289357 100644 --- a/apps/companyfront/modules/ad/templates/indexSuccess.php +++ b/apps/companyfront/modules/ad/templates/indexSuccess.php @@ -12,7 +12,12 @@
- $pager->getResults(), 'userLanguageId' => $userLanguageId)) ?> +haveToPaginate()): ?> + $pager->getResults(), 'userLanguageId' => $userLanguageId, 'page' => $pager->getPage())) ?> + + $pager->getResults(), 'userLanguageId' => $userLanguageId, 'page' => '1')) ?> + + haveToPaginate()): ?> - +haveToPaginate()): ?> + + + + diff --git a/apps/companyfront/modules/ad/templates/newSuccess.php b/apps/companyfront/modules/ad/templates/newSuccess.php index 2c9e131..13dcbf3 100644 --- a/apps/companyfront/modules/ad/templates/newSuccess.php +++ b/apps/companyfront/modules/ad/templates/newSuccess.php @@ -1,3 +1,3 @@

- $form)) ?> + $form, 'page' => $page)) ?> -- 2.1.4