From 6bbdd30fb7cbbffb1e63612f5ba5510770f874d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 6 Apr 2011 12:14:46 +0000 Subject: [PATCH] --- cms/admin.php | 27 +++++++++++++--- include/content.class.php | 5 +-- include/gruppe.class.php | 8 ++++- include/tw/vilesci_menu_main.inc.php | 2 +- vilesci/lehre/einheit_menu.php | 48 +++++++++++++++------------- vilesci/statistik/statistik.php | 2 +- 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/cms/admin.php b/cms/admin.php index 6540e51f2..a81cf88cc 100644 --- a/cms/admin.php +++ b/cms/admin.php @@ -142,7 +142,15 @@ if(isset($_GET['method'])) $content->insertvon = $user; $content->insertamum = date('Y-m-d H:i:s'); - $content->save(); + if($content->save()) + { + $message .= 'Eintrag wurde erfolgreich angelegt'; + $action='prefs'; + $content_id=$content->content_id; + } + else + $message .= ''.$content->errormsg.''; + break; case 'rights_add_group': if(!isset($_POST['gruppe_kurzbz'])) @@ -207,8 +215,19 @@ if(isset($_GET['method'])) $message.=''.$content->errormsg.''; break; case 'childs_delete': - $content = new content(); - $content->deleteChild($content_id, $_GET['child_content_id']); + if(isset($_GET['contentchild_id'])) + { + $contentchild_id = $_GET['contentchild_id']; + $content = new content(); + if($content->deleteChild($contentchild_id)) + $message.='Zuordnung wurde erfolgreich entfernt'; + else + $message.=''.$content->errormsg.''; + } + else + { + $message.='Fehler: ID wurde nicht uebergeben'; + } break; default: break; } @@ -373,7 +392,7 @@ function print_childs() echo '',$row->child_content_id,''; echo '',$row->titel,''; echo ' - + '; diff --git a/include/content.class.php b/include/content.class.php index 2c69c2543..a7bd7700c 100644 --- a/include/content.class.php +++ b/include/content.class.php @@ -446,6 +446,7 @@ class content extends basis_db { $obj = new content(); + $obj->contentchild_id = $row->contentchild_id; $obj->content_id = $row->content_id; $obj->child_content_id = $row->child_content_id; $obj->titel = $row->titel; @@ -501,9 +502,9 @@ class content extends basis_db * @param $child_content_id * @return boolean */ - public function deleteChild($content_id, $child_content_id) + public function deleteChild($contentchild_id) { - $qry = "DELETE FROM campus.tbl_contentchild WHERE content_id='".addslashes($content_id)."' AND child_content_id='".addslashes($child_content_id)."'"; + $qry = "DELETE FROM campus.tbl_contentchild WHERE contentchild_id='".addslashes($contentchild_id)."'"; if($this->db_query($qry)) { diff --git a/include/gruppe.class.php b/include/gruppe.class.php index 914550185..06b18598e 100644 --- a/include/gruppe.class.php +++ b/include/gruppe.class.php @@ -38,6 +38,7 @@ class gruppe extends basis_db public $generiert; // boolean public $sichtbar; // boolean public $aktiv; // boolean + public $content_visible=false; // boolean public $updateamum; // timestamp public $updatevon; // varchar(16) public $insertamum; // timestamp @@ -127,6 +128,7 @@ class gruppe extends basis_db $this->beschreibung = $row->beschreibung; $this->sichtbar = ($row->sichtbar=='t'?true:false); $this->aktiv = ($row->aktiv=='t'?true:false); + $this->content_visible = ($row->content_visible=='t'?true:false); $this->generiert = ($row->generiert=='t'?true:false); $this->updateamum = $row->updateamum; $this->updatevon = $row->updatevon; @@ -173,6 +175,7 @@ class gruppe extends basis_db $grp_obj->beschreibung = $row->beschreibung; $grp_obj->sichtbar = ($row->sichtbar=='t'?true:false); $grp_obj->aktiv = ($row->aktiv=='t'?true:false); + $grp_obj->content_visible = ($row->content_visible=='t'?true:false); $grp_obj->generiert = ($row->generiert=='t'?true:false); $grp_obj->updateamum = $row->updateamum; $grp_obj->updatevon = $row->updatevon; @@ -258,6 +261,7 @@ class gruppe extends basis_db $grp_obj->beschreibung = $row->beschreibung; $grp_obj->sichtbar = ($row->sichtbar=='t'?true:false); $grp_obj->aktiv = ($row->aktiv=='t'?true:false); + $grp_obj->content_visible = ($row->content_visible=='t'?true:false); $grp_obj->generiert = ($row->generiert=='t'?true:false); $grp_obj->updateamum = $row->updateamum; $grp_obj->updatevon = $row->updatevon; @@ -370,7 +374,7 @@ class gruppe extends basis_db $kurzbz = $this->gruppe_kurzbz; $qry = 'INSERT INTO public.tbl_gruppe (gruppe_kurzbz, studiengang_kz, bezeichnung, semester, sort, - mailgrp, beschreibung, sichtbar, generiert, aktiv, lehre, + mailgrp, beschreibung, sichtbar, generiert, aktiv, lehre, content_visible, updateamum, updatevon, insertamum, insertvon, orgform_kurzbz) VALUES('.$this->addslashes($kurzbz).','. $this->addslashes($this->studiengang_kz).','. @@ -383,6 +387,7 @@ class gruppe extends basis_db ($this->generiert?'true':'false').','. ($this->aktiv?'true':'false').','. ($this->lehre?'true':'false').','. + ($this->content_visible?'true':'false').','. $this->addslashes($this->updateamum).','. $this->addslashes($this->updatevon).','. $this->addslashes($this->insertamum).','. @@ -402,6 +407,7 @@ class gruppe extends basis_db ' generiert='.($this->generiert?'true':'false').','. ' aktiv='.($this->aktiv?'true':'false').','. ' lehre='.($this->lehre?'true':'false').','. + ' content_visible='.($this->content_visible?'true':'false').','. ' updateamum='.$this->addslashes($this->updateamum).','. ' updatevon='.$this->addslashes($this->updatevon).','. ' orgform_kurzbz='.$this->addslashes($this->orgform_kurzbz). diff --git a/include/tw/vilesci_menu_main.inc.php b/include/tw/vilesci_menu_main.inc.php index bd3145f0f..83ea2d530 100644 --- a/include/tw/vilesci_menu_main.inc.php +++ b/include/tw/vilesci_menu_main.inc.php @@ -190,7 +190,7 @@ $menu=array ), 'Auswertung'=> array ( - 'name'=>'Auswertung', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('admin','lv-plan','support'), 'image'=>'statistic.png', + 'name'=>'Auswertung', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('admin','lv-plan','support','assistenz','wawi/inventar'), 'image'=>'statistic.png', 'link'=>'left.php?categorie=Auswertung', 'target'=>'nav', /* 'Raumauslastung'=>array('name'=>'Raumauslastung...', 'link'=>'lehre/raumauslastung.php', 'target'=>'main'), diff --git a/vilesci/lehre/einheit_menu.php b/vilesci/lehre/einheit_menu.php index 8dc8600c1..cfe02d9ba 100644 --- a/vilesci/lehre/einheit_menu.php +++ b/vilesci/lehre/einheit_menu.php @@ -57,21 +57,21 @@ $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($uid); ?> - -Gruppe-Verwaltung - - - - - - + + Gruppe-Verwaltung + + + + + + -

Gruppen - Verwaltung

+

Gruppen - Verwaltung

generiert=isset($_POST['generiert']); $e->aktiv=isset($_POST['aktiv']); $e->sort=$_POST['sort']; + $e->content_visible=isset($_POST['content_visible']); + if(!$e->save()) echo $e->errormsg; } @@ -193,7 +195,7 @@ function doEdit($kurzbz,$new=false) - Studiengang + Studiengang - Semester - Mailgrpmailgrp?'checked':'');?>> - Sichtbarsichtbar?'checked':'');?>> - Generiertgeneriert?'checked':'');?>> - Aktivaktiv?'checked':'');?>> + Semester + Mailgrpmailgrp?'checked':'');?>> + Sichtbarsichtbar?'checked':'');?>> + Generiertgeneriert?'checked':'');?>> + Aktivaktiv?'checked':'');?>> + ContentVisiblecontent_visible?'checked':'');?>> - Sort + Sort @@ -287,6 +290,5 @@ function getUebersicht() } ?> - - + \ No newline at end of file diff --git a/vilesci/statistik/statistik.php b/vilesci/statistik/statistik.php index 3e13c40b6..16ca535d3 100644 --- a/vilesci/statistik/statistik.php +++ b/vilesci/statistik/statistik.php @@ -54,7 +54,7 @@ echo '

Statistik - '.$statistik->bezeichnung.'

'; //Beschreibung zu der Statistik anzeigen if($statistik->content_id!='') { - echo "\n",'Beschreibung anzeigen

'; + echo "\n",'Beschreibung anzeigen

'; } $variablenstring=''; $action='';