diff --git a/cms/admin.php b/cms/admin.php index 4edb324ec..6540e51f2 100644 --- a/cms/admin.php +++ b/cms/admin.php @@ -27,8 +27,15 @@ require_once('../include/sprache.class.php'); require_once('../include/gruppe.class.php'); require_once('../include/xsdformprinter/xsdformprinter.php'); require_once('../include/organisationseinheit.class.php'); +require_once('../include/benutzerberechtigung.class.php'); $user = get_uid(); + +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); + +if(!$rechte->isBerechtigt('basis/cms')) + die('Sie haben keine Berechtigung fuer diese Seite'); ?> @@ -49,19 +56,33 @@ $user = get_uid(); { mode : "textareas", theme : "advanced", - file_browser_callback: "FHCFileBrowser" + file_browser_callback: "FHCFileBrowser", + + plugins : "spellchecker,pagebreak,style,layer,table,advhr,advimage,advlink,inlinepopups,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras", + + // Theme options + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontsizeselect", + theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,|,forecolor,backcolor", + theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,|,print,|,ltr,rtl,|,fullscreen", + //theme_advanced_buttons4 : "insertfile,insertimage", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "center", + theme_advanced_statusbar_location : "bottom", + theme_advanced_resizing : true, + } ); function FHCFileBrowser(field_name, url, type, win) { - cmsURL = "cms/tinymce_dms.php?type"+type; + cmsURL = "cms/tinymce_dms.php?type="+type; tinyMCE.activeEditor.windowManager.open({ file: cmsURL, title : "FHComplete File Browser", - width: 420, - heigth: 400, + width: 550, + height: 550, resizable: "yes", close_previous: "no", + scrollbars: "yes", popup_css : false },{ window: win, @@ -70,20 +91,6 @@ $user = get_uid(); return false; } - @@ -169,12 +176,14 @@ if(isset($_GET['method'])) $titel = $_POST['titel']; $oe_kurzbz=$_POST['oe_kurzbz']; $sichtbar=isset($_POST['sichtbar']); + $template_kurzbz = $_POST['template_kurzbz']; if($content->getContent($content_id, $sprache, $version)) { $content->titel = $titel; $content->oe_kurzbz = $oe_kurzbz; $content->sichtbar = $sichtbar; + $content->template_kurzbz = $template_kurzbz; $content->updateamum=date('Y-m-d H:i:s'); $content->updatevon=$user; @@ -337,7 +346,7 @@ function print_childs() $content = new content(); $content->getChilds($content_id); - echo 'Die Mitglieder der folgenden Gruppen dürfen die Seite ansehen:

'; + echo 'Folgende Einträge sind diesem Untergeordnet:

'; echo ' 'pdf.ico', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'=>'word2007.jpg', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation'=>'x-office-presentation.png', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'=>'excel.gif', + 'application/vnd.oasis.opendocument.text'=>'openoffice0.jpg', + 'application/msword'=>'dotpic.gif', + 'application/zip'=>'zippic.jpg', + +); + + +if(isset($_POST['fileupload'])) +{ + $dms_id = $_POST['dms_id']; + + $filename = uniqid(); + $uploadfile = DMS_PATH.$filename; + + if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) + { + $dms = new dms(); + + if($dms_id!='') + { + if(!$dms->load($dms_id)) + { + die($dms->errormsg); + } + $dms->version=$dms->version+1; + } + else + { + $dms->version='0'; + } + + $dms->insertamum=date('Y-m-d H:i:s'); + $dms->insertvon = $user; + $dms->mimetype=$_FILES['userfile']['type']; + $dms->filename = $filename; + $dms->name = $_FILES['userfile']['name']; + $dms->kategorie_kurzbz=$kategorie_kurzbz; + + if($dms->save(true)) + { + echo 'File wurde erfolgreich hochgeladen. Filename:'.$filename.' ID:'.$dms->dms_id; + $dms_id=$dms->dms_id; + } + else + { + echo 'Fehler beim Speichern der Daten'; + } + } + else + { + echo 'Fehler beim Hochladen der Datei'; + } +} + + echo '

Dokument Auswählen

- + +
+ Kategorie:
'; +//Kategorien anzeigen + $dms = new dms(); $dms->getKategorie(); foreach($dms->result as $row) { if($kategorie_kurzbz=='') $kategorie_kurzbz=$row->kategorie_kurzbz; - echo ''.$row->bezeichnung.'
'; + if($kategorie_kurzbz==$row->kategorie_kurzbz) + $class='class="marked"'; + else + $class=''; + + echo ' + '; + echo $row->bezeichnung.'
'; } -echo '
'; +echo ' + '; + +//Dokumente der Ausgewaehlten Kategorie laden und Anzeigen $dms = new dms(); $dms->getDocuments($kategorie_kurzbz); -$mimetypes=array('application/pdf'=>'pdf.ico', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'=>'word2007.jpg', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation'=>'x-office-presentation.png', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'=>'excel.gif', - 'application/zip'=>'zippic.jpg'); + +echo ' + + '; +$anzahl=0; foreach($dms->result as $row) { - echo '
'; - echo ''; + if($anzahl>2) + { + echo " +
+ "; + $anzahl=0; + } + echo ' + '; + $anzahl++; } -echo '
'; + echo ''; + echo '
'; if(array_key_exists($row->mimetype,$mimetypes)) - echo ''; + echo ''; else - echo ''; - echo '
'.$row->name.'
'; - echo ''; + echo ''; + + echo '
'.$row->name.'
'; + + //Upload einer neuen Version + echo 'Upload '; + echo '
'; -echo '
Neue Datei hochladen'; +echo ' +
+ + + + +
+ Neue Datei hochladen + +

+ +
+
+ +
+ + + + +
+
'; ?> \ No newline at end of file diff --git a/include/content.class.php b/include/content.class.php index cf1babc8e..2c69c2543 100644 --- a/include/content.class.php +++ b/include/content.class.php @@ -378,6 +378,7 @@ class content extends basis_db " titel=".$this->addslashes($this->titel).','. " updatevon=".$this->addslashes($this->updatevon).','. " updateamum=".$this->addslashes($this->updateamum).','. + " template_kurzbz=".$this->addslashes($this->template_kurzbz).','. " oe_kurzbz=".$this->addslashes($this->oe_kurzbz). " WHERE content_id='".addslashes($this->content_id)."';". "UPDATE campus.tbl_contentsprache SET ". diff --git a/include/dms.class.php b/include/dms.class.php index ecd313646..128a60db7 100644 --- a/include/dms.class.php +++ b/include/dms.class.php @@ -110,9 +110,22 @@ class dms extends basis_db if($new) { - $qry = "BEGIN;INSERT INTO campus.tbl_dms(version, oe_kurzbz, dokument_kurzbz, kategorie_kurzbz, + + if($this->dms_id=='') + $dms_id="nextval('campus.seq_dms_dms_id')"; + else + { + if(!is_numeric($this->dms_id)) + { + $this->errormsg = 'dms_id ist ungueltig'; + return false; + } + $dms_id=$this->dms_id; + } + $qry = "BEGIN;INSERT INTO campus.tbl_dms(dms_id, version, oe_kurzbz, dokument_kurzbz, kategorie_kurzbz, filename, mimetype, name, beschreibung, letzterzugriff, insertamum, insertvon, updateamum, updatevon) VALUES(". + $dms_id.','. $this->addslashes($this->version).','. $this->addslashes($this->oe_kurzbz).','. $this->addslashes($this->dokument_kurzbz).','. @@ -147,14 +160,23 @@ class dms extends basis_db { if($new) { - $qry = "SELECT currval('campus.seq_dms_dms_id') as id;"; - if($result = $this->db_query($qry)) + if($this->dms_id=='') { - if($row = $this->db_fetch_object($result)) + $qry = "SELECT currval('campus.seq_dms_dms_id') as id;"; + if($result = $this->db_query($qry)) { - $this->dms_id = $row->id; - $this->db_query('COMMIT;'); - return true; + if($row = $this->db_fetch_object($result)) + { + $this->dms_id = $row->id; + $this->db_query('COMMIT;'); + return true; + } + else + { + $this->errormsg='Fehler beim Auslesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } } else { @@ -165,9 +187,8 @@ class dms extends basis_db } else { - $this->errormsg='Fehler beim Auslesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; + $this->db_query('COMMIT;'); + return true; } } else @@ -231,10 +252,11 @@ class dms extends basis_db */ public function getDocuments($kategorie_kurzbz) { - $qry = "SELECT * FROM ( - SELECT distinct on(dms_id) * + $qry = "SELECT * FROM campus.tbl_dms where (dms_id, version) in( + SELECT dms_id, max(version) FROM campus.tbl_dms - WHERE kategorie_kurzbz='".addslashes($kategorie_kurzbz)."') as a + WHERE kategorie_kurzbz='".addslashes($kategorie_kurzbz)."' + GROUP BY dms_id) ORDER BY name;"; if($result = $this->db_query($qry)) diff --git a/include/xsdformprinter/xsdformprinter.php b/include/xsdformprinter/xsdformprinter.php index b78e38362..3f3bfac6f 100644 --- a/include/xsdformprinter/xsdformprinter.php +++ b/include/xsdformprinter/xsdformprinter.php @@ -17,7 +17,7 @@ * * Authors: Andreas Oesterreicher */ -namespace XSDFormPrinter; +//namespace XSDFormPrinter; class XSDFormPrinter { @@ -28,7 +28,7 @@ class XSDFormPrinter public function __construct() { $this->loadDefaultConfiguration(); - require_once(__DIR__.'/types.php'); + require_once(dirname(__FILE__).'/types.php'); } /** @@ -38,10 +38,10 @@ class XSDFormPrinter */ public function output($xsd, $xml) { - $dom = new \DOMDocument(); + $dom = new DOMDocument(); $dom->loadXML($xsd); - $this->xml_inhalt = new \DOMDocument(); + $this->xml_inhalt = new DOMDocument(); $this->xml_inhalt->loadXML($xml); if($dom===false) @@ -94,7 +94,7 @@ class XSDFormPrinter private function loadDefaultConfiguration() { - require_once(__DIR__.'/config.inc.php'); + require_once(dirname(__FILE__).'/config.inc.php'); } /** @@ -225,7 +225,10 @@ class XSDFormPrinter //ToDo: Create a Unique reproduceable fieldid $fieldid = $this->config['PREFIX'].'FIELD_'.$name; $validatefunction = $this->createValidation($fieldid, $factory[$type][1]); - $value = $this->xml_inhalt->getElementsByTagName($name)->item(0)->nodeValue; + if($this->xml_inhalt->getElementsByTagName($name)->item(0)) + $value = $this->xml_inhalt->getElementsByTagName($name)->item(0)->nodeValue; + else + $value=''; $output['html'].=sprintf($this->types[$ftype],$name, $fieldid,$validatefunction, $value); $output['html'].= ''; $output['html'].= ''; diff --git a/skin/fhcomplete.css b/skin/fhcomplete.css index 90d9da1c0..c68eef22d 100644 --- a/skin/fhcomplete.css +++ b/skin/fhcomplete.css @@ -28,4 +28,8 @@ { color: green; } - \ No newline at end of file + +.marked +{ + text-decoration: underline; +} \ No newline at end of file diff --git a/skin/styles/tw.css b/skin/styles/tw.css index 42a1cf334..a1ea150b6 100644 --- a/skin/styles/tw.css +++ b/skin/styles/tw.css @@ -146,6 +146,10 @@ a color: #008381; text-decoration: none; cursor: pointer; } +a:hover +{ + color: Black; text-decoration: none; +} a.ItemTesttool { color: #008381; diff --git a/system/checksystem.php b/system/checksystem.php index e3fe06327..05cda4e65 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -2275,7 +2275,7 @@ $tabellen=array( "public.tbl_firmatag" => array("firma_id","tag","insertamum","insertvon"), "public.tbl_funktion" => array("funktion_kurzbz","beschreibung","aktiv","fachbereich","semester"), "public.tbl_geschaeftsjahr" => array("geschaeftsjahr_kurzbz","start","ende","bezeichnung"), - "public.tbl_gruppe" => array("gruppe_kurzbz","studiengang_kz","semester","bezeichnung","beschreibung","sichtbar","lehre","aktiv","sort","mailgrp","generiert","updateamum","updatevon","insertamum","insertvon","ext_id","orgform_kurzbz","gid"), + "public.tbl_gruppe" => array("gruppe_kurzbz","studiengang_kz","semester","bezeichnung","beschreibung","sichtbar","lehre","aktiv","sort","mailgrp","generiert","updateamum","updatevon","insertamum","insertvon","ext_id","orgform_kurzbz","gid","content_visible"), "public.tbl_kontakt" => array("kontakt_id","person_id","kontakttyp","anmerkung","kontakt","zustellung","updateamum","updatevon","insertamum","insertvon","ext_id","standort_id"), "public.tbl_kontaktmedium" => array("kontaktmedium_kurzbz","beschreibung"), "public.tbl_kontakttyp" => array("kontakttyp","beschreibung"),