Beispiel #1
0
 function __construct()
 {
     $this->conf = array('path' => 'admin/schedules');
     parent::__construct(User_model::LEVEL_MANAGER);
     /* check how many locations do we have */
     $lm = new Location_Model();
     $location_count = $lm->count();
     $this->data['location_count'] = $location_count;
     /* check how many staff do we have */
     $um = new User_Model();
     $staff_count = $um->count_staff();
     $this->data['staff_count'] = $staff_count;
     $um = new User_Model();
     $staffs = $um->get()->all;
     $this->data['staffs'] = array();
     foreach ($staffs as $sta) {
         $this->data['staffs'][$sta->id] = $sta;
     }
     /* also get all shift templates */
     $shift_template_titles = array();
     $stm = new Shift_Template_Model();
     $stm->get();
     foreach ($stm->get() as $st) {
         //			$shift_template_titles[ $st->start . '-' . $st->end ] = $st->name;
     }
     $this->data['shift_template_titles'] = $shift_template_titles;
 }
Beispiel #2
0
 function __construct()
 {
     $this->conf = array('model' => 'Shift_model', 'path' => 'admin/shifts', 'entity' => 'shift', 'after_save' => 'shift');
     parent::__construct(User_model::LEVEL_MANAGER);
     /* check how many locations do we have */
     $lm = new Location_Model();
     $location_count = $lm->count();
     $this->data['location_count'] = $location_count;
 }
Beispiel #3
0
 function __construct()
 {
     $this->conf = array('model' => 'Shift_model', 'path' => 'staff/shifts', 'entity' => 'shift');
     parent::__construct(USER_MODEL::LEVEL_STAFF);
     $this->{$this->model} = $this->auth->user()->shift;
     $this->{$this->model}->user = $this->auth->user();
     //		$this->data['fields'] = $this->process_fields();
     //		parent::__construct( USER_MODEL::LEVEL_STAFF, 'staff/shifts' );
     /* check how many locations do we have */
     $lm = new Location_Model();
     $location_count = $lm->count();
     $this->data['location_count'] = $location_count;
 }
Beispiel #4
0
 public function view_text($skip = array())
 {
     $return = parent::view_text($skip);
     unset($return['start']);
     unset($return['end']);
     unset($return['status']);
     $return['date'][1] = $this->date_view($skip);
     /* optimize it sometime later */
     $lm = new Location_Model();
     $location_count = $lm->count();
     if ($location_count < 2) {
         unset($return['location']);
     }
     return $return;
 }
Beispiel #5
0
 function __construct()
 {
     $this->conf = array('path' => 'wall');
     parent::__construct();
     $this->load->library('hc_time');
     /* check user level */
     $remote_integration = $this->remote_integration();
     if ($remote_integration) {
         $user_level = 0;
     } else {
         $user_level = $this->app_conf->get('wall_schedule_display');
     }
     if ($user_level) {
         $this->check_level($user_level);
     }
     /* check how many locations do we have */
     $lm = new Location_Model();
     $location_count = $lm->count();
     $this->data['location_count'] = $location_count;
 }