mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
Suche Person in OE; OE in Rechteliste OE-Suche
This commit is contained in:
@@ -29,17 +29,20 @@ require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/berechtigung.class.php');
|
||||
require_once ('../../include/organisationseinheit.class.php');
|
||||
require_once ('../../include/benutzerfunktion.class.php');
|
||||
require_once ('../../include/funktion.class.php');
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Berechtigungen Uebersicht</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">';
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
<link href="../../skin/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css">';
|
||||
|
||||
include('../../include/meta/jquery.php');
|
||||
include('../../include/meta/jquery-tablesorter.php');
|
||||
|
||||
echo '
|
||||
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function checkLength()
|
||||
{
|
||||
@@ -53,77 +56,138 @@ function checkLength()
|
||||
return true;
|
||||
}
|
||||
$(document).ready(function()
|
||||
{
|
||||
if ($("#berechtigung_kurzbz").val() == "" && $("#rolle_kurzbz").val() == "")
|
||||
$("#erweitertesuche").hide();
|
||||
{
|
||||
if ($("#berechtigung_kurzbz").val() == "" && $("#rolle_kurzbz").val() == "" && $("#person_oe_kurzbz").val() == "")
|
||||
$("#erweitertesuche").hide();
|
||||
|
||||
$("#t1").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[2,0]],
|
||||
widgets: ["zebra"],
|
||||
headers: {4:{sorter:false}}
|
||||
});
|
||||
$("#t2").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[2,0],[3,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {8:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
6 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return e == "Ja" || e == "" },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
},
|
||||
7 : {
|
||||
"Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); },
|
||||
"Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t3").tablesorter(
|
||||
{
|
||||
sortList: [[1,0],[2,0],[3,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {8:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
6 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return /Ja/.test(e); },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
},
|
||||
7 : {
|
||||
"Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); },
|
||||
"Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t4").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[2,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {9:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
7 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return /Ja/.test(e); },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
},
|
||||
8 : {
|
||||
"Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); },
|
||||
"Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t1").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[2,0]],
|
||||
widgets: ["zebra"],
|
||||
headers: {4:{sorter:false}}
|
||||
});
|
||||
$("#t2").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[2,0],[3,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {8:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
6 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return e == "Ja" || e == "" },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
},
|
||||
7 : {
|
||||
"Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); },
|
||||
"Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t3").tablesorter(
|
||||
{
|
||||
sortList: [[1,0],[2,0],[3,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {8:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
6 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return /Ja/.test(e); },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
},
|
||||
7 : {
|
||||
"Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); },
|
||||
"Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t4").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[2,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {9:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
7 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return /Ja/.test(e); },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
},
|
||||
8 : {
|
||||
"Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); },
|
||||
"Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t5").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0],[3,1]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
headers: {4:{sorter:false}},
|
||||
emptyTo: "emptyMax",
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
3 : {
|
||||
"Ja" : function(e, n, f, i, $r, c, data) { return /Ja/.test(e); },
|
||||
"Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// Breite des Autocompletes korrigieren um das Springen zu verhindern
|
||||
$.extend($.ui.autocomplete.prototype.options, {
|
||||
open: function(event, ui) {
|
||||
$(this).autocomplete("widget").css({
|
||||
"width": ($(".ui-menu-item").width()+ 20 + "px"),
|
||||
"padding-left": "5px"
|
||||
});
|
||||
}
|
||||
});
|
||||
$(".oe_kurzbz_autocomplete").autocomplete({
|
||||
source: "benutzerberechtigung_autocomplete.php?autocomplete=oe_kurzbz",
|
||||
minLength:2,
|
||||
response: function(event, ui)
|
||||
{
|
||||
if (!ui.content.length)
|
||||
{
|
||||
var noResult = { value:"",label:"Keine Ergebnisse" };
|
||||
ui.content.push(noResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Value und Label fuer die Anzeige setzen
|
||||
for (i in ui.content) {
|
||||
ui.content[i].value = ui.content[i].organisationseinheittyp_kurzbz + " " + ui.content[i].bezeichnung;
|
||||
ui.content[i].label = ui.content[i].organisationseinheittyp_kurzbz + " " + ui.content[i].bezeichnung;
|
||||
}
|
||||
}
|
||||
},
|
||||
select: function(event, ui)
|
||||
{
|
||||
$(this).siblings("input:hidden").val(ui.item.oe_kurzbz);
|
||||
}
|
||||
});
|
||||
$(".oe_kurzbz_autocomplete").on( "input", function() {
|
||||
if ($(this).val() == "")
|
||||
{
|
||||
$(this).siblings("input:hidden").val("");
|
||||
}
|
||||
});
|
||||
$("#person_oe_kurzbz").on( "click", function() {
|
||||
$(this).select();
|
||||
});
|
||||
$("#searchbox").on( "click", function() {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<style>
|
||||
@@ -203,6 +267,7 @@ $benutzerart = (isset($_GET['benutzerart'])?$_GET['benutzerart']:'');
|
||||
$benutzeraktiv = (isset($_GET['aktiv'])?$_GET['aktiv']:'aktiv');
|
||||
$berechtigung_kurzbz = (isset($_GET['berechtigung_kurzbz'])?$_GET['berechtigung_kurzbz']:'');
|
||||
$rolle_kurzbz = (isset($_GET['rolle_kurzbz'])?$_GET['rolle_kurzbz']:'');
|
||||
$person_oe_kurzbz = (isset($_GET['person_oe_kurzbz'])?$_GET['person_oe_kurzbz']:'');
|
||||
$userOnly = (isset($_GET['userOnly']) ? true : false);
|
||||
|
||||
$htmlstr='
|
||||
@@ -228,6 +293,13 @@ $htmlstr='
|
||||
</form>
|
||||
<div id="erweitertesuche">
|
||||
<hr>
|
||||
<form accept-charset="UTF-8" name="searchPersonenOe" method="GET">
|
||||
Personen in Organisationseinheit:
|
||||
<input type="hidden" name="person_oe_kurzbz" value="'.$person_oe_kurzbz.'">
|
||||
<input type="text" id="person_oe_kurzbz" value="'.$person_oe_kurzbz.'" class="oe_kurzbz_autocomplete">
|
||||
<input type="submit" value="Suchen">
|
||||
</form>
|
||||
<hr>
|
||||
<form accept-charset="UTF-8" name="searchrechte" method="GET">
|
||||
Rechte:
|
||||
<select id="berechtigung_kurzbz" name="berechtigung_kurzbz">
|
||||
@@ -552,7 +624,7 @@ if($rolle_kurzbz != '')
|
||||
// Anzahl uniquer UIDs ermitteln
|
||||
$berechtigungen_array_uids = sizeof(array_column($rollen->result, null, 'uid'));
|
||||
|
||||
$htmlstr .= "<h3>".$berechtigung_kurzbz."</h3>\n";
|
||||
$htmlstr .= "<h3>".$rolle_kurzbz."</h3>\n";
|
||||
$htmlstr .= "<div style='font-size: 9pt'>".count($rollen->result)." Einträge</div>";
|
||||
$htmlstr .= "<div style='font-size: 9pt'>".$berechtigungen_array_uids." UIDs</div>";
|
||||
$htmlstr .= "<table id='t3' class='tablesorter'><thead><tr>\n";
|
||||
@@ -607,6 +679,76 @@ if($rolle_kurzbz != '')
|
||||
}
|
||||
}
|
||||
|
||||
//Personen in OEs suchen und Tabelle anzeigen
|
||||
if($person_oe_kurzbz != '')
|
||||
{
|
||||
$childOes = new organisationseinheit();
|
||||
$oeChilds = $childOes->getChilds($person_oe_kurzbz);
|
||||
$uids = array();
|
||||
$countUID = array();
|
||||
|
||||
$benutzerfunktion = new benutzerfunktion();
|
||||
foreach ($oeChilds AS $key => $oe)
|
||||
{
|
||||
$benutzerfunktion->getOeFunktionen($oe,'kstzuordnung,fachzuordnung','now()','now()');
|
||||
foreach($benutzerfunktion->result as $bf)
|
||||
{
|
||||
$oeFunktion = new organisationseinheit($bf->oe_kurzbz);
|
||||
$funktion = new funktion($bf->funktion_kurzbz);
|
||||
$uids[$bf->uid.$bf->oe_kurzbz] = ["uid" => $bf->uid, "funktion" => $funktion->beschreibung." ".$oeFunktion->bezeichnung];
|
||||
$countUID[] = $bf->uid;
|
||||
}
|
||||
$benutzerfunktion->getOeFunktionen($oe,'Leitung,stvLtg,oezuordnung','now()','now()');
|
||||
foreach($benutzerfunktion->result as $bf)
|
||||
{
|
||||
$oeFunktion = new organisationseinheit($bf->oe_kurzbz);
|
||||
$funktion = new funktion($bf->funktion_kurzbz);
|
||||
$uids[$bf->uid.$bf->oe_kurzbz] = ["uid" => $bf->uid, "funktion" => $funktion->beschreibung." ".$oeFunktion->bezeichnung];
|
||||
$countUID[] = $bf->uid;
|
||||
}
|
||||
}
|
||||
|
||||
if(count($uids) != 0)
|
||||
{
|
||||
// Anzahl uniquer UIDs ermitteln
|
||||
$berechtigungen_array_uids = count($uids);
|
||||
$countUID = array_unique($countUID);
|
||||
$oeName = new organisationseinheit($person_oe_kurzbz);
|
||||
|
||||
$htmlstr .= "<h3>".$oeName->organisationseinheittyp_kurzbz." ".$oeName->bezeichnung."</h3>\n";
|
||||
$htmlstr .= "<div style='font-size: 9pt'>".$berechtigungen_array_uids." Einträge</div>";
|
||||
$htmlstr .= "<div style='font-size: 9pt'>".count($countUID)." UIDs</div>";
|
||||
$htmlstr .= "<table id='t5' class='tablesorter'><thead><tr>\n";
|
||||
$htmlstr .= " <th>Nachname</th>
|
||||
<th>Vorname</th>
|
||||
<th>UID</th>
|
||||
<th>Funktion</th>
|
||||
<th data-value='Ja'>Benutzer Aktiv</th>
|
||||
<th>Aktion</th>";
|
||||
$htmlstr .= "</tr></thead><tbody>\n";
|
||||
|
||||
foreach($uids as $key => $uid)
|
||||
{
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($uid["uid"]);
|
||||
|
||||
$htmlstr .= ' <tr>';
|
||||
$htmlstr .= ' <td>'.($benutzer->nachname != ''?$benutzer->nachname:'').'</td>';
|
||||
$htmlstr .= ' <td>'.($benutzer->vorname != ''?$benutzer->vorname:'').'</td>';
|
||||
$htmlstr .= ' <td>'.$uid["uid"].'</td>';
|
||||
$htmlstr .= ' <td>'.$uid["funktion"].'</td>';
|
||||
$htmlstr .= ' <td>'.(isset($uid)?$benutzer->bnaktiv?'Ja':'Nein':'').'</td>';
|
||||
$htmlstr .= ' <td><a href="benutzerberechtigung_details.php?uid='.$uid["uid"].'" target="vilesci_detail">Rechte bearbeiten</a></td>';
|
||||
$htmlstr .= ' </tr>';
|
||||
}
|
||||
$htmlstr .= '</tbody></table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlstr .= "Für diese Berechtigung sind keine Einträge vorhanden";
|
||||
}
|
||||
}
|
||||
|
||||
echo $htmlstr;
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user