mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- Datenbankanpassungen für Coodle
- Seite für Anlage und Bearbeitung der Stammdaten von Coodle Umfragen
This commit is contained in:
Executable
+185
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 FH Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
require_once('../../../include/coodle.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
$sprache = getSprache();
|
||||
$p = new phrasen($sprache);
|
||||
$datum_obj = new datum();
|
||||
$db = new basis_db();
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">
|
||||
<link rel="stylesheet" href="../../../skin/styles/jquery.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../../skin/styles/jquery-ui.css" type="text/css">
|
||||
|
||||
<script src="../../../include/js/jquery.js" type="text/javascript"></script>
|
||||
<script src="../../../include/js/jquery-ui.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="../../../include/tiny_mce/tiny_mce.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init
|
||||
(
|
||||
{
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
language : "de",
|
||||
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,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,bullist,pastetext",
|
||||
theme_advanced_buttons2 : "",
|
||||
theme_advanced_buttons3 : "",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "center",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
force_br_newlines : true,
|
||||
force_p_newlines : false,
|
||||
forced_root_block : "",
|
||||
//Formatierungen beim Einfuegen entfernen
|
||||
paste_auto_cleanup_on_paste : true,
|
||||
paste_remove_styles: true,
|
||||
paste_remove_styles_if_webkit: true,
|
||||
paste_strip_class_attributes: true,
|
||||
paste_retain_style_properties: "",
|
||||
paste_text_sticky: true,
|
||||
setup : function(ed)
|
||||
{
|
||||
ed.onInit.add(function(ed)
|
||||
{ ed.pasteAsPlainText = true;
|
||||
ed.controlManager.setActive("pastetext", true);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<title>'.$p->t('coodle/coodle').'</title>
|
||||
</head>
|
||||
<body>';
|
||||
echo '<h1>'.$p->t('coodle/coodle').'</h1>';
|
||||
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
//Speichern
|
||||
$titel = $_POST['titel'];
|
||||
$beschreibung = $_POST['beschreibung'];
|
||||
$dauer = $_POST['dauer'];
|
||||
$endedatum = $_POST['endedatum'];
|
||||
$coodle_id = $_POST['coodle_id'];
|
||||
|
||||
$coodle = new coodle();
|
||||
|
||||
if($coodle_id!='')
|
||||
{
|
||||
if(!$coodle->load($coodle_id))
|
||||
die($coodle->errormsg);
|
||||
|
||||
if($coodle->ersteller_uid!=$user)
|
||||
{
|
||||
die($p->t('basis/keineBerechtigung'));
|
||||
}
|
||||
$coodle->new=false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$coodle->new=true;
|
||||
$coodle->ersteller_uid = $user;
|
||||
$coodle->insertamum = date('Y-m-d H:i:s');
|
||||
$coodle->insertvon = $user;
|
||||
$coodle->coodle_status_kurzbz='neu';
|
||||
}
|
||||
|
||||
$coodle->titel = $titel;
|
||||
$coodle->beschreibung = $beschreibung;
|
||||
$coodle->dauer = $dauer;
|
||||
$coodle->endedatum = $datum_obj->formatDatum($endedatum, 'Y-m-d');
|
||||
$coodle->updateamum = date('Y-m-d H:i:s');
|
||||
$coodle->updatevon = $user;
|
||||
|
||||
if($coodle->save())
|
||||
{
|
||||
echo '<span class="ok">'.$p->t('global/erfolgreichgespeichert').'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">'.$coodle->errormsg.'</span>';
|
||||
}
|
||||
}
|
||||
elseif(isset($_GET['coodle_id']))
|
||||
{
|
||||
// Bearbeiten
|
||||
$coodle = new coodle();
|
||||
if($coodle->load($_GET['coodle_id']))
|
||||
{
|
||||
if($coodle->ersteller_uid!=$user)
|
||||
die($p->t('global/keineBerechtigungFuerDieseSeite'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Neu
|
||||
$coodle = new coodle();
|
||||
$coodle->endedatum=date('d.m.Y',strtotime("+7 day"));
|
||||
$coodle->dauer=60;
|
||||
}
|
||||
echo '
|
||||
<form method="POST">
|
||||
<input type="hidden" name="coodle_id" value="'.$db->convert_html_chars($coodle->coodle_id).'" />
|
||||
<table>
|
||||
<tr>
|
||||
<td>'.$p->t('coodle/titel').'</td>
|
||||
<td><input type="text" name="titel" value="'.$db->convert_html_chars($coodle->titel).'" maxlength="64" size="50"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$p->t('coodle/beschreibung').'</td>
|
||||
<td><textarea name="beschreibung" rows="6" cols="50">'.$db->convert_html_chars($coodle->beschreibung).'</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$p->t('coodle/dauer').'</td>
|
||||
<td><input type="text" name="dauer" value="'.$db->convert_html_chars($coodle->dauer).'" maxlength="5" size="2"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$p->t('coodle/endedatum').'</td>
|
||||
<td><input type="text" name="endedatum" value="'.$db->convert_html_chars($datum_obj->formatDatum($coodle->endedatum,'d.m.Y')).'" maxlength="10" size="5"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="save" value="'.$p->t('global/speichern').'"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>';
|
||||
|
||||
echo '</body>
|
||||
</html>';
|
||||
?>
|
||||
Executable
+238
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 FH Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Klasse Coodle
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
|
||||
class coodle extends basis_db
|
||||
{
|
||||
public $new;
|
||||
public $result = array();
|
||||
|
||||
//Tabellenspalten
|
||||
public $coodle_id; // integer
|
||||
public $ersteller_uid; // varchar(32)
|
||||
public $coodle_status_kurzbz; // varchar(32)
|
||||
public $titel; // varchar(64)
|
||||
public $beschreibung; // text
|
||||
public $dauer; // smallint
|
||||
public $endedatum; // date
|
||||
public $updateamum; // timestamp
|
||||
public $updatevon; // varchar(32)
|
||||
public $insertamum; // timestamp
|
||||
public $insertvon; // varchar(32)
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
* @param $coodle_id ID die geladen werden soll (Default=null)
|
||||
*/
|
||||
public function __construct($coodle_id=null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if(!is_null($coodle_id))
|
||||
$this->load($coodle_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt einen Eintrag mit der ID $coodle_id
|
||||
* @param $coodle_id ID des zu ladenden Eintrags
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($coodle_id)
|
||||
{
|
||||
//Pruefen ob coodle_id eine gueltige Zahl ist
|
||||
if(!is_numeric($coodle_id) || $coodle_id == '')
|
||||
{
|
||||
$this->errormsg = 'Coodle_id muss eine Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//Daten aus der Datenbank lesen
|
||||
$qry = "SELECT * FROM campus.tbl_coodle WHERE coodle_id=".$this->db_add_param($coodle_id, FHC_INTEGER, false);
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->coodle_id = $row->coodle_id;
|
||||
$this->ersteller_uid = $row->ersteller_uid;
|
||||
$this->coodle_status_kurzbz = $row->coodle_status_kurzbz;
|
||||
$this->titel = $row->titel;
|
||||
$this->beschreibung = $row->beschreibung;
|
||||
$this->dauer = $row->dauer;
|
||||
$this->endedatum = $row->endedatum;
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Es ist kein Datensatz mit dieser ID vorhanden';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prueft die Variablen auf Gueltigkeit
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
protected function validate()
|
||||
{
|
||||
//Gesamtlaenge pruefen
|
||||
if(mb_strlen($this->coodle_status_kurzbz)>32)
|
||||
{
|
||||
$this->errormsg = 'Status darf nicht laenger als 32 Zeichen sein';
|
||||
return false;
|
||||
}
|
||||
if(mb_strlen($this->titel)>64)
|
||||
{
|
||||
$this->errormsg = 'titel darf nicht länger als 64 Zeichen sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->errormsg = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert den aktuellen Datensatz in die Datenbank
|
||||
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
|
||||
* andernfalls wird der Datensatz mit der ID in $coodle_id aktualisiert
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function save($new = null)
|
||||
{
|
||||
if(is_null($new))
|
||||
$new = $this->new;
|
||||
|
||||
//Variablen pruefen
|
||||
if(!$this->validate())
|
||||
return false;
|
||||
|
||||
if($new)
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry='BEGIN;INSERT INTO campus.tbl_coodle(ersteller_uid, coodle_status_kurzbz, titel, beschreibung,
|
||||
dauer, endedatum, insertamum, insertvon, updateamum, updatevon) VALUES('.
|
||||
$this->db_add_param($this->ersteller_uid).', '.
|
||||
$this->db_add_param($this->coodle_status_kurzbz).', '.
|
||||
$this->db_add_param($this->titel).', '.
|
||||
$this->db_add_param($this->beschreibung).', '.
|
||||
$this->db_add_param($this->dauer).', '.
|
||||
$this->db_add_param($this->endedatum).', '.
|
||||
$this->db_add_param($this->insertamum).', '.
|
||||
$this->db_add_param($this->insertvon).', '.
|
||||
$this->db_add_param($this->updateamum).', '.
|
||||
$this->db_add_param($this->updatevon).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
//Pruefen ob coodle_id eine gueltige Zahl ist
|
||||
if(!is_numeric($this->coodle_id))
|
||||
{
|
||||
$this->errormsg = 'coolde_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
$qry='UPDATE campus.tbl_coodle SET'.
|
||||
' ersteller_uid='.$this->db_add_param($this->ersteller_uid).', '.
|
||||
' coodle_status_kurzbz='.$this->db_add_param($this->coodle_status_kurzbz).', '.
|
||||
' titel='.$this->db_add_param($this->titel).', '.
|
||||
' beschreibung='.$this->db_add_param($this->beschreibung).', '.
|
||||
' dauer='.$this->db_add_param($this->dauer).', '.
|
||||
' endedatum='.$this->db_add_param($this->endedatum).', '.
|
||||
' updateamum='.$this->db_add_param($this->updateamum).', '.
|
||||
' updatevon='.$this->db_add_param($this->updatevon).' '.
|
||||
'WHERE coodle_id='.$this->db_add_param($this->coodle_id, FHC_INTEGER, false).';';
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($new)
|
||||
{
|
||||
//naechste ID aus der Sequence holen
|
||||
$qry="SELECT currval('campus.seq_coodle_coodle_id') as id;";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->coodle_id = $row->id;
|
||||
$this->db_query('COMMIT');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = "Fehler beim Auslesen der Sequence";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern des Datensatzes';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loescht den Datenensatz mit der ID die uebergeben wird
|
||||
* @param $coodle_id ID die geloescht werden soll
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function delete($coodle_id)
|
||||
{
|
||||
//Pruefen ob adresse_id eine gueltige Zahl ist
|
||||
if(!is_numeric($coodle_id) || $coodle_id == '')
|
||||
{
|
||||
$this->errormsg = 'Coodle_id muss eine gültige Zahl sein'."\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
//loeschen des Datensatzes
|
||||
$qry="DELETE FROM campus.tbl_coodle WHERE coodle_id=".$this->db_add_param($coodle_id, FHC_INTEGER, false).";";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten'."\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$this->phrasen['coodle/coodle']='Coodle';
|
||||
$this->phrasen['coodle/titel']='Titel';
|
||||
$this->phrasen['coodle/beschreibung']='Beschreibung';
|
||||
$this->phrasen['coodle/dauer']='Dauer in Minuten';
|
||||
$this->phrasen['coodle/endedatum']='Umfrageende';
|
||||
?>
|
||||
+3843
-42
File diff suppressed because it is too large
Load Diff
@@ -3748,6 +3748,139 @@ if(!@$db->db_query("SELECT projektarbeittitel FROM public.tbl_preoutgoing LIMIT
|
||||
echo 'Tabelle public.tbl_preoutgoing Spalte projektarbeittitel hinzugefuegt<br>';
|
||||
}
|
||||
|
||||
// Coodle
|
||||
if(!@$db->db_query("SELECT 1 FROM campus.tbl_coodle LIMIT 1"))
|
||||
{
|
||||
$qry ="
|
||||
CREATE TABLE campus.tbl_coodle_status
|
||||
(
|
||||
coodle_status_kurzbz varchar(32) NOT NULL,
|
||||
bezeichnung varchar(256)
|
||||
);
|
||||
ALTER TABLE campus.tbl_coodle_status ADD CONSTRAINT pk_coodle_status PRIMARY KEY (coodle_status_kurzbz);
|
||||
|
||||
GRANT SELECT ON campus.tbl_coodle_status TO web;
|
||||
GRANT SELECT ON campus.tbl_coodle_status TO vilesci;
|
||||
|
||||
CREATE TABLE campus.tbl_coodle
|
||||
(
|
||||
coodle_id integer NOT NULL,
|
||||
ersteller_uid varchar(32),
|
||||
titel varchar(64),
|
||||
beschreibung text,
|
||||
coodle_status_kurzbz varchar(32) NOT NULL,
|
||||
dauer smallint,
|
||||
endedatum date,
|
||||
insertamum timestamp,
|
||||
insertvon varchar(32),
|
||||
updateamum timestamp,
|
||||
updatevon varchar(32)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE campus.seq_coodle_coodle_id
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
GRANT SELECT, UPDATE ON SEQUENCE campus.seq_coodle_coodle_id TO web;
|
||||
GRANT SELECT, UPDATE ON SEQUENCE campus.seq_coodle_coodle_id TO vilesci;
|
||||
|
||||
ALTER TABLE campus.tbl_coodle ADD CONSTRAINT pk_coodle PRIMARY KEY (coodle_id);
|
||||
ALTER TABLE campus.tbl_coodle ALTER COLUMN coodle_id SET DEFAULT nextval('campus.seq_coodle_coodle_id');
|
||||
|
||||
ALTER TABLE campus.tbl_coodle ADD CONSTRAINT fk_coodle_coodle_status FOREIGN KEY(coodle_status_kurzbz) REFERENCES campus.tbl_coodle_status (coodle_status_kurzbz) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_coodle ADD CONSTRAINT fk_coodle_benutzer FOREIGN KEY(ersteller_uid) REFERENCES public.tbl_benutzer (uid) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle TO web;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle TO vilesci;
|
||||
|
||||
CREATE TABLE campus.tbl_coodle_ressource
|
||||
(
|
||||
coodle_ressource_id integer NOT NULL,
|
||||
coodle_id integer NOT NULL,
|
||||
uid varchar(32),
|
||||
ort_kurzbz varchar(16),
|
||||
email varchar(128),
|
||||
name varchar(256),
|
||||
zugangscode varchar(64),
|
||||
insertamum timestamp,
|
||||
insertvon varchar(32),
|
||||
updateamum timestamp,
|
||||
updatevon varchar(32)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE campus.seq_coodle_ressource_coodle_ressource_id
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
GRANT SELECT, UPDATE ON SEQUENCE campus.seq_coodle_ressource_coodle_ressource_id TO web;
|
||||
GRANT SELECT, UPDATE ON SEQUENCE campus.seq_coodle_ressource_coodle_ressource_id TO vilesci;
|
||||
|
||||
ALTER TABLE campus.tbl_coodle_ressource ADD CONSTRAINT pk_coodle_ressource PRIMARY KEY (coodle_ressource_id);
|
||||
ALTER TABLE campus.tbl_coodle_ressource ALTER COLUMN coodle_ressource_id SET DEFAULT nextval('campus.seq_coodle_ressource_coodle_ressource_id');
|
||||
|
||||
ALTER TABLE campus.tbl_coodle_ressource ADD CONSTRAINT fk_coodle_ressource_coodle_id FOREIGN KEY(coodle_id) REFERENCES campus.tbl_coodle (coodle_id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_coodle_ressource ADD CONSTRAINT fk_coodle_ressource_uid FOREIGN KEY(uid) REFERENCES public.tbl_benutzer (uid) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_coodle_ressource ADD CONSTRAINT fk_coodle_ressource_ort_kurzbz FOREIGN KEY(ort_kurzbz) REFERENCES public.tbl_ort (ort_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle_ressource TO web;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle_ressource TO vilesci;
|
||||
|
||||
CREATE TABLE campus.tbl_coodle_termin
|
||||
(
|
||||
coodle_termin_id integer NOT NULL,
|
||||
coodle_id integer NOT NULL,
|
||||
datum date NOT NULL,
|
||||
uhrzeit time NOT NULL,
|
||||
auswahl boolean NOT NULL
|
||||
);
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle_termin TO web;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle_termin TO vilesci;
|
||||
|
||||
CREATE SEQUENCE campus.seq_coodle_termin_coodle_termin_id
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
GRANT SELECT, UPDATE ON SEQUENCE campus.seq_coodle_termin_coodle_termin_id TO web;
|
||||
GRANT SELECT, UPDATE ON SEQUENCE campus.seq_coodle_termin_coodle_termin_id TO vilesci;
|
||||
|
||||
ALTER TABLE campus.tbl_coodle_termin ADD CONSTRAINT pk_coodle_termin PRIMARY KEY (coodle_termin_id);
|
||||
ALTER TABLE campus.tbl_coodle_termin ALTER COLUMN coodle_termin_id SET DEFAULT nextval('campus.seq_coodle_termin_coodle_termin_id');
|
||||
ALTER TABLE campus.tbl_coodle_termin ADD CONSTRAINT fk_coodle_termin_coodle_termin_id FOREIGN KEY(coodle_id) REFERENCES campus.tbl_coodle (coodle_id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
CREATE TABLE campus.tbl_coodle_ressource_termin
|
||||
(
|
||||
coodle_ressource_id integer NOT NULL,
|
||||
coodle_termin_id integer NOT NULL,
|
||||
insertamum timestamp,
|
||||
insertvon varchar(32)
|
||||
);
|
||||
|
||||
ALTER TABLE campus.tbl_coodle_ressource_termin ADD CONSTRAINT pk_coodle_ressource_termin PRIMARY KEY (coodle_ressource_id, coodle_termin_id);
|
||||
ALTER TABLE campus.tbl_coodle_ressource_termin ADD CONSTRAINT fk_coodle_ressource_termin_coodle_ressource_id FOREIGN KEY(coodle_ressource_id) REFERENCES campus.tbl_coodle_ressource (coodle_ressource_id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_coodle_ressource_termin ADD CONSTRAINT fk_coodle_ressource_termin_coodle_termin_id FOREIGN KEY(coodle_termin_id) REFERENCES campus.tbl_coodle_termin (coodle_termin_id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle_ressource_termin TO web;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON campus.tbl_coodle_ressource_termin TO vilesci;
|
||||
|
||||
INSERT INTO campus.tbl_coodle_status(coodle_status_kurzbz,bezeichnung) VALUES('neu','Neu');
|
||||
INSERT INTO campus.tbl_coodle_status(coodle_status_kurzbz,bezeichnung) VALUES('laufend','Laufend');
|
||||
INSERT INTO campus.tbl_coodle_status(coodle_status_kurzbz,bezeichnung) VALUES('abgeschlossen','Abgeschlossen');
|
||||
INSERT INTO campus.tbl_coodle_status(coodle_status_kurzbz,bezeichnung) VALUES('storniert','Storniert');
|
||||
";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Coodle: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'Tabelle fuer Coodle hinzugefuegt<br>';
|
||||
}
|
||||
|
||||
echo '<br>';
|
||||
|
||||
$tabellen=array(
|
||||
@@ -3780,6 +3913,11 @@ $tabellen=array(
|
||||
"campus.tbl_contentgruppe" => array("content_id","gruppe_kurzbz","insertamum","insertvon"),
|
||||
"campus.tbl_contentlog" => array("contentlog_id","contentsprache_id","uid","start","ende"),
|
||||
"campus.tbl_contentsprache" => array("contentsprache_id","content_id","sprache","version","sichtbar","content","reviewvon","reviewamum","updateamum","updatevon","insertamum","insertvon","titel","gesperrt_uid"),
|
||||
"campus.tbl_coodle" => array("coodle_id","titel","beschreibung","coodle_status_kurzbz","dauer","endedatum","insertamum","insertvon","updateamum","updatevon"),
|
||||
"campus.tbl_coodle_ressource" => array("coodle_ressource_id","coodle_id","uid","ort_kurzbz","email","name","zugangscode","insertamum","insertvon","updateamum","updatevon"),
|
||||
"campus.tbl_coodle_termin" => array("coodle_termin_id","coodle_id","datum","uhrzeit","auswahl"),
|
||||
"campus.tbl_coodle_ressource_termin" => array("coodle_ressource_id","coodle_termin_id","insertamum","insertvon"),
|
||||
"campus.tbl_coodle_status" => array("coodle_status_kurzbz","bezeichnung"),
|
||||
"campus.tbl_dms" => array("dms_id","oe_kurzbz","dokument_kurzbz","kategorie_kurzbz"),
|
||||
"campus.tbl_dms_kategorie" => array("kategorie_kurzbz","bezeichnung","beschreibung","parent_kategorie_kurzbz"),
|
||||
"campus.tbl_dms_kategorie_gruppe" => array("kategorie_kurzbz","gruppe_kurzbz","insertamum","insertvon"),
|
||||
|
||||
Reference in New Issue
Block a user