public function getSearchIndexField() { $result = array(); $result['class'] = 'users'; $result['key'] = $this->id; $result['title'] = SiteConstants::createName($this->firstname, $this->lastname, $this->mi, $this->designation); $result['contents'] = ""; $result['summary'] = "Email address: " . $this->email_add . " Contact number: " . $this->contacts; $result['createdBy'] = $this->user_created; $result['dateCreated'] = $this->date_created; return $result; }
private function getStructuredArray($aUsers, $bEditAllowed = false, $bDeleteAllowed = false, $bApproveAllowed = false, $bDenyAllowed = false) { $aFinalUsers = array(); for ($i = 0, $count = count($aUsers); $i < $count; $i++) { $aItem = array(); $aItem['id'] = $aUsers[$i]['id']; $aItem['name'] = SiteConstants::createName($aUsers[$i]['firstname'], $aUsers[$i]['lastname'], $aUsers[$i]['mi'], $aUsers[$i]['designation']); $aItem['status'] = $aUsers[$i]['status']; $aItem['email_add'] = $aUsers[$i]['email_add']; $aItem['contacts'] = $aUsers[$i]['contacts']; $aItem['date_created'] = $aUsers[$i]['date_created']; $aItem['user_created'] = $aUsers[$i]['user_created']; $aItem['date_modified'] = $aUsers[$i]['date_last_modified']; $aItem['user_modified'] = $aUsers[$i]['user_last_modified']; $aItem['edit'] = $bEditAllowed; $aItem['delete'] = $bDeleteAllowed; $aItem['approve'] = $bApproveAllowed; $aItem['deny'] = $bDenyAllowed; $aItem['alreadyapproved'] = $aUsers[$i]['status'] === SiteConstants::$REG; $aFinalUsers[$aUsers[$i]['id']] = $aItem; } return $aFinalUsers; }
public function editmyprivilegeAction() { $user = $this->_helper->_aclHelper->getCurrentUser(); $userRoleId = $user->id; $userId = $user->sysUserId; $message = ""; $form = new Form_UserEditPrivilege('/users/editmyprivilege/'); $form->setData(array('user_role_id' => $userRoleId)); $form->init(); if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $this->users->updatePrivilege($userId, $this->getRequest()->getPost()); $message = "New information has been successfully updated. Privilege changes will reflect next time you logged in."; } else { $form->populate($this->getRequest()->getPost()); $message = 'Submission Failed. See errors below.'; } } if ($this->getRequest()->isGet()) { $personalData = $this->users->getPersonalData($userId)->toArray(); $accountData = $this->users->getAccountData($userRoleId)->toArray(); $this->view->title = SiteConstants::createName($personalData['firstname'], $personalData['lastname'], $personalData['mi'], $personalData['designation']); $form->populate($accountData); } $this->view->links = $this->_helper->_linksHelper->getLinks($user->sysRoleId, $this->view); $this->view->form = $form; $this->view->message = $message; }