From ccf964a9c320b01d1a3ee355a8040b6ee4f7fc87 Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Thu, 25 Oct 2012 07:24:23 +0000 Subject: [PATCH] =?UTF-8?q?Authentifizierung=20und=20Checks=20eingebaut=20?= =?UTF-8?q?CSS=20aktualisiert=20Endedatum=20in=20=C3=9Cbersicht=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/coodle/uebersicht.php | 13 ++- cis/public/coodle.php | 146 ++++++++++++++++++++++-------- 2 files changed, 119 insertions(+), 40 deletions(-) diff --git a/cis/private/coodle/uebersicht.php b/cis/private/coodle/uebersicht.php index ea12ae1d5..cd2d1747a 100755 --- a/cis/private/coodle/uebersicht.php +++ b/cis/private/coodle/uebersicht.php @@ -23,6 +23,7 @@ require_once('../../../config/cis.config.inc.php'); require_once('../../../include/coodle.class.php'); require_once('../../../include/functions.inc.php'); require_once('../../../include/phrasen.class.php'); +require_once('../../../include/datum.class.php'); $lang = getSprache(); @@ -94,7 +95,7 @@ if($method=='delete') else { if($coodle->delete($coodle_id)) - $message =''.$p->t('global/erfolgreichgelöscht').''; + $message ='Erfolgreich storniert!'; else $message =''.$p->t('coodle/umfrageKonnteNichtGeloeschtWerden').''; } @@ -115,10 +116,12 @@ echo'

'.$p->t('coodle/uebersicht').'

'.$p->t('coodle/beschreibung').' '.$p->t('coodle/letzterStatus').' '.$p->t('coodle/ersteller').' + Endedatum '.$p->t('coodle/aktion').' '; +$datum = new datum(); $coodle = new coodle(); $coodle->getCoodleFromUser($uid); foreach($coodle->result as $c) @@ -126,12 +129,14 @@ foreach($coodle->result as $c) echo ' '.$coodle->convert_html_chars($c->coodle_id).' '.$coodle->convert_html_chars($c->titel).' - '.$coodle->convert_html_chars(substr($c->beschreibung,0,40)).' + '.(substr($c->beschreibung,0,40)).' '.$coodle->convert_html_chars($c->coodle_status_kurzbz).' '.$coodle->convert_html_chars($c->ersteller_uid).' + '.$coodle->convert_html_chars($datum->formatDatum($c->endedatum, 'd.m.Y')).' -   -   +   +   +   '; } diff --git a/cis/public/coodle.php b/cis/public/coodle.php index c840b43f5..bb2d0918a 100755 --- a/cis/public/coodle.php +++ b/cis/public/coodle.php @@ -19,12 +19,11 @@ * Authors: Karl Burkhart */ - - require_once('../../config/cis.config.inc.php'); require_once('../../include/phrasen.class.php'); require_once('../../include/functions.inc.php'); require_once('../../include/coodle.class.php'); +require_once('../../include/datum.class.php'); if(isset($_GET['lang'])) setSprache($_GET['lang']); @@ -40,9 +39,25 @@ $coodle = new coodle(); if(!$coodle->load($coodle_id)) die($coodle->errormsg); +if(!$coodle->checkStatus($coodle_id)) + die('Umfrage ist schon beendet oder noch nicht gestartet'); + // authentifizierung if(!isset($_GET['zugangscode'])) - $uid = get_uid(); +{ + $uid = get_uid(); + if(!$coodle->checkBerechtigung($coodle_id, $uid)) + die('Keine Berechtiung für diese Umfrage'); +} +else +{ + if(!$coodle->checkBerechtigung($coodle_id, '', $_GET['zugangscode'])) + die('Keine Berechtigung für diese Umfrage'); +} + +// Überprüfen ob Coodle Status laufend hat + + // checkboxen speichern if(isset ($_POST['save'])) @@ -55,6 +70,7 @@ if(isset ($_POST['save'])) $coodle_help->getRessourceFromUser($coodle_id, '', $_GET['zugangscode']); $coodle_ressource_termin= $coodle_help->deleteRessourceTermin($coodle_help->coodle_ressource_id, $coodle_id); + $message = "Erfolgreich gespeichert"; // weil wenn alle checkboxen gelöscht werden kommt man nicht mehr in die speichern schleife } else { @@ -62,6 +78,7 @@ if(isset ($_POST['save'])) { $coodle_help->getRessourceFromUser($coodle_id, $uid); $coodle_ressource_termin= $coodle_help->deleteRessourceTermin($coodle_help->coodle_ressource_id, $coodle_id); + $message = "Erfolgreich gespeichert"; } } @@ -80,9 +97,9 @@ if(isset ($_POST['save'])) $coodle_ressource_termin->new = true; if(!$coodle_ressource_termin->saveRessourceTermin()) - $message= "Fehler beim Speichern aufgetreten"; + $message= "Fehler beim Speichern aufgetreten"; else - $message = "Erfolgreich gespeichert"; + $message = "Erfolgreich gespeichert"; } } } @@ -91,29 +108,68 @@ if(isset ($_POST['save'])) - -Coodle Übersicht - + h5 {margin-top:0px; } + .container {width: 100%; } + #header { + background: #DCDDDF; + border: 1px solid #c4c6ca; + position: relative; + padding-left: 50px; + + } + + .error { + color:red; + padding-left:20px; + } + + .ok { + color:green; + padding-left:20px; + } + + #content { + padding: 20px 20px; + } + + #content th { + color:#008462; + padding-left: 10px; + padding-right: 10px; + } + + #content tr.owner + { + background-color: #DCDDDF; + } + + a + { + color: #008381; text-decoration: none; + cursor: pointer; + } + a:hover + { + color: Black; text-decoration: none; + } + #content table{ + + } + + @@ -144,15 +200,23 @@ h5 {margin-top:0px; } $coodle_termine = new coodle(); $coodle_termine->getTermine($coodle_id); - echo " -
-
+ $datum = new datum(); + + echo "
 "; + if(!isset($_GET['zugangscode'])) + echo "<< zurück zur Übersicht"; + echo "
"; foreach($coodle_termine->result as $termin) - echo ""; + { + $time = strtotime($termin->uhrzeit); + + + echo ""; + } echo ""; @@ -160,13 +224,23 @@ h5 {margin-top:0px; } foreach($coodle_ressourcen->result as $ressource) { $name = ''; + $class ='normal'; + + // wenn uid gesetzt ist nimm uid if($ressource->uid != '') $name = $ressource->uid; - - if($ressource->zugangscode !='') + // wenn uid nicht gesetzt ist nimm zugangscode + if($ressource->zugangscode !='' && $ressource->uid =='') $name = $ressource->name; - echo ""; + // eigene Reihe farbig hervorheben + if(isset($_GET['zugangscode']) && $_GET['zugangscode'] == $ressource->zugangscode) + $class ='owner'; + + if(!isset($_GET['zugangscode']) && $ressource->uid == $uid) + $class = 'owner'; + + echo ""; // termine zu ressourcen anzeigen foreach($coodle_termine->result as $termin) { @@ -195,10 +269,10 @@ h5 {margin-top:0px; } } echo " - +
".$termin->datum.' '.$termin->uhrzeit."".$datum->formatDatum($termin->datum, 'd.m.Y').'
'.date('H:i',$time)."
".$name."
".$name."
 
-
"; + ".$message; ?>