Exemplo n.º 1
0
 public function executeIndex(sfWebRequest $request)
 {
     if ($request->getParameter('deal_id')) {
         $this->setFilters(array('deal_id' => $request->getParameter('deal_id')));
     }
     parent::executeIndex($request);
 }
Exemplo n.º 2
0
 public function executeNew(sfWebRequest $request)
 {
     parent::executeNew($request);
     // Generate unique token based on random time
     list($usec, $sec) = explode(" ", microtime());
     $rand_num = substr(sha1((int) ($usec * 1000000 * ($sec / 1000000))), 0, 20);
     // Set default value into 'token' field
     $formProfile = $this->form->getDefault('Profile');
     $formProfile['token'] = $rand_num;
     $this->form->setDefault('Profile', $formProfile);
     // Set readonly mode onto 'token' field
     $formProfile = $this->form->getWidget('Profile');
     $formProfile['token']->setAttribute('readonly', 'readonly');
 }
Exemplo n.º 3
0
 public function executeEdit(sfWebRequest $request)
 {
     $user = $this->getRoute()->getObject();
     // SAMBA FORM
     $this->samba_form = new EmbeddedSambaAccountForm();
     $this->samba_form->setDefault('user_id', $user->getId());
     // FTP FORM
     $this->ftp_form = new EmbeddedFtpAccountForm();
     $this->ftp_form->setDefault('user_id', $user->getId());
     // UNIX FORM
     $this->unix_form = new EmbeddedUnixAccountForm();
     $this->unix_form->setDefault('user_id', $user->getId());
     return parent::executeEdit($request);
 }
Exemplo n.º 4
0
 public function executeEdit(sfWebRequest $request)
 {
     $user = $this->getRoute()->getObject();
     $this->samba_form = new EmbeddedSambaAccountForm();
     $this->samba_form->setDefault('user_id', $user->getId());
     return parent::executeEdit($request);
 }