Example #1
0
 public function edit()
 {
     $id = $this->_data['username'];
     $this->_uses[$this->modeltype]->load($id);
     $user = $this->_uses[$this->modeltype];
     $this->view->set('current', $user->roles->getAssoc());
     $companies = new UsercompanyaccessCollection(DataObjectFactory::Factory('Usercompanyaccess'));
     $sh = new SearchHandler($companies, FALSE, FALSE);
     $sh->addConstraint(new Constraint('username', '=', $id));
     $sh->setFields(array('id', 'usercompanyid'));
     $companies->load($sh);
     $this->view->set('selected_companies', $companies->getAssoc());
     $this->view->set('username', $id);
     $this->view->set('edit', TRUE);
     $this->_new();
     $this->setTemplateName('new');
     $debug = DebugOption::getUserOption($id);
     $this->view->set('debug_id', $debug->id);
     $this->view->set('selected_options', $debug->getOptions());
 }
Example #2
0
 public function getCompanies()
 {
     $companies = new UsercompanyaccessCollection();
     $sh = new SearchHandler($companies, false, false);
     $sh->addConstraint(new Constraint('username', '=', $this->username));
     $companies->load($sh);
     return $companies;
 }