mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
Conflicts: application/core/FHC_Controller.php
This commit is contained in:
@@ -231,6 +231,8 @@ $config['fhc_acl'] = array
|
||||
'wawi.tbl_rechnungsbetrag' => 'basis/rechnungsbetrag',
|
||||
'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp',
|
||||
'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp',
|
||||
|
||||
DMS_PATH => 'fs/dms',
|
||||
|
||||
'public.tbl_sprache' => 'admin'
|
||||
);
|
||||
|
||||
@@ -23,9 +23,13 @@ class Dms extends APIv1_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model PersonModel
|
||||
$this->load->model('content/dms_model', 'DmsModel');
|
||||
// Load set the uid of the model to let to check the permissions
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->load->model('content/DmsFS_model', 'DmsFSModel');
|
||||
// Set the uid of the model to let to check the permissions
|
||||
$this->DmsModel->setUID($this->_getUID());
|
||||
$this->DmsVersionModel->setUID($this->_getUID());
|
||||
$this->DmsFSModel->setUID($this->_getUID());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,9 +45,52 @@ class Dms extends APIv1_Controller
|
||||
$result = $this->_getDms($dms_id, $version);
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval) && count($result->retval) > 0)
|
||||
{
|
||||
if (($fileContent = $this->_readFile($result->retval[0]->filename)) != false)
|
||||
$resultFS = $this->DmsFSModel->read($result->retval[0]->filename);
|
||||
if (is_object($resultFS) && $resultFS->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result->retval[0]->file_content = $fileContent;
|
||||
$result->retval[0]->file_content = $resultFS->retval;
|
||||
}
|
||||
}
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function postDms()
|
||||
{
|
||||
$dms = $this->_parseData($this->post());
|
||||
|
||||
if ($this->_validate($dms))
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if (isset($dms['dms_id']))
|
||||
{
|
||||
if ($this->_saveFileOnUpdate($dms))
|
||||
{
|
||||
$result = $this->DmsModel->update($dms['dms_id'], $this->DmsModel->filterFields($dms));
|
||||
if ($result->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result = $this->DmsVersionModel->update(array($dms['dms_id'], $dms['version']), $this->DmsVersionModel->filterFields($dms));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (($filename = $this->_saveFileOnInsert($dms)) !== false)
|
||||
{
|
||||
$result = $this->DmsModel->insert($this->DmsModel->filterFields($dms));
|
||||
if ($result->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result = $this->DmsVersionModel->insert($this->DmsVersionModel->filterFields($dms, $result->retval, $filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,102 +136,6 @@ class Dms extends APIv1_Controller
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function postDms()
|
||||
{
|
||||
$dms = $this->_parseData($this->post());
|
||||
if ($this->_validate($dms))
|
||||
{
|
||||
if (isset($dms['dms_id']))
|
||||
{
|
||||
if ($this->_saveFileOnUpdate($dms))
|
||||
{
|
||||
$result = $this->DmsModel->update($dms['dms_id'], $this->_dmsFieldsArray($dms));
|
||||
if ($result->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result = $this->DmsModel->updateDmsVersion($dms['dms_id'], $this->_dmsVersionFieldsArray($dms));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (($fileName = $this->_saveFileOnInsert($dms)) !== false)
|
||||
{
|
||||
$result = $this->DmsModel->insert($this->_dmsFieldsArray($dms));
|
||||
if ($result->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result = $this->DmsModel->insertDmsVersion($this->_dmsVersionFieldsArray($dms, $result->retval, $fileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _dmsFieldsArray($dms)
|
||||
{
|
||||
$fieldsArray = array('oe_kurzbz', 'dokument_kurzbz', 'kategorie_kurzbz');
|
||||
$returnArray = array();
|
||||
|
||||
foreach ($fieldsArray as $value)
|
||||
{
|
||||
if (isset($dms[$value]))
|
||||
{
|
||||
$returnArray[$value] = $dms[$value];
|
||||
}
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _dmsVersionFieldsArray($dms, $dms_id = null, $fileName = null)
|
||||
{
|
||||
$fieldsArray = array(
|
||||
'version',
|
||||
'mimetype',
|
||||
'name',
|
||||
'beschreibung',
|
||||
'letzterzugriff',
|
||||
'insertamum',
|
||||
'insertvon',
|
||||
'updateamum',
|
||||
'updatevon'
|
||||
);
|
||||
$returnArray = array();
|
||||
|
||||
foreach ($fieldsArray as $value)
|
||||
{
|
||||
if (isset($dms[$value]))
|
||||
{
|
||||
$returnArray[$value] = $dms[$value];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($dms_id))
|
||||
{
|
||||
$returnArray['dms_id'] = $dms_id;
|
||||
}
|
||||
if (isset($fileName))
|
||||
{
|
||||
$returnArray['filename'] = $fileName;
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -193,19 +144,11 @@ class Dms extends APIv1_Controller
|
||||
if(isset($dms['version']))
|
||||
{
|
||||
$result = $this->_getDms($dms['dms_id'], $dms['version']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->_getDms($dms['dms_id']);
|
||||
}
|
||||
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval) && count($result->retval) > 0)
|
||||
{
|
||||
$fileName = DMS_PATH . $result->retval[0]->filename;
|
||||
|
||||
if (($fileContent = base64_decode($dms['file_content'])))
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval) && count($result->retval) > 0)
|
||||
{
|
||||
if (file_put_contents($fileName, $fileContent))
|
||||
$result = $this->DmsFSModel->write($result->retval[0]->filename, $dms['file_content']);
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -220,47 +163,17 @@ class Dms extends APIv1_Controller
|
||||
*/
|
||||
private function _saveFileOnInsert($dms)
|
||||
{
|
||||
$fileName = uniqid() . '.' . pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
$FileNamePath = DMS_PATH . $fileName;
|
||||
$filename = uniqid() . '.' . pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
|
||||
if (($fileContent = base64_decode($dms['file_content'])))
|
||||
$result = $this->DmsFSModel->write($filename, $dms['file_content']);
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS)
|
||||
{
|
||||
if ($fileHandle = fopen($FileNamePath, 'w'))
|
||||
{
|
||||
if(fwrite($fileHandle, $fileContent))
|
||||
{
|
||||
fclose($fileHandle);
|
||||
return $fileName;
|
||||
}
|
||||
}
|
||||
return $filename;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _readFile($fileName)
|
||||
{
|
||||
$fileNamePath = DMS_PATH . $fileName;
|
||||
if (file_exists($fileNamePath))
|
||||
{
|
||||
if ($fileHandle = fopen($fileNamePath, 'r'))
|
||||
{
|
||||
$cTmpHEX = '';
|
||||
while (!feof($fileHandle))
|
||||
{
|
||||
$cTmpHEX .= fread($fileHandle, 8192);
|
||||
}
|
||||
fclose($fileHandle);
|
||||
return base64_encode($cTmpHEX);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function _validate($dms = NULL)
|
||||
{
|
||||
if (!isset($dms['file_content']) || (isset($dms['file_content']) && $dms['file_content'] == ''))
|
||||
@@ -274,4 +187,4 @@ class Dms extends APIv1_Controller
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,45 +23,20 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model MessageModel
|
||||
$this->load->model('system/message_model', 'MessageModel');
|
||||
// Load set the uid of the model to let to check the permissions
|
||||
$this->MessageModel->setUID($this->_getUID());
|
||||
$this->load->library('MessageLib', array('uid' => $this->_getUID()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getMessage()
|
||||
public function getMessagesByPersonID()
|
||||
{
|
||||
$messageID = $this->get('message_id');
|
||||
$person_id = $this->get('person_id');
|
||||
$all = $this->get('all');
|
||||
|
||||
if (isset($messageID))
|
||||
if (isset($person_id))
|
||||
{
|
||||
$result = $this->MessageModel->load($messageID);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postMessage()
|
||||
{
|
||||
if ($this->_validate($this->post()))
|
||||
{
|
||||
if (isset($this->post()['message_id']))
|
||||
{
|
||||
$result = $this->MessageModel->update($this->post()['message_id'], $this->post());
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->MessageModel->insert($this->post());
|
||||
}
|
||||
$result = $this->messagelib->getMessagesByPerson($person_id, $all);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
@@ -71,8 +46,39 @@ class Message extends APIv1_Controller
|
||||
}
|
||||
}
|
||||
|
||||
private function _validate($message = NULL)
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postMessage()
|
||||
{
|
||||
if ($this->_validate($this->post()))
|
||||
{
|
||||
$this->messagelib->addRecipient($this->post()['person_id']);
|
||||
$result = $this->messagelib->sendMessage(
|
||||
$this->post()['person_id'],
|
||||
$this->post()['subject'],
|
||||
$this->post()['body'],
|
||||
PRIORITY_NORMAL,
|
||||
NULL,
|
||||
$this->post()['oe_kurzbz']
|
||||
);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
private function _validate($message = null)
|
||||
{
|
||||
if (!isset($message['person_id']) || !isset($message['subject']) ||
|
||||
!isset($message['body']) || !isset($message['oe_kurzbz']))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,43 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Messages extends FHC_Controller
|
||||
class Messages extends VileSci_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('messaging');
|
||||
$this->load->library('MessageLib');
|
||||
//$this->load->model('person/Person_model');
|
||||
//$this->load->model('system/Message_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//$messages = $this->Message_model->getMessages();
|
||||
$msg = $this->Message_model->load(1);
|
||||
$this->load->view('system/messages.php');
|
||||
}
|
||||
|
||||
public function table()
|
||||
{
|
||||
$person_id = $this->input->post('person_id', TRUE);
|
||||
if ($person_id)
|
||||
$msg = $this->messagelib->getMessagesByPerson($person_id);
|
||||
else
|
||||
$msg = $this->messagelib->getMessagesByUID($this->getUID());
|
||||
if ($msg->error)
|
||||
show_error($msg->retval);
|
||||
|
||||
$data = array
|
||||
(
|
||||
'message' => $msg->retval[0]
|
||||
'messages' => $msg->retval
|
||||
);
|
||||
$v = $this->load->view('message.php', $data);
|
||||
var_dump ($data);
|
||||
$this->load->view('system/messagesList.php', $data);
|
||||
}
|
||||
|
||||
public function view($msg_id)
|
||||
{
|
||||
$msg = $this->messaging->getMessage($msg_id);
|
||||
$msg = $this->messagelib->getMessage($msg_id);
|
||||
//var_dump($msg);
|
||||
if ($msg->error)
|
||||
show_error($msg->retval);
|
||||
@@ -57,9 +66,9 @@ class Messages extends FHC_Controller
|
||||
{
|
||||
$body = $this->input->post('body', TRUE);
|
||||
$subject = $this->input->post('subject', TRUE);
|
||||
if (! $this->messaging->addRecipient(1))
|
||||
if (! $this->messagelib->addRecipient(1))
|
||||
show_error('Error: AddRecipient');
|
||||
$msg = $this->messaging->sendMessage(1,$body ,$subject);
|
||||
$msg = $this->messagelib->sendMessage(1,$body ,$subject);
|
||||
if ($msg->error)
|
||||
show_error($msg->retval);
|
||||
$msg_id = $msg->retval;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
class DB_Model extends FHC_Model
|
||||
{
|
||||
protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ...
|
||||
protected $pk; // Name of the PrimaryKey for DB-Update, Load, ...
|
||||
protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ...
|
||||
protected $pk; // Name of the PrimaryKey for DB-Update, Load, ...
|
||||
protected $hasSequence; // False if this table has a composite primary key that is not using a sequence
|
||||
// True if this table has a primary key that uses a sequence
|
||||
protected $acl; // Name of the PrimaryKey for DB-Update, Load, ...
|
||||
protected $acl; // Name of the PrimaryKey for DB-Update, Load, ...
|
||||
|
||||
function __construct($dbTable = null, $pk = null, $hasSequence = true)
|
||||
{
|
||||
|
||||
@@ -3,21 +3,23 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FHC_Controller extends CI_Controller
|
||||
{
|
||||
public $uid;
|
||||
|
||||
function __construct()
|
||||
protected $_uid; // needs to be changed to protected $_uid
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('session');
|
||||
//$this->load->helper('language');
|
||||
|
||||
// look if User is logged in and set uid
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
$this->uid = $_SERVER['PHP_AUTH_USER'];
|
||||
if (isset($_SESSION['uid']))
|
||||
$this->uid = $_SESSION['uid'];
|
||||
$this->session->set_userdata('uid', 'pam');
|
||||
$this->load->helper('fhcauth');
|
||||
|
||||
$this->_uid = getAuthUID();
|
||||
}
|
||||
|
||||
public function getUID()
|
||||
{
|
||||
if (empty($this->_uid))
|
||||
return false;
|
||||
else
|
||||
return $this->_uid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,16 @@ class FHC_Model extends CI_Model
|
||||
{
|
||||
return $this->fhc_db_acl->setUID($uid);
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* get UID
|
||||
*
|
||||
* @return string or (bool)false
|
||||
*/
|
||||
public function getUID()
|
||||
{
|
||||
return $this->fhc_db_acl->getUID();
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Success
|
||||
@@ -61,4 +71,4 @@ class FHC_Model extends CI_Model
|
||||
{
|
||||
return error($retval, $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
class FS_Model extends FHC_Model
|
||||
{
|
||||
protected $filepath; // Path of the file
|
||||
protected $acl; // Name of the permissions array index for FS writing, reading...
|
||||
|
||||
function __construct($filepath = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('FilesystemLib');
|
||||
$this->acl = $this->config->item('fhc_acl');
|
||||
$this->filepath = $filepath;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Read data from file system
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function read($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->filepath], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->filepath], FHC_MODEL_ERROR);
|
||||
|
||||
if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename)))
|
||||
{
|
||||
return $this->_success(base64_encode($data));
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Writing data to file system
|
||||
*
|
||||
* @param string $fileContent File content
|
||||
* @return object
|
||||
*/
|
||||
public function write($filename, $content)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
if (is_null($content))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->filepath], 'i'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->filepath], FHC_MODEL_ERROR);
|
||||
|
||||
if ($this->filesystemlib->write($this->filepath, $filename, base64_decode($content)) === true)
|
||||
{
|
||||
return $this->_success(FHC_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Append data to a file
|
||||
*
|
||||
* @param array $data File content
|
||||
* @return array
|
||||
*/
|
||||
public function append($filename, $content)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
if (is_null($content))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->filepath], 'i'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->filepath], FHC_MODEL_ERROR);
|
||||
|
||||
if ($this->filesystemlib->append($this->filepath, $filename, base64_decode($content)) === true)
|
||||
{
|
||||
return $this->_success(FHC_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Delete data from file system
|
||||
*
|
||||
* @param string $id Primary Key for DELETE
|
||||
* @return array
|
||||
*/
|
||||
public function remove($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->filepath], 'd'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->filepath], FHC_MODEL_ERROR);
|
||||
|
||||
if ($this->filesystemlib->remove($this->filepath, $filename) === true)
|
||||
{
|
||||
return $this->_success(FHC_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Rename a file
|
||||
*
|
||||
* @param string $id Primary Key for DELETE
|
||||
* @return array
|
||||
*/
|
||||
public function rename($filename, $newFilename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
if (is_null($newFilename))
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->filepath], 'u'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->filepath], FHC_MODEL_ERROR);
|
||||
|
||||
if ($this->filesystemlib->rename($this->filepath, $filename, $this->filepath, $newFilename) === true)
|
||||
{
|
||||
return $this->_success(FHC_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_error(lang('fhc_'.FHC_ERROR), FHC_MODEL_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,4 +48,20 @@ if ( ! function_exists('auth'))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Look if User is logged in and return uid
|
||||
* Otherwise return false
|
||||
*
|
||||
* @return string or (bool)false
|
||||
*/
|
||||
function getAuthUID()
|
||||
{
|
||||
// look if User is logged in and return uid
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
return $_SERVER['PHP_AUTH_USER'];
|
||||
if (isset($_SESSION['uid']))
|
||||
return $_SESSION['uid'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,4 +68,14 @@ class FHC_DB_ACL
|
||||
{
|
||||
return $this->_uid = $uid;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* get UID
|
||||
*
|
||||
* @return string or (bool)false
|
||||
*/
|
||||
public function getUID()
|
||||
{
|
||||
return $this->_uid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FilesystemLib
|
||||
{
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function __construct() {}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
private function checkParameters($filepath, $filename)
|
||||
{
|
||||
if (isset($filepath) && isset($filename) &&
|
||||
$filepath != '' && $filename != '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function read($filepath, $filename)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
if (file_exists($resource) && $fileHandle = fopen($resource, 'r'))
|
||||
{
|
||||
$result = '';
|
||||
while (!feof($fileHandle))
|
||||
{
|
||||
$result .= fread($fileHandle, 8192);
|
||||
}
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function write($filepath, $filename, $content)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && isset($content))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
if (is_writable($filepath) && $fileHandle = fopen($resource, 'w'))
|
||||
{
|
||||
if (fwrite($fileHandle, $content) !== false)
|
||||
{
|
||||
$result = true;
|
||||
}
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function append($filepath, $filename, $content)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && isset($content))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
if (is_writable($resource) && $fileHandle = fopen($resource, 'a'))
|
||||
{
|
||||
if (fwrite($fileHandle, $content) !== false)
|
||||
{
|
||||
$result = true;
|
||||
}
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function remove($filepath, $filename)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename))
|
||||
{
|
||||
if (is_writable($filepath))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
$result = unlink($resource);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function rename($filepath, $filename, $newFilepath, $newFilename)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && $this->checkParameters($newFilepath, $newFilename))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
if (is_writable($filepath) && is_writable($newFilepath) && file_exists($resource))
|
||||
{
|
||||
$destination = $newFilepath . DIRECTORY_SEPARATOR . $newFilename;
|
||||
$result = rename($resource, $destination);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,18 @@ class MessageLib
|
||||
{
|
||||
private $recipients = array();
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params)
|
||||
{
|
||||
require_once APPPATH.'config/message.php';
|
||||
|
||||
$this->ci =& get_instance();
|
||||
//$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
$this->ci->load->model('system/Message_model', 'MessageModel');
|
||||
if (is_array($params) && isset($params['uid']))
|
||||
{
|
||||
$this->ci->MessageModel->setUID($params['uid']);
|
||||
}
|
||||
|
||||
$this->ci->load->model('system/MsgStatus_model', 'MsgStatusModel');
|
||||
$this->ci->load->model('system/Recipient_model', 'RecipientModel');
|
||||
$this->ci->load->model('system/Attachment_model', 'AttachmentModel');
|
||||
@@ -53,6 +58,40 @@ class MessageLib
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessagesByUID() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*
|
||||
* @param string $uid REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getMessagesByUID($uid, $all = false)
|
||||
{
|
||||
if (empty($uid))
|
||||
return $this->_error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->MessageModel->getMessagesByUID($uid, $all);
|
||||
|
||||
// General Error Occurred
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessagesByPerson() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*
|
||||
* @param bigint $person_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getMessagesByPerson($person_id, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->MessageModel->getMessagesByPerson($person_id, $all);
|
||||
|
||||
// General Error Occurred
|
||||
return $msg;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -66,8 +105,7 @@ class MessageLib
|
||||
if (!is_numeric($msg_id))
|
||||
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->getMessage($msg_id);
|
||||
return $msg;
|
||||
return $this->getMessage($msg_id);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@@ -8,17 +8,37 @@ class Migration_Vorlage extends CI_Migration {
|
||||
{
|
||||
if (! @$this->db->simple_query('SELECT attribute FROM public.tbl_vorlage'))
|
||||
{
|
||||
$this->db->insert('system.tbl_berechtigung', array(
|
||||
'berechtigung_kurzbz' => 'basis/vorlage',
|
||||
'beschreibung' => 'Vorlagen fuer Dokumente (DOC, PDF, eMail, ...'));
|
||||
$this->db->insert('system.tbl_rolleberechtigung', array(
|
||||
'berechtigung_kurzbz' => 'basis/vorlage',
|
||||
'rolle_kurzbz' => 'admin',
|
||||
'art' => 'suid'));
|
||||
$query= "ALTER TABLE public.tbl_vorlage
|
||||
ADD COLUMN attribute json;
|
||||
";
|
||||
if ($this->db->simple_query($query))
|
||||
{
|
||||
echo 'Column public.tbl_vorlage.attribute added!';
|
||||
// Insert Demo Data
|
||||
$query= "INSERT INTO public.tbl_vorlage VALUES ('MailRegistration', 'eMail zur Registrierung', NULL, 'text/html', '{ \"\$schema\": \"http://json-schema.org/draft-03/schema#\", \"title\": \"Person\", \"type\": \"object\", \"properties\": { \"anrede\": { \"type\": \"string\", \"enum\": [ \"Herr\", \"Frau\" ], \"default\": \"Herr\" }, \"vorname\": { \"type\": \"string\", \"description\": \"Firstname\", \"minLength\": 2, \"default\": \"Vorname\" }, \"nachname\": { \"type\": \"string\", \"description\": \"Surename\", \"minLength\": 2, \"default\": \"Nachname\" }, \"code\": { \"type\": \"string\", \"description\": \"Accesscode\", \"minLength\": 6, \"default\": \"1q2w3e4r5t6z7u8i9o0\" }, \"link\": { \"type\": \"string\", \"description\": \"LoginURL\", \"minLength\": 6, \"default\": \"https://cis.fhcomplete.org/addon/aufnahme/cis/login/\" } }}');
|
||||
";
|
||||
$this->db->simple_query($query);
|
||||
}
|
||||
else
|
||||
echo "Error adding public.tbl_vorlage.attribute!";
|
||||
}
|
||||
|
||||
if (! @$this->db->simple_query('SELECT subject FROM public.tbl_vorlagestudiengang'))
|
||||
{
|
||||
$this->db->insert('system.tbl_berechtigung', array(
|
||||
'berechtigung_kurzbz' => 'basis/vorlagestudiengang',
|
||||
'beschreibung' => 'Vorlagen fuer Dokumente (DOC, PDF, eMail, ...'));
|
||||
$this->db->insert('system.tbl_rolleberechtigung', array(
|
||||
'berechtigung_kurzbz' => 'basis/vorlagestudiengang',
|
||||
'rolle_kurzbz' => 'admin',
|
||||
'art' => 'suid'));
|
||||
$query= "ALTER TABLE public.tbl_vorlagestudiengang
|
||||
ADD COLUMN subject text;
|
||||
";
|
||||
@@ -34,7 +54,17 @@ class Migration_Vorlage extends CI_Migration {
|
||||
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!';
|
||||
// Insert Demo Data
|
||||
$query= "INSERT INTO public.tbl_vorlagestudiengang VALUES ('MailRegistration', 0, 1, '<p>Sehr geehrte/r {anrede} <strong>{vorname} {nachname}</strong>,</p>
|
||||
<p>vielen Dank für Ihre Registrierung an unserer Hochschule. Im Anhang senden wir ihnen den Zugangscode.</p>
|
||||
<p>Code: <code>{code}</code></p>
|
||||
<p>Unter folgenden Link können sie sich direkt für unser Service einloggen: <a title=\"LoginLink\" href=\"{link}{code}\">{link}{code}</a></p>
|
||||
<p>Mit freundlichen Grüßen,<br>FH Technikum Wien</p>', 'etw');
|
||||
";
|
||||
$this->db->simple_query($query);
|
||||
}
|
||||
else
|
||||
echo "Error adding public.tbl_vorlagestudiengang.orgform_kurzbz!";
|
||||
}
|
||||
@@ -44,6 +74,12 @@ class Migration_Vorlage extends CI_Migration {
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->db->delete('system.tbl_rolleberechtigung', array('berechtigung_kurzbz' => 'basis/vorlage'));
|
||||
$this->db->delete('system.tbl_berechtigung', array('berechtigung_kurzbz' => 'basis/vorlage'));
|
||||
$this->db->delete('system.tbl_rolleberechtigung', array('berechtigung_kurzbz' => 'basis/vorlagestudiengang'));
|
||||
$this->db->delete('system.tbl_berechtigung', array('berechtigung_kurzbz' => 'basis/vorlagestudiengang'));
|
||||
$this->db->delete('public.tbl_vorlagestudiengang', array('vorlage_kurzbz' => 'MailRegistration'));
|
||||
$this->db->delete('public.tbl_vorlage', array('vorlage_kurzbz' => 'MailRegistration'));
|
||||
$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');
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
class DmsFS_model extends FS_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->filepath = DMS_PATH;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
class DmsVersion_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'campus.tbl_dms_version';
|
||||
$this->pk = array('dms_id', 'version');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function filterFields($dms, $dms_id = null, $fileName = null)
|
||||
{
|
||||
$fieldsArray = array(
|
||||
'version',
|
||||
'mimetype',
|
||||
'name',
|
||||
'beschreibung',
|
||||
'letzterzugriff',
|
||||
'insertamum',
|
||||
'insertvon',
|
||||
'updateamum',
|
||||
'updatevon'
|
||||
);
|
||||
$returnArray = array();
|
||||
|
||||
foreach ($fieldsArray as $value)
|
||||
{
|
||||
if (isset($dms[$value]))
|
||||
{
|
||||
$returnArray[$value] = $dms[$value];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($dms_id))
|
||||
{
|
||||
$returnArray['dms_id'] = $dms_id;
|
||||
}
|
||||
if (isset($fileName))
|
||||
{
|
||||
$returnArray['filename'] = $fileName;
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
}
|
||||
@@ -12,39 +12,22 @@ class Dms_model extends DB_Model
|
||||
$this->pk = 'dms_id';
|
||||
}
|
||||
|
||||
public function insertDmsVersion($data)
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function filterFields($dms)
|
||||
{
|
||||
$tableName = 'campus.tbl_dms_version';
|
||||
$fieldsArray = array('oe_kurzbz', 'dokument_kurzbz', 'kategorie_kurzbz');
|
||||
$returnArray = array();
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$tableName], 'i'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$tableName], FHC_MODEL_ERROR);
|
||||
|
||||
// DB-INSERT
|
||||
if ($this->db->insert($tableName, $data))
|
||||
return $this->_success($this->db->insert_id());
|
||||
else
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
|
||||
public function updateDmsVersion($id, $data)
|
||||
{
|
||||
$tableName = 'campus.tbl_dms_version';
|
||||
foreach ($fieldsArray as $value)
|
||||
{
|
||||
if (isset($dms[$value]))
|
||||
{
|
||||
$returnArray[$value] = $dms[$value];
|
||||
}
|
||||
}
|
||||
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->pk))
|
||||
return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$tableName], 'u'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$tableName], FHC_MODEL_ERROR);
|
||||
|
||||
// DB-UPDATE
|
||||
$this->db->where('dms_id', $id);
|
||||
|
||||
if ($this->db->update($tableName, $data))
|
||||
return $this->_success($id);
|
||||
else
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
return $returnArray;
|
||||
}
|
||||
}
|
||||
@@ -16,5 +16,86 @@ class Message_model extends DB_Model
|
||||
$this->pk = 'message_id';
|
||||
}
|
||||
|
||||
public function getMessagesByUID($uid, $all)
|
||||
{
|
||||
// Check wrights
|
||||
// @ToDo: Define the special wright for reading own messages "basis/message:own"
|
||||
// if same user
|
||||
if ($uid === $this->getUID())
|
||||
{
|
||||
if (! $this->fhc_db_acl->isBerechtigt('basis/message', 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> system/message', FHC_MODEL_ERROR);
|
||||
}
|
||||
// if different user, for reading messages from other users
|
||||
else
|
||||
{
|
||||
if (! $this->fhc_db_acl->isBerechtigt('basis/message', 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> system/message:all', FHC_MODEL_ERROR);
|
||||
}
|
||||
|
||||
// get Data
|
||||
$sql = 'SELECT uid, person_id, message_id, subject, priority, relationmessage_id, oe_kurzbz, m.insertamum, anrede, titelpost, titelpre, nachname, vorname, vornamen,
|
||||
status, statusinfo, s.insertamum AS statusamum
|
||||
FROM public.tbl_msg_message m
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
JOIN public.tbl_benutzer USING (person_id)
|
||||
LEFT JOIN
|
||||
(
|
||||
SELECT message_id, person_id, status, statusinfo, tbl_msg_status.insertamum
|
||||
FROM public.tbl_msg_status
|
||||
INNER JOIN
|
||||
(
|
||||
SELECT message_id, person_id, max(insertamum) AS insertamum
|
||||
FROM public.tbl_msg_status
|
||||
GROUP BY message_id, person_id
|
||||
) status
|
||||
USING (message_id, person_id)
|
||||
WHERE tbl_msg_status.insertamum=status.insertamum
|
||||
) s
|
||||
USING (message_id, person_id)
|
||||
WHERE uid = ?';
|
||||
if (! $all)
|
||||
$sql .= ' AND status<2';
|
||||
$result = $this->db->query($sql, array($uid));
|
||||
if (is_object($result))
|
||||
return $this->_success($result->result());
|
||||
else
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
|
||||
public function getMessagesByPerson($person_id, $all)
|
||||
{
|
||||
// Check wrights
|
||||
if (! $this->fhc_db_acl->isBerechtigt('basis/message', 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> system/message', FHC_MODEL_ERROR);
|
||||
|
||||
// get Data
|
||||
$sql = 'SELECT person_id, message_id, subject, priority, relationmessage_id, oe_kurzbz, m.insertamum, anrede, titelpost, titelpre, nachname, vorname, vornamen,
|
||||
status, statusinfo, s.insertamum AS statusamum
|
||||
FROM public.tbl_msg_message m
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
LEFT JOIN
|
||||
(
|
||||
SELECT message_id, person_id, status, statusinfo, tbl_msg_status.insertamum
|
||||
FROM public.tbl_msg_status
|
||||
INNER JOIN
|
||||
(
|
||||
SELECT message_id, person_id, max(insertamum) AS insertamum
|
||||
FROM public.tbl_msg_status
|
||||
GROUP BY message_id, person_id
|
||||
) status
|
||||
USING (message_id, person_id)
|
||||
WHERE tbl_msg_status.insertamum=status.insertamum
|
||||
) s
|
||||
USING (message_id, person_id)
|
||||
WHERE person_id = ?';
|
||||
if (! $all)
|
||||
$sql .= ' AND status<2';
|
||||
$result = $this->db->query($sql, array($person_id));
|
||||
//var_dump($result);
|
||||
if (is_object($result))
|
||||
return $this->_success($result->result());
|
||||
else
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
/* end of file Message_model.php */
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/tinymce/tinymce/tinymce.min.js');?>"></script>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<h2>Nachricht <?php echo $message->message_id,': ',$message->subject; ?></h2>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
|
||||
<html lang="de_AT">
|
||||
|
||||
Absender: <?php echo $message->person_id; ?><br/>
|
||||
Betreff: <?php echo $message->subject; ?><br/>
|
||||
Text: <?php echo $message->body; ?><br/>
|
||||
<?php
|
||||
// This is an example to show that you can load stuff from inside the template file
|
||||
echo $this->template->widget("organisationseinheit_widget", array('title' => 'Organisationseinheit', 'oe_kurzbz' => $message->oe_kurzbz));
|
||||
?>
|
||||
<form method="post" action="system/Message/send">
|
||||
<?php
|
||||
// This is an example to show that you can load stuff from inside the template file
|
||||
echo $this->template->widget("tinymce_widget", array());
|
||||
?>
|
||||
<input type="text" name="subject"></input>
|
||||
<textarea name="body" style="width:100%"></textarea>
|
||||
<button type="submit">send Message!</button>
|
||||
</form>
|
||||
</div>
|
||||
<head>
|
||||
<title>VileSci - Messages</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
|
||||
<frameset rows="30%,*">
|
||||
<frame src="Messages/table" id="MessagesTop" name="MessagesTop" frameborder="0" />
|
||||
<frame src="Messages/edit" id="MessagesBottom" name="MessagesBottom" frameborder="0" />
|
||||
<noframes>
|
||||
<body bgcolor="#FFFFFF">
|
||||
This application works only with a frames-enabled browser.<br />
|
||||
<a href="MessagesList">Use without frames</a>
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'MessagesList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '4:{sorter:false}'));
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<h2>Vorlagen</h2>
|
||||
<form method="post" action="">
|
||||
Person
|
||||
<input name="person_id"></input>
|
||||
<button type="submit">Filter</button>
|
||||
</form>
|
||||
|
||||
<table id="t1" class="tablesorter">
|
||||
<thead>
|
||||
<tr><th class='table-sortable:default'>Vorlage</th>
|
||||
<th class='table-sortable:default'>Bezeichnung</th>
|
||||
<th>Anmerkung</th><th>MimeType</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($vorlage as $v): ?>
|
||||
<tr><td><a href="edit/<?php echo $v->vorlage_kurzbz; ?>" target="MessagesBottom"><?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>
|
||||
<td><a href="view/<?php echo $v->vorlage_kurzbz; ?>">View</a></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<script type="text/javascript" >
|
||||
// get json
|
||||
function getJSON(form)
|
||||
function getJSON(form)
|
||||
{
|
||||
form.elements["attribute"].value = JSON.stringify(jsoneditor.get(), null, 2);
|
||||
//alert(form.elements["attribute"].value);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplateList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '4:{sorter:false}'));
|
||||
$this->load->view('templates/header', array('title' => 'TemplatesList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '4:{sorter:false}'));
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -57,6 +57,6 @@ if ($tablesort)
|
||||
<link rel="stylesheet" href="<?php echo base_url('vendor/json-forms/dist/css/brutusin-json-forms.min.css'); ?>"/>
|
||||
<script src="<?php echo base_url('vendor/json-forms/dist/js/brutusin-json-forms.min.js'); ?>"></script>
|
||||
<?php endif ?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -97,6 +97,8 @@ $berechtigungen = array(
|
||||
array('basis/testtool','Administrationseite, Gebiete löschen/zurücksetzen'),
|
||||
array('basis/variable','Variablenverwaltung'),
|
||||
array('basis/vilesci','Grundrecht, um in VileSci irgendwelche Menüpunkte zu sehen'),
|
||||
array('basis/vorlage','Erstellen und Bearbeiten von Vorlagen'),
|
||||
array('basis/vorlagestudiengang','Bearbeiten der Texte zu den Vorlagen'),
|
||||
array('buchung/typen','Verwaltung von Buchungstypen'),
|
||||
array('buchung/mitarbeiter','Verwaltung von Buchungen fuer Mitarbeiter'),
|
||||
array('inout/incoming','Incomingverwaltung'),
|
||||
|
||||
@@ -343,7 +343,8 @@ DELETE FROM system.tbl_rolleberechtigung WHERE berechtigung_kurzbz IN (
|
||||
'basis/lehrverband',
|
||||
'basis/log',
|
||||
'basis/mitarbeiter',
|
||||
'basis/msg_message',
|
||||
'basis/msg_message',
|
||||
'basis/message',
|
||||
'basis/msg_thread',
|
||||
'basis/notiz',
|
||||
'basis/notizzuordnung',
|
||||
@@ -419,7 +420,8 @@ DELETE FROM system.tbl_rolleberechtigung WHERE berechtigung_kurzbz IN (
|
||||
'basis/vw_studiensemester',
|
||||
'lehre/reservierung',
|
||||
'lehre/reihungstest',
|
||||
'wawi/inventar:begrenzt'
|
||||
'wawi/inventar:begrenzt',
|
||||
'fs/dms'
|
||||
);
|
||||
|
||||
-- DELETE FROM system.tbl_berechtigung
|
||||
@@ -569,6 +571,7 @@ DELETE FROM system.tbl_berechtigung WHERE berechtigung_kurzbz IN (
|
||||
'basis/log',
|
||||
'basis/mitarbeiter',
|
||||
'basis/msg_message',
|
||||
'basis/message',
|
||||
'basis/msg_thread',
|
||||
'basis/notiz',
|
||||
'basis/notizzuordnung',
|
||||
@@ -644,7 +647,8 @@ DELETE FROM system.tbl_berechtigung WHERE berechtigung_kurzbz IN (
|
||||
'basis/vw_studiensemester',
|
||||
'lehre/reservierung',
|
||||
'lehre/reihungstest',
|
||||
'wawi/inventar:begrenzt'
|
||||
'wawi/inventar:begrenzt',
|
||||
'fs/dms'
|
||||
);
|
||||
|
||||
-- INSERT Permissions
|
||||
@@ -869,6 +873,8 @@ INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('
|
||||
INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('lehre/reservierung', '');
|
||||
INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('lehre/reihungstest', '');
|
||||
INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('wawi/inventar:begrenzt', '');
|
||||
INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('fs/dms', '');
|
||||
INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/message', '');
|
||||
|
||||
-- INSERT link between user admin and permissions
|
||||
INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/archiv', 'admin', 'suid');
|
||||
@@ -1092,6 +1098,8 @@ INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art
|
||||
INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('lehre/reservierung', 'admin', 'suid');
|
||||
INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('lehre/reihungstest', 'admin', 'suid');
|
||||
INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('wawi/inventar:begrenzt', 'admin', 'suid');
|
||||
INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('fs/dms', 'admin', 'suid');
|
||||
INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/message', 'admin', 'suid');
|
||||
|
||||
-- EMPTY public.tbl_statistik
|
||||
DELETE FROM public.tbl_statistik;
|
||||
|
||||
Reference in New Issue
Block a user