29 $this->logger = $DIC->logger()->obj();
31 $this->container = $a_container_obj;
32 $this->main_container = $a_main_container;
35 parent::__construct($a_parent_class, $a_parent_cmd);
60 $this->
setRowTemplate(
'tpl.crs_manage_timings_row.html',
'Modules/Course');
62 $this->
setTitle($this->lng->txt(
'edit_timings_list'));
64 $this->
addColumn($this->lng->txt(
'title'),
'',
'40%');
65 $this->
addColumn($this->lng->txt(
'crs_timings_short_active'),
'',
'',
false);
68 $this->
addColumn($this->lng->txt(
'crs_timings_short_start_end_rel'),
'',
'',
false);
69 $this->
addColumn($this->lng->txt(
'crs_timings_time_frame'),
'',
'',
false);
71 $this->
addColumn($this->lng->txt(
'crs_timings_short_start_end'),
'',
'',
false);
72 $this->
addColumn($this->lng->txt(
'crs_timings_short_end'),
'');
74 $this->
addColumn($this->lng->txt(
'crs_timings_short_changeable'),
'',
'',
false);
80 #$this->addCommandButton('timingsOff', $this->lng->txt('cancel')); 111 if ($set[
'error'] ==
true) {
112 $this->tpl->setVariable(
'TD_CLASS',
'warning');
114 $this->tpl->setVariable(
'TD_CLASS',
'std');
118 if (strlen($set[
'title_link'])) {
119 $this->tpl->setCurrentBlock(
'title_link');
120 $this->tpl->setVariable(
'TITLE_LINK', $set[
'title_link']);
121 $this->tpl->setVariable(
'TITLE_LINK_NAME', $set[
'title']);
122 $this->tpl->parseCurrentBlock();
124 $this->tpl->setCurrentBlock(
'title_plain');
125 $this->tpl->setVariable(
'TITLE', $set[
'title']);
126 $this->tpl->parseCurrentBlock();
128 if (strlen($set[
'desc'])) {
129 $this->tpl->setCurrentBlock(
'item_description');
130 $this->tpl->setVariable(
'DESC', $set[
'desc']);
131 $this->tpl->parseCurrentBlock();
134 if ($set[
'failure']) {
135 $this->tpl->setCurrentBlock(
'alert');
137 $this->tpl->setVariable(
'ALT_ALERT', $this->lng->txt(
"alert"));
138 $this->tpl->setVariable(
"TXT_ALERT", $this->lng->txt($set[
'failure']));
139 $this->tpl->parseCurrentBlock();
143 $this->tpl->setVariable(
'NAME_ACTIVE',
'item[' . $set[
'ref_id'] .
'][active]');
144 $GLOBALS[
'ilLog']->write(__METHOD__ .
': ' . print_r(
$_POST,
true));
146 $this->tpl->setVariable(
'CHECKED_ACTIVE',
$_POST[
'item'][$set[
'ref_id']][
'active'] ?
'checked="checked"' :
'');
153 include_once
'./Services/Form/classes/class.ilDateTimeInputGUI.php';
160 $this->tpl->setVariable(
'start_abs');
161 $this->tpl->setVariable(
'SUG_START', $dt_input->render());
162 $this->tpl->parseCurrentBlock();
164 $this->tpl->setCurrentBlock(
'start_rel');
165 $this->tpl->setVariable(
'START_REL_VAL', (
int) $set[
'item'][
'suggestion_start_rel']);
167 $this->tpl->setVariable(
'START_REL_VAL',
$_POST[
'item'][$set[
'ref_id']][
'sug_start_rel']);
169 $this->tpl->setVariable(
'START_REL_VAL', (
int) $set[
'item'][
'suggestion_start_rel']);
171 $this->tpl->setVariable(
'START_REL_NAME',
'item[' . $set[
'ref_id'] .
'][sug_start_rel]');
172 $this->tpl->parseCurrentBlock();
177 $this->tpl->setVariable(
'VAL_DURATION_A',
$_POST[
'item'][$set[
'ref_id']][
'duration_a']);
179 $duration = $set[
'item'][
'suggestion_end_rel'] - $set[
'item'][
'suggestion_start_rel'];
180 $this->tpl->setVariable(
'VAL_DURATION_A', (
int) $duration);
182 $this->tpl->setVariable(
'NAME_DURATION_A',
'item[' . $set[
'ref_id'] .
'][duration_a]');
184 include_once
'./Services/Form/classes/class.ilDateTimeInputGUI.php';
191 $this->tpl->setVariable(
'end_abs');
192 $this->tpl->setVariable(
'SUG_END', $dt_end->render());
193 $this->tpl->parseCurrentBlock();
197 $this->tpl->setVariable(
'NAME_CHANGE',
'item[' . $set[
'ref_id'] .
'][change]');
198 $this->tpl->setVariable(
'CHECKED_CHANGE', $set[
'item'][
'changeable'] ?
'checked="checked"' :
'');
200 $this->tpl->setVariable(
'CHECKED_CHANGE',
$_POST[
'item'][$set[
'ref_id']][
'change'] ?
'checked="checked"' :
'');
202 $this->tpl->setVariable(
'CHECKED_CHANGE', $set[
'item'][
'changeable'] ?
'checked="checked"' :
'');
210 public function parse($a_item_data, $a_failed_update = array())
213 foreach ($a_item_data as $item) {
214 $current_row = array();
217 if ($item[
'type'] ==
'itgr') {
220 $current_row[
'ref_id'] = $item[
'ref_id'];
221 $current_row = $this->
parseTitle($current_row, $item);
224 if (array_key_exists($item[
'ref_id'], $a_failed_update)) {
225 $current_row[
'failed'] =
true;
226 $current_row[
'failure'] = $a_failed_update[$item[
'ref_id']];
228 $current_row[
'item'] = $item;
230 $rows[] = $current_row;
242 include_once
'./Services/Link/classes/class.ilLink.php';
243 switch ($item[
'type']) {
246 $current_row[
'title'] = $item[
'title'];
247 $current_row[
'title_link'] =
ilLink::_getLink($item[
'ref_id'], $item[
'type']);
251 if (strlen($item[
'title'])) {
252 $current_row[
'title'] = $item[
'title'];
254 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
262 $current_row[
'title_link'] =
ilLink::_getLink($item[
'ref_id'], $item[
'type']);
266 $current_row[
'title'] = $item[
'title'];
267 $current_row[
'title_link'] =
'';
271 $current_row[
'desc'] = $item[
'desc'];
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
__construct($a_parent_class, $a_parent_cmd, ilObject $a_container_obj, ilObjCourse $a_main_container)
Constructor.
const IL_CRS_VIEW_TIMING_ABSOLUTE
setFailureStatus($a_status)
Set status.
fillRow($set)
Fill table row.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
getFailureStatus()
Get failure status.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static _appointmentToString($start, $end, $fulltime)
const IL_CRS_VIEW_TIMING_RELATIVE
getFormAction()
Get Form action parameter.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
TableGUI class for timings administration.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
static _lookupAppointment($a_obj_id)
lookup appointment
parseTitle($current_row, $item)
Parse title.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
parse($a_item_data, $a_failed_update=array())
Parse table content.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.