Esempio n. 1
0
 public function findallAction()
 {
     $offset = $this->getRequest()->getParam("offset") ? $this->getRequest()->getParam("offset") : null;
     $limit = Admin_Model_Admin::BO_DISPLAYED_PER_PAGE;
     $params = array("offset" => $offset, "limit" => $limit);
     $admin = new Admin_Model_Admin();
     $admins = $admin->findAll(null, null, $params);
     $data = array("display_per_page" => $limit, "collection" => array());
     foreach ($admins as $admin) {
         $data["collection"][] = array("id" => $admin->getId(), "email" => $admin->getEmail(), "name" => $admin->getFirstname() . " " . $admin->getLastname(), "company" => $admin->getCompany(), "key" => sha1($admin->getFirstname() . $admin->getId()), "created_at" => $admin->getFormattedCreatedAt($this->_("MM/dd/yyyy")));
     }
     $this->_sendHtml($data);
 }
Esempio n. 2
0
 public function findAction()
 {
     $admin = new Admin_Model_Admin();
     $admin->find($this->getRequest()->getParam("admin_id"));
     $data = array();
     if ($admin->getId()) {
         $data["admin"] = $admin->getData();
         $data["section_title"] = $this->_("Edit the user %s", $admin->getFirstname() . " " . $admin->getLastname());
     } else {
         $data["section_title"] = $this->_("Create a new user");
     }
     $data["applications_section_title"] = $this->_("Manage access");
     $countries = Zend_Registry::get('Zend_Locale')->getTranslationList('Territory', null, 2);
     asort($countries, SORT_LOCALE_STRING);
     $data["country_codes"] = $countries;
     $roles = $admin->getAvailableRole();
     $data["roles"] = $roles;
     $role = new Acl_Model_Role();
     $default_role_id = $role->findDefaultRoleId();
     $data["default_role_id"] = $default_role_id;
     $this->_sendHtml($data);
 }