auf Stand feature-12646/LVVerwaltungOEundFilterAnpassen vom 26.4. gebracht: Adaptierungen Berechtigungen

This commit is contained in:
manu
2021-04-26 09:40:47 +02:00
parent 12d1dafa9f
commit 14434e8421
+88 -90
View File
@@ -219,48 +219,6 @@ if(isset($_POST['lvid']) && is_numeric($_POST['lvid']))
else
exit('Fehler beim Laden der LV:'.$lv_obj->errormsg);
}
//Lehrform Speichern
//userstory #12645: only $write_admin
if(isset($_POST['lf']))
{
$lv_obj = new lehrveranstaltung();
if($lv_obj->load($_POST['lvid']))
{
$lv_obj->lehrform_kurzbz = $_POST['lf'];
$lv_obj->updateamum = date('Y-m-d H:i:s');
$lv_obj->updatevon = $user;
if($lv_obj->save(false))
exit('true');
else
exit('Fehler beim Speichern:'.$lv_obj->errormsg);
}
else
exit('Fehler beim Laden der LV:'.$lv_obj->errormsg);
}
//Lehrtyp Speichern
//userstory #12645: only $write_admin
if(isset($_POST['lt']))
{
$lv_obj = new lehrveranstaltung();
if($lv_obj->load($_POST['lvid']))
{
$lv_obj->lehrtyp_kurzbz = $_POST['lt'];
$lv_obj->updateamum = date('Y-m-d H:i:s');
$lv_obj->updatevon = $user;
if($lv_obj->save(false))
exit('true');
else
exit('Fehler beim Speichern:'.$lv_obj->errormsg);
}
else
exit('Fehler beim Laden der LV:'.$lv_obj->errormsg);
}
}
else
{
exit('Keine Berechtigung, um Lehrveranstaltungen zu bearbeiten!');
}
if($write_low || $write_admin)
@@ -365,6 +323,42 @@ if(isset($_POST['lvid']) && is_numeric($_POST['lvid']))
exit('Fehler beim Laden der LV:'.$lv_obj->errormsg);
}
//Lehrform Speichern
if(isset($_POST['lf']))
{
$lv_obj = new lehrveranstaltung();
if($lv_obj->load($_POST['lvid']))
{
$lv_obj->lehrform_kurzbz = $_POST['lf'];
$lv_obj->updateamum = date('Y-m-d H:i:s');
$lv_obj->updatevon = $user;
if($lv_obj->save(false))
exit('true');
else
exit('Fehler beim Speichern:'.$lv_obj->errormsg);
}
else
exit('Fehler beim Laden der LV:'.$lv_obj->errormsg);
}
//Lehrtyp Speichern
if(isset($_POST['lt']))
{
$lv_obj = new lehrveranstaltung();
if($lv_obj->load($_POST['lvid']))
{
$lv_obj->lehrtyp_kurzbz = $_POST['lt'];
$lv_obj->updateamum = date('Y-m-d H:i:s');
$lv_obj->updatevon = $user;
if($lv_obj->save(false))
exit('true');
else
exit('Fehler beim Speichern:'.$lv_obj->errormsg);
}
else
exit('Fehler beim Laden der LV:'.$lv_obj->errormsg);
}
//Projektarbeit Feld setzen
if(isset($_POST['projektarbeit']))
{
@@ -425,6 +419,7 @@ if($result = $db->db_query($qry))
}
}
//Fachbereichskoordinatoren holen
$fb_kurzbz='';
if($stg_kz!='')
@@ -473,8 +468,7 @@ if($result = $db->db_query($qry))
}
}
//Lehrveranstaltungen holen
//Lehrveranstaltungen mit OEs holen
$sql_query = "
SELECT
tbl_lehrveranstaltung.*, tbl_organisationseinheit.organisationseinheittyp_kurzbz,
@@ -485,7 +479,7 @@ $sql_query = "
LEFT JOIN lehre.tbl_lehrveranstaltung as lehrfach on (lehre.tbl_lehreinheit.lehrfach_id = lehrfach.lehrveranstaltung_id)
LEFT JOIN public.tbl_organisationseinheit ON (public.tbl_organisationseinheit.oe_kurzbz = lehre.tbl_lehrveranstaltung.oe_kurzbz)
where
lehre.tbl_lehrveranstaltung.bezeichnung != 'NULL'
true
";
if($stg_kz!='')
@@ -884,27 +878,6 @@ echo '
});
}
function changelehrmodus(lvid, lm)
{
$.ajax({
type:"POST",
url:"lehrveranstaltung.php",
data:{ "lvid": lvid, "lm": lm },
success: function(data)
{
if(data!="true")
alert("ERROR:"+data)
else
{
$("#lm"+lvid).css("background-color", "lightgreen");
window.setTimeout(function(){$("#lm"+lvid).css("background-color", "");}, 500);
}
},
error: function() { alert("error"); }
});
}
function copylvinfo(lvid, source_id)
{
$.ajax({
@@ -1052,7 +1025,6 @@ if ($result_lv!=0)
<th>Bezeichnung English</th>
<th>Lehrform</th>
<th>Lehrtyp</th>
<th>Lehrmodus</th>
<th>Stg</th>\n
<th>Orgform</th>
<th>Organisationseinheit</th>
@@ -1104,34 +1076,60 @@ if ($result_lv!=0)
echo '</td>';
//Lehrform
echo '<td style="white-space:nowrap;">';
echo '<SELECT style="width:80px;" id="lf'.$row->lehrveranstaltung_id.'">';
echo '<option value="">--</option>';
foreach ($lf as $lehrform=>$lf_kz)
if($write_admin)
{
if($lehrform==$row->lehrform_kurzbz)
$selected='selected';
else
$selected='';
echo '<option value="'.$db->convert_html_chars($lehrform).'" '.$selected.'>'.$db->convert_html_chars($lf_kz['lehrform_kurzbz']).' '.$db->convert_html_chars($lf_kz['bezeichnung']).'</option>';
echo '<td style="white-space:nowrap;">';
echo '<SELECT style="width:80px;" id="lf'.$row->lehrveranstaltung_id.'">';
echo '<option value="">--</option>';
foreach ($lf as $lehrform=>$lf_kz)
{
if($lehrform == $row->lehrform_kurzbz)
$selected='selected';
else
$selected='';
echo '<option value="'.$db->convert_html_chars($lehrform).'" '.$selected.'>'.$db->convert_html_chars($lf_kz['lehrform_kurzbz']).' '.$db->convert_html_chars($lf_kz['bezeichnung']).'</option>';
}
echo '</SELECT><input type="button" value="ok" id="lf'.$row->lehrveranstaltung_id.'" onclick="changelehrform(\''.$row->lehrveranstaltung_id.'\',$(\'#lf'.$row->lehrveranstaltung_id.'\').val())">';
echo '</td>';
}
else
{
echo '<td>';
foreach ($lf as $lehrform=>$lf_kz)
{
if($lehrform == $row->lehrform_kurzbz)
echo $db->convert_html_chars($lf_kz['lehrform_kurzbz']). ' '. $db->convert_html_chars($lf_kz['bezeichnung']);
}
echo '</td>';
}
echo '</SELECT><input type="button" value="ok" id="lf'.$row->lehrveranstaltung_id.'" onclick="changelehrform(\''.$row->lehrveranstaltung_id.'\',$(\'#lf'.$row->lehrveranstaltung_id.'\').val())">';
echo '</td>';
//Lehrtyp
echo '<td style="white-space:nowrap;">';
echo '<SELECT id="lt'.$row->lehrveranstaltung_id.'">';
echo '<option value="">--</option>';
foreach ($lt as $lehrtyp=>$lt_kz)
if($write_admin)
{
if($lehrtyp==$row->lehrtyp_kurzbz)
$selected='selected';
else
$selected='';
echo '<option value="'.$db->convert_html_chars($lehrtyp).'" '.$selected.'>'.$db->convert_html_chars($lt_kz['bezeichnung']).'</option>';
echo '<td style="white-space:nowrap;">';
echo '<SELECT id="lt'.$row->lehrveranstaltung_id.'">';
echo '<option value="">--</option>';
foreach ($lt as $lehrtyp=>$lt_kz)
{
if($lehrtyp == $row->lehrtyp_kurzbz)
$selected='selected';
else
$selected='';
echo '<option value="'.$db->convert_html_chars($lehrtyp).'" '.$selected.'>'.$db->convert_html_chars($lt_kz['bezeichnung']).'</option>';
}
echo '</SELECT><input type="button" value="ok" id="lf'.$row->lehrveranstaltung_id.'" onclick="changelehrtyp(\''.$row->lehrveranstaltung_id.'\',$(\'#lt'.$row->lehrveranstaltung_id.'\').val())">';
echo '</td>';
}
else
{
echo '<td>';
foreach ($lt as $lehrtyp=>$lt_kz)
{
if($lehrtyp == $row->lehrtyp_kurzbz)
echo $db->convert_html_chars($lt_kz['bezeichnung']);
}
echo '</td>';
}
echo '</SELECT><input type="button" value="ok" id="lf'.$row->lehrveranstaltung_id.'" onclick="changelehrtyp(\''.$row->lehrveranstaltung_id.'\',$(\'#lt'.$row->lehrveranstaltung_id.'\').val())">';
echo '</td>';
//lehrmodus
//analog Lehrform
@@ -1166,9 +1164,9 @@ if ($result_lv!=0)
echo '<td>'.($row->lehrmodus_kurzbz).'</td>';
//Studiengang
echo '<td>'.$db->convert_html_chars($s[$row->studiengang_kz]->kurzbz).'</td>';
//Organisationsform
echo '<td style="white-space:nowrap;">';
echo ($row->orgform_kurzbz!=''?$db->convert_html_chars($row->orgform_kurzbz):'&nbsp;');