mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Initial commit
This commit is contained in:
@@ -312,5 +312,42 @@ class berechtigung extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sucht nach Berechtigungen
|
||||
* @param string $searchItem Suchbegriff
|
||||
* @return boolean
|
||||
*/
|
||||
public function searchBerechtigungen($searchItem)
|
||||
{
|
||||
$this->result=array();
|
||||
$qry = 'SELECT * FROM system.tbl_berechtigung WHERE
|
||||
(
|
||||
LOWER(berechtigung_kurzbz) LIKE LOWER(\'%'.$this->db_escape(($searchItem)).'%\')
|
||||
OR
|
||||
LOWER(beschreibung) LIKE LOWER(\'%'.$this->db_escape(($searchItem)).'%\')
|
||||
)';
|
||||
|
||||
$qry .= ' ORDER BY berechtigung_kurzbz';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new berechtigung();
|
||||
|
||||
$obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Berechtigungen';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2010 Technikum-Wien
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
* Authors: Manfred Kindl <kindlm@technikum-wien.at>
|
||||
*/
|
||||
require_once ('../../config/vilesci.config.inc.php');
|
||||
require_once ('../../include/functions.inc.php');
|
||||
require_once ('../../include/basis_db.class.php');
|
||||
require_once ('../../include/ort.class.php');
|
||||
require_once ('../../include/benutzer.class.php');
|
||||
require_once ('../../include/studiengang.class.php');
|
||||
require_once ('../../include/berechtigung.class.php');
|
||||
require_once ('../../include/organisationseinheit.class.php');
|
||||
require_once ('../../include/sprache.class.php');
|
||||
|
||||
if (! $db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$uid = get_uid();
|
||||
$sprache = getSprache();
|
||||
|
||||
if (isset($_REQUEST['autocomplete']) && $_REQUEST['autocomplete'] == 'benutzer')
|
||||
{
|
||||
$search = trim((isset($_REQUEST['term']) ? $_REQUEST['term'] : ''));
|
||||
if (is_null($search) || $search == '')
|
||||
exit();
|
||||
|
||||
$benutzer = new benutzer();
|
||||
|
||||
if ($benutzer->search(array(
|
||||
$search
|
||||
)))
|
||||
{
|
||||
$result_obj = array();
|
||||
foreach ($benutzer->result as $row)
|
||||
{
|
||||
$item['vorname'] = html_entity_decode($row->vorname);
|
||||
$item['nachname'] = html_entity_decode($row->nachname);
|
||||
$item['uid'] = html_entity_decode($row->uid);
|
||||
$result_obj[] = $item;
|
||||
}
|
||||
echo json_encode($result_obj);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['autocomplete']) && $_REQUEST['autocomplete'] == 'berechtigung')
|
||||
{
|
||||
$search = trim((isset($_REQUEST['term']) ? $_REQUEST['term'] : ''));
|
||||
if (is_null($search) || $search == '')
|
||||
exit();
|
||||
|
||||
$berechtigung = new berechtigung();
|
||||
|
||||
if ($berechtigung->searchBerechtigungen($search))
|
||||
{
|
||||
$result_obj = array();
|
||||
foreach ($berechtigung->result as $row)
|
||||
{
|
||||
$item['berechtigung_kurzbz'] = html_entity_decode($row->berechtigung_kurzbz);
|
||||
$item['beschreibung'] = html_entity_decode($row->beschreibung);
|
||||
$result_obj[] = $item;
|
||||
}
|
||||
echo json_encode($result_obj);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['autocomplete']) && $_REQUEST['autocomplete'] == 'oe_kurzbz')
|
||||
{
|
||||
$search = trim((isset($_REQUEST['term']) ? $_REQUEST['term'] : ''));
|
||||
if (is_null($search) || $search == '')
|
||||
exit();
|
||||
|
||||
$search = array($search);
|
||||
$oe = new organisationseinheit();
|
||||
$oe->search($search);
|
||||
|
||||
$stg = new studiengang();
|
||||
$stg->search($search);
|
||||
foreach($stg->result as $row)
|
||||
{
|
||||
if($row->aktiv===true)
|
||||
$oe->result[] = new organisationseinheit($row->oe_kurzbz);
|
||||
}
|
||||
|
||||
if(is_array($oe->result) && count($oe->result) > 0)
|
||||
{
|
||||
$result_obj = array();
|
||||
foreach($oe->result as $row)
|
||||
{
|
||||
if($row->aktiv==true)
|
||||
{
|
||||
$item['oe_kurzbz'] = html_entity_decode($row->oe_kurzbz);
|
||||
$item['organisationseinheittyp_kurzbz'] = html_entity_decode($row->organisationseinheittyp_kurzbz);
|
||||
$item['bezeichnung'] = html_entity_decode($row->bezeichnung);
|
||||
$result_obj[] = $item;
|
||||
}
|
||||
}
|
||||
echo json_encode($result_obj);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user