diff --git a/cis/ampel.php b/cis/ampel.php index 3036bcb2b..d8429335f 100644 --- a/cis/ampel.php +++ b/cis/ampel.php @@ -28,43 +28,62 @@ if(is_user_logged_in()) $ampel = new ampel(); $ampel->loadUserAmpel($user); $rot=0; - $gelb=0; + $gelb = 0; + $gruen = 0; $verpflichtend = false; + $cnt_verpflichtend = 0; + $cnt_abgelaufen = 0; + $cnt_notConf_notOverdue = 0; //counts mandatory, not confirmed && not overdued ampeln (for popup) + $datum = new datum(); + $now = $datum->mktime_fromdate(date('Y-m-d')); foreach($ampel->result as $row) - { - $ts_deadline = $datum->mktime_fromdate($row->deadline); - $vlz = "-".$row->vorlaufzeit." day"; - $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); - $ts_now = $datum->mktime_fromdate(date('Y-m-d')); - if($ts_deadline < $ts_now) - { - $rot++; - if ($row->verpflichtend == 't') - $verpflichtend = true; - } - else - { - if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) - { - $gelb++; - if ($row->verpflichtend == 't') - $verpflichtend = true; - } - } - } - if($rot==0 && $gelb==0) - echo ''.$p->t("tools/ampelsystem").'  |  '; + { + $deadline =$datum->mktime_fromdate($row->deadline); + $vorlaufzeit = $row->vorlaufzeit; + $verfallszeit = $row->verfallszeit; + $bestaetigt = $ampel->isBestaetigt($user, $row->ampel_id); + $verpflichtend = $row->verpflichtend; + $abgelaufen = false; - if($rot>0 || $gelb>0) - { - // Wenn es eine verpflichtende Ampel gibt, das Pupup im CIS anzeigen - if ($verpflichtend == true) - { + $datum_liegt_vor_vorlaufzeit = false; + $datum_liegt_nach_verfallszeit = false; + + if (!is_null($vorlaufzeit)) + $datum_liegt_vor_vorlaufzeit = $now < strtotime('-' . $vorlaufzeit . ' day', $deadline); + + if (!is_null($verfallszeit)) + $datum_liegt_nach_verfallszeit = $now > strtotime('+' . $verfallszeit . ' day', $deadline); + + //count mandatory + if($verpflichtend == 't') + $cnt_verpflichtend++; + + //count overdue + if ($datum_liegt_nach_verfallszeit) + $cnt_abgelaufen++; + + //set status + if ($bestaetigt) + $gruen++; + else if ($now >= $deadline && !$datum_liegt_nach_verfallszeit && !$bestaetigt) + $rot++; + else if (!$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit) + $gelb++; + + //count mandatory ampeln that are not confirmed and not overdue (for popup) + if ($verpflichtend == 't' && !$bestaetigt && !$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit) + $cnt_notConf_notOverdue++; + } + + + // Wenn es eine verpflichtende Ampel gibt, das Pupup im CIS anzeigen + if ($cnt_notConf_notOverdue > 0) + { echo ' '; @@ -101,15 +120,17 @@ if(is_user_logged_in()) } '; } - if($rot>0) + + //show & color header ampel-link + if($rot > 0) echo ''.$p->t("tools/ampelsystem").'  |  '; - elseif($gelb>0) + elseif($gelb > 0) echo ''.$p->t("tools/ampelsystem").'  |  '; - } -} + elseif($rot==0 || $rot <= $cnt_abgelaufen && $gelb==0) + echo ''.$p->t("tools/ampelsystem").'  |  '; + } else { - echo ""; - //echo microtime(); + echo ""; } ?> \ No newline at end of file diff --git a/cis/private/tools/ampelverwaltung.php b/cis/private/tools/ampelverwaltung.php index ad76dd7cf..98bc9d812 100644 --- a/cis/private/tools/ampelverwaltung.php +++ b/cis/private/tools/ampelverwaltung.php @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * Authors: Andreas Oesterreicher + * Cristina Hainberger */ require_once('../../../config/cis.config.inc.php'); require_once('../../../include/functions.inc.php'); @@ -26,19 +27,23 @@ require_once('../../../include/benutzerfunktion.class.php'); require_once('../../../include/organisationseinheit.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); require_once('../../../include/studiensemester.class.php'); +require_once('../../../include/person.class.php'); $user = get_uid(); $sprache = getSprache(); $p = new phrasen($sprache); -$show = (isset($_GET['show'])?$_GET['show']:'aktuell'); +$person = new person(); +$person->getPersonFromBenutzer($user); + +$show = (isset($_POST['show']) ? $_POST['show'] : 'aktuell'); //show: alle / aktuell +$is_popup = (isset($_GET['verpflichtend']) && $_GET['verpflichtend'] == true) ? true : false; //Leiter OEs holen $benutzerfunktion = new benutzerfunktion(); $benutzerfunktion->getBenutzerFunktionen('Leitung', '', '', $user); $organisationseinheit = new organisationseinheit(); - $oes=array(); foreach ($benutzerfunktion->result as $row) { @@ -54,225 +59,431 @@ if($rechte->isBerechtigt('basis/ampeluebersicht')) $oes_berechtigung = $rechte->getOEkurzbz('basis/ampeluebersicht'); $oes = array_merge($oes_berechtigung, $oes); } - array_unique($oes); +//actual studiensemester $studiensemester = new studiensemester(); $ss_akt = $studiensemester->getakt(); -echo ' - - - - - - - - - - - - - - ',$p->t('tools/ampelsystem'),' - - - - -

',$p->t('tools/ampelsystem'),'

'; - -if(count($oes)!=0) - echo '

'.($p->t('tools/uebersichtLeitung')).'

'; - -echo '

'.$p->t('tools/dasAmpelsystemIstEinErinnerungsystem').'

'; - -if ($show == 'aktuell') - echo '

'.$p->t('tools/ampelAlleAnzeigen').'

'; -else - echo '

'.$p->t('tools/ampelNurAktuellesStudiensemester').'

'; - -$datum_obj = new datum(); +//semesterstart +$studiensemester = new studiensemester($ss_akt); +$semester_start = $studiensemester->start; $type = isset($_GET['type'])?$_GET['type']:''; $ampel_id = isset($_GET['ampel_id'])?$_GET['ampel_id']:''; -$message=''; + +//ampel confirmation & relaod of header link if($type=='bestaetigen' && is_numeric($ampel_id)) { $ampel = new ampel(); + $message=''; if($ampel->load($ampel_id)) { - if($ampel->isZugeteilt($user, $ampel->benutzer_select)) + if($ampel->isZugeteilt($user, $ampel->benutzer_select)) { if(!$ampel->isBestaetigt($user, $ampel_id)) { - if($ampel->bestaetigen($user, $ampel_id)) + if($ampel->bestaetigen($user, $ampel_id)) //confirm ampel { - //$message = 'OK'; - //Ampel Ansicht im Seiten-Header aktualisieren - $message=''; + echo ''; + header('Refresh:0'); + exit; } else $message = ''.$ampel->errormsg.''; } - else - { - $message = ''.$p->t('tools/ampelBereitsBestaetigt').''; - } } else $message = ''.$p->t('tools/nichtZugeteilt').''; } else $message = ''.$p->t('tools/ampelNichtGefunden').''; + + if ($message != '') + echo ''; } -echo $message; -$ampel = new ampel(); -$ampel->loadUserAmpel($user, false, true); +//get all user ampeln +list( + $user_ampel_arr, + $cnt_ueberfaellig) = //counts overdue ampeln (not expired) + getUserAmpelData($user); -echo ' - - - - - - - - - - -'; -$beginn = new studiensemester($ss_akt); +//sort ampeln +$user_ampel_arr = sortUserAmpelData($user_ampel_arr); -foreach($ampel->result as $row) +//filter ampeln for popup (if at least one mandatory, which is neither expired nor before vorlaufzeit) +if ($is_popup) { - //Nur Ampeln laden, die im aktuellen Studiensemester liegen - if ($show == 'aktuell' && $row->deadline>=$beginn->start) + list( + $user_ampel_arr, + $cnt_ueberfaellig_und_verpflichtend) = //counts mandatory, overdue (not expired), unconfirmed, not before vorlaufzeit + getPopupUserAmpelData($user_ampel_arr); +} + +//filter ampeln of actual term (if radiobutton is set to aktuell) +if ($show == 'aktuell') + $user_ampel_arr = getActualUserAmpelData($user_ampel_arr, $semester_start); + + +//***************************************** FUNCTIONS for Ampeln +function getUserAmpelData($user) +{ + $cnt_ueberfaellig = 0; + + $ampel = new ampel(); + $ampel->loadUserAmpel($user, true); + $user_ampel_arr = array(); + + $datum = new datum(); + $now = $datum->mktime_fromdate(date('Y-m-d')); + + foreach($ampel->result as $row) { - $ts_deadline = $datum_obj->mktime_fromdate($row->deadline); - $vlz = "-".$row->vorlaufzeit." day"; - $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); - $ts_now = $datum_obj->mktime_fromdate(date('Y-m-d')); + $deadline = $datum->mktime_fromdate($row->deadline); + $vorlaufzeit = $row->vorlaufzeit; + $verfallszeit = $row->verfallszeit; + $bestaetigt = $ampel->isBestaetigt($user, $row->ampel_id); + $verpflichtend = $row->verpflichtend; // 't'/'f' + + $datum_liegt_vor_vorlaufzeit = false; + $datum_liegt_nach_verfallszeit = false; + + if (!is_null($vorlaufzeit)) + $datum_liegt_vor_vorlaufzeit = $now < strtotime('-' . $vorlaufzeit . ' day', $deadline); + + if (!is_null($verfallszeit)) + $datum_liegt_nach_verfallszeit = $now > strtotime('+' . $verfallszeit . ' day', $deadline); - if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) - $ampelstatus='gelb'; - elseif($ts_now>$ts_deadline) - $ampelstatus='rot'; - elseif($ts_now<$ts_deadline && $ts_vorlaufzeit>=$ts_now) - $ampelstatus='gruen'; + //default + $show_ampel = true; //true while actual date is not before vorlaufzeit + $abgelaufen = false; //false while actual date is not after verfallszeit + $active = true; //true while not confirmed or expired + $status = 'gelb'; //yellow while not overdue (red) or confirmed (green) + $status_ampel = ''; //ampel image + + if ($bestaetigt) + $status = 'gruen'; - if($bestaetigt = $ampel->isBestaetigt($user,$row->ampel_id)) - $ampelstatus=''; - echo ''; - echo ''; - - echo ''; - $beschreibung = $row->beschreibung[$sprache]; - if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) - $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; - echo ''; - echo ''; - - // echo ""; - // echo ""; - // echo ""; - echo ''; + $user_ampel_arr[] = array( + 'ampel_id' => $row->ampel_id, + 'kurzbz' => $row->kurzbz, + 'show_ampel' => $show_ampel, + 'status' => $status, + 'status_ampel' => $status_ampel, + 'verpflichtend' => $verpflichtend, + 'bestaetigt' => $bestaetigt, + 'deadline' => $row->deadline, + 'vorlaufzeit' => $row->vorlaufzeit, + 'verfallszeit' => $row->verfallszeit, + 'beschreibung' => $row->beschreibung, + 'abgelaufen' => $abgelaufen, + 'active' => $active); } - elseif ($show == 'alle') - { - $ts_deadline = $datum_obj->mktime_fromdate($row->deadline); - $vlz = "-".$row->vorlaufzeit." day"; - $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); - $ts_now = $datum_obj->mktime_fromdate(date('Y-m-d')); - if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) - $ampelstatus='gelb'; - elseif($ts_now>$ts_deadline) - $ampelstatus='rot'; - elseif($ts_now<$ts_deadline && $ts_vorlaufzeit>=$ts_now) - $ampelstatus='gruen'; - - if($bestaetigt = $ampel->isBestaetigt($user,$row->ampel_id)) - $ampelstatus=''; - - echo ''; - echo ''; - - echo ''; - $beschreibung = $row->beschreibung[$sprache]; - if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) - $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; - echo ''; - echo ''; - - // echo ""; - // echo ""; - // echo ""; - echo ''; - } + return array($user_ampel_arr, $cnt_ueberfaellig); } -echo '
'.$p->t('tools/ampelBeschreibung').''.$p->t('tools/ampelDeadline').'
'; - switch($ampelstatus) + if ($datum_liegt_vor_vorlaufzeit) + $show_ampel = false; + + + if ($datum_liegt_nach_verfallszeit) + $abgelaufen = true; + + + if ($now >= $deadline && !$bestaetigt) + { + if (!$abgelaufen) + $cnt_ueberfaellig++; + $status = 'rot'; + } + + if ($bestaetigt || $abgelaufen) + $active = false; + + //assign png-image to ampelstatus + switch($status) { case 'rot': - $status= ''; + $status_ampel= ''; break; case 'gelb': - $status= ''; + $status_ampel= ''; break; case 'gruen': - $status= ''; + $status_ampel= ''; break; default: - $status= ''; + $status_ampel= ''; break; } - echo $status; - echo ''; - if(!$bestaetigt) - echo '
'; - else - echo ''; - echo '
verpflichtend=='t'?'style="background-color: #EF8A88"':'').'>'.$beschreibung.''.$datum_obj->formatDatum($row->deadline,'d.m.Y').'".date('d.m.Y',$ts_now)."".date('d.m.Y',$ts_vorlaufzeit)."".date('d.m.Y',$ts_deadline)."
'; - switch($ampelstatus) - { - case 'rot': - $status= ''; - break; - case 'gelb': - $status= ''; - break; - case 'gruen': - $status= ''; - break; - default: - $status= ''; - break; - } - echo $status; - - echo ''; - if(!$bestaetigt) - echo '
'; - else - echo ''; - echo '
verpflichtend=='t'?'style="background-color: #EF8A88"':'').'>'.$beschreibung.''.$datum_obj->formatDatum($row->deadline,'d.m.Y').'".date('d.m.Y',$ts_now)."".date('d.m.Y',$ts_vorlaufzeit)."".date('d.m.Y',$ts_deadline)."
'; +function sortUserAmpelData($user_ampel_arr) +{ + //first: sort deadline + foreach ($user_ampel_arr as $key => $val) + $deadline[$key] = $val['deadline']; + + array_multisort($deadline, SORT_DESC, $user_ampel_arr); + + //second: sort inactive after active + $active_ampel_arr = array(); + $inactive_ampel_arr = array(); + foreach ($user_ampel_arr as $user_ampel) + { + if ($user_ampel['active']) + $active_ampel_arr[] = $user_ampel; + else + $inactive_ampel_arr[] = $user_ampel; + } + return $user_ampel_arr = array_merge($active_ampel_arr, $inactive_ampel_arr); +} +function getPopupUserAmpelData($user_ampel_arr) +{ + $arr = array(); + $cnt_ueberfaellig_und_verpflichtend = 0; + foreach ($user_ampel_arr as $user_ampel) + { + if ($user_ampel['verpflichtend'] == 't' && !$user_ampel['bestaetigt'] && !$user_ampel['abgelaufen'] && $user_ampel['show_ampel']) + { + $arr[] = $user_ampel; + + if ($user_ampel['status'] == 'rot') + $cnt_ueberfaellig_und_verpflichtend++; + } + } + return array ($arr, $cnt_ueberfaellig_und_verpflichtend); +} +function getActualUserAmpelData($user_ampel_arr, $semester_start) +{ + $arr = array(); + foreach ($user_ampel_arr as $user_ampel) + { + if ($user_ampel['deadline'] >= $semester_start) + $arr[] = $user_ampel; + } + return $arr; +} + +?> + + + + + + + + + + + + + +<?php echo $p->t('tools/ampelsystem') ?> + + + + + + + + + + + ' . $p->t('tools/ampelsystem') . ''; + + //title in popup for mandatory ampeln + if ($is_popup) + echo '

' . $p->t('tools/ampelPopupTitel'). '


'; + ?> + + +
+ + + +
+ t('tools/ampelAnzeigeFuer') ?>   + + +
+



+ 1) + $ovdue_txt = 'ich habe ' . count($user_ampel_arr) . ' Nachrichten entdeckt, die verpflichtend zu bestätigen sind.'; + + if (count($user_ampel_arr) > 0) + { + echo ' +
+
+ sancho_ampel_ueberfaellig +
+
+

+
+
+



'; + } + } +//***************************************** COLLAPSED PANELS WITH AMPELN + + $cnt = 1; //counter to set iterative id's + $cnt_inactive = 1; //counter to set only one heading line for inactive ampeln + + //fill panel with ampeln + foreach ($user_ampel_arr as $user_ampel) + { + //use only ampeln that are not overdue + if ($user_ampel['show_ampel'] == true) + { + //heading line for inactive ampeln + if ($user_ampel['active'] == false && $cnt_inactive == 1) + { + echo ' +
+
+ +
+
'; + $cnt_inactive++; + } + ?> +
+
+ +
+
+
+ +


+
+ +
+
+ + +
+
+ +
+ + + + -echo ' -'; -?> \ No newline at end of file diff --git a/include/ampel.class.php b/include/ampel.class.php index 7473cca87..fba67585e 100644 --- a/include/ampel.class.php +++ b/include/ampel.class.php @@ -221,27 +221,23 @@ class ampel extends basis_db /** * Laedt alle aktuellen Ampeln eines Users * @param string $user User, dessen Ampeln geladen werden sollen - * @param boolean $zukuenftige_anzeigen Default false - * wenn true, werden alle zukuenftigen Ampeln geladen - * wenn false, werden nur die Ampeln geladen die innerhalb der vorlaufzeit liegen * @param boolean $bestaetigt Default false * wenn true, werden alle Ampeln geladen * wenn false, werden nur die Ampeln geladen die noch NICHT bestaetigt wurden */ - public function loadUserAmpel($user, $zukuenftige_anzeigen=false, $bestaetigt=false) + public function loadUserAmpel($user, $bestaetigt=false) { $sprache = new sprache(); $beschreibung = $sprache->getSprachQuery('beschreibung'); - $buttontext = $sprache->getSprachQuery('buttontext'); + $buttontext = $sprache->getSprachQuery('buttontext'); - $qry = "SELECT *,".$beschreibung.", ".$buttontext." FROM public.tbl_ampel WHERE deadline+verfallszeit>now()"; + //all ampeln except where now is before the vorlaufzeit + $qry = "SELECT *,".$beschreibung.", ".$buttontext." FROM public.tbl_ampel"; - if(!$zukuenftige_anzeigen) - $qry.=" AND deadline-vorlaufzeitphrasen['global/loeschen']='Löschen'; $this->phrasen['global/entfernen']='Entfernen'; $this->phrasen['global/editieren']='Editieren'; $this->phrasen['global/suchen']='Suchen'; +$this->phrasen['global/lesen']='Lesen'; +$this->phrasen['global/bestaetigen']='Bestätigen'; $this->phrasen['global/alle']='Alle'; $this->phrasen['global/abbrechen']='Abbrechen'; $this->phrasen['global/eintragen']='Eintragen'; @@ -61,6 +63,7 @@ $this->phrasen['global/drucken']='Drucken'; $this->phrasen['global/pdfExport']='PDF Export'; $this->phrasen['global/und']='und'; $this->phrasen['global/oder']='oder'; +$this->phrasen['global/faelligAm']='Fällig am'; $this->phrasen['global/username']='Username'; $this->phrasen['global/vorname']='Vorname'; diff --git a/locale/de-AT/tools.php b/locale/de-AT/tools.php index 2f7141c83..cbe551bc4 100644 --- a/locale/de-AT/tools.php +++ b/locale/de-AT/tools.php @@ -49,8 +49,14 @@ $this->phrasen['tools/ampelBereitsBestaetigt']='Diese Ampel wurde bereits bestä $this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='Das Ampelsystem ist ein ERINNERUNGS- und BESTÄTIGUNGSSYSTEM, welches Sie auf ausstehende Aufgaben aufmerksam machen soll.'; $this->phrasen['tools/waehlenSieEineOEoderAmpel']='Bitte wählen Sie ein Organisationseinheit und/oder eine Ampel aus dem Dropdown'; $this->phrasen['tools/uebersichtLeitung']='Ampel-Übersicht für LeiterInnen'; -$this->phrasen['tools/ampelAlleAnzeigen']='Alle anzeigen'; -$this->phrasen['tools/ampelNurAktuellesStudiensemester']='Nur aktuelles Studiensemester anzeigen'; +$this->phrasen['tools/ampelAnzeigeFuer']='Anzeige für'; +$this->phrasen['tools/ampelAlleAnzeigen']='alle'; +$this->phrasen['tools/ampelNurAktuellesStudiensemester']='aktuelles Studiensemester'; +$this->phrasen['tools/ampelPopupTitel']='Nachrichten, die verpflichtend bestätigt werden müssen'; +$this->phrasen['tools/ampelBitteBestaetigen']='Bitte bestätigen Sie diese jetzt:'; +$this->phrasen['tools/ampelAbgelaufenTitel']='Abgelaufene oder bereits bestätigte Ampeln'; +$this->phrasen['tools/ampelAbgelaufenTxt']='Sie können diese Ampeln weiterhin lesen, aber nicht mehr bestätigen.'; +$this->phrasen['tools/ampelBestaetigtAbgelaufen']='Bereits bestätigt oder abgelaufen'; //Software fuer Lehre -> Softgrid $this->phrasen['tools/applikationsliste']='Applikationsliste'; diff --git a/locale/en-US/global.php b/locale/en-US/global.php index 1ff736473..7750d5c29 100644 --- a/locale/en-US/global.php +++ b/locale/en-US/global.php @@ -37,6 +37,8 @@ $this->phrasen['global/loeschen']='Delete'; $this->phrasen['global/entfernen']='Delete'; $this->phrasen['global/editieren']='Edit'; $this->phrasen['global/suchen']='Search'; +$this->phrasen['global/lesen']='Read'; +$this->phrasen['global/bestaetigen']='Confirm'; $this->phrasen['global/alle']='All'; $this->phrasen['global/abbrechen']='Cancel'; $this->phrasen['global/eintragen']='Register'; @@ -60,6 +62,7 @@ $this->phrasen['global/hinzufuegen']='Add'; $this->phrasen['global/drucken']='Print'; $this->phrasen['global/und']='and'; $this->phrasen['global/oder']='or'; +$this->phrasen['global/faelligAm']='Due on'; $this->phrasen['global/username']='Username'; $this->phrasen['global/vorname']='First Name'; diff --git a/locale/en-US/tools.php b/locale/en-US/tools.php index aaac6f9bd..23345ebed 100644 --- a/locale/en-US/tools.php +++ b/locale/en-US/tools.php @@ -51,6 +51,14 @@ $this->phrasen['tools/waehlenSieEineOEoderAmpel']='Please select an organization $this->phrasen['tools/uebersichtLeitung']='Overview of notifications for Heads of Departments'; $this->phrasen['tools/alleAnzeigen']='Show all'; $this->phrasen['tools/nurAktuellesStudiensemester']='Show current semester only'; +$this->phrasen['tools/ampelAnzeigeFuer']='Show'; +$this->phrasen['tools/ampelAlleAnzeigen']='all'; +$this->phrasen['tools/ampelNurAktuellesStudiensemester']='actual term'; +$this->phrasen['tools/ampelPopupTitel']='Mandatory Notifications that need to be confirmed'; +$this->phrasen['tools/ampelBitteBestaetigen']='Please confirm now!'; +$this->phrasen['tools/ampelAbgelaufenTitel']='Notifications expired or confirmed'; +$this->phrasen['tools/ampelAbgelaufenTxt']='Notifications can still be read, but not confirmed anymore.'; +$this->phrasen['tools/ampelBestaetigtAbgelaufen']='Almost confirmed or expired'; //Software fuer Lehre -> Softgrid $this->phrasen['tools/applikationsliste']='List of Applications'; diff --git a/skin/images/sancho_round_right_grey.png b/skin/images/sancho_round_right_grey.png new file mode 100644 index 000000000..103634acb Binary files /dev/null and b/skin/images/sancho_round_right_grey.png differ diff --git a/skin/images/sancho_round_right_red.png b/skin/images/sancho_round_right_red.png new file mode 100644 index 000000000..aafe9b2b4 Binary files /dev/null and b/skin/images/sancho_round_right_red.png differ diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 96c65c276..c4faf436c 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -1265,6 +1265,34 @@ if($result = $db->db_query("SELECT 1 FROM system.tbl_app WHERE app='bewerbung'") } } +// Remove NOT NULL constraint on vorlaufszeit on public.tbl_ampel +if($result = @$db->db_query("SELECT is_nullable FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'public' AND TABLE_NAME = 'tbl_ampel' AND COLUMN_NAME = 'vorlaufzeit' AND is_nullable = 'NO'")) +{ + if($db->db_num_rows($result) > 0) + { + $qry = "ALTER TABLE public.tbl_ampel ALTER COLUMN vorlaufzeit DROP NOT NULL;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_ampel '.$db->db_last_error().'
'; + else + echo '
Removed NOT NULL constraint on "vorlaufszeit" from public.tbl_ampel
'; + } +} + + +// Remove NOT NULL constraint on verfallszeit on public.tbl_ampel +if($result = @$db->db_query("SELECT is_nullable FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'public' AND TABLE_NAME = 'tbl_ampel' AND COLUMN_NAME = 'verfallszeit' AND is_nullable = 'NO'")) +{ + if($db->db_num_rows($result) > 0 ) + { + $qry = "ALTER TABLE public.tbl_ampel ALTER COLUMN verfallszeit DROP NOT NULL;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_ampel '.$db->db_last_error().'
'; + else + echo '
Removed NOT NULL constraint on "verfallszeit" from public.tbl_ampel
'; + } +} // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/vilesci/stammdaten/ampel_details.php b/vilesci/stammdaten/ampel_details.php index 3a45f5fec..d04da9992 100644 --- a/vilesci/stammdaten/ampel_details.php +++ b/vilesci/stammdaten/ampel_details.php @@ -175,12 +175,12 @@ $datum_obj = new datum(); Vorlaufzeit (in Tagen) - + Verfallszeit (in Tagen) - +