示例#1
0
 public function indexAction()
 {
     $userMapper = new UserMapper();
     $birthdayMapper = new BirthdayMapper();
     $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuBirthdayList'), array('controller' => 'index'));
     $this->getView()->set('birthdayListNOW', $birthdayMapper->getBirthdayUserList());
     $this->getView()->set('birthdayList', $userMapper->getUserList());
 }
示例#2
0
 public function indexAction()
 {
     $calendarMapper = new CalendarMapper();
     $userMapper = new UserMapper();
     $eventsMapper = new EventsMapper();
     $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuCalendar'), array('controller' => 'index'));
     $this->getView()->set('calendarList', $calendarMapper->getEntries());
     $this->getView()->set('birthdayList', $userMapper->getUserList());
     if ($calendarMapper->existsTable('events') == true) {
         $this->getView()->set('eventList', $eventsMapper->getEntries(array('show' => 1)));
     }
 }
示例#3
0
 /**
  * Shows a table with all users.
  */
 public function indexAction()
 {
     $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('menuUser'), array('action' => 'index'));
     $userMapper = new UserMapper();
     if ($this->getRequest()->getPost('action') == 'delete' && $this->getRequest()->getPost('check_users')) {
         foreach ($this->getRequest()->getPost('check_users') as $userId) {
             $deleteUser = $userMapper->getUserById($userId);
             if ($deleteUser->getId() != Registry::get('user')->getId()) {
                 if ($deleteUser->hasGroup(1) && $userMapper->getAdministratorCount() == 1) {
                 } else {
                     $userMapper->delete($deleteUser->getId());
                 }
             }
         }
     }
     $userList = $userMapper->getUserList();
     $this->getView()->set('userList', $userList);
     $this->getView()->set('showDelUserMsg', $this->getRequest()->getParam('showDelUserMsg'));
     $this->getView()->set('errorMsg', $this->getRequest()->getParam('errorMsg'));
 }
示例#4
0
 public function treatAction()
 {
     $awardsMapper = new AwardsMapper();
     $userMapper = new UserMapper();
     if ($this->getRequest()->getParam('id')) {
         $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('menuAwards'), array('action' => 'index'))->add($this->getTranslator()->trans('edit'), array('action' => 'treat'));
         $this->getView()->set('awards', $awardsMapper->getAwardsById($this->getRequest()->getParam('id')));
     } else {
         $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('menuAwards'), array('action' => 'index'))->add($this->getTranslator()->trans('add'), array('action' => 'treat'));
     }
     if ($this->getRequest()->isPost()) {
         $model = new AwardsModel();
         if ($this->getRequest()->getParam('id')) {
             $model->setId($this->getRequest()->getParam('id'));
         }
         $date = new \Ilch\Date(trim($this->getRequest()->getPost('date')));
         $rank = trim($this->getRequest()->getPost('rank'));
         $utId = trim($this->getRequest()->getPost('utId'));
         $typ = trim($this->getRequest()->getPost('typ'));
         if (empty($date)) {
             $this->addMessage('missingDate', 'danger');
         } elseif (empty($rank)) {
             $this->addMessage('missingRank', 'danger');
         } elseif (empty($typ)) {
             $this->addMessage('missingTyp', 'danger');
         } elseif (empty($utId)) {
             $this->addMessage('missingUTId', 'danger');
         } else {
             $model->setDate($date);
             $model->setRank($rank);
             $model->setEvent($this->getRequest()->getPost('event'));
             $model->setURL($this->getRequest()->getPost('url'));
             $model->setUTId($utId);
             $model->setTyp($typ);
             $awardsMapper->save($model);
             $this->addMessage('saveSuccess');
             $this->redirect(array('action' => 'index'));
         }
     }
     $this->getView()->set('users', $userMapper->getUserList(array('confirmed' => 1)));
 }
示例#5
0
 public function indexAction()
 {
     $userMapper = new UserMapper();
     $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuUserList'), array('action' => 'index'));
     $this->getView()->set('userList', $userMapper->getUserList(array('confirmed' => 1)));
 }