diff --git a/app/views/course/wizard/steps/lvgroups/lvgroup_searchentry.php b/app/views/course/wizard/steps/lvgroups/lvgroup_searchentry.php index e4af01c1b94775880ac8c19d1cbe022680a03d7a..a6715da793b1a98870c3ad99f26d8fb5a023f858 100644 --- a/app/views/course/wizard/steps/lvgroups/lvgroup_searchentry.php +++ b/app/views/course/wizard/steps/lvgroups/lvgroup_searchentry.php @@ -1,19 +1,21 @@ -<? -# Lifter010: TODO +<?php $_id = htmlReady(implode('_', (array) $area->getId())); ?> <li id="lvgruppe_search_<?= $_id ?>" class="<?= TextHelper::cycle('odd', 'even') ?>"> -<? if (!$inlist) : ?> - <?= Icon::create('arr_2left', 'sort')->asInput(["name" => 'assign['.$_id.']', "onclick" => "return STUDIP.MVV.CourseWizard.assignNode('".$_id."')", - "class" => in_array($_id,$values['studyareas']?:[])?'hidden-no-js':'']) ?> -<? endif; ?> - <?/* <span class="lvgruppe_selection_expand">*/?> + <?= Icon::create('arr_2left', Icon::ROLE_SORT)->asInput([ + 'name' => "assign[{$_id}]", + 'onclick' => "return STUDIP.MVV.CourseWizard.assignNode('{$_id}')", + 'class' => in_array($_id, $values['studyareas'] ?: []) ? 'hidden-no-js' : '', + ]) ?> + <?= htmlReady($area->getDisplayName()) ?> - <?= Icon::create('info', 'clickable')->asInput(["name" => 'lvgruppe_search[details]['.$_id.']', - "onclick" => "return STUDIP.MVV.CourseWizard.showSearchDetails('".$_id."')", "class" => '', - "data-id" => $_id, "data-course_id" => htmlReady($course_id)]) ?> - <?/* - </span>*/?> + <?= Icon::create('info')->asInput([ + 'name' => "lvgruppe_search[details][{$_id}]", + 'onclick' => "return STUDIP.MVV.CourseWizard.showSearchDetails('{$_id}')", + 'class' => '', + 'data-id' => $_id, + 'data-course_id' => htmlReady($course_id), + ]) ?> </li> diff --git a/composer.json b/composer.json index a99ae27c2d3c9867be532dce37ea7be3cd5c4ac2..3d4cea4f95629c5924ce916868381803134dc646 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ "ext-pcre": "*", "ext-pdo": "*", "ext-mbstring": "*", + "ext-dom": "*", "opis/json-schema": "^1.0", "slim/psr7": "1.4", "slim/slim": "4.7.1", diff --git a/lib/admission.inc.php b/lib/admission.inc.php index 86980b7fe9cc35f8f1987f8299f4dc458dddcec1..817dbb50c21dbc4ff7c730c59159dbd9511b93ce 100644 --- a/lib/admission.inc.php +++ b/lib/admission.inc.php @@ -50,7 +50,7 @@ require_once 'lib/dates.inc.php'; * to seminar_user. Overrides the $contingent-parameter * @param string $contingent optional studiengang_id, if no id is given, no contingent is considered * @param string $log_message optional log-message. if no log-message is given a default one is used - * @return void + * @return bool */ function insert_seminar_user($seminar_id, $user_id, $status, $copy_studycourse = false, $contingent = false, $log_message = false) { diff --git a/lib/admissionrules/coursememberadmission/templates/configure.php b/lib/admissionrules/coursememberadmission/templates/configure.php index 68b6312bc7a77ce45309aabfba1a43e0a561aaf4..c5d3e4efad234501acb1d39cbb0f243d648f845f 100644 --- a/lib/admissionrules/coursememberadmission/templates/configure.php +++ b/lib/admissionrules/coursememberadmission/templates/configure.php @@ -41,7 +41,7 @@ <div style="display:flex; align-items: flex-start; column-gap: 1em; flex-wrap: wrap"> <?= - QuickSearch::get("mandatory_course_id", new SeminarSearch('number-name-lecturer')) + QuickSearch::get('mandatory_course_id', new SeminarSearch()) ->fireJSFunctionOnSelect('addcourse') ->setInputStyle('flex: 0 0 40%') ->render(); diff --git a/lib/classes/DbView.class.php b/lib/classes/DbView.class.php index 45d580e80bac5a64f2c43012fafc5c592ddde0f8..bcd7d0f8eb92924d1f57a3ff703368d980548892 100644 --- a/lib/classes/DbView.class.php +++ b/lib/classes/DbView.class.php @@ -162,9 +162,9 @@ class DbView { foreach (self::$dbviewfiles as $view => $status) { if ($status === 0) { - include 'lib/dbviews/' . $view . '.view.php'; - self::$dbviews += $_views; - unset($_views); + $views = include 'lib/dbviews/' . $view . '.view.php'; + self::$dbviews += $views; + self::$dbviewfiles[$view] = 1; } } diff --git a/lib/classes/PageLayout.php b/lib/classes/PageLayout.php index a8f3ffac40c55a2a6892a2ff549d37ab20197c0d..ecb34b7c1222d2173b6fc9ccb361d24bd650acca 100644 --- a/lib/classes/PageLayout.php +++ b/lib/classes/PageLayout.php @@ -392,7 +392,6 @@ class PageLayout $package_elements = []; if (isset($GLOBALS['_include_stylesheet'])) { - unset($package_elements['base-style.css']); self::addStylesheet($GLOBALS['_include_stylesheet'], ['media' => 'screen, print']); } diff --git a/lib/classes/StudipArrayObject.class.php b/lib/classes/StudipArrayObject.class.php index c1aa0f32f80ea91607959447cc32cd21720d8da5..bb5444c6188cacdd7ec8fb2290a2b13ea9b465b8 100644 --- a/lib/classes/StudipArrayObject.class.php +++ b/lib/classes/StudipArrayObject.class.php @@ -89,7 +89,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, public function __set($key, $value) { if ($this->flag == self::ARRAY_AS_PROPS) { - return $this->offsetSet($key, $value); + $this->offsetSet($key, $value); + return; } $this->validateKeyUsage($key); @@ -106,7 +107,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, public function __unset($key) { if ($this->flag == self::ARRAY_AS_PROPS) { - return $this->offsetUnset($key); + $this->offsetUnset($key); + return; } $this->validateKeyUsage($key); @@ -122,7 +124,6 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, */ public function __get($key) { - $ret = null; if ($this->flag == self::ARRAY_AS_PROPS) { $ret = $this->offsetGet($key); return $ret; @@ -300,7 +301,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, public function offsetSet($key, $value) { if (is_null($key)) { - return $this->append($value); + $this->append($value); + return; } $this->storage[$key] = $value; } diff --git a/lib/classes/StudipSemTreeViewSimple.class.php b/lib/classes/StudipSemTreeViewSimple.class.php index fee30abffa13902968e567895ca3a3f4cfed56da..e2150472b3a649d7547784590ea8a299daf7f300 100644 --- a/lib/classes/StudipSemTreeViewSimple.class.php +++ b/lib/classes/StudipSemTreeViewSimple.class.php @@ -44,7 +44,7 @@ class StudipSemTreeViewSimple * constructor * */ - public function __construct($start_item_id = "root", $sem_number = false, $sem_status, $visible_only = false) + public function __construct($start_item_id = 'root', $sem_number = false, $sem_status = false, $visible_only = false) { $this->start_item_id = ($start_item_id) ? $start_item_id : "root"; $this->root_content = $GLOBALS['UNI_INFO']; @@ -75,7 +75,7 @@ class StudipSemTreeViewSimple <div class="sem-path">'. '<div class="sem-path-dir">'. $this->getSemPath($start_id); - echo + echo '</div> <div class="sem_path_info"> <div class="sem_path_title">'. @@ -179,7 +179,7 @@ class StudipSemTreeViewSimple return $ret; } - public function showContent($item_id, $num_all_entries) + public function showContent($item_id, $num_all_entries = 0) { echo "\n<div align=\"left\" style=\"margin-top:10px;margin-bottom:10px;font-size:10pt\">"; if ($item_id != "root"){ diff --git a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php index 93f2c1b98b0fa6e167be9bf437186cfbe8cdffcd..0dbf0582b72eacfcbc4af297fc052067a494c88b 100644 --- a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php +++ b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php @@ -224,7 +224,7 @@ class LVGroupsWizardStep implements CourseWizardStep } $factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views'); - $html = $factory->render('course/wizard/steps/lvgroups/lvgroup_searchentry', compact('area', 'inlist')); + $html = $factory->render('course/wizard/steps/lvgroups/lvgroup_searchentry', compact('area')); $data = [ 'id' => $area->id, 'html_string' => $html diff --git a/lib/classes/librarysearch/resultparsers/BASELibraryResultParser.class.php b/lib/classes/librarysearch/resultparsers/BASELibraryResultParser.class.php index c1025f5efab7aac2c00db4034c92530f3d91cd49..b92628f1ce64c47f8244a1a531e56b23c290035e 100644 --- a/lib/classes/librarysearch/resultparsers/BASELibraryResultParser.class.php +++ b/lib/classes/librarysearch/resultparsers/BASELibraryResultParser.class.php @@ -144,13 +144,15 @@ class BASELibraryResultParser implements LibraryResultParser /** * @see LibraryResultParser::readRecord */ - public function readRecord($data = '') : LibraryDocument + public function readRecord($data = ''): LibraryDocument { - $dom = new \DOMDocument(); + $dom = new DOMDocument(); @$dom->loadXML($data); $record = $dom->getElementsByTagName('doc')[0]; if ($record) { return $this->readXMLRecord($record); } + + throw new Exception('Could not read record'); } } diff --git a/lib/classes/librarysearch/resultparsers/MarcxmlLibraryResultParser.class.php b/lib/classes/librarysearch/resultparsers/MarcxmlLibraryResultParser.class.php index 37225ee28231634be0e90a46be01a6fa20dea587..8017f3db1ee886039cfa5e5d03b37ae40454a02a 100644 --- a/lib/classes/librarysearch/resultparsers/MarcxmlLibraryResultParser.class.php +++ b/lib/classes/librarysearch/resultparsers/MarcxmlLibraryResultParser.class.php @@ -201,12 +201,14 @@ class MarcxmlLibraryResultParser implements LibraryResultParser */ public function readRecord($data = ''): LibraryDocument { - $dom = new \DOMDocument(); + $dom = new DOMDocument(); $dom->loadXML($data); $record = $dom->getElementsByTagName('record')[0]; if ($record instanceof \DOMElement) { return $this->readResultNode($record); } + + throw new Exception('Could not read record'); } /** diff --git a/lib/classes/librarysearch/resultparsers/SRULibraryResultParser.class.php b/lib/classes/librarysearch/resultparsers/SRULibraryResultParser.class.php index 2bacba19fe39beac25aa74a5bc0d321525325008..fed92f394681d6d7a10375a18decf7b623dd3c30 100644 --- a/lib/classes/librarysearch/resultparsers/SRULibraryResultParser.class.php +++ b/lib/classes/librarysearch/resultparsers/SRULibraryResultParser.class.php @@ -68,7 +68,7 @@ class SRULibraryResultParser implements LibraryResultParser /** * @see LibraryResultParser::readRecord */ - public function readRecord($data = '') : LibraryDocument + public function readRecord($data = ''): LibraryDocument { $dom = new \DOMDocument(); @$dom->loadXML($data); @@ -88,9 +88,9 @@ class SRULibraryResultParser implements LibraryResultParser $document = $parser->readResultNode($record); if ($document->getTitle()) { return $document; - } else { - return null; } } + + throw new Exception('Could not read record'); } } diff --git a/lib/dbviews/range_tree.view.php b/lib/dbviews/range_tree.view.php index e9124cabc58c5c914fc0dcb2c4f5978662ab9215..8d3af86fdb49794a7ac155e1fd91e663aae27e91 100644 --- a/lib/dbviews/range_tree.view.php +++ b/lib/dbviews/range_tree.view.php @@ -25,10 +25,14 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // +---------------------------------------------------------------------------+ +$sem_start_times = []; foreach (Semester::findAllVisible() as $key => $value){ if (isset($value['beginn']) && $value['beginn']) $sem_start_times[] = $value['beginn']; } + +$_views = []; + $_views['sem_number_sql'] = "INTERVAL(start_time," . join(",",$sem_start_times) .")"; $_views['sem_number_end_sql'] = "IF(duration_time=-1,-1,INTERVAL(start_time+duration_time," . join(",",$sem_start_times) ."))"; @@ -80,4 +84,5 @@ $_views["CAT_DEL"] = ["query" => "DELETE FROM kategorien WHERE kategorie_id IN ( $_views["CAT_DEL_RANGE"] = ["query" => "DELETE FROM kategorien WHERE range_id IN (&)"]; $_views["STATUS_COUNT"] = ["query"=>"SELECT count(DISTINCT user_id) AS anzahl FROM statusgruppen LEFT JOIN statusgruppe_user USING(statusgruppe_id) WHERE range_id=?"]; -?> + +return $_views; diff --git a/lib/dbviews/sem_tree.view.php b/lib/dbviews/sem_tree.view.php index 4799137bb25e3ae3d908407042e27955a1238b5e..f82767dd1ebec9f264280409f2d0ffece0dbf941 100644 --- a/lib/dbviews/sem_tree.view.php +++ b/lib/dbviews/sem_tree.view.php @@ -25,12 +25,13 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // +---------------------------------------------------------------------------+ - +$sem_start_times = []; foreach (Semester::findAllVisible() as $key => $value){ if (isset($value['beginn']) && $value['beginn']) $sem_start_times[] = $value['beginn']; } +$_views = []; $_views['sem_number_sql'] = "INTERVAL(start_time," . join(",",$sem_start_times) .")"; $_views['sem_number_end_sql'] = "IF(duration_time=-1,-1,INTERVAL(start_time+duration_time," . join(",",$sem_start_times) ."))"; @@ -104,4 +105,5 @@ $_views["SEM_INST_GET_SEM"] = ["query" => "SELECT c.Seminar_id, " . $_views['sem $_views["SEM_USER_GET_SEM"] = ["query" =>"SELECT b.Seminar_id,b.Name, " . $_views['sem_number_sql'] . " AS sem_number , " . $_views['sem_number_end_sql'] . " AS sem_number_end FROM seminar_user a LEFT JOIN seminare b USING(Seminar_id) WHERE b.visible=1 AND a.user_id=? AND a.status=? §"]; -?> + +return $_views; diff --git a/lib/extern/elements/ExternElementLinkInternSimple.class.php b/lib/extern/elements/ExternElementLinkInternSimple.class.php index 1d3ecc79615573330ce576fb3f5bf184e7291ce1..d4765075f58ea8c9e6fa0937c643f78db20d28a5 100644 --- a/lib/extern/elements/ExternElementLinkInternSimple.class.php +++ b/lib/extern/elements/ExternElementLinkInternSimple.class.php @@ -70,8 +70,6 @@ class ExternElementLinkInternSimple extends ExternElement { function toStringEdit ($post_vars = "", $faulty_values = "", $edit_form = "", $anker = "") { global $EXTERN_MODULE_TYPES; - $out = ""; - $table = ""; if ($edit_form == "") { $edit_form = new ExternEditModule($this->config, $post_vars, $faulty_values, $anker); } @@ -95,11 +93,12 @@ class ExternElementLinkInternSimple extends ExternElement { if (is_array($configs) && count($configs)) { $module_name = $EXTERN_MODULE_TYPES[$this->link_module_type]["module"]; $values = array_keys($configs[$module_name]); - unset($names); - foreach ($configs[$module_name] as $config) + + $names = []; + foreach ($configs[$module_name] as $config) { $names[] = $config["name"]; - } - else { + } + } else { $values = []; $names = []; } diff --git a/lib/extern/modules/views/ExternSemLectureTree.class.php b/lib/extern/modules/views/ExternSemLectureTree.class.php index 6ea8afa5d1ee727138812f22f176cab4c6248e59..02820e8014b819f358405100429e2886feafcef0 100644 --- a/lib/extern/modules/views/ExternSemLectureTree.class.php +++ b/lib/extern/modules/views/ExternSemLectureTree.class.php @@ -5,11 +5,11 @@ # Lifter010: TODO class ExternSemLectureTree extends StudipSemTreeViewSimple { - + var $config; var $param; var $root_id; - + function __construct(&$config, $start_item_id = "", $sem_number = FALSE) { $this->config = $config; @@ -21,7 +21,7 @@ class ExternSemLectureTree extends StudipSemTreeViewSimple { $this->start_item_id = ($start_item_id) ? $start_item_id : $this->root_id; $this->param = "range_id={$this->config->range_id}&module=Semlecturetree&config_id={$this->config->id}&"; - + parent::__construct($this->start_item_id, $sem_number); } @@ -63,7 +63,7 @@ class ExternSemLectureTree extends StudipSemTreeViewSimple { } echo "</table>\n"; } - + function backLink ($item_id) { if ($item_id != $this->root_id){ echo "<table width=\"100%\" border=\"0\""; @@ -82,7 +82,7 @@ class ExternSemLectureTree extends StudipSemTreeViewSimple { } } - function showContent ($item_id) { + function showContent ($item_id, $num_all_entries = 0) { echo "<table" . $this->config->getAttributes("TreeLevelName", "table"); echo ">\n<tr><td" . $this->config->getAttributes("TreeLevelName", "td") . ">"; echo "<font" . $this->config->getAttributes("TreeLevelName", "font") . ">"; @@ -115,10 +115,10 @@ class ExternSemLectureTree extends StudipSemTreeViewSimple { $ret .= $delimiter; $ret .= htmlReady($this->tree->tree_data[$this->start_item_id]["name"]); $ret .= "</font></td></tr></table>\n"; - + return $ret; } - + } ?> diff --git a/lib/ilias_interface/IliasSoap.class.php b/lib/ilias_interface/IliasSoap.class.php index bf313e8514208ffa57bf48d0eb57f4750995be3a..93f34970fb185f329a394c11874deda369dcda02 100644 --- a/lib/ilias_interface/IliasSoap.class.php +++ b/lib/ilias_interface/IliasSoap.class.php @@ -87,8 +87,9 @@ class IliasSoap extends StudipSoapClient return $this->admin_sid; } if ($this->user_type == "user") { - if ($this->user_sid == false) - $this->loginUser(); + if ($this->user_sid == false) { + throw new Exception('Not implemented'); + } return $this->user_sid; } return false; diff --git a/lib/modules/CoreForum.class.php b/lib/modules/CoreForum.class.php index 88dd5ddc7f70c95e8bab378dbfdf4f516f3d4832..ba1ee64f7e207349c9ff9984fcbaf7b9daf4fda7 100644 --- a/lib/modules/CoreForum.class.php +++ b/lib/modules/CoreForum.class.php @@ -163,12 +163,12 @@ class CoreForum extends CorePlugin implements ForumModule public function migrateUser($user_from, $user_to) { - return ForumEntry::migrateUser($user_from, $user_to); + ForumEntry::migrateUser($user_from, $user_to); } public function deleteContents($seminar_id) { - return ForumEntry::delete($seminar_id); + ForumEntry::delete($seminar_id); } public function getDump($seminar_id)