Darstellung Services optimiert, wenn ext_id vorhanden wird ein link zum

Moodle-Kurs dargestellt
This commit is contained in:
Gerald Raab
2017-11-29 16:10:52 +01:00
parent 3f3479abaa
commit 13ddee4748
4 changed files with 69 additions and 47 deletions
+46 -28
View File
@@ -26,12 +26,12 @@ require_once('../../../include/phrasen.class.php');
require_once('../../../include/person.class.php');
$user = get_uid();
$sprache = getSprache();
$sprache = getSprache();
$p=new phrasen($sprache);
//$rechte = new benutzerberechtigung();
//$rechte->getBerechtigungen($user);
//if(!$rechte->isBerechtigt('basis/service'))
// die('Sie haben keine Berechtigung fuer diese Seite');
@@ -42,7 +42,7 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<title>'.$p->t("services/service").'</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
@@ -50,20 +50,36 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>';
// Load Addons to get Moodle_Path
$addon_obj = new addon();
if ($addon_obj->loadAddons())
{
if (count($addon_obj->result) > 0)
{
foreach ($addon_obj->result as $row)
{
if (file_exists('../../../addons/'.$row->kurzbz.'/config.inc.php'))
include_once('../../../addons/'.$row->kurzbz.'/config.inc.php');
}
}
}
echo '
<script type="text/javascript">
$(document).ready(function()
{
$(document).ready(function()
{
$("#myTable").tablesorter(
{
sortList: [[0,0],[1,0]],
widgets: [\'zebra\']
});
}
});
}
);
function ContentPopUp (Adresse)
function ContentPopUp (Adresse)
{
Content = window.open(Adresse, "Content", "width=800,height=500,scrollbars=yes");
Content.focus();
@@ -82,28 +98,29 @@ echo '<SELECT name="oe_kurzbz">
<OPTION value="">-- '.$p->t("global/alle").' --</OPTION>';
$oe = new organisationseinheit();
//$oe->getAll();
$oe->loadArray($oe->getChilds('Infrastruktur'),'bezeichnung');
$oe->getAll();
//$oe->loadArray($oe->getChilds('Infrastruktur'),'bezeichnung');
foreach($oe->result as $row)
{
if($row->oe_kurzbz==$oe_kurzbz)
$selected='selected';
else
$selected='';
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
$serv_tmp = new service();
if($serv_tmp->getServicesOrganisationseinheit($row->oe_kurzbz, true))
{
if (! empty($serv_tmp->result))
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
}
}
echo '</SELECT>
<input type="submit" value="'.$p->t("services/filtern").'" />
</form>';
if($oe_kurzbz!='')
{
// Wenn der OE keine Services zugeteilt sind, dann die Services der untergeordneten OE laden
if($service->getServicesOrganisationseinheit($oe_kurzbz, true))
if (empty($service->result))
if(!$service->getSubServicesOrganisationseinheit($oe_kurzbz,'oe_kurzbz,bezeichnung',true))
die($service->errormsg);
$service->getServicesOrganisationseinheit($oe_kurzbz);
}
else
{
@@ -117,8 +134,6 @@ echo '<table class="tablesorter" id="myTable">
<th>'.$p->t("global/bezeichnung").'</th>
<th>'.$p->t("services/leistung").'</th>
<th>'.$p->t("services/design").'</th>
<th>'.$p->t("services/betrieb").'</th>
<th>'.$p->t("services/operativ").'</th>
<th>'.$p->t("services/details").'</th>
</tr>
</thead>
@@ -126,7 +141,7 @@ echo '<table class="tablesorter" id="myTable">
foreach($service->result as $row)
{
if ($row->content_id!='')
if ($row->content_id != '' || $row->ext_id != '')
{
$person = new person();
$person->getPersonFromBenutzer($row->design_uid);
@@ -139,12 +154,15 @@ foreach($service->result as $row)
$operativ = $person->nachname.' '.$person->vorname;
echo '<tr>';
echo '<td>',$row->oe_kurzbz,'</td>';
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">'.$row->bezeichnung.'</a>':$row->bezeichnung).'</td>';
echo '<td><b>'.$row->bezeichnung.'</b></td>';
echo '<td>',$row->beschreibung,'</td>';
echo '<td><nobr><a href="../profile/index.php?uid='.$row->design_uid.'">',$design,'</a></nobr></td>';
echo '<td><nobr><a href="../profile/index.php?uid='.$row->betrieb_uid.'">',$betrieb,'</a></nobr></td>';
echo '<td><nobr><a href="../profile/index.php?uid='.$row->operativ_uid.'">',$operativ,'</a></nobr></td>';
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">Details</a>':'').'</td>';
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->betrieb_uid.'">',$betrieb,'</a></nobr></td>';
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->operativ_uid.'">',$operativ,'</a></nobr></td>';
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">Details</a>':'');
if (defined("ADDON_MOODLE_PATH"))
echo ' '.($row->ext_id!=''?'<a href="'.ADDON_MOODLE_PATH.'course/view.php?id='.$row->ext_id.'" target="_blank">Beschreibung</a>':'');
echo '</td>';
echo '</tr>';
}
}
@@ -152,4 +170,4 @@ echo '</tbody>
</table>
</body>
</html>';
?>
?>
Regular → Executable
+5 -3
View File
@@ -200,11 +200,11 @@ class service extends basis_db
WHERE tbl_zeitaufzeichnung.uid=".$this->db_add_param($user)."
$zeit
GROUP BY tbl_service.service_id HAVING COUNT(*) > $anzahl_ereignisse
UNION
SELECT tbl_service.*, '0' AS anzahl
FROM public.tbl_service
ORDER BY count DESC,bezeichnung,oe_kurzbz";
if($result = $this->db_query($qry))
@@ -363,12 +363,13 @@ class service extends basis_db
if($new)
{
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, oe_kurzbz, content_id, design_uid, betrieb_uid, operativ_uid)
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, oe_kurzbz, content_id, ext_id, design_uid, betrieb_uid, operativ_uid)
VALUES(".
$this->db_add_param($this->bezeichnung).','.
$this->db_add_param($this->beschreibung).','.
$this->db_add_param($this->oe_kurzbz).','.
$this->db_add_param($this->content_id).','.
$this->db_add_param($this->ext_id).','.
$this->db_add_param($this->design_uid).','.
$this->db_add_param($this->betrieb_uid).','.
$this->db_add_param($this->operativ_uid).');';
@@ -380,6 +381,7 @@ class service extends basis_db
' beschreibung = '.$this->db_add_param($this->beschreibung).','.
' oe_kurzbz = '.$this->db_add_param($this->oe_kurzbz).','.
' content_id = '.$this->db_add_param($this->content_id).','.
' ext_id = '.$this->db_add_param($this->ext_id).','.
' design_uid = '.$this->db_add_param($this->design_uid).','.
' betrieb_uid = '.$this->db_add_param($this->betrieb_uid).','.
' operativ_uid = '.$this->db_add_param($this->operativ_uid).
Regular → Executable
+2 -2
View File
@@ -4,7 +4,7 @@ $this->phrasen['services/uebersichtUeberServicesOrganisationseinheiten']='Übers
$this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filtern';
$this->phrasen['services/leistung']='Leistung';
$this->phrasen['services/design']='Design';
$this->phrasen['services/design']='Verantwortlich';
$this->phrasen['services/betrieb']='Betrieb';
$this->phrasen['services/operativ']='Operativ';
?>
?>
+16 -14
View File
@@ -26,7 +26,7 @@ $user = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('basis/service'))
die('Sie haben keine Berechtigung fuer diese Seite');
@@ -37,27 +37,27 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<title>Service</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">';
include('../../include/meta/jquery.php');
include('../../include/meta/jquery-tablesorter.php');
echo'
<script type="text/javascript">
$(document).ready(function()
{
$(document).ready(function()
{
$("#myTable").tablesorter(
{
sortList: [[3,0],[2,0]],
widgets: [\'zebra\'],
headers: {8:{sorter:false}}
});
}
});
}
);
function confdel()
{
return confirm("Wollen Sie diesen Eintrag wirklich löschen?");
@@ -73,10 +73,10 @@ if(isset($_GET['action']) && $_GET['action']=='delete')
{
if(!$rechte->isBerechtigt('basis/service', null, 'suid'))
die('Sie haben keine Berechtigung fuer diese Seite');
if(!isset($_GET['service_id']))
die('Fehlender Parameter ServiceID');
$service = new service();
if($service->delete($_GET['service_id']))
echo '<span class="ok">Eintrag wurde erfolgreich gelöscht</span>';
@@ -100,7 +100,7 @@ foreach($oe->result as $row)
$selected='selected';
else
$selected='';
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
}
echo '</SELECT>
@@ -125,6 +125,7 @@ echo '<table class="tablesorter" id="myTable">
<th>Beschreibung</th>
<th>Organisationseinheit</th>
<th>Content_ID</th>
<th>Ext_ID</th>
<th>Design</th>
<th>Betrieb</th>
<th>Operativ</th>
@@ -141,6 +142,7 @@ foreach($service->result as $row)
echo '<td>',$row->beschreibung,'</td>';
echo '<td>',$row->oe_kurzbz,'</td>';
echo '<td>',$row->content_id,'</td>';
echo '<td>',$row->ext_id,'</td>';
echo '<td>',$row->design_uid,'</td>';
echo '<td>',$row->betrieb_uid,'</td>';
echo '<td>',$row->operativ_uid,'</td>';
@@ -152,4 +154,4 @@ echo '</tbody>
</table>
</body>
</html>';
?>
?>