Skip to content
Snippets Groups Projects
Commit faed414f authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

fix bugs introduced in #1118 (lonely_sem was removed in 4.2), fixes #3383

Closes #3383

Merge request studip/studip!2303
parent 94302894
No related branches found
No related tags found
No related merge requests found
...@@ -187,7 +187,6 @@ class ActionMenu ...@@ -187,7 +187,6 @@ class ActionMenu
'icon' => $icon, 'icon' => $icon,
'label' => $label, 'label' => $label,
'attributes' => $attributes, 'attributes' => $attributes,
'index' => ''
]; ];
} }
...@@ -206,7 +205,6 @@ class ActionMenu ...@@ -206,7 +205,6 @@ class ActionMenu
$this->actions[] = [ $this->actions[] = [
'type' => 'multi-person-search', 'type' => 'multi-person-search',
'object' => $mp, 'object' => $mp,
'index' => ''
]; ];
} }
......
...@@ -146,7 +146,7 @@ class StudipSemTreeView extends TreeView { ...@@ -146,7 +146,7 @@ class StudipSemTreeView extends TreeView {
$content .= "<tr><td colspan=\"2\" class=\"table_row_even\">" . sprintf(_("Alle Veranstaltungen innerhalb dieses Bereiches in der %sÜbersicht%s"), $content .= "<tr><td colspan=\"2\" class=\"table_row_even\">" . sprintf(_("Alle Veranstaltungen innerhalb dieses Bereiches in der %sÜbersicht%s"),
"<a href=\"" . URLHelper::getLink($this->getSelf("cmd=show_sem_range&item_id=$item_id")) ."\">","</a>") . "</td></tr>"; "<a href=\"" . URLHelper::getLink($this->getSelf("cmd=show_sem_range&item_id=$item_id")) ."\">","</a>") . "</td></tr>";
$content .= "<tr><td colspan=\"2\">&nbsp;</td></tr>"; $content .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
if ($this->tree->getNumEntries($item_id) - $this->tree->tree_data[$item_id]['lonely_sem']){ if ($this->tree->getNumEntries($item_id)){
$content .= "<tr><td class=\"table_row_even\" align=\"left\" colspan=\"2\"><b>" . _("Einträge auf dieser Ebene:"); $content .= "<tr><td class=\"table_row_even\" align=\"left\" colspan=\"2\"><b>" . _("Einträge auf dieser Ebene:");
$content .= "</b>\n</td></tr>"; $content .= "</b>\n</td></tr>";
$entries = $this->tree->getSemData($item_id); $entries = $this->tree->getSemData($item_id);
...@@ -154,12 +154,6 @@ class StudipSemTreeView extends TreeView { ...@@ -154,12 +154,6 @@ class StudipSemTreeView extends TreeView {
} else { } else {
$content .= "\n<tr><td class=\"table_row_even\" colspan=\"2\">" . _("Keine Einträge auf dieser Ebene vorhanden!") . "</td></tr>"; $content .= "\n<tr><td class=\"table_row_even\" colspan=\"2\">" . _("Keine Einträge auf dieser Ebene vorhanden!") . "</td></tr>";
} }
if ($this->tree->tree_data[$item_id]['lonely_sem']){
$content .= "<tr><td class=\"table_row_even\" align=\"left\" colspan=\"2\"><b>" . _("Nicht zugeordnete Veranstaltungen auf dieser Ebene:");
$content .= "</b>\n</td></tr>";
$entries = $this->tree->getLonelySemData($item_id);
$content .= $this->getSemDetails($entries->getGroupedResult("seminar_id"));
}
$content .= "</table>"; $content .= "</table>";
return $content; return $content;
} }
......
...@@ -46,8 +46,8 @@ class StudipSemTreeViewAdmin extends TreeView ...@@ -46,8 +46,8 @@ class StudipSemTreeViewAdmin extends TreeView
var $marked_item; var $marked_item;
var $marked_sem; var $marked_sem;
var $mode; var $mode;
var $move_item_id; var $move_item_id = null;
var $edit_item_id; var $edit_item_id = null;
/** /**
* constructor * constructor
...@@ -492,12 +492,14 @@ class StudipSemTreeViewAdmin extends TreeView ...@@ -492,12 +492,14 @@ class StudipSemTreeViewAdmin extends TreeView
} }
function getItemContent($item_id){ function getItemContent($item_id){
if (!empty($this->edit_item_id) && ($item_id == $this->edit_item_id)) return $this->getEditItemContent(); if ($item_id == $this->edit_item_id) {
if(empty($GLOBALS['SEM_TREE_TYPES'][$this->tree->getValue($item_id, 'type')]['editable'])){ return $this->getEditItemContent();
}
if (empty($GLOBALS['SEM_TREE_TYPES'][$this->tree->getValue($item_id, 'type')]['editable'])){
$is_not_editable = true; $is_not_editable = true;
$this->msg[$item_id] = "info§" . sprintf(_("Der Typ dieses Elementes verbietet eine Bearbeitung.")); $this->msg[$item_id] = "info§" . sprintf(_("Der Typ dieses Elementes verbietet eine Bearbeitung."));
} }
if (!empty($this->move_item_id) && ($item_id == $this->move_item_id)) { if ($item_id == $this->move_item_id) {
$this->msg[$item_id] = "info§" . sprintf(_("Dieses Element wurde zum Verschieben / Kopieren markiert. Bitte wählen Sie ein Einfügesymbol %s aus, um das Element zu verschieben / kopieren."), Icon::create('arr_2right', 'sort', ['title' => "Einfügesymbol"])->asImg(16, ["alt" => "Einfügesymbol"])); $this->msg[$item_id] = "info§" . sprintf(_("Dieses Element wurde zum Verschieben / Kopieren markiert. Bitte wählen Sie ein Einfügesymbol %s aus, um das Element zu verschieben / kopieren."), Icon::create('arr_2right', 'sort', ['title' => "Einfügesymbol"])->asImg(16, ["alt" => "Einfügesymbol"]));
} }
$content = "\n<table width=\"90%\" cellpadding=\"2\" cellspacing=\"2\" align=\"center\" style=\"font-size:10pt;\">"; $content = "\n<table width=\"90%\" cellpadding=\"2\" cellspacing=\"2\" align=\"center\" style=\"font-size:10pt;\">";
...@@ -521,7 +523,7 @@ class StudipSemTreeViewAdmin extends TreeView ...@@ -521,7 +523,7 @@ class StudipSemTreeViewAdmin extends TreeView
URLHelper::getURL($this->getSelf('cmd=AssertDeleteItem&item_id=' . $item_id)), URLHelper::getURL($this->getSelf('cmd=AssertDeleteItem&item_id=' . $item_id)),
['title' => _('Dieses Element löschen')]) . '&nbsp;'; ['title' => _('Dieses Element löschen')]) . '&nbsp;';
if (!empty($this->move_item_id) && ($this->move_item_id == $item_id) && ($this->mode == "MoveItem" || $this->mode == "CopyItem")){ if ($this->move_item_id == $item_id && ($this->mode == "MoveItem" || $this->mode == "CopyItem")){
$content .= LinkButton::create(_('Abbrechen'), $content .= LinkButton::create(_('Abbrechen'),
URLHelper::getURL($this->getSelf('cmd=Cancel&item_id=' . $item_id)), URLHelper::getURL($this->getSelf('cmd=Cancel&item_id=' . $item_id)),
['title' => _('Verschieben / Kopieren abbrechen')]) . '&nbsp;'; ['title' => _('Verschieben / Kopieren abbrechen')]) . '&nbsp;';
...@@ -562,7 +564,7 @@ class StudipSemTreeViewAdmin extends TreeView ...@@ -562,7 +564,7 @@ class StudipSemTreeViewAdmin extends TreeView
$content .= formatReady($this->tree->tree_data[$item_id]['info']) . "</td></tr>"; $content .= formatReady($this->tree->tree_data[$item_id]['info']) . "</td></tr>";
} }
$content .= "<tr><td style=\"font-size:10pt;\"colspan=\"3\">&nbsp;</td></tr>"; $content .= "<tr><td style=\"font-size:10pt;\"colspan=\"3\">&nbsp;</td></tr>";
if (!empty($this->tree->tree_data[$item_id]['lonely_sem']) && ($this->tree->getNumEntries($item_id) - $this->tree->tree_data[$item_id]['lonely_sem'])) { if ($this->tree->getNumEntries($item_id)) {
$content .= "<tr><td class=\"table_row_even\" style=\"font-size:10pt;\" align=\"left\" colspan=\"3\"><b>" . _("Einträge auf dieser Ebene:"); $content .= "<tr><td class=\"table_row_even\" style=\"font-size:10pt;\" align=\"left\" colspan=\"3\"><b>" . _("Einträge auf dieser Ebene:");
$content .= "</b>\n</td></tr>"; $content .= "</b>\n</td></tr>";
$entries = $this->tree->getSemData($item_id); $entries = $this->tree->getSemData($item_id);
...@@ -570,12 +572,6 @@ class StudipSemTreeViewAdmin extends TreeView ...@@ -570,12 +572,6 @@ class StudipSemTreeViewAdmin extends TreeView
} else { } else {
$content .= "\n<tr><td class=\"table_row_even\" style=\"font-size:10pt;\" colspan=\"3\">" . _("Keine Einträge auf dieser Ebene vorhanden!") . "</td></tr>"; $content .= "\n<tr><td class=\"table_row_even\" style=\"font-size:10pt;\" colspan=\"3\">" . _("Keine Einträge auf dieser Ebene vorhanden!") . "</td></tr>";
} }
if (!empty($this->tree->tree_data[$item_id]['lonely_sem'])) {
$content .= "<tr><td class=\"table_row_even\" align=\"left\" style=\"font-size:10pt;\" colspan=\"3\"><b>" . _("Nicht zugeordnete Veranstaltungen auf dieser Ebene:");
$content .= "</b>\n</td></tr>";
$entries = $this->tree->getLonelySemData($item_id);
$content .= $this->getSemDetails($entries,$item_id,true);
}
$content .= "</table>"; $content .= "</table>";
return $content; return $content;
} }
...@@ -776,7 +772,7 @@ class StudipSemTreeViewAdmin extends TreeView ...@@ -776,7 +772,7 @@ class StudipSemTreeViewAdmin extends TreeView
if ($item_id != "root"){ if ($item_id != "root"){
$head .= " (" . $this->tree->getNumEntries($item_id,true) . ") " ; $head .= " (" . $this->tree->getNumEntries($item_id,true) . ") " ;
} }
if ($item_id != $this->start_item_id && $this->isParentAdmin($item_id) && !empty($this->edit_item_id) && ($item_id != $this->edit_item_id)){ if ($item_id != $this->start_item_id && $this->isParentAdmin($item_id) && $item_id != $this->edit_item_id){
$head .= "</td><td nowrap align=\"right\" valign=\"bottom\" class=\"printhead\">"; $head .= "</td><td nowrap align=\"right\" valign=\"bottom\" class=\"printhead\">";
if (!$this->tree->isFirstKid($item_id)){ if (!$this->tree->isFirstKid($item_id)){
$head .= "<a href=\"". URLHelper::getLink($this->getSelf("cmd=OrderItem&direction=up&item_id=$item_id")) . $head .= "<a href=\"". URLHelper::getLink($this->getSelf("cmd=OrderItem&direction=up&item_id=$item_id")) .
......
...@@ -4,17 +4,8 @@ ...@@ -4,17 +4,8 @@
* @license GPL2 or any later version * @license GPL2 or any later version
* @category Stud.IP * @category Stud.IP
*/ */
class RangeSearch extends SQLSearch class RangeSearch extends SearchType
{ {
public $search;
public function __construct()
{
$this->avatarLike = $this->search = '';
$this->sql = $this->getSQL();
}
/** /**
* returns the title/description of the searchfield * returns the title/description of the searchfield
* *
......
...@@ -37,7 +37,6 @@ class SQLSearch extends SearchType ...@@ -37,7 +37,6 @@ class SQLSearch extends SearchType
protected $sql; protected $sql;
protected $avatarLike; protected $avatarLike;
protected $title; protected $title;
public $extendedLayout = false;
/** /**
* *
......
...@@ -278,7 +278,7 @@ class LogEvent extends SimpleORMap implements PrivacyObject ...@@ -278,7 +278,7 @@ class LogEvent extends SimpleORMap implements PrivacyObject
protected function formatSemester($field) { protected function formatSemester($field) {
$all_semester = Semester::findAllVisible(false); $all_semester = Semester::findAllVisible(false);
foreach ($all_semester as $val) { foreach ($all_semester as $val) {
if (!empty($val['beginn']) && ($val['beginn'] == $this->$field)) { if ($val['beginn'] == $this->$field) {
return '<em>' . htmlReady($val['name']) . '</em>'; return '<em>' . htmlReady($val['name']) . '</em>';
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment