mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
This commit is contained in:
@@ -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 ".
|
||||
|
||||
+35
-13
@@ -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))
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
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'].= '</td>';
|
||||
$output['html'].= '</tr>';
|
||||
|
||||
Reference in New Issue
Block a user