예제 #1
0
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_payroll_payments_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Employee\'s Salaries'));
     $this->title[] = at('Employee\'s Salaries');
 }
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_payroll_standard_salary_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Standard Salary'));
     $this->title[] = at('Standard Salary');
 }
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_attendances_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Attendances'));
     $this->title[] = at('Attendances');
 }
예제 #4
0
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_payroll_cities_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Area Cities'));
     $this->title[] = at('Area Cities');
 }
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_employee_termination_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Employee Termination'));
     $this->title[] = at('Employee Termination');
 }
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_masters_employee_employments_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Employments'));
     $this->title[] = at('Employee Employments');
 }
예제 #7
0
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_payroll_allowance_groups_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Allowance Groups'));
     $this->title[] = at('Allowances Groups');
 }
예제 #8
0
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_payroll_ump_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Regional Minimum Wage'));
     $this->title[] = at('Regional Minimum Wage');
 }
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_masters_positions_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Positions'));
     $this->title[] = at('Positions');
 }
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_reference_educations_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Educations'));
     $this->title[] = at('Educations');
 }
예제 #11
0
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_reference_districts_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Geography'));
     $this->addBreadCrumb(at('Districts'));
     $this->title[] = at('Districts');
 }
예제 #12
0
 /**
  * init
  */
 public function init()
 {
     // Check Access
     checkAccessThrowException('op_media_view');
     // Make sure uploads directory is set
     if (!getParam('uploads_dir')) {
         throw new CHttpException(500, Yii::t('media', 'Sorry, You must set the uploads directory first. From the top menu Go to Tools -> Settings -> Missing Settings.'));
     }
     parent::init();
     // Add Breadcrumb
     $this->addBreadCrumb(at('Media Manager'));
     $this->title[] = at('Media Manager');
 }
예제 #13
0
 /**
  * User manager index
  */
 public function actionLoginHistory()
 {
     // Check Access
     checkAccessThrowException('op_loginhistory_view');
     $model = new AdminLoginHistory('search');
     $model->unsetAttributes();
     if (isset($_GET['AdminLoginHistory'])) {
         $model->attributes = $_GET['AdminLoginHistory'];
     }
     // Add Breadcrumb
     $this->addBreadCrumb(at('Login History'));
     $this->title[] = at('Admin Login History');
     $this->render('login_history', array('model' => $model));
 }
예제 #14
0
 public function actionIndex()
 {
     // Submitted form
     if (isset($_POST['dashboard_staff_message'])) {
         // Check access
         checkAccessThrowException('op_dashboard_update_staff_message');
         // Update message
         Setting::model()->updateSettingByKey('dashboard_staff_message', $_POST['dashboard_staff_message']);
         // Log Message
         alog(at("Updated Staff Message"));
         // Updated redirect
         fok(at('Message Saved.'));
         $this->redirect(array('index'));
     }
     $logModel = new AdminLog();
     $this->render('index', array('logModel' => $logModel));
 }
 /**
  * adding auth item child relationships
  */
 public function actionAddItemChild()
 {
     // Check Access
     checkAccessThrowException('op_permission_add_item_child');
     $model = new AuthItemChild();
     $roles = AuthItem::model()->findAll(array('order' => 'type DESC, name ASC'));
     $_roles = array();
     if (count($roles)) {
         foreach ($roles as $role) {
             $_roles[AuthItem::model()->types[$role->type]][$role->name] = $role->description . ' (' . $role->name . ')';
         }
     }
     // Did we choose a parent already?
     if (isset($_GET['parent']) && $_GET['parent'] != '') {
         $model->parent = $_GET['parent'];
     }
     if (isset($_POST['AuthItemChild'])) {
         if (isset($_POST['AuthItemChild']['child']) && count($_POST['AuthItemChild']['child'])) {
             // We need to delete all child items selected up until now
             $existsalready = AuthItemChild::model()->findAll('parent=:parent', array(':parent' => $model->parent));
             if (count($existsalready)) {
                 foreach ($existsalready as $existitem) {
                     Yii::app()->authManager->removeItemChild($existitem->parent, $existitem->child);
                 }
             }
             $added = 0;
             foreach ($_POST['AuthItemChild']['child'] as $childItem) {
                 $model->child = $childItem;
                 if ($model->validate()) {
                     $added++;
                 }
             }
             // Get model parent
             $authItem = AuthItem::model()->find('name=:name', array(':name' => $model->parent));
             fok(at('{number} Child item(s) Added.', array('{number}' => $added)));
             // Log Message
             alog(at("Added {number} child items for {name}", array('{number}' => $added, '{name}' => $model->parent)));
             if ($authItem) {
                 $this->redirect(array('view', 'id' => $authItem->id, '#' => 'tabs-2'));
             } else {
                 $this->redirect(array('index'));
             }
         }
     }
     // Selected values
     $selected = AuthItemChild::model()->findAll('parent=:parent', array(':parent' => $model->parent));
     $_selected = array();
     if (count($selected)) {
         foreach ($selected as $select) {
             $_selected[] = $select->child;
         }
     }
     $model->child = $_selected;
     // Add Breadcrumb
     $this->addBreadCrumb(at('Adding Child Permissions'));
     $this->title[] = at('Adding Child Permissions');
     $this->render('child_form', array('model' => $model, 'roles' => $_roles));
 }
예제 #16
0
 /**
  * Sync theme
  */
 public function actionSync($id)
 {
     // Check Access
     checkAccessThrowException('op_theme_sync');
     if ($model = Theme::model()->findByPk($id)) {
         $total = $model->SyncTheme();
         alog(at("Synced Theme '{name}'.", array('{name}' => $model->name)));
         fok(at('Theme Synced. Total {n} files synced.', array('{n}' => $total)));
         $this->redirect(array('themes/index'));
     } else {
         $this->redirect(array('themes/index'));
     }
 }
예제 #17
0
 /**
  * Delete user
  */
 public function actionDelete($id)
 {
     // Check Access
     checkAccessThrowException('op_users_delete');
     $model = User::model()->findByPk($id);
     if ($model) {
         // Log Message
         alog(at("Deleted user: '******'.", array('{name}' => $model->name)));
         $model->delete();
         fok(at('User Deleted!'));
     } else {
         throw new CHttpException(404, at('Sorry, That record was not found.'));
     }
 }
예제 #18
0
 /**
  * Delete city action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_uscities_deletepages');
     if (isset($_GET['id']) && ($model = USCity::model()->findByPk($_GET['id']))) {
         alog(at("Deleted City Record '{name}'.", array('{name}' => $model->city_name)));
         $model->delete();
         fok(at('City Record Deleted.'));
         $this->redirect(array('city/index'));
     } else {
         $this->redirect(array('city/index'));
     }
 }
 /**
  * Delete help topic action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_helptopics_delete');
     if (isset($_GET['id']) && ($model = HelpTopic::model()->findByPk($_GET['id']))) {
         alog(at("Deleted Help Topic '{name}'.", array('{name}' => $model->name)));
         $model->delete();
         fok(at('Help Topic Deleted.'));
         $this->redirect(array('helptopics/index'));
     } else {
         $this->redirect(array('helptopics/index'));
     }
 }
예제 #20
0
 /**
  * Delete page action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_blog_deleteposts');
     if (isset($_GET['id']) && ($model = BlogPost::model()->findByPk($_GET['id']))) {
         alog(at("Deleted Blog Post '{name}'.", array('{name}' => $model->title)));
         $model->delete();
         fok(at('Page Deleted.'));
         $this->redirect(array('blog/index'));
     } else {
         $this->redirect(array('blog/index'));
     }
 }
예제 #21
0
 /**
  * Revert a string to it's original form
  */
 public function actionRevert()
 {
     // Check Access
     checkAccessThrowException('op_language_translate');
     $id = getRParam('id', 0);
     $string = getRParam('string', 0);
     // Check if it exists
     $model = Language::model()->findByPk($id);
     if (!$model) {
         ferror(at('That language was not found.'));
         $this->redirect(array('index'));
     }
     // Grab the string and source
     $source = SourceMessage::model()->findByPk($string);
     $stringdata = Message::model()->find('language_id=:lang AND id=:id', array(':id' => $string, ':lang' => $id));
     if (!$source || !$stringdata) {
         ferror(at('That language string was not found.'));
         $this->redirect(array('index'));
     }
     // Update the stringdata based on the soruce
     Message::model()->updateAll(array('translation' => $source->message), 'language_id=:lang AND id=:id', array(':id' => $string, ':lang' => $id));
     fok(at('String Reverted.'));
     $this->redirect(array('language/view', 'id' => $id));
 }
예제 #22
0
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_ajax_masters_employees_view');
 }
 /**
  * Delete Form Template action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_formtemplate_delete');
     if (isset($_GET['id']) && ($model = FormTemplate::model()->findByPk($_GET['id']))) {
         alog(at("Deleted Form Template '{name}'.", array('{name}' => $model->title)));
         $model->delete();
         fok(at('Form Template Deleted.'));
         $this->redirect(array('formtemplate/index'));
     } else {
         $this->redirect(array('formtemplate/index'));
     }
 }
 /**
  * Delete help topic action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_personalmessages_delete');
     if (isset($_GET['id']) && ($model = PersonalMessageTopic::model()->findByPk($_GET['id']))) {
         alog(at("Deleted Personal Message '{name}'.", array('{name}' => $model->title)));
         // Make sure we are allowed to delete this
         if ($model->author_id != Yii::app()->user->id) {
             ferror(at('Sorry, You are not the author of this personal message so you can not delete it.'));
             alog(at("Tried Deleting a Personal Message '{name}' When he is not the author.", array('{name}' => $model->title)));
             $this->redirect(getReferrer('personalmessages/index'));
         }
         $model->delete();
         fok(at('Personal Message Deleted.'));
         $this->redirect(array('personalmessages/index'));
     } else {
         $this->redirect(array('personalmessages/index'));
     }
 }
예제 #25
0
 /**
  * Revert setting action
  */
 public function actionrevertsetting()
 {
     // Check Access
     checkAccessThrowException('op_settings_revert_settings');
     if (isset($_GET['id'])) {
         $setting = Setting::model()->findByPk($_GET['id']);
         Setting::model()->updateByPk($_GET['id'], array('value' => $setting->default_value));
         if ($setting) {
             $setting->value = $setting->default_value;
             // Store setting and run the php code for storing
             // Evaluate php code
             if ($setting->php) {
                 $show = 0;
                 $save = 0;
                 $store = 1;
                 eval($setting->php);
             }
         }
         // Log Message
         alog(at("Reverted Setting '{name}'", array('{name}' => $setting->title)));
         // Clear cache
         Yii::app()->settings->clearCache();
         fok(at('Setting Reverted.'));
         $this->redirect(array('setting/viewgroup', 'id' => $setting->category));
     } else {
         $this->redirect(array('setting/index'));
     }
 }
 /**
  * Delete page action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_custompages_deletepages');
     if (isset($_GET['id']) && ($model = CustomPage::model()->findByPk($_GET['id']))) {
         alog(at("Deleted Custom Page '{name}'.", array('{name}' => $model->title)));
         $model->delete();
         fok(at('Page Deleted.'));
         $this->redirect(array('custompages/index'));
     } else {
         $this->redirect(array('custompages/index'));
     }
 }
 /**
  * Delete field action
  */
 public function actionDelete()
 {
     // Check Access
     checkAccessThrowException('op_usercustomfields_deleteposts');
     if (isset($_GET['id']) && ($model = UserCustomField::model()->findByPk($_GET['id']))) {
         alog(at("Deleted Custom Field '{name}'.", array('{name}' => $model->title)));
         $model->delete();
         fok(at('Field Deleted.'));
         $this->redirect(array('usercustomfields/index'));
     } else {
         $this->redirect(array('usercustomfields/index'));
     }
 }