mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- Moved file to manage vorlage into subdir vorlage
- Updated sprache, orgform, organisationseinheit and vorlage to the new widget - Changed method getRecursiveList of model Organisationseinheit_model - Updated vilesci_menu_main.inc.php - Changed method loadDropDownView of WidgetLib: if a selected value is not given, by default it is set as HTML_DEFAULT_VALUE - Updated all the affectd files
This commit is contained in:
+96
-65
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Templates extends FHC_Controller
|
||||
class Vorlage extends VileSci_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -17,97 +17,106 @@ class Templates extends FHC_Controller
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/templates.php');
|
||||
$this->load->view('system/vorlage/templates.php');
|
||||
}
|
||||
|
||||
public function table()
|
||||
{
|
||||
$mimetype = $this->input->post('mimetype', TRUE);
|
||||
$mimetype = $this->input->post('mimetype');
|
||||
|
||||
if (is_null($mimetype))
|
||||
$mimetype = 'text/html';
|
||||
if ($mimetype == '')
|
||||
$mimetype = null;
|
||||
|
||||
$vorlage = $this->vorlagelib->getVorlageByMimetype($mimetype);
|
||||
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
//var_dump($vorlage);
|
||||
|
||||
$data = array
|
||||
(
|
||||
$data = array (
|
||||
'mimetype' => $mimetype,
|
||||
'vorlage' => $vorlage->retval
|
||||
);
|
||||
$v = $this->load->view('system/templatesList.php', $data);
|
||||
|
||||
$v = $this->load->view('system/vorlage/templatesList.php', $data);
|
||||
}
|
||||
|
||||
public function view($vorlage_kurzbz = null)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
exit;
|
||||
if (empty($vorlage_kurzbz)) exit;
|
||||
|
||||
$vorlagentext = $this->vorlagelib->getVorlagetextByVorlage($vorlage_kurzbz);
|
||||
|
||||
if ($vorlagentext->error)
|
||||
show_error($vorlagentext->retval);
|
||||
//var_dump($vorlagentext);
|
||||
|
||||
$data = array
|
||||
(
|
||||
$data = array (
|
||||
'vorlage_kurzbz' => $vorlage_kurzbz,
|
||||
'vorlagentext' => $vorlagentext->retval
|
||||
);
|
||||
$v = $this->load->view('system/templatetextList.php', $data);
|
||||
|
||||
$v = $this->load->view('system/vorlage/templatetextList.php', $data);
|
||||
}
|
||||
|
||||
public function edit($vorlage_kurzbz = null)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
exit;
|
||||
if (empty($vorlage_kurzbz)) exit;
|
||||
|
||||
$vorlage = $this->vorlagelib->getVorlage($vorlage_kurzbz);
|
||||
//var_dump($vorlage);
|
||||
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
|
||||
if (count($vorlage->retval) != 1)
|
||||
show_error('Nachricht nicht vorhanden! ID: '.$vorlage_kurzbz);
|
||||
|
||||
$data = array
|
||||
(
|
||||
$data = array (
|
||||
'vorlage' => $vorlage->retval[0]
|
||||
);
|
||||
//var_dump($data['message']);
|
||||
$v = $this->load->view('system/templatesEdit', $data);
|
||||
|
||||
$v = $this->load->view('system/vorlage/templatesEdit', $data);
|
||||
}
|
||||
|
||||
public function write($vorlage_kurzbz = null)
|
||||
{
|
||||
$data = array
|
||||
(
|
||||
$data = array (
|
||||
'subject' => 'TestSubject',
|
||||
'body' => 'TestDevelopmentBodyText'
|
||||
);
|
||||
$v = $this->load->view('system/messageWrite', $data);
|
||||
|
||||
$v = $this->load->view('system/vorlage/messageWrite', $data);
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz', TRUE);
|
||||
$data['bezeichnung'] = $this->input->post('bezeichnung', TRUE);
|
||||
$data['anmerkung'] = $this->input->post('anmerkung', TRUE);
|
||||
$data['mimetype'] = $this->input->post('mimetype', TRUE);
|
||||
$data['attribute'] = $this->input->post('attribute', TRUE);
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz');
|
||||
|
||||
$data = array(
|
||||
'bezeichnung' => $this->input->post('bezeichnung'),
|
||||
'anmerkung' => $this->input->post('anmerkung'),
|
||||
'mimetype' => $this->input->post('mimetype'),
|
||||
'attribute' => $this->input->post('attribute')
|
||||
);
|
||||
|
||||
$vorlage = $this->vorlagelib->saveVorlage($vorlage_kurzbz, $data);
|
||||
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
|
||||
$vorlage_kurzbz = $vorlage->retval;
|
||||
|
||||
redirect('/system/Templates/edit/'.$vorlage_kurzbz);
|
||||
redirect('/system/vorlage/edit/'.$vorlage_kurzbz);
|
||||
}
|
||||
|
||||
public function newText()
|
||||
{
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz', true);
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz');
|
||||
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->OrganisationseinheitModel->addLimit(1);
|
||||
$this->OrganisationseinheitModel->addOrder('oe_kurzbz');
|
||||
|
||||
$resultOE = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true, 'oe_parent_kurzbz' => null));
|
||||
|
||||
if ($resultOE->error)
|
||||
@@ -125,12 +134,13 @@ class Templates extends FHC_Controller
|
||||
);
|
||||
|
||||
$vorlagetext = $this->vorlagelib->insertVorlagetext($data);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
|
||||
$vorlagestudiengang_id = $vorlagetext->retval;
|
||||
|
||||
redirect('/system/Templates/editText/'.$vorlagestudiengang_id);
|
||||
redirect('/system/vorlage/editText/'.$vorlagestudiengang_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,89 +151,110 @@ class Templates extends FHC_Controller
|
||||
public function editText($vorlagestudiengang_id)
|
||||
{
|
||||
$vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
|
||||
$data = $vorlagetext->retval[0];
|
||||
|
||||
// Preview-Data
|
||||
$schema = $this->vorlagelib->getVorlage($data->vorlage_kurzbz);
|
||||
|
||||
$data->schema = $schema->retval[0]->attribute;
|
||||
|
||||
$this->load->view('system/templatetextEdit', $data);
|
||||
$this->load->view('system/vorlage/templatetextEdit', $data);
|
||||
}
|
||||
|
||||
public function linkDocuments($vorlagestudiengang_id)
|
||||
{
|
||||
$this->load->model('system/vorlagedokument_model');
|
||||
$return = $this->vorlagedokument_model->loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id);
|
||||
$data = array();
|
||||
|
||||
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
|
||||
|
||||
$return = $this->VorlagedokumentModel->loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id);
|
||||
|
||||
$data['documents'] = $return->retval;
|
||||
|
||||
$this->load->model('system/dokument_model');
|
||||
$this->dokument_model->addOrder("bezeichnung");
|
||||
$return = $this->dokument_model->load();
|
||||
$data['allDocuments'] = $return->retval;
|
||||
$this->load->model('system/Dokument_model', 'DokumentModel');
|
||||
$this->DokumentModel->addOrder('bezeichnung');
|
||||
|
||||
$return = $this->DokumentModel->load();
|
||||
|
||||
$data['allDocuments'] = $return->retval;
|
||||
$data['vorlagestudiengang_id'] = $vorlagestudiengang_id;
|
||||
|
||||
$this->load->view('system/templateLinkDocuments', $data);
|
||||
$this->load->view('system/vorlage/templateLinkDocuments', $data);
|
||||
}
|
||||
|
||||
public function saveDocuments($vorlagestudiengang_id, $dokument_kurzbz, $sort)
|
||||
{
|
||||
$this->load->model('system/vorlagedokument_model');
|
||||
$insert = array();
|
||||
|
||||
$insert['vorlagestudiengang_id'] = $vorlagestudiengang_id;
|
||||
$insert['dokument_kurzbz'] = $dokument_kurzbz;
|
||||
$insert['sort'] = $sort;
|
||||
$this->vorlagedokument_model->insert($insert);
|
||||
$insert['sort'] = $sort;
|
||||
|
||||
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
|
||||
|
||||
$this->VorlagedokumentModel->insert($insert);
|
||||
}
|
||||
|
||||
public function deleteDocumentLink($vorlagestudiengang_id)
|
||||
{
|
||||
$this->load->model('system/vorlagedokument_model');
|
||||
$this->vorlagedokument_model->delete($vorlagestudiengang_id);
|
||||
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
|
||||
|
||||
$this->VorlagedokumentModel->delete($vorlagestudiengang_id);
|
||||
}
|
||||
|
||||
public function changeSort($vorlagestudiengang_id, $sort)
|
||||
{
|
||||
$this->load->model('system/vorlagedokument_model');
|
||||
$this->vorlagedokument_model->update($vorlagestudiengang_id, array("sort"=>$sort));
|
||||
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
|
||||
|
||||
$this->VorlagedokumentModel->update($vorlagestudiengang_id, array('sort' => $sort));
|
||||
}
|
||||
|
||||
public function saveText()
|
||||
{
|
||||
$vorlagestudiengang_id = $this->input->post('vorlagestudiengang_id', TRUE);
|
||||
$data['studiengang_kz'] = $this->input->post('studiengang_kz', TRUE);
|
||||
$data['version'] = $this->input->post('version', TRUE);
|
||||
$data['oe_kurzbz'] = $this->input->post('oe_kurzbz', TRUE);
|
||||
$data = array(
|
||||
'studiengang_kz' => $this->input->post('studiengang_kz'),
|
||||
'version' => $this->input->post('version'),
|
||||
'oe_kurzbz' => $this->input->post('oe_kurzbz'),
|
||||
'aktiv' => $this->input->post('aktiv'),
|
||||
'text' => $this->input->post('text'),
|
||||
'vorlagestudiengang_id' => $this->input->post('vorlagestudiengang_id')
|
||||
);
|
||||
|
||||
if ($this->input->post('sprache') == '')
|
||||
$data['sprache'] = null;
|
||||
else
|
||||
$data['sprache'] = $this->input->post('sprache', TRUE);
|
||||
$data['sprache'] = $this->input->post('sprache');
|
||||
|
||||
if ($this->input->post('orgform_kurzbz') == '')
|
||||
$data['orgform_kurzbz'] = null;
|
||||
else
|
||||
$data['orgform_kurzbz'] = $this->input->post('orgform_kurzbz', TRUE);
|
||||
$data['text'] = $this->input->post('text', TRUE);
|
||||
$data['aktiv'] = $this->input->post('aktiv', TRUE);
|
||||
$vorlagetext = $this->vorlagelib->updateVorlagetext($vorlagestudiengang_id, $data);
|
||||
$data['orgform_kurzbz'] = $this->input->post('orgform_kurzbz');
|
||||
|
||||
$vorlagetext = $this->vorlagelib->updateVorlagetext($data['vorlagestudiengang_id'], $data);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
$data['vorlagestudiengang_id'] = $vorlagestudiengang_id;
|
||||
redirect('/system/Templates/editText/'.$vorlagestudiengang_id);
|
||||
//$this->load->view('system/templatetextEdit', $data);
|
||||
|
||||
redirect('/system/vorlage/editText/'.$data['vorlagestudiengang_id']);
|
||||
}
|
||||
|
||||
public function preview($vorlagestudiengang_id)
|
||||
{
|
||||
$formdata = $this->input->post('formdata', FALSE);
|
||||
$daten = json_decode($formdata, TRUE);
|
||||
$jsonDecodedForm = json_decode($this->input->post('formdata'), true);
|
||||
|
||||
$vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
$data = array
|
||||
(
|
||||
'text' => $this->vorlagelib->parseVorlagetext($vorlagetext->retval[0]->text, $daten)
|
||||
|
||||
$data = array(
|
||||
'text' => $this->vorlagelib->parseVorlagetext($vorlagetext->retval[0]->text, $jsonDecodedForm)
|
||||
);
|
||||
$this->load->view('system/templatetextPreview', $data);
|
||||
|
||||
$this->load->view('system/vorlage/templatetextPreview', $data);
|
||||
}
|
||||
}
|
||||
@@ -713,6 +713,11 @@ class DropdownWidget extends Widget
|
||||
{
|
||||
$widgetData[DropdownWidget::WIDGET_DATA_ELEMENTS_ARRAY_NAME] = $this->elementsArray->retval;
|
||||
|
||||
if (!isset($widgetData[DropdownWidget::SELECTED_ELEMENT]))
|
||||
{
|
||||
$widgetData[DropdownWidget::SELECTED_ELEMENT] = Widget::HTML_DEFAULT_VALUE;
|
||||
}
|
||||
|
||||
$this->view('widgets/dropdown', $widgetData);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,32 +11,38 @@ class Organisationseinheit_model extends DB_Model
|
||||
$this->pk = 'oe_kurzbz';
|
||||
}
|
||||
|
||||
public function getRecursiveList($typ)
|
||||
public function getRecursiveList($typ = null)
|
||||
{
|
||||
$qry = "WITH RECURSIVE tree (oe_kurzbz, bezeichnung, path, organisationseinheittyp_kurzbz) AS
|
||||
(
|
||||
SELECT
|
||||
oe_kurzbz,
|
||||
bezeichnung||' ('||organisationseinheittyp_kurzbz||')' AS bezeichnung,
|
||||
oe_kurzbz||'|' AS path,
|
||||
organisationseinheittyp_kurzbz
|
||||
FROM tbl_organisationseinheit
|
||||
WHERE oe_parent_kurzbz IS NULL AND aktiv
|
||||
UNION ALL
|
||||
SELECT
|
||||
oe.oe_kurzbz,
|
||||
oe.bezeichnung||' ('||oe.organisationseinheittyp_kurzbz||')' AS bezeichnung,
|
||||
tree.path ||oe.oe_kurzbz||'|' AS path,
|
||||
oe.organisationseinheittyp_kurzbz
|
||||
FROM tree
|
||||
JOIN tbl_organisationseinheit oe ON (tree.oe_kurzbz=oe.oe_parent_kurzbz)
|
||||
$qry = "WITH RECURSIVE tree (oe_kurzbz, bezeichnung, path, organisationseinheittyp_kurzbz) AS (
|
||||
SELECT oe_kurzbz,
|
||||
bezeichnung || ' (' || organisationseinheittyp_kurzbz || ')' AS bezeichnung,
|
||||
oe_kurzbz || '|' AS path,
|
||||
organisationseinheittyp_kurzbz
|
||||
FROM tbl_organisationseinheit
|
||||
WHERE oe_parent_kurzbz IS NULL
|
||||
AND aktiv = true
|
||||
UNION ALL
|
||||
SELECT oe.oe_kurzbz,
|
||||
oe.bezeichnung || ' (' || oe.organisationseinheittyp_kurzbz || ')' AS bezeichnung,
|
||||
tree.path || oe.oe_kurzbz || '|' AS path,
|
||||
oe.organisationseinheittyp_kurzbz
|
||||
FROM tree JOIN tbl_organisationseinheit oe ON (tree.oe_kurzbz = oe.oe_parent_kurzbz)
|
||||
)
|
||||
SELECT oe_kurzbz AS value, substring(regexp_replace(path, '[A-z]+\|', '-','g')||bezeichnung,2) AS name, path FROM tree ";
|
||||
if (!empty($typ))
|
||||
$qry .= 'WHERE organisationseinheittyp_kurzbz IN ('.$typ.') ';
|
||||
$qry .= 'ORDER BY path;';
|
||||
SELECT oe_kurzbz AS id,
|
||||
SUBSTRING(REGEXP_REPLACE(path, '[A-z]+\|', '-', 'g') || bezeichnung, 2) AS description
|
||||
FROM tree";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
$parametersArray = array();
|
||||
|
||||
if (is_array($typ) && count($typ) > 0)
|
||||
{
|
||||
$parametersArray[] = $typ;
|
||||
$qry .= ' WHERE organisationseinheittyp_kurzbz IN ?';
|
||||
}
|
||||
|
||||
$qry .= ' ORDER BY path';
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,13 @@
|
||||
<div class="span4">
|
||||
<button type="submit">Send</button>
|
||||
|
||||
<?php echo $this->widgetlib->widget("Vorlage_widget", array("title" => "Vorlage")); ?>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
null,
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,19 +40,26 @@
|
||||
$url = str_replace("/system/Messages/reply", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
function getVorlageText(vorlage_kurzbz)
|
||||
{
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"vorlage_kurzbz": vorlage_kurzbz},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.activeEditor.setContent(data.retval[0].text + "<?php echo $message->body; ?>");
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
if ($("#vorlageDnD"))
|
||||
{
|
||||
$("#vorlageDnD").change(function() {
|
||||
if (this.value != '')
|
||||
{
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"vorlage_kurzbz": this.value},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.activeEditor.setContent(data.retval[0].text + "<?php echo $message->body; ?>");
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -72,7 +72,13 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->widgetlib->widget("Vorlage_widget", array("title" => "Vorlage")); ?>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
null,
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -186,6 +192,31 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#vorlageDnD"))
|
||||
{
|
||||
$("#vorlageDnD").change(function() {
|
||||
if (this.value != '')
|
||||
{
|
||||
<?php
|
||||
$url = str_replace("/system/Messages/write", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"vorlage_kurzbz": this.value},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.get("bodyTextArea").setContent(data.retval[0].text);
|
||||
$("#subject").val(data.retval[0].subject);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function tinymcePreviewSetContent()
|
||||
@@ -222,25 +253,5 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getVorlageText(vorlage_kurzbz)
|
||||
{
|
||||
<?php
|
||||
$url = str_replace("/system/Messages/write", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"vorlage_kurzbz": vorlage_kurzbz},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.get("bodyTextArea").setContent(data.retval[0].text);
|
||||
$("#subject").val(data.retval[0].subject);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
@@ -11,11 +11,43 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>OE</td>
|
||||
<td><?php echo $this->widgetlib->widget("organisationseinheit_widget", array('oe_kurzbz' => $orgeinheit_kurzbz)); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Organisationseinheit_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $orgeinheit_kurzbz),
|
||||
array('name' => 'organisationseinheit', 'id' => 'organisationseinheitDnD')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>Preview</td>
|
||||
</tr>
|
||||
<tr><td>Orgform</td><td><?php echo $this->widgetlib->widget("orgform_widget", array('orgform_kurzbz' => $orgform_kurzbz)); ?></td><td></td></tr>
|
||||
<tr><td>Sprache</td><td><?php echo $this->widgetlib->widget("sprache_widget", array('sprache' => $sprache)); ?></td><td></td></tr>
|
||||
<tr>
|
||||
<td>Orgform</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Orgform_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $orgform_kurzbz),
|
||||
array('name' => 'orgform', 'id' => 'orgformDnD')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sprache</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Sprache_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $sprache),
|
||||
array('name' => 'sprache', 'id' => 'spracheDnD')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr><td>Text</td><td><textarea name="text" style="width:500px; height:300px;" id="markitup"><?php echo $text ?></textarea></td>
|
||||
<td valign="top">
|
||||
<div id="textile-preview" style="width:500px; height:300px; border: 1px solid gray; overflow: auto;"></div>
|
||||
|
||||
+4
-4
@@ -2,17 +2,17 @@
|
||||
<html lang="de_AT">
|
||||
|
||||
<head>
|
||||
<title>VileSci - Templates</title>
|
||||
<title>VileSci - Vorlage</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
|
||||
<frameset rows="30%,*">
|
||||
<frame src="Templates/table" id="TemplatesTop" name="TemplatesTop" frameborder="0" />
|
||||
<frame src="Templates/edit" id="TemplatesBottom" name="TemplatesBottom" frameborder="0" />
|
||||
<frame src="Vorlage/table" id="VorlageTop" name="VorlageTop" frameborder="0" />
|
||||
<frame src="Vorlage/edit" id="VorlageBottom" name="VorlageBottom" frameborder="0" />
|
||||
<noframes>
|
||||
<body bgcolor="#FFFFFF">
|
||||
This application works only with a frames-enabled browser.<br />
|
||||
<a href="TemplatesList">Use without frames</a>
|
||||
<a href="VorlageList">Use without frames</a>
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplateEdit', 'jsoneditor' => true));
|
||||
$this->load->view('templates/header', array('title' => 'VorlageEdit', 'jsoneditor' => true));
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplatesList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '4:{sorter:false}'));
|
||||
$this->load->view('templates/header', array('title' => 'VorlageList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '4:{sorter:false}'));
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
@@ -23,7 +23,7 @@ MimeType
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($vorlage as $v): ?>
|
||||
<tr><td><a href="edit/<?php echo $v->vorlage_kurzbz; ?>" target="TemplatesBottom"><?php echo $v->vorlage_kurzbz; ?></a></td>
|
||||
<tr><td><a href="edit/<?php echo $v->vorlage_kurzbz; ?>" target="VorlageBottom"><?php echo $v->vorlage_kurzbz; ?></a></td>
|
||||
<td><?php echo $v->bezeichnung; ?></td>
|
||||
<td><?php echo $v->anmerkung; ?></td>
|
||||
<td><?php echo $v->mimetype; ?></td>
|
||||
+28
-6
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplateEdit', 'tinymce' => true, 'jsonforms' => true));
|
||||
$this->load->view('templates/header', array('title' => 'VorlageEdit', 'tinymce' => true, 'jsonforms' => true));
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
@@ -7,9 +7,31 @@
|
||||
<h2>Vorlagetext: <?=$vorlagestudiengang_id?></h2>
|
||||
<!--StudiengangKZ: <?=$studiengang_kz?>-->
|
||||
<form method="post" action="../saveText/<?=$vorlagestudiengang_id?>">
|
||||
OE:<?php echo $this->widgetlib->widget("organisationseinheit_widget", array('oe_kurzbz' => $oe_kurzbz, 'typ' => "'Erhalter','Studienzentrum','Studiengang','Lehrgang'")); ?>
|
||||
Sprache:<?php echo $this->widgetlib->widget("sprache_widget", array('sprache' => $sprache)); ?>
|
||||
OrgForm:<?php echo $this->widgetlib->widget("orgform_widget", array('orgform' => $orgform_kurzbz)); ?>
|
||||
|
||||
OE: <?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Organisationseinheit_widget',
|
||||
array(
|
||||
DropdownWidget::SELECTED_ELEMENT => $oe_kurzbz,
|
||||
'typ' => array('Erhalter', 'Studienzentrum', 'Studiengang', 'Lehrgang')
|
||||
),
|
||||
array('name' => 'organisationseinheit', 'id' => 'organisationseinheitDnD')
|
||||
);
|
||||
?>
|
||||
Sprache: <?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Sprache_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $sprache),
|
||||
array('name' => 'sprache', 'id' => 'spracheDnD')
|
||||
);
|
||||
?>
|
||||
OrgForm: <?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Orgform_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $orgform_kurzbz),
|
||||
array('name' => 'orgform', 'id' => 'orgformDnD')
|
||||
);
|
||||
?>
|
||||
Version: <input type="text" name="version" value="<?php echo $version; ?>" size="1" />
|
||||
Aktiv: <input type="text" name="aktiv" value="<?php echo $aktiv; ?>" size="1" />
|
||||
<input type="hidden" name="vorlagestudiengang_id" value="<?php echo $vorlagestudiengang_id; ?>" />
|
||||
@@ -21,7 +43,7 @@
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
<hr/><h2>Preview-Data</h2>
|
||||
<form method="post" action="../preview/<?=$vorlagestudiengang_id?>" target="TemplatePreview">
|
||||
<form method="post" action="../preview/<?=$vorlagestudiengang_id?>" target="VorlagePreview">
|
||||
<?php echo $this->widgetlib->widget("jsonforms_widget", array('id' => 'dataform', 'schema' => $schema)); ?>
|
||||
<input type="hidden" name="formdata" id="formdata" value="" />
|
||||
<button type="submit" onclick="getFormdata(this.form);">Preview</button>
|
||||
@@ -38,6 +60,6 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<iframe name="TemplatePreview" width="100%" src=""/>
|
||||
<iframe name="VorlagePreview" width="100%" src=""/>
|
||||
</body>
|
||||
</html>
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplatetextList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '7:{sorter:false},8:{sorter:false},9:{sorter:false}'));
|
||||
$this->load->view('templates/header', array('title' => 'VorlagetextList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '7:{sorter:false},8:{sorter:false},9:{sorter:false}'));
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<h2>Vorlagentext - <?php echo $vorlage_kurzbz; ?></h2>
|
||||
<form method="post" action="../newtext" target="TemplatesBottom">
|
||||
<form method="post" action="../newtext" target="VorlageBottom">
|
||||
<input type="hidden" name="vorlage_kurzbz" value="<?php echo $vorlage_kurzbz; ?>"/>
|
||||
<button type="submit">Neu</button>
|
||||
</form>
|
||||
@@ -28,16 +28,16 @@
|
||||
<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><a href="../edittext/<?php echo $v->vorlagestudiengang_id; ?>" target="VorlageBottom"><?php echo $v->vorlagestudiengang_id; ?></a></td>
|
||||
<td><a href="../edittext/<?php echo $v->vorlagestudiengang_id; ?>" target="VorlageBottom"><?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 implode(',', $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 Text</a></td>
|
||||
<td><a href="../linkDocuments/<?php echo $v->vorlagestudiengang_id; ?>" target="TemplatesBottom">Edit Documents</a></td>
|
||||
<td><a href="../editText/<?php echo $v->vorlagestudiengang_id; ?>" target="VorlageBottom">Edit Text</a></td>
|
||||
<td><a href="../linkDocuments/<?php echo $v->vorlagestudiengang_id; ?>" target="VorlageBottom">Edit Documents</a></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
@@ -1,7 +0,0 @@
|
||||
<select name="<?php echo $htmltagname; ?>">
|
||||
<?php foreach($items as $item): ?>
|
||||
<option value="<?php echo $item['value']; ?>" <?php if ($item['selected']) echo 'selected'?>>
|
||||
<?php echo $item['name']; ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
@@ -1,7 +0,0 @@
|
||||
<select name="<?php echo $htmltagname; ?>">
|
||||
<?php foreach($items as $item): ?>
|
||||
<option value="<?php echo $item['value']; ?>" <?php if ($item['selected']) echo 'selected'?>>
|
||||
<?php echo $item['name']; ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
@@ -1,7 +0,0 @@
|
||||
<select name="<?php echo 'sprache'; ?>">
|
||||
<?php foreach($items as $item): ?>
|
||||
<option value="<?php echo $item['sprache']; ?>" <?php if ($item['selected']) echo 'selected'?>>
|
||||
<?php echo $item['sprache']; ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
@@ -1,16 +0,0 @@
|
||||
<select name="vorlage">
|
||||
<?php foreach($vorlage as $v): ?>
|
||||
<option value="<?php echo $v->vorlage_kurzbz; ?>" onClick="getVorlageText(this.value)">
|
||||
<?php
|
||||
if ($v->vorlage_kurzbz == '-1')
|
||||
{
|
||||
echo $v->bezeichnung;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $v->vorlage_kurzbz . (isset($v->bezeichnung) ? " - " . $v->bezeichnung : "");
|
||||
}
|
||||
?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
class Organisationseinheit_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
|
||||
if (isset($widgetData['typ']))
|
||||
$typ = $widgetData['typ'];
|
||||
else
|
||||
$typ = null;
|
||||
|
||||
// NOTE: no need to call addSelectToModel because getRecursiveList already returns
|
||||
// the correct names of the fields
|
||||
|
||||
$this->setElementsArray($this->OrganisationseinheitModel->getRecursiveList($typ));
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Orgform_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
$this->load->model('codex/Orgform_model', 'OrgFormModel');
|
||||
$this->OrgFormModel->addOrder('bezeichnung');
|
||||
|
||||
$this->addSelectToModel($this->OrgFormModel, 'orgform_kurzbz', 'bezeichnung');
|
||||
|
||||
$this->setElementsArray($this->OrgFormModel->load());
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Sprache_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->SpracheModel->addOrder('sprache');
|
||||
|
||||
$this->addSelectToModel($this->SpracheModel, 'sprache', 'sprache');
|
||||
|
||||
$this->setElementsArray($this->SpracheModel->load());
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* OE widget
|
||||
*/
|
||||
class organisationseinheit_widget extends Widget
|
||||
{
|
||||
|
||||
protected $_htmltagname = 'oe_kurzbz';
|
||||
|
||||
public function display($data)
|
||||
{
|
||||
$this->load->model('organisation/Organisationseinheit_model');
|
||||
if (isset($data['typ']))
|
||||
$typ = $data['typ'];
|
||||
else
|
||||
$typ = null;
|
||||
$res = $this->Organisationseinheit_model->getRecursiveList($typ);
|
||||
|
||||
// *** set data ***
|
||||
if (isset($data['htmltagname']))
|
||||
$this->_htmltagname = $data['htmltagname'];
|
||||
|
||||
// items from db
|
||||
foreach ($res->retval as $obj)
|
||||
{
|
||||
$item = array
|
||||
(
|
||||
'name' => $obj->name,
|
||||
'value' => $obj->value
|
||||
);
|
||||
if (isset($data['oe_kurzbz']) && $data['oe_kurzbz'] == $obj->value)
|
||||
$item['selected'] = true;
|
||||
else
|
||||
$item['selected'] = false;
|
||||
$data['items'][] = $item;
|
||||
}
|
||||
$data['htmltagname'] = $this->_htmltagname;
|
||||
|
||||
$this->view('widgets/organisationseinheit', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* OrgForm widget
|
||||
*/
|
||||
class orgform_widget extends Widget
|
||||
{
|
||||
protected $_htmltagname = 'orgform_kurzbz';
|
||||
|
||||
public function display($data)
|
||||
{
|
||||
$this->load->model('codex/Orgform_model', 'OrgFormModel');
|
||||
$res = $this->OrgFormModel->load();
|
||||
|
||||
// set data
|
||||
if (isset($data['htmltagname']))
|
||||
$this->_htmltagname = $data['htmltagname'];
|
||||
|
||||
// empty item for null values
|
||||
$item = array
|
||||
(
|
||||
'name' => ' - ',
|
||||
'value' => ''
|
||||
);
|
||||
if (empty($data['oe_kurzbz']))
|
||||
$item['selected'] = true;
|
||||
else
|
||||
$item['selected'] = false;
|
||||
$data['items'][] = $item;
|
||||
|
||||
// items from db
|
||||
foreach ($res->retval as $obj)
|
||||
{
|
||||
$item = array
|
||||
(
|
||||
'name' => $obj->orgform_kurzbz.' ('.$obj->bezeichnung.')',
|
||||
'value' => $obj->orgform_kurzbz
|
||||
);
|
||||
if (isset($data['orgform_kurzbz']) && $obj->orgform_kurzbz == $data['orgform_kurzbz'])
|
||||
$item['selected'] = true;
|
||||
else
|
||||
$item['selected'] = false;
|
||||
$data['items'][] = $item;
|
||||
}
|
||||
$data['htmltagname'] = $this->_htmltagname;
|
||||
|
||||
$this->view('widgets/orgform', $data);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* OE widget
|
||||
*/
|
||||
class sprache_widget extends Widget
|
||||
{
|
||||
public function display($data)
|
||||
{
|
||||
$this->load->model('system/Sprache_model');
|
||||
$res = $this->Sprache_model->load();
|
||||
//var_dump($res);
|
||||
foreach ($res->retval as $obj)
|
||||
{
|
||||
$item = array('sprache' => $obj->sprache);
|
||||
if (isset($data['sprache']) && $obj->sprache == $data['sprache'])
|
||||
$item['selected'] = true;
|
||||
else
|
||||
$item['selected'] = false;
|
||||
$data['items'][] = $item;
|
||||
}
|
||||
if (! isset($data['sprache']))
|
||||
$data['sprache'] = 'German';
|
||||
$this->view('widgets/sprache', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +1,21 @@
|
||||
<?php
|
||||
|
||||
class Vorlage_widget extends Widget
|
||||
class Vorlage_widget extends DropdownWidget
|
||||
{
|
||||
public function display($data)
|
||||
public function display($widgetData)
|
||||
{
|
||||
$this->load->model("system/Vorlage_model", "VorlageModel");
|
||||
$this->VorlageModel->addOrder("vorlage_kurzbz");
|
||||
$result = $this->VorlageModel->loadWhere(array("mimetype" => "text/html"));
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
$this->VorlageModel->addOrder('vorlage_kurzbz');
|
||||
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS)
|
||||
{
|
||||
// Adding an empty element
|
||||
$emptyVorlage = new stdClass();
|
||||
$emptyVorlage->vorlage_kurzbz = '-1';
|
||||
$emptyVorlage->bezeichnung = 'Select a template...';
|
||||
array_unshift($result->retval, $emptyVorlage);
|
||||
$this->addSelectToModel($this->VorlageModel, 'vorlage_kurzbz', 'bezeichnung');
|
||||
|
||||
$data = array("vorlage" => $result->retval);
|
||||
$this->view("widgets/vorlage", $data);
|
||||
}
|
||||
$this->setElementsArray(
|
||||
$this->VorlageModel->loadWhere(array('mimetype' => 'text/html')),
|
||||
true,
|
||||
'Select a vorlage...',
|
||||
'No vorlage found'
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -229,7 +229,7 @@ $menu=array
|
||||
'name'=>'Admin', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('basis/cronjob'), 'image'=>'vilesci_admin.png',
|
||||
'link'=>'left.php?categorie=Admin', 'target'=>'nav',
|
||||
'Cronjobs'=>array('name'=>'Cronjobs', 'link'=>'stammdaten/cronjobverwaltung.php', 'target'=>'main','permissions'=>array('basis/cronjob')),
|
||||
'Vorlagen'=>array('name'=>'Vorlagen', 'link'=>'../index.ci.php/system/Templates', 'target'=>'main','permissions'=>array('basis/cronjob')),
|
||||
'Vorlagen'=>array('name'=>'Vorlagen', 'link'=>'../index.ci.php/system/Vorlage', 'target'=>'main','permissions'=>array('basis/cronjob')),
|
||||
'Messages'=>array('name'=>'Nachrichten', 'link'=>'../index.ci.php/system/Messages', 'target'=>'main','permissions'=>array('basis/cronjob')),
|
||||
'Phrasen'=>array('name'=>'Phrasen', 'link'=>'../index.ci.php/system/Phrases', 'target'=>'main','permissions'=>array('basis/cronjob'))
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user