Sprache bei Templatetext

This commit is contained in:
Paminger
2016-07-13 07:56:19 +02:00
parent 483d133fc1
commit ed6f9fa676
5 changed files with 25 additions and 10 deletions
+1
View File
@@ -458,6 +458,7 @@ class DBTools extends FHC_Controller
break;
// **** Default ****
default: echo ' what? roles or permisssions?';
exit();
}
exit('Succesfully checked!');
@@ -134,6 +134,10 @@ class Templates extends FHC_Controller
$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);
if ($this->input->post('sprache') == '')
$data['sprache'] = null;
else
$data['sprache'] = $this->input->post('sprache', TRUE);
if ($this->input->post('orgform_kurzbz') == '')
$data['orgform_kurzbz'] = null;
else
@@ -11,25 +11,30 @@ class Organisationseinheit_model extends DB_Model
$this->pk = 'oe_kurzbz';
}
public function getRecursiveList()
public function getRecursiveList($typ)
{
$qry = "WITH RECURSIVE tree (oe_kurzbz, bezeichnung,path) AS
$qry = "WITH RECURSIVE tree (oe_kurzbz, bezeichnung, path, organisationseinheittyp_kurzbz) AS
(
SELECT
oe_kurzbz,
bezeichnung||' ('||organisationseinheittyp_kurzbz||')' AS bezeichnung,
oe_kurzbz||'|' AS path
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
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 ORDER BY path;";
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;';
if ($res = $this->db->query($qry))
@@ -5,12 +5,13 @@
<div class="row">
<div class="span4">
<h2>Vorlagetext: <?=$vorlagestudiengang_id?></h2>
StudiengangKZ: <?=$studiengang_kz?>
<!--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)); ?>
OE:<?php echo $this->templatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $oe_kurzbz, 'typ' => "'Erhalter','Studienzentrum','Studiengang','Lehrgang'")); ?>
Sprache:<?php echo $this->templatelib->widget("sprache_widget", array('sprache' => $sprache)); ?>
OrgForm:<?php echo $this->templatelib->widget("orgform_widget", array('orgform' => $orgform_kurzbz)); ?>
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; ?>" />
<input type="hidden" name="studiengang_kz" value="<?php echo $studiengang_kz; ?>" />
<?php
@@ -11,7 +11,11 @@ class organisationseinheit_widget extends Widget
public function display($data)
{
$this->load->model('organisation/Organisationseinheit_model');
$res = $this->Organisationseinheit_model->getRecursiveList();
if (isset($data['typ']))
$typ = $data['typ'];
else
$typ = null;
$res = $this->Organisationseinheit_model->getRecursiveList($typ);
// *** set data ***
if (isset($data['htmltagname']))