diff --git a/block_hshcourselist.php b/block_hshcourselist.php index bca3336515b3c62ee87d3f20128059ec9dc1f3ac..c0d568906966eb7eab812668c66b07cad09d3083 100644 --- a/block_hshcourselist.php +++ b/block_hshcourselist.php @@ -26,7 +26,6 @@ class block_hshcourselist extends block_base { global $CFG, $DB, $OUTPUT; $this->page->requires->js('/blocks/hshcourselist/javascript/jquery-3.2.0.min.js'); - $this->page->requires->js_call_amd('block_hshcourselist/listselect', 'init', array($CFG->wwwroot)); $this->page->requires->css('/blocks/hshcourselist/style.css'); if ($this->content !== null) { @@ -36,7 +35,7 @@ class block_hshcourselist extends block_base { $this->content = new stdClass(); $context_block = context_block::instance($this->instance->id); $search = optional_param('hshcoursesearch', '', PARAM_TEXT); - + $hshcoursesubmit = optional_param('hshcoursesubmit', false, PARAM_TEXT); // set placeholder if($this->config->placeholder) { @@ -45,7 +44,7 @@ class block_hshcourselist extends block_base { $placeholder = ""; } $list_contents = ''; - $anchor = html_writer::tag('a', '', array('name' => 'hshcourselistanchor')); + $anchor = html_writer::tag('a', '', array('name' => 'hshcourselistanchor')); $ordercheckbox = html_writer::empty_tag('input', array('type' => 'checkbox', 'name' => 'orderbysemestercheckbox', 'id' => 'orderbysemestercheckbox_id')); $ordercheckbox .= html_writer::start_tag('label', array('for' => 'orderbysemestercheckbox_id')); @@ -92,10 +91,10 @@ class block_hshcourselist extends block_base { ); $questionhsh = html_writer::start_span("helpbutton"); - $questionhsh .= html_writer::start_tag('a', $atagparams); - $questionhsh .= html_writer::start_tag('i', $questionattrs); - $questionhsh .= html_writer::end_tag('i'); - $questionhsh .= html_writer::end_tag('a'); + $questionhsh .= html_writer::start_tag('a', $atagparams); + $questionhsh .= html_writer::start_tag('i', $questionattrs); + $questionhsh .= html_writer::end_tag('i'); + $questionhsh .= html_writer::end_tag('a'); $questionhsh .= html_writer::end_span(); $progressattrs = array( @@ -107,18 +106,18 @@ class block_hshcourselist extends block_base { $progress = html_writer::empty_tag('img', $progressattrs); $formattrs = array( - 'id' => 'hshcourseform', - 'method' => 'post', - 'name' => 'hshcourselistform', - //'action' => $this->page->url->out().'#hshcourselistanchor' - 'action' => new moodle_url('/') - ); + 'id' => 'hshcourseform', + 'method' => 'post', + 'name' => 'hshcourselistform', + //'action' => $this->page->url->out().'#hshcourselistanchor' + 'action' => new moodle_url('/') + ); $form = html_writer::tag('form', $idSearchinglabel.$ordercheckbox.$questionhsh.$input.$progress, $formattrs); if (!empty($hshcoursesubmit)) { $courses = self::get_courses($search, $context_block, $this->globalconf->splitterms, - $this->globalconf->restrictcontext, $this->page->context, - $this->globalconf->idSearching, $this->config->orderbysemester); + $this->globalconf->restrictcontext, $this->page->context, + $this->globalconf->idSearching, $this->config->orderbysemester); if (!empty($courses)) { foreach ($courses as $course) { @@ -178,6 +177,7 @@ class block_hshcourselist extends block_base { if (!empty($this->config->title) && $this->config->enablecustomheader) { $this->title = $this->config->title; } + $this->page->requires->js_call_amd('block_hshcourselist/listselect', 'init', array($CFG->wwwroot)); return $this->content; } @@ -201,7 +201,7 @@ class block_hshcourselist extends block_base { if($idSearch) { $params = array_merge($params, array($search)); $where .= 'id = ?'; -// $where .= 'idnumber LIKE ?'; --- Bei Postgres nur "id" + // $where .= 'idnumber LIKE ?'; --- Bei Postgres nur "id" } else { $params = array_merge($params, array("%$search%", "%$search%")); $where .= 'shortname ILIKE ? OR fullname ILIKE ?'; @@ -227,6 +227,6 @@ class block_hshcourselist extends block_base { $fields = 'id, idnumber, shortname, fullname'; $courses = $DB->get_recordset_select('course', $where, $params, $order, $fields); - return $courses; + return $courses; } } diff --git a/version.php b/version.php index 82ca49a0779cf0d9820f355938b4f00dd2903ff5..85771de3c8343538b522ff53ebbb4072c1e66441 100644 --- a/version.php +++ b/version.php @@ -1,4 +1,4 @@ <?php $plugin->component = 'block_hshcourselist'; -$plugin->version = 2018082901; // YYYYMMDDHH +$plugin->version = 2018083000; // YYYYMMDDHH $plugin->requires = 2016112900; // YYYYMMDDHH