From 6cff7d762d2a0957f54b607dbd351b9f263048f7 Mon Sep 17 00:00:00 2001 From: L_DA Date: Fri, 6 Nov 2020 10:19:55 +0100 Subject: [PATCH] Matching of type in SQL-Like improved --- LICENSE.md | 0 README.md | 0 amd/build/search.min.js | 0 amd/src/search.js | 0 classes/output/renderer.php | 0 classes/output/searchform.php | 0 classes/output/timetable.php | 0 classes/timetable.php | 2 +- db/access.php | 0 db/install.php | 0 db/install.xml | 0 db/services.php | 0 db/uninstall.php | 0 db/upgrade.php | 0 externallib.php | 0 index.php | 0 lang/en/timetable.php | 0 lib.php | 0 mod_form.php | 0 pix/icon.png | Bin pix/icon.svg | 0 settings.php | 0 styles.css | 0 templates/searchform.mustache | 0 templates/searchresult.mustache | 0 templates/timetable.mustache | 0 version.php | 0 view.php | 0 28 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 LICENSE.md mode change 100644 => 100755 README.md mode change 100644 => 100755 amd/build/search.min.js mode change 100644 => 100755 amd/src/search.js mode change 100644 => 100755 classes/output/renderer.php mode change 100644 => 100755 classes/output/searchform.php mode change 100644 => 100755 classes/output/timetable.php mode change 100644 => 100755 db/access.php mode change 100644 => 100755 db/install.php mode change 100644 => 100755 db/install.xml mode change 100644 => 100755 db/services.php mode change 100644 => 100755 db/uninstall.php mode change 100644 => 100755 db/upgrade.php mode change 100644 => 100755 externallib.php mode change 100644 => 100755 index.php mode change 100644 => 100755 lang/en/timetable.php mode change 100644 => 100755 lib.php mode change 100644 => 100755 mod_form.php mode change 100644 => 100755 pix/icon.png mode change 100644 => 100755 pix/icon.svg mode change 100644 => 100755 settings.php mode change 100644 => 100755 styles.css mode change 100644 => 100755 templates/searchform.mustache mode change 100644 => 100755 templates/searchresult.mustache mode change 100644 => 100755 templates/timetable.mustache mode change 100644 => 100755 version.php mode change 100644 => 100755 view.php diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/amd/build/search.min.js b/amd/build/search.min.js old mode 100644 new mode 100755 diff --git a/amd/src/search.js b/amd/src/search.js old mode 100644 new mode 100755 diff --git a/classes/output/renderer.php b/classes/output/renderer.php old mode 100644 new mode 100755 diff --git a/classes/output/searchform.php b/classes/output/searchform.php old mode 100644 new mode 100755 diff --git a/classes/output/timetable.php b/classes/output/timetable.php old mode 100644 new mode 100755 diff --git a/classes/timetable.php b/classes/timetable.php index f14a447..6df582e 100755 --- a/classes/timetable.php +++ b/classes/timetable.php @@ -126,7 +126,7 @@ class timetable { $day = new \DateTime($this->monday->format('Y-m-d\TH:i:sP')); for ($i=0; $i<$this->numdayweek; $i++) { - $sql = "date = '".$day->format('Ymd')."' AND ({$this->type}a LIKE '%{$this->name}%' OR {$this->type}b LIKE '%{$this->name}%')"; + $sql = "date = '".$day->format('Ymd')."' AND ({$this->type}a RLIKE '(^|~){$this->name}($|~)' OR {$this->type}b RLIKE '(^|~){$this->name}($|~)')"; if ($result = $DB->get_records_select('timetable_substitution',$sql)) { foreach ($result as $substitution) { $this->data[$i+1][$substitution->period]['substitution'][] = $substitution; diff --git a/db/access.php b/db/access.php old mode 100644 new mode 100755 diff --git a/db/install.php b/db/install.php old mode 100644 new mode 100755 diff --git a/db/install.xml b/db/install.xml old mode 100644 new mode 100755 diff --git a/db/services.php b/db/services.php old mode 100644 new mode 100755 diff --git a/db/uninstall.php b/db/uninstall.php old mode 100644 new mode 100755 diff --git a/db/upgrade.php b/db/upgrade.php old mode 100644 new mode 100755 diff --git a/externallib.php b/externallib.php old mode 100644 new mode 100755 diff --git a/index.php b/index.php old mode 100644 new mode 100755 diff --git a/lang/en/timetable.php b/lang/en/timetable.php old mode 100644 new mode 100755 diff --git a/lib.php b/lib.php old mode 100644 new mode 100755 diff --git a/mod_form.php b/mod_form.php old mode 100644 new mode 100755 diff --git a/pix/icon.png b/pix/icon.png old mode 100644 new mode 100755 diff --git a/pix/icon.svg b/pix/icon.svg old mode 100644 new mode 100755 diff --git a/settings.php b/settings.php old mode 100644 new mode 100755 diff --git a/styles.css b/styles.css old mode 100644 new mode 100755 diff --git a/templates/searchform.mustache b/templates/searchform.mustache old mode 100644 new mode 100755 diff --git a/templates/searchresult.mustache b/templates/searchresult.mustache old mode 100644 new mode 100755 diff --git a/templates/timetable.mustache b/templates/timetable.mustache old mode 100644 new mode 100755 diff --git a/version.php b/version.php old mode 100644 new mode 100755 diff --git a/view.php b/view.php old mode 100644 new mode 100755