<tr> <td> <?php $this->hc_time->setDateDb($sh->date); $date_view = ''; $date_view .= $this->hc_time->formatWeekdayShort(); $date_view .= ', '; $date_view .= $this->hc_time->formatDate(); ?> <?php echo $date_view; ?> </td> <td> <?php $time_view = hc_format_time_of_day($sh->start) . ' - ' . hc_format_time_of_day($sh->end); ?> <?php echo $time_view; ?> </td> <td> <?php echo $this->hc_time->formatPeriodShort($sh->get_duration(), 'hour'); ?> </td> <?php if ($location_count > 1) { ?> <td> <i class="fa fa-home"></i> <?php
<?php echo Hc_html::wrap_input($fields['date']['label'], $this->hc_form->build_input($fields['date'])); } ?> <?php if (count($shift_templates)) { $templates_label = array(); $templates_label[] = '<div class="dropdown">'; $templates_label[] = '<a class="dropdown-toggle" data-toggle="dropdown" href="#">' . lang('time') . ' <b class="caret"></b></a>'; $templates_label[] = '<ul class="dropdown-menu" role="menu">'; foreach ($shift_templates as $sht) { $end = $sht->end > 24 * 60 * 60 ? $sht->end - 24 * 60 * 60 : $sht->end; $templates_label[] = '<li>'; $templates_label[] = '<a href="#" class="hc-shift-templates" data-start="' . $sht->start . '" data-end="' . $end . '">'; $templates_label[] = $sht->name . '<br>' . hc_format_time_of_day($sht->start) . ' - ' . hc_format_time_of_day($sht->end); $templates_label[] = '</a>'; $templates_label[] = '</li>'; } $templates_label[] = '</ul>'; $templates_label[] = '</div>'; $templates_label = join("\n", $templates_label); } else { $templates_label = lang('time'); } echo Hc_html::wrap_input($templates_label, array($this->hc_form->build_input($fields['start']), ' - ', $this->hc_form->build_input($fields['end']))); ?> <?php if ($location_count > 1) { ?>
$my_user_id = $this->auth->user()->id; $is_my = $my_user_id == $sh->user_id ? TRUE : FALSE; $notes = array(); if ($this->hc_modules->exists('notes')) { $notes = $this->access_manager->filter_see($sh->note->get()->all); } $this->hc_time->setDateDb($sh->date); $date_view = ''; $date_view .= $this->hc_time->formatWeekdayShort(); $date_view .= ', '; $date_view .= $this->hc_time->formatDate(); $show_end_time_for_staff = $this->app_conf->get('show_end_time_for_staff'); $time_view = hc_format_time_of_day($sh->start); if ($show_end_time_for_staff) { $time_view .= ' - ' . hc_format_time_of_day($sh->end); } $conflicts = $sh->conflicts(); $container_class = $conflicts ? 'alert-danger' : 'alert-none'; ?> <div class="alert alert-condensed <?php echo $container_class; ?> "> <ul class="list-unstyled list-separated"> <li> <i class="fa-fw fa fa-calendar"></i> <?php if ($is_my) { ?>
function export_browse() { $separator = $this->app_conf->get('csv_separator'); // header $headers = array(lang('time_date'), lang('time'), lang('time_duration'), lang('user_level_staff'), lang('location'), lang('shift_status')); $data = array(); $data[] = join($separator, $headers); // shifts reset($this->data['shifts']); foreach ($this->data['shifts'] as $sh) { if ($sh->date < $this->data['start_date']) { continue; } if ($sh->date > $this->data['end_date']) { continue; } if ($this->data['filter'] == 'location' && $sh->location_id != $this->data['current_location']->id) { continue; } $values = array(); // date $this->hc_time->setDateDb($sh->date); $date_view = ''; $date_view .= $this->hc_time->formatWeekdayShort(); $date_view .= ', '; $date_view .= $this->hc_time->formatDate(); $values[] = $date_view; // time $time_view = hc_format_time_of_day($sh->start) . ' - ' . hc_format_time_of_day($sh->end); $values[] = $time_view; // duration $values[] = $this->hc_time->formatPeriodShort($sh->get_duration(), 'hour'); // staff if ($sh->user_id && isset($this->data['staffs'][$sh->user_id])) { $staff_title = $this->data['staffs'][$sh->user_id]->full_name(); } else { $staff_title = ''; } $values[] = $staff_title; // location $values[] = $sh->location_name; // status $conflicts = $sh->conflicts($this->data['shifts'], $this->data['timeoffs']); if ($sh->user_id && count($conflicts)) { $status = lang('shift_conflict'); } else { $status = $sh->prop_text('status', FALSE, $sh->get_status()); } $values[] = $status; /* add csv line */ $data[] = hc_build_csv(array_values($values), $separator); } // output $out = join("\n", $data); $file_name = isset($this->conf['export']) ? $this->conf['export'] : 'export'; $file_name .= '-' . date('Y-m-d_H-i') . '.csv'; $this->load->helper('download'); force_download($file_name, $out); return; }
<?php $CI =& ci_get_instance(); $class = 'alert alert-success'; ?> <div class="<?php echo $class; ?> "> <?php echo ci_anchor(array($this->conf['path'], 'delete', $e->id), '×', 'class="close hc-confirm" title="' . lang('common_delete') . '"'); echo ci_anchor(array($this->conf['path'], 'edit', $e->id), '<strong>' . $e->name . '</strong>'); ?> <br> <?php echo hc_format_time_of_day($e->start); ?> - <?php echo hc_format_time_of_day($e->end); ?> <br> [<?php echo $this->hc_time->formatPeriod($e->get_duration()); ?> ] </div>