From 2ab23b6b63e1b0b588cc0c100cf195de9cead27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 27 Sep 2011 08:26:13 +0000 Subject: [PATCH] =?UTF-8?q?Filter=20f=C3=BCr=20offene=20Notizen=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/notiz.xml.php | 24 ++++++++++++++++++++++++ include/notiz.class.php | 9 +++++++-- rdf/notiz.rdf.php | 5 ++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/content/notiz.xml.php b/content/notiz.xml.php index 39ddc07b5..74a192e62 100755 --- a/content/notiz.xml.php +++ b/content/notiz.xml.php @@ -44,6 +44,12 @@ echo ''; + + + + + + '; + '; this.setAttribute('prestudent_id',prestudent_id); this.setAttribute('bestellung_id',bestellung_id); this.setAttribute('user',user); + + //Wenn kein Erledigt Parameter uebergeben wird, dann wird die zuletzt + //verwendete Einstellung verwendet + if(typeof erledigt=="undefined") + erledigt = this.getAttribute('erledigt'); + + if(typeof erledigt!="undefined") + this.setAttribute('erledigt',erledigt); + var datasource="rdf/notiz.rdf.php?ts="+gettimestamp(); datasource = datasource+"&projekt_kurzbz="+encodeURIComponent(projekt_kurzbz); @@ -242,6 +258,14 @@ echo ''; datasource = datasource+"&prestudent_id="+encodeURIComponent(prestudent_id); datasource = datasource+"&bestellung_id="+encodeURIComponent(bestellung_id); datasource = datasource+"&user="+encodeURIComponent(user); + + //Wenn es als Parameter uebergeben wird, ist es ein boolean, sonst ein String + if((typeof erledigt=="boolean" && erledigt==true) || (typeof erledigt=="string" && erledigt=='true')) + datasource = datasource+"&erledigt=true"; + else if((typeof erledigt=="boolean" && erledigt==false) || (typeof erledigt=="string" && erledigt=='false')) + datasource = datasource+"&erledigt=false"; + + //debug('Source:'+datasource); var tree = document.getAnonymousElementByAttribute(this ,'anonid', 'tree-notiz'); diff --git a/include/notiz.class.php b/include/notiz.class.php index 5b34d04f9..d27caf8b2 100644 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -241,8 +241,13 @@ class notiz extends basis_db LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) WHERE 1=1"; - if($erledigt) - $qry.=" AND erledigt=true"; + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } if($projekt_kurzbz!='') $qry.=" AND projekt_kurzbz='".addslashes($projekt_kurzbz)."'"; if($projektphase_id!='') diff --git a/rdf/notiz.rdf.php b/rdf/notiz.rdf.php index 34fb9d0ad..4d622e6f1 100644 --- a/rdf/notiz.rdf.php +++ b/rdf/notiz.rdf.php @@ -43,7 +43,10 @@ echo ' '; $notiz = new notiz(); -$erledigt=null; +if(isset($_GET['erledigt'])) + $erledigt=($_GET['erledigt']=='true'?true:false); +else + $erledigt=null; $projekt_kurzbz=(isset($_GET['projekt_kurzbz'])?$_GET['projekt_kurzbz']:null); $projektphase_id=(isset($_GET['projektphase_id'])?$_GET['projektphase_id']:null); $projekttask_id=(isset($_GET['projekttask_id'])?$_GET['projekttask_id']:null);