mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
VorlageExtension
This commit is contained in:
@@ -23,7 +23,7 @@ $config['migration_enabled'] = TRUE;
|
||||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 007;
|
||||
$config['migration_version'] = 009;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -19,12 +19,12 @@ class Migration_Message extends CI_Migration {
|
||||
$query= "
|
||||
CREATE TABLE public.tbl_msg_message (
|
||||
message_id serial,
|
||||
person_id bigint NOT NULL,
|
||||
person_id bigint NOT NULL references public.tbl_person(person_id),
|
||||
subject varchar(256) NOT NULL,
|
||||
body text NOT NULL,
|
||||
priority smallint NOT NULL DEFAULT 0,
|
||||
relationmessage_id bigint,
|
||||
oe_kurzbz varchar(32),
|
||||
relationmessage_id bigint references public.tbl_msg_message(message_id),
|
||||
oe_kurzbz varchar(32) references public.tbl_organisationseinheit(oe_kurzbz),
|
||||
insertamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
insertvon varchar(32),
|
||||
PRIMARY KEY (message_id)
|
||||
@@ -39,8 +39,8 @@ class Migration_Message extends CI_Migration {
|
||||
GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO vilesci;
|
||||
|
||||
CREATE TABLE public.tbl_msg_recipient (
|
||||
person_id bigint NOT NULL,
|
||||
message_id bigint NOT NULL,
|
||||
person_id bigint NOT NULL references public.tbl_person(person_id),
|
||||
message_id bigint NOT NULL references public.tbl_msg_message(message_id),
|
||||
insertamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
insertvon varchar(32),
|
||||
PRIMARY KEY (person_id,message_id)
|
||||
@@ -50,15 +50,15 @@ class Migration_Message extends CI_Migration {
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_recipient TO vilesci;
|
||||
|
||||
CREATE TABLE public.tbl_msg_status (
|
||||
message_id bigint NOT NULL,
|
||||
person_id bigint NOT NULL,
|
||||
message_id bigint NOT NULL references public.tbl_msg_message(message_id),
|
||||
person_id bigint NOT NULL references public.tbl_person(person_id),
|
||||
status smallint NOT NULL,
|
||||
statusinfo text,
|
||||
insertamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
insertvon varchar(32),
|
||||
updateamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updatevon varchar(32),
|
||||
PRIMARY KEY (message_id,person_id)
|
||||
PRIMARY KEY (message_id,person_id, status)
|
||||
);
|
||||
GRANT SELECT ON TABLE public.tbl_msg_status TO web;
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_status TO admin;
|
||||
@@ -66,10 +66,10 @@ class Migration_Message extends CI_Migration {
|
||||
|
||||
CREATE TABLE public.tbl_msg_attachment (
|
||||
attachment_id serial,
|
||||
message_id bigint NOT NULL,
|
||||
message_id bigint NOT NULL references public.tbl_msg_message(message_id),
|
||||
name text,
|
||||
filename text,
|
||||
PRIMARY KEY (message_id)
|
||||
PRIMARY KEY (attachment_id)
|
||||
);
|
||||
GRANT SELECT ON TABLE public.tbl_msg_attachment TO web;
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_attachment TO admin;
|
||||
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Migration_Vorlage extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
if (! @$this->db->simple_query('SELECT attribute FROM public.tbl_vorlage'))
|
||||
{
|
||||
$query= "ALTER TABLE public.tbl_vorlage
|
||||
ADD COLUMN attribute json;
|
||||
";
|
||||
if ($this->db->simple_query($query))
|
||||
echo 'Column public.tbl_vorlage.attribute added!';
|
||||
else
|
||||
echo "Error adding public.tbl_vorlage.attribute!";
|
||||
}
|
||||
|
||||
if (! @$this->db->simple_query('SELECT subject FROM public.tbl_vorlagestudiengang'))
|
||||
{
|
||||
$query= "ALTER TABLE public.tbl_vorlagestudiengang
|
||||
ADD COLUMN subject text;
|
||||
";
|
||||
if ($this->db->simple_query($query))
|
||||
echo 'Column public.tbl_vorlagestudiengang.subject added!';
|
||||
else
|
||||
echo "Error adding public.tbl_vorlagestudiengang.subject!";
|
||||
}
|
||||
|
||||
if (! @$this->db->simple_query('SELECT orgform_kurzbz FROM public.tbl_vorlagestudiengang'))
|
||||
{
|
||||
$query= "ALTER TABLE public.tbl_vorlagestudiengang
|
||||
ADD COLUMN orgform_kurzbz varchar(3) references bis.tbl_orgform(orgform_kurzbz);
|
||||
";
|
||||
if ($this->db->simple_query($query))
|
||||
echo 'Column public.tbl_vorlagestudiengang.orgform_kurzbz added!';
|
||||
else
|
||||
echo "Error adding public.tbl_vorlagestudiengang.orgform_kurzbz!";
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->dbforge->drop_column('public.tbl_vorlage', 'attribute');
|
||||
$this->dbforge->drop_column('public.tbl_vorlagestudiengang', 'subject');
|
||||
$this->dbforge->drop_column('public.tbl_vorlagestudiengang', 'orgform_kurzbz');
|
||||
echo "Column public.tbl_vorlage.attribute, public.tbl_vorlagestudiengang.subject, public.tbl_vorlagestudiengang.orgform_kurzbz dropped!";
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo 'Exception abgefangen: ', $e->getMessage(), "\n";
|
||||
echo $this->db->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplateEdit', 'tinymce' => true));
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<h2>Vorlagetext: <?=$vorlagestudiengang_id?></h2>
|
||||
StudiengangKZ: <?=$studiengang_kz?>
|
||||
<form method="post" action="../saveText/<?=$vorlagestudiengang_id?>">
|
||||
Version: <input type="text" name="version" value="<?php echo $version; ?>" />
|
||||
Aktiv: <input type="text" name="aktiv" value="<?php echo $aktiv; ?>" />
|
||||
OE:<?php echo $this->templatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $oe_kurzbz)); ?>
|
||||
<input type="hidden" name="vorlagestudiengang_id" value="<?php echo $vorlagestudiengang_id; ?>" />
|
||||
<input type="hidden" name="studiengang_kz" value="<?php echo $studiengang_kz; ?>" />
|
||||
<?php
|
||||
// This is an example to show that you can load stuff from inside the template file
|
||||
echo $this->templatelib->widget("tinymce_widget", array('name' => 'text', 'text' => $text));
|
||||
?>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="../preview/<?=$vorlagestudiengang_id?>" target="TemplatePreview">
|
||||
<button type="submit">Preview</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<iframe name="TemplatePreview" width="100%" src="../preview/<?=$vorlagestudiengang_id?>"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplatetextList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '7:{sorter:false}'));
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<h2>Vorlagentext - <?php echo $vorlage_kurzbz; ?></h2>
|
||||
<form method="post" action="../newtext" target="TemplatesBottom">
|
||||
<input type="hidden" name="vorlage_kurzbz" value="<?php echo $vorlage_kurzbz; ?>"/>
|
||||
<button type="submit">Neu</button>
|
||||
</form>
|
||||
|
||||
<table id="t1" class="tablesorter">
|
||||
<thead>
|
||||
<tr><th class='table-sortable:default'>ID</th>
|
||||
<th class='table-sortable:default'>Vorlage</th>
|
||||
<th class='table-sortable:default'>Version</th>
|
||||
<th class='table-sortable:default'>OrgEinheit</th>
|
||||
<th class='table-sortable:default'>OrgForm</th>
|
||||
<th class='table-sortable:default'>Berechtigung</th>
|
||||
<th>Anmerkung</th><th>Aktiv</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($vorlagentext as $v): ?>
|
||||
<tr><td><a href="../edittext/<?php echo $v->vorlagestudiengang_id; ?>" target="TemplatesBottom"><?php echo $v->vorlagestudiengang_id; ?></a></td>
|
||||
<td><a href="../edittext/<?php echo $v->vorlagestudiengang_id; ?>" target="TemplatesBottom"><?php echo $v->vorlage_kurzbz; ?></a></td>
|
||||
<td><?php echo $v->version; ?></td>
|
||||
<td><?php echo $v->oe_kurzbz; ?></td>
|
||||
<td></td>
|
||||
<td><?php echo $v->berechtigung; ?></td>
|
||||
<td><?php echo $v->anmerkung_vorlagestudiengang; ?></td>
|
||||
<td><?php echo $v->aktiv; ?></td>
|
||||
<td><a href="../editText/<?php echo $v->vorlagestudiengang_id; ?>" target="TemplatesBottom">Edit</a></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->load->view('templates/footer');
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
echo $text;
|
||||
?>
|
||||
@@ -1,9 +1,8 @@
|
||||
<script type="text/javascript">
|
||||
tinymce.init({
|
||||
selector: "<?php echo $selector; ?>",
|
||||
plugins: [<?php echo $plugins; ?>],
|
||||
toolbar: "<?php echo $toolbar; ?>"
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
tinymce.init({
|
||||
selector: "<?php echo $selector; ?>",
|
||||
plugins: [<?php echo $plugins; ?>],
|
||||
toolbar: "<?php echo $toolbar; ?>"
|
||||
});
|
||||
</script>
|
||||
<<?=$selector?> name="<?=$name?>" style="<?=$style?>"><?=$text?></<?=$selector?>>
|
||||
|
||||
@@ -9,6 +9,12 @@ class tinymce_widget extends Widget
|
||||
{
|
||||
if (! isset($data['selector']))
|
||||
$data['selector'] = 'textarea';
|
||||
if (! isset($data['name']))
|
||||
$data['name'] = 'text';
|
||||
if (! isset($data['text']))
|
||||
$data['text'] = '';
|
||||
if (! isset($data['style']))
|
||||
$data['style'] = 'width:100%';
|
||||
if (! isset($data['plugins']))
|
||||
$data['plugins'] = '
|
||||
"advlist autolink lists link image charmap print preview anchor",
|
||||
|
||||
Reference in New Issue
Block a user