Move public.phrase to system.phrase and change phrase_inhalt to phrasentext

This commit is contained in:
Paminger
2016-06-29 09:32:51 +02:00
parent 9a44c818ea
commit 48655039ba
4 changed files with 39 additions and 39 deletions
+13 -13
View File
@@ -20,7 +20,7 @@ class PhrasesLib
$this->ci->load->library('parser');
$this->ci->load->model('system/Phrase_model', 'PhraseModel');
$this->ci->load->model('system/Phrase_inhalt_model', 'PhraseInhaltModel');
$this->ci->load->model('system/Phrasetext_model', 'PhrasentextModel');
$this->ci->load->helper('language');
$this->ci->load->helper('Message');
@@ -59,8 +59,8 @@ class PhrasesLib
if (empty($phrase_id))
return $this->_error(MSG_ERR_INVALID_MSG_ID);
$phrase_inhalt = $this->ci->PhraseInhaltModel->loadWhere(array('phrase_id' => $phrase_id));
return $phrase_inhalt;
$phrasentext = $this->ci->PhrasentextModel->loadWhere(array('phrase_id' => $phrase_id));
return $phrasentext;
}
/**
@@ -85,13 +85,13 @@ class PhrasesLib
* @param string $vorlage_kurzbz REQUIRED
* @return array
*/
function getPhraseInhaltById($phrase_inhalt_id)
function getPhrasentextById($phrasentext_id)
{
if (empty($phrase_inhalt_id))
if (empty($phrasentext_id))
return $this->_error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
$phrase_inhalt = $this->ci->PhraseInhaltModel->loadWhere(array('phrase_inhalt_id' =>$phrase_inhalt_id));
return $phrase_inhalt;
$phrasentext = $this->ci->PhrasentextModel->load($phrasentext_id);
return $phrasentext;
}
/**
@@ -138,8 +138,8 @@ class PhrasesLib
*/
function insertPhraseinhalt($data)
{
$phrase_inhalt = $this->ci->PhraseInhaltModel->insert($data);
return $phrase_inhalt;
$phrasentext = $this->ci->PhrasentextModel->insert($data);
return $phrasentext;
}
/**
@@ -160,10 +160,10 @@ class PhrasesLib
* @param string $vorlage_kurzbz REQUIRED
* @return array
*/
function updatePhraseInhalt($phrase_inhalt_id, $data)
function updatePhraseInhalt($phrasentext_id, $data)
{
$phrase_inhalt = $this->ci->PhraseInhaltModel->update($phrase_inhalt_id, $data);
return $phrase_inhalt;
$phrasentext = $this->ci->PhrasentextModel->update($phrasentext_id, $data);
return $phrasentext;
}
/**
@@ -196,4 +196,4 @@ class PhrasesLib
{
return success($retval, $message);
}
}
}
+11 -11
View File
@@ -41,8 +41,8 @@ class Migration_Phrase extends CI_Migration {
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrase_phrase_id_seq TO admin;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrase_phrase_id_seq TO vilesci;
CREATE TABLE system.tbl_phrase_inhalt (
phrase_inhalt_id serial,
CREATE TABLE system.tbl_phrasentext (
phrasentext_id serial,
phrase_id bigint NOT NULL,
sprache varchar(32) NOT NULL,
orgeinheit_kurzbz varchar(32),
@@ -51,14 +51,14 @@ class Migration_Phrase extends CI_Migration {
description text,
insertamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
insertvon varchar(32),
PRIMARY KEY (phrase_inhalt_id)
PRIMARY KEY (phrasentext_id)
);
GRANT SELECT ON TABLE system.tbl_phrase_inhalt TO web;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE system.tbl_phrase_inhalt TO admin;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE system.tbl_phrase_inhalt TO vilesci;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrase_inhalt_phrase_inhalt_id_seq TO web;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrase_inhalt_phrase_inhalt_id_seq TO admin;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrase_inhalt_phrase_inhalt_id_seq TO vilesci;
GRANT SELECT ON TABLE system.tbl_phrasentext TO web;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE system.tbl_phrasentext TO admin;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE system.tbl_phrasentext TO vilesci;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrasentext_phrasentext_id_seq TO web;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrasentext_phrasentext_id_seq TO admin;
GRANT SELECT, UPDATE ON SEQUENCE system.tbl_phrasentext_phrasentext_id_seq TO vilesci;
";
if (!$this->db->simple_query($query))
{
@@ -71,10 +71,10 @@ class Migration_Phrase extends CI_Migration {
{
try
{
$this->dbforge->drop_table('system.tbl_phrase_inhalt');
$this->dbforge->drop_table('system.tbl_phrasentext');
$this->dbforge->drop_table('system.tbl_phrase');
$this->dbforge->drop_table('system.tbl_app');
echo "Table system.tbl_phrase_inhalt, system.tbl_phrase and system.tbl_app dropped!";
echo "Table system.tbl_phrasentext, system.tbl_phrase and system.tbl_app dropped!";
}
catch(Exception $e)
{
@@ -1,15 +0,0 @@
<?php
class Phrase_inhalt_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_phrase_inhalt';
$this->pk = 'phrase_inhalt_id';
}
}
@@ -0,0 +1,15 @@
<?php
class Phrasentext_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_phrasentext';
$this->pk = 'phrasentext_id';
}
}