308 lines
9.4 KiB
PHP
Executable File
308 lines
9.4 KiB
PHP
Executable File
<?php
|
|
# Fuer debugging
|
|
#error_reporting(E_ALL);
|
|
#ini_set('display_errors', 1);
|
|
|
|
session_start();
|
|
include_once 'classes/TestProjektSmarty.class.php';
|
|
require_once("config.inc.php");
|
|
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
|
$smarty = new Smarty();
|
|
require_once "language/german.inc.php";
|
|
require_once("func_mail_einstell.php");
|
|
require_once("func_verlauf.php");
|
|
require_once("func_htmlclean.php");
|
|
|
|
|
|
if(isset($_GET['id'])){
|
|
$_SESSION["edit_id"] = $_GET['id'];
|
|
$search_prefix = 'erfassen_status_';
|
|
$search_len = strlen($search_prefix);
|
|
foreach( $_SESSION as $key => $value){
|
|
if ( substr( $key, 0, $search_len) == $search_prefix) {
|
|
unset( $_SESSION[$key]);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
$action = $_GET['action'];
|
|
|
|
if($action == ''){
|
|
|
|
|
|
$query1 = "SELECT vid, betreff, date_format(erfass_dat, '%d.%m.%Y') erfass_dat1
|
|
FROM imt_vorschlag
|
|
WHERE imtuid='$uid'
|
|
ORDER BY erfass_dat DESC";
|
|
|
|
$result1 = $db->query ($query1)
|
|
or die ("Cannot execute query");
|
|
|
|
$table_data1 = array();
|
|
|
|
while ($row1 = $result1->fetch_array()){
|
|
|
|
array_push($table_data1, array(
|
|
'vid' => $row1['vid'],
|
|
'betreff' => $row1['betreff'],
|
|
'erfass_dat1' => $row1['erfass_dat1']
|
|
)
|
|
);
|
|
}
|
|
$smarty->assign('table_data1', $table_data1);
|
|
|
|
}
|
|
|
|
|
|
if($action == 'status1'){
|
|
$vid = $_POST['vid'];
|
|
if($vid == ''){
|
|
$vid = $_GET['vid'];
|
|
}
|
|
|
|
$result_vorh = $db->query("SELECT count(*) Anz
|
|
FROM imt_vorschlag
|
|
WHERE vid=$vid
|
|
AND imtuid='$uid'");
|
|
$row_vorh = $result_vorh->fetch_array();
|
|
if($row_vorh['Anz'] == 0){
|
|
$smarty->assign('bearbeiten_err', "1");
|
|
}else{
|
|
$smarty->assign('bearbeiten_err', "0");
|
|
}
|
|
|
|
|
|
$_SESSION["erfassen_status_vid"] = $vid;
|
|
|
|
$result = $db->query("SELECT betreff, beschreibung, vorschlag, nutzen, public, kategorie, hinweis_eigen, hinweis_admin, vorname, nachname, mail, beziehung
|
|
FROM imt_vorschlag a, imt_user b
|
|
WHERE a.imtuid=b.imtuid
|
|
AND a.vid=$vid");
|
|
$row = $result->fetch_array();
|
|
|
|
$result1 = $db->query("SELECT kategorie
|
|
FROM imt_kategorie
|
|
WHERE kid='$row[kategorie]'");
|
|
$row1 = $result1->fetch_array();
|
|
|
|
switch ($row['beziehung'])
|
|
{
|
|
case "P":
|
|
$beziehung = "ProfessorIn";
|
|
break;
|
|
case "L":
|
|
$beziehung = "Lehrbeauftragte/r";
|
|
break;
|
|
case "E":
|
|
$beziehung = "Externe/r";
|
|
break;
|
|
case "S":
|
|
$beziehung = "StudentIn";
|
|
break;
|
|
case "V":
|
|
$beziehung = "Verwaltungsmitarbeiter";
|
|
break;
|
|
default:
|
|
$beziehung = "$row[beziehung]";
|
|
}
|
|
|
|
if($row['public'] =='Y'){
|
|
$public = "Ja";
|
|
}else{
|
|
$public = "Nein";
|
|
}
|
|
|
|
|
|
$smarty->assign('erfassen_status_vid', "$vid");
|
|
$smarty->assign('erfassen_status_betreff', "$row[betreff]");
|
|
$smarty->assign('erfassen_status_beschreibung', "$row[beschreibung]");
|
|
$smarty->assign('erfassen_status_vorschlag', "$row[vorschlag]");
|
|
$smarty->assign('erfassen_status_nutzen', "$row[nutzen]");
|
|
$smarty->assign('erfassen_status_hinweis_eigen', "$row[hinweis_eigen]");
|
|
$smarty->assign('erfassen_status_hinweis_admin', "$row[hinweis_admin]");
|
|
$smarty->assign('erfassen_status_vorname', "$row[vorname]");
|
|
$smarty->assign('erfassen_status_nachname', "$row[nachname]");
|
|
$smarty->assign('erfassen_status_mail', "$row[mail]");
|
|
$smarty->assign('erfassen_status_kategorie', "$row1[kategorie]");
|
|
$smarty->assign('erfassen_status_beziehung', "$beziehung");
|
|
$smarty->assign('erfassen_status_public', "$public");
|
|
|
|
$query2 = "SELECT name
|
|
FROM imt_gruppenmitglieder
|
|
WHERE vid='$vid'
|
|
ORDER BY name";
|
|
|
|
$result2 = $db->query ($query2)
|
|
or die ("Cannot execute query2");
|
|
|
|
$table_data2 = array();
|
|
|
|
while ($row2 = $result2->fetch_array()){
|
|
array_push($table_data2, array(
|
|
'name' => $row2[name]
|
|
)
|
|
);
|
|
}
|
|
$smarty->assign('table_data2', $table_data2);
|
|
|
|
# Statis
|
|
$query3 = "SELECT date_format(datum, '%d.%m.%Y - %H:%i Uhr') datum1,b.sid, b.status, verlauf
|
|
FROM imt_verlauf a, imt_stati b
|
|
WHERE a.status = b.sid
|
|
AND a.status != 0
|
|
AND a.vid='$vid'
|
|
ORDER BY datum DESC";
|
|
|
|
$result3 = $db->query ($query3)
|
|
or die ("Cannot execute query3");
|
|
|
|
$table_data3 = array();
|
|
$verlauf_dup = array("");
|
|
while ($row3 = $result3->fetch_array()){
|
|
$status = $row3['status'];
|
|
|
|
if($row3['sid'] == '103'){
|
|
# Da jedes Ausschussmitglied informiert wird, reicht es aus, wenn bei den Statusdetails nur ein Hinweis pro Gutachter genannt wird, nicht 5x pro Person
|
|
# Bei der Meldung "Ausschuss (Bernd Fuchsi) über Gutachter Wolf Wursti informiert. Frist: 25.06.2011" wird der Gutachter "Wolf Wursti"
|
|
# ausgeschnitten und in ein Array gepackt. Wird der gleiche Gutachter mit dem Status 103 nochamls durchgeschleift, wird in den else Bereich verwiesen
|
|
# Im Template werden nur die Statis angezeigt die != "" sind
|
|
$pos1 = strpos ($row3[verlauf], 'Gutachter')+9;
|
|
$status_103 = trim(substr($row3[verlauf], $pos1));
|
|
$pos2 = strpos ($status_103, 'informiert')-1;
|
|
$status = trim(substr($status_103, 0,$pos2));
|
|
|
|
if (!in_array($status, $verlauf_dup)) {
|
|
$verlauf_dup[] = "$status";
|
|
$status = $row3[status];
|
|
}else{
|
|
$status = "";
|
|
}
|
|
|
|
}
|
|
|
|
if($row3['sid'] == '7' OR $row3['sid'] == '8'){
|
|
$info = '1';
|
|
}else{
|
|
$info = '0';
|
|
}
|
|
|
|
array_push($table_data3, array(
|
|
'datum1' => $row3['datum1'],
|
|
'info' => $info,
|
|
'status' => $status
|
|
)
|
|
);
|
|
|
|
|
|
|
|
}
|
|
$smarty->assign('table_data3', $table_data3);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
if($action == 'status2'){
|
|
|
|
|
|
$vid = $_SESSION["erfassen_status_vid"];
|
|
|
|
|
|
$edit_hinweis_eigen = htmlclean($_POST['erfassen_status_hinweis_eigen']);
|
|
|
|
$result = $db->query("SELECT hinweis_eigen
|
|
FROM imt_vorschlag
|
|
WHERE vid = '$vid'");
|
|
$row = $result->fetch_array();
|
|
|
|
|
|
if($row['hinweis_eigen'] != $edit_hinweis_eigen){
|
|
|
|
$sql = $db->query("UPDATE imt_vorschlag SET hinweis_eigen='$edit_hinweis_eigen' WHERE vid='$vid'");
|
|
if($sql){
|
|
|
|
#verlauf($uid, $vid, 'Hinweis des Erfassers', 104, '');
|
|
$query_ga = $db->query("SELECT uid, a.imtuid, passwort, vorname, nachname, betreff
|
|
FROM imt_user a, imt_vorschlag b
|
|
WHERE a.imtuid=b.imtuid
|
|
AND b.vid='$vid'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username
|
|
$row_ga = $query_ga->fetch_array();
|
|
$empfaenger = "$global_service_admin_uid";
|
|
$betreff = "Hinweis des Erfassers zu Vorschlag $vid";
|
|
|
|
$text = "
|
|
<html>
|
|
<head>
|
|
<title>Hinweis des Erfassers</title>
|
|
</head>
|
|
<body>
|
|
<font face='Arial' size='2'>
|
|
Guten Tag $global_service_admin!
|
|
<br /><br />
|
|
Im Rahmen des Ideenmanagements ist ein Hinweis des Erfassers eingegangen.
|
|
|
|
<br />
|
|
<br />
|
|
<table>
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Vorschlag:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$row_ga[betreff]
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>ID:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$vid
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Hinweis:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$edit_hinweis_eigen
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br />
|
|
Um den Hinweis zu kommentieren, melden Sie sich bitte im System an und wählen den betroffenen Vorschlag im Adminbereich. Nach Auswahl des Vorschlages kann ein Adminhinweis in der Übersicht erfasst werden.
|
|
<br>
|
|
Link zum System: <a href='https://www.hs-ludwigsburg.de/kurs/ideenmanagement'>Ideenmanagement</a>
|
|
<p>
|
|
Diese Mail wurde automatisch generiert!<br />
|
|
Antworten Sie daher nicht auf diese Mail.<br />
|
|
<br />
|
|
Vielen Dank!
|
|
</body>
|
|
</html>";
|
|
|
|
mail_einstell($vid, $uid, $empfaenger, NULL, NULL, $betreff, $text, 104, NULL);
|
|
}
|
|
}
|
|
|
|
echo "<meta http-equiv=\"refresh\" content=\"2; URL=".$_SERVER['PHP_SELF']."?action=status1&vid=$vid\">";
|
|
|
|
}
|
|
|
|
$smarty->assign('action', "$action");
|
|
$smarty->display("$template/$templatename");
|
|
?>
|