[symfony-users] Re: Doctrine Pager max per page problem

2010-09-07 Thread ziclo
class articleActions extends sfActions
{

   public function executeIndex(sfWebRequest $request)
  {
// sorting
if ($request->getParameter('sort') && $this-
>isValidSortColumn($request->getParameter('sort')))
{
  $this->setSort(array($request->getParameter('sort'), $request-
>getParameter('sort_type')));
}

// pager
if ($request->getParameter('page'))
{
  $this->setPage($request->getParameter('page'));
}

$this->sort = $this->getSort();
$this->pager = $this->getPager();


  }


  public function executeShow(sfWebRequest $request)
  {
$this->tracker_article = Doctrine::getTable('TrackerArticle')-
>find(array($request->getParameter('id')));
$this->forward404Unless($this->tracker_article);
  }

  public function executeConfirm(sfWebRequest $request)
  {
$this->tracker_article = Doctrine::getTable('TrackerArticle')-
>find(array($request->getParameter('id')));
$this->forward404Unless($this->tracker_article);
  }
   public function executeReturn(sfWebRequest $request)
  {
$this->tracker_article = Doctrine::getTable('TrackerArticle')-
>find(array($request->getParameter('id')));
$this->forward404Unless($this->tracker_article);
  }


   public function executeChangeStatus(sfWebRequest $request)
  {
   $id=$request->getParameter('id');
$q= Doctrine_Query::create()
->update('TrackerArticle')
->set('id_statut_article', $id)
->where('id=6');
$this->tracker_article = $q->execute();
$this->redirect('article/index');
  }

  /*
   public function executeFilter(sfWebRequest $request)
  {
$this->setPage(1);

if ($request->hasParameter('_reset'))
{
  $this->setFilters($this->getFilterDefaults());

  $this->redirect('article/index');
}

$this->filters = new TrackerArticleFormFilter($this-
>getFilters());

$this->filters->bind($request->getParameter($this->filters-
>getName()));
if ($this->filters->isValid())
{
  $this->setFilters($this->filters->getValues());

  $this->redirect('article/index');
}

$this->pager = $this->getPager();
$this->sort = $this->getSort();

$this->setTemplate('index');
  }*/
 public function executeFilter(sfWebRequest $request)
  {
$this->setPage(1);

if ($request->hasParameter('_reset'))
{
  $this->setFilters(array()); //reset, filtre vide

  $this->redirect('article/index');
}

$this->filters = new TrackerArticleFormFilter($this-
>getFilters());

$this->filters->bind($request->getParameter($this->filters-
>getName()));
if ($this->filters->isValid())
{
  $this->setFilters($this->filters->getValues());

  $this->redirect('article/index');
}

$this->pager = $this->getPager();
$this->sort = $this->getSort();

$this->setTemplate('index');
  }

  public function executeNew(sfWebRequest $request)
  {
$this->form = new TrackerArticleForm();
  }


  public function executeCreate(sfWebRequest $request)
  {
$this->forward404Unless($request->isMethod(sfRequest::POST));

$this->form = new TrackerArticleForm();

$this->processForm($request, $this->form);

$this->setTemplate('new');
  }

  public function executeEdit(sfWebRequest $request)
  {
$this->forward404Unless($tracker_article =
Doctrine::getTable('TrackerArticle')->find(array($request-
>getParameter('id'))), sprintf('Object tracker_article does not exist
(%s).', $request->getParameter('id')));
$this->form = new TrackerArticleForm($tracker_article);
  }

  public function executeUpdate(sfWebRequest $request)
  {
$this->forward404Unless($request->isMethod(sfRequest::POST) ||
$request->isMethod(sfRequest::PUT));
$this->forward404Unless($tracker_article =
Doctrine::getTable('TrackerArticle')->find(array($request-
>getParameter('id'))), sprintf('Object tracker_article does not exist
(%s).', $request->getParameter('id')));
$this->form = new TrackerArticleForm($tracker_article);

$this->processForm($request, $this->form);

$this->setTemplate('edit');
  }

  public function executeDelete(sfWebRequest $request)
  {
$request->checkCSRFProtection();

$this->forward404Unless($tracker_article =
Doctrine::getTable('TrackerArticle')->find(array($request-
>getParameter('id'))), sprintf('Object tracker_article does not exist
(%s).', $request->getParameter('id')));
$tracker_article->delete();

$this->redirect('article/index');
  }
/*
  protected function processForm(sfWebRequest $request, sfForm $form)
  {
$form->bind($request->getParameter($form->getName()), $request-
>getFiles($form->getName()));
if ($form->isValid())
{
  $tracker_article = $form->save();

  $this->redirect('article/edit?id='.$tracker_article->getId());
}
  }
  */
protected function processForm(sfWebRequest $request, sfForm
$form)
  {
$form->bind($request->getParameter($form->getName()), $request-
>getFiles($form->getName()));
if ($form->isValid())
{
  $

Re: [symfony-users] Re: Doctrine Pager max per page problem

2010-08-27 Thread Gustavo Adrian
Could you show us your action's code?

On Fri, Aug 27, 2010 at 12:11 PM, ziclo  wrote:

> More explanation about this issue :
>
> If the number of objects returned is > 10 then objects are displayed.
> If number of objects returned < 10 then nothing is displayed.
> I think there is a problem with the pager. But what ?
>
> An idea ?
>
> Thank you
>
> On 6 août, 15:46, ziclo  wrote:
> > My symfony version : 1.4.1 withdoctrine
> >
> > On 6 août, 14:57, ziclo  wrote:
> >
> > > Hi everybody !
> >
> > > On the frontend i have a module called "articles" which is composed by
> > > a list of results. I usedoctrinepagerlike the one in the admin
> > > backend.
> >
> > > I have set up a max number of rows for thepager(=10). I also use a
> > >doctrinefilter (on the same view as result, like the admin backend).
> >
> > > Here is the sequence :
> >
> > > 1 / I select an article's category
> > > 2 / I send the form (filter) by clicking on the submit button
> > > 3 / A list of articles is displayed.
> >
> > > But if the result (number of articles found with the request (filter))
> > > is < max per page parameter (10) nothing is displayed.
> >
> > > An idea ?
> >
> > > Thank you very much
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Doctrine Pager max per page problem

2010-08-27 Thread ziclo
More explanation about this issue :

If the number of objects returned is > 10 then objects are displayed.
If number of objects returned < 10 then nothing is displayed.
I think there is a problem with the pager. But what ?

An idea ?

Thank you

On 6 août, 15:46, ziclo  wrote:
> My symfony version : 1.4.1 withdoctrine
>
> On 6 août, 14:57, ziclo  wrote:
>
> > Hi everybody !
>
> > On the frontend i have a module called "articles" which is composed by
> > a list of results. I usedoctrinepagerlike the one in the admin
> > backend.
>
> > I have set up a max number of rows for thepager(=10). I also use a
> >doctrinefilter (on the same view as result, like the admin backend).
>
> > Here is the sequence :
>
> > 1 / I select an article's category
> > 2 / I send the form (filter) by clicking on the submit button
> > 3 / A list of articles is displayed.
>
> > But if the result (number of articles found with the request (filter))
> > is < max per page parameter (10) nothing is displayed.
>
> > An idea ?
>
> > Thank you very much

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Doctrine Pager max per page problem

2010-08-06 Thread ziclo
My symfony version : 1.4.1 with doctrine

On 6 août, 14:57, ziclo  wrote:
> Hi everybody !
>
> On the frontend i have a module called "articles" which is composed by
> a list of results. I use doctrine pager like the one in the admin
> backend.
>
> I have set up a max number of rows for the pager (=10). I also use a
> doctrine filter (on the same view as result, like the admin backend).
>
> Here is the sequence :
>
> 1 / I select an article's category
> 2 / I send the form (filter) by clicking on the submit button
> 3 / A list of articles is displayed.
>
> But if the result (number of articles found with the request (filter))
> is < max per page parameter (10) nothing is displayed.
>
> An idea ?
>
> Thank you very much

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en