Beispiel #1
0
 /**
  * Searches for contacts
  * CODE:contact_index
  */
 public function executeIndex(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Volunteer'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     # filter
     $this->processFilter($request);
     if ($request->isMethod('post') || $request->getParameter('page')) {
         $this->pager = ContactPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->city, $this->state, $this->ref_source, $this->contact_type, $this->added_date1, $this->added_date2);
         $this->contact_list = $this->pager->getResults();
     }
     $this->ref_sources = RefSourcePeer::doSelect(new Criteria());
     $this->contact_types = ContactTypePeer::doSelect(new Criteria());
     $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
 }