Skip to content
Snippets Groups Projects
Commit ac094fbc authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

Fix miscellaneous errors, fixes #1276

Closes #1276

Merge request studip/studip!782
parent 3d3bb7e2
Branches
No related tags found
No related merge requests found
Showing
with 67 additions and 52 deletions
<? <?php
# Lifter010: TODO
$_id = htmlReady(implode('_', (array) $area->getId())); $_id = htmlReady(implode('_', (array) $area->getId()));
?> ?>
<li id="lvgruppe_search_<?= $_id ?>" class="<?= TextHelper::cycle('odd', 'even') ?>"> <li id="lvgruppe_search_<?= $_id ?>" class="<?= TextHelper::cycle('odd', 'even') ?>">
<? if (!$inlist) : ?> <?= Icon::create('arr_2left', Icon::ROLE_SORT)->asInput([
<?= Icon::create('arr_2left', 'sort')->asInput(["name" => 'assign['.$_id.']', "onclick" => "return STUDIP.MVV.CourseWizard.assignNode('".$_id."')", 'name' => "assign[{$_id}]",
"class" => in_array($_id,$values['studyareas']?:[])?'hidden-no-js':'']) ?> 'onclick' => "return STUDIP.MVV.CourseWizard.assignNode('{$_id}')",
<? endif; ?> 'class' => in_array($_id, $values['studyareas'] ?: []) ? 'hidden-no-js' : '',
<?/* <span class="lvgruppe_selection_expand">*/?> ]) ?>
<?= htmlReady($area->getDisplayName()) ?> <?= 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> </li>
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
"ext-pcre": "*", "ext-pcre": "*",
"ext-pdo": "*", "ext-pdo": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-dom": "*",
"opis/json-schema": "^1.0", "opis/json-schema": "^1.0",
"slim/psr7": "1.4", "slim/psr7": "1.4",
"slim/slim": "4.7.1", "slim/slim": "4.7.1",
......
...@@ -50,7 +50,7 @@ require_once 'lib/dates.inc.php'; ...@@ -50,7 +50,7 @@ require_once 'lib/dates.inc.php';
* to seminar_user. Overrides the $contingent-parameter * to seminar_user. Overrides the $contingent-parameter
* @param string $contingent optional studiengang_id, if no id is given, no contingent is considered * @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 * @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) { function insert_seminar_user($seminar_id, $user_id, $status, $copy_studycourse = false, $contingent = false, $log_message = false) {
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div style="display:flex; align-items: flex-start; column-gap: 1em; flex-wrap: wrap"> <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') ->fireJSFunctionOnSelect('addcourse')
->setInputStyle('flex: 0 0 40%') ->setInputStyle('flex: 0 0 40%')
->render(); ->render();
......
...@@ -162,9 +162,9 @@ class DbView ...@@ -162,9 +162,9 @@ class DbView
{ {
foreach (self::$dbviewfiles as $view => $status) { foreach (self::$dbviewfiles as $view => $status) {
if ($status === 0) { if ($status === 0) {
include 'lib/dbviews/' . $view . '.view.php'; $views = include 'lib/dbviews/' . $view . '.view.php';
self::$dbviews += $_views; self::$dbviews += $views;
unset($_views);
self::$dbviewfiles[$view] = 1; self::$dbviewfiles[$view] = 1;
} }
} }
......
...@@ -392,7 +392,6 @@ class PageLayout ...@@ -392,7 +392,6 @@ class PageLayout
$package_elements = []; $package_elements = [];
if (isset($GLOBALS['_include_stylesheet'])) { if (isset($GLOBALS['_include_stylesheet'])) {
unset($package_elements['base-style.css']);
self::addStylesheet($GLOBALS['_include_stylesheet'], ['media' => 'screen, print']); self::addStylesheet($GLOBALS['_include_stylesheet'], ['media' => 'screen, print']);
} }
......
...@@ -89,7 +89,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, ...@@ -89,7 +89,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
public function __set($key, $value) public function __set($key, $value)
{ {
if ($this->flag == self::ARRAY_AS_PROPS) { if ($this->flag == self::ARRAY_AS_PROPS) {
return $this->offsetSet($key, $value); $this->offsetSet($key, $value);
return;
} }
$this->validateKeyUsage($key); $this->validateKeyUsage($key);
...@@ -106,7 +107,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, ...@@ -106,7 +107,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
public function __unset($key) public function __unset($key)
{ {
if ($this->flag == self::ARRAY_AS_PROPS) { if ($this->flag == self::ARRAY_AS_PROPS) {
return $this->offsetUnset($key); $this->offsetUnset($key);
return;
} }
$this->validateKeyUsage($key); $this->validateKeyUsage($key);
...@@ -122,7 +124,6 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, ...@@ -122,7 +124,6 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
*/ */
public function __get($key) public function __get($key)
{ {
$ret = null;
if ($this->flag == self::ARRAY_AS_PROPS) { if ($this->flag == self::ARRAY_AS_PROPS) {
$ret = $this->offsetGet($key); $ret = $this->offsetGet($key);
return $ret; return $ret;
...@@ -300,7 +301,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, ...@@ -300,7 +301,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
public function offsetSet($key, $value) public function offsetSet($key, $value)
{ {
if (is_null($key)) { if (is_null($key)) {
return $this->append($value); $this->append($value);
return;
} }
$this->storage[$key] = $value; $this->storage[$key] = $value;
} }
......
...@@ -44,7 +44,7 @@ class StudipSemTreeViewSimple ...@@ -44,7 +44,7 @@ class StudipSemTreeViewSimple
* constructor * 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->start_item_id = ($start_item_id) ? $start_item_id : "root";
$this->root_content = $GLOBALS['UNI_INFO']; $this->root_content = $GLOBALS['UNI_INFO'];
...@@ -179,7 +179,7 @@ class StudipSemTreeViewSimple ...@@ -179,7 +179,7 @@ class StudipSemTreeViewSimple
return $ret; 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\">"; echo "\n<div align=\"left\" style=\"margin-top:10px;margin-bottom:10px;font-size:10pt\">";
if ($item_id != "root"){ if ($item_id != "root"){
......
...@@ -224,7 +224,7 @@ class LVGroupsWizardStep implements CourseWizardStep ...@@ -224,7 +224,7 @@ class LVGroupsWizardStep implements CourseWizardStep
} }
$factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views'); $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 = [ $data = [
'id' => $area->id, 'id' => $area->id,
'html_string' => $html 'html_string' => $html
......
...@@ -146,11 +146,13 @@ class BASELibraryResultParser implements LibraryResultParser ...@@ -146,11 +146,13 @@ class BASELibraryResultParser implements LibraryResultParser
*/ */
public function readRecord($data = ''): LibraryDocument public function readRecord($data = ''): LibraryDocument
{ {
$dom = new \DOMDocument(); $dom = new DOMDocument();
@$dom->loadXML($data); @$dom->loadXML($data);
$record = $dom->getElementsByTagName('doc')[0]; $record = $dom->getElementsByTagName('doc')[0];
if ($record) { if ($record) {
return $this->readXMLRecord($record); return $this->readXMLRecord($record);
} }
throw new Exception('Could not read record');
} }
} }
...@@ -201,12 +201,14 @@ class MarcxmlLibraryResultParser implements LibraryResultParser ...@@ -201,12 +201,14 @@ class MarcxmlLibraryResultParser implements LibraryResultParser
*/ */
public function readRecord($data = ''): LibraryDocument public function readRecord($data = ''): LibraryDocument
{ {
$dom = new \DOMDocument(); $dom = new DOMDocument();
$dom->loadXML($data); $dom->loadXML($data);
$record = $dom->getElementsByTagName('record')[0]; $record = $dom->getElementsByTagName('record')[0];
if ($record instanceof \DOMElement) { if ($record instanceof \DOMElement) {
return $this->readResultNode($record); return $this->readResultNode($record);
} }
throw new Exception('Could not read record');
} }
/** /**
......
...@@ -88,9 +88,9 @@ class SRULibraryResultParser implements LibraryResultParser ...@@ -88,9 +88,9 @@ class SRULibraryResultParser implements LibraryResultParser
$document = $parser->readResultNode($record); $document = $parser->readResultNode($record);
if ($document->getTitle()) { if ($document->getTitle()) {
return $document; return $document;
} else {
return null;
} }
} }
throw new Exception('Could not read record');
} }
} }
...@@ -25,10 +25,14 @@ ...@@ -25,10 +25,14 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// +---------------------------------------------------------------------------+ // +---------------------------------------------------------------------------+
$sem_start_times = [];
foreach (Semester::findAllVisible() as $key => $value){ foreach (Semester::findAllVisible() as $key => $value){
if (isset($value['beginn']) && $value['beginn']) if (isset($value['beginn']) && $value['beginn'])
$sem_start_times[] = $value['beginn']; $sem_start_times[] = $value['beginn'];
} }
$_views = [];
$_views['sem_number_sql'] = "INTERVAL(start_time," . join(",",$sem_start_times) .")"; $_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) ."))"; $_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 ( ...@@ -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["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=?"]; $_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;
...@@ -25,12 +25,13 @@ ...@@ -25,12 +25,13 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// +---------------------------------------------------------------------------+ // +---------------------------------------------------------------------------+
$sem_start_times = [];
foreach (Semester::findAllVisible() as $key => $value){ foreach (Semester::findAllVisible() as $key => $value){
if (isset($value['beginn']) && $value['beginn']) if (isset($value['beginn']) && $value['beginn'])
$sem_start_times[] = $value['beginn']; $sem_start_times[] = $value['beginn'];
} }
$_views = [];
$_views['sem_number_sql'] = "INTERVAL(start_time," . join(",",$sem_start_times) .")"; $_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) ."))"; $_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 ...@@ -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) $_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=? §"]; WHERE b.visible=1 AND a.user_id=? AND a.status=? §"];
?>
return $_views;
...@@ -70,8 +70,6 @@ class ExternElementLinkInternSimple extends ExternElement { ...@@ -70,8 +70,6 @@ class ExternElementLinkInternSimple extends ExternElement {
function toStringEdit ($post_vars = "", $faulty_values = "", function toStringEdit ($post_vars = "", $faulty_values = "",
$edit_form = "", $anker = "") { $edit_form = "", $anker = "") {
global $EXTERN_MODULE_TYPES; global $EXTERN_MODULE_TYPES;
$out = "";
$table = "";
if ($edit_form == "") { if ($edit_form == "") {
$edit_form = new ExternEditModule($this->config, $post_vars, $faulty_values, $anker); $edit_form = new ExternEditModule($this->config, $post_vars, $faulty_values, $anker);
} }
...@@ -95,11 +93,12 @@ class ExternElementLinkInternSimple extends ExternElement { ...@@ -95,11 +93,12 @@ class ExternElementLinkInternSimple extends ExternElement {
if (is_array($configs) && count($configs)) { if (is_array($configs) && count($configs)) {
$module_name = $EXTERN_MODULE_TYPES[$this->link_module_type]["module"]; $module_name = $EXTERN_MODULE_TYPES[$this->link_module_type]["module"];
$values = array_keys($configs[$module_name]); $values = array_keys($configs[$module_name]);
unset($names);
foreach ($configs[$module_name] as $config) $names = [];
foreach ($configs[$module_name] as $config) {
$names[] = $config["name"]; $names[] = $config["name"];
} }
else { } else {
$values = []; $values = [];
$names = []; $names = [];
} }
......
...@@ -82,7 +82,7 @@ class ExternSemLectureTree extends StudipSemTreeViewSimple { ...@@ -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 "<table" . $this->config->getAttributes("TreeLevelName", "table");
echo ">\n<tr><td" . $this->config->getAttributes("TreeLevelName", "td") . ">"; echo ">\n<tr><td" . $this->config->getAttributes("TreeLevelName", "td") . ">";
echo "<font" . $this->config->getAttributes("TreeLevelName", "font") . ">"; echo "<font" . $this->config->getAttributes("TreeLevelName", "font") . ">";
......
...@@ -87,8 +87,9 @@ class IliasSoap extends StudipSoapClient ...@@ -87,8 +87,9 @@ class IliasSoap extends StudipSoapClient
return $this->admin_sid; return $this->admin_sid;
} }
if ($this->user_type == "user") { if ($this->user_type == "user") {
if ($this->user_sid == false) if ($this->user_sid == false) {
$this->loginUser(); throw new Exception('Not implemented');
}
return $this->user_sid; return $this->user_sid;
} }
return false; return false;
......
...@@ -163,12 +163,12 @@ class CoreForum extends CorePlugin implements ForumModule ...@@ -163,12 +163,12 @@ class CoreForum extends CorePlugin implements ForumModule
public function migrateUser($user_from, $user_to) 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) public function deleteContents($seminar_id)
{ {
return ForumEntry::delete($seminar_id); ForumEntry::delete($seminar_id);
} }
public function getDump($seminar_id) public function getDump($seminar_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment