mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,6 +5,11 @@ $config['navigation_header'] = array(
|
||||
'FH-Complete' => site_url(''),
|
||||
'Vilesci' => base_url('/vilesci'),
|
||||
'CIS' => CIS_ROOT
|
||||
),
|
||||
'system/infocenter/InfoCenter/infocenterFreigegeben' => array(
|
||||
'FH-Complete' => base_url('index.ci.php/'),
|
||||
'Vilesci' => base_url('/vilesci'),
|
||||
'CIS' => CIS_ROOT
|
||||
)
|
||||
);
|
||||
|
||||
@@ -57,3 +62,27 @@ $config['navigation_menu']['Vilesci/index'] = array(
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
//HIDDEN as long as filter is revised
|
||||
//$config['navigation_menu']['system/infocenter/InfoCenter/index'] = array(
|
||||
// 'Freigegeben' => array(
|
||||
// 'link' => base_url('index.ci.php/system/infocenter/InfoCenter/infocenterFreigegeben'),
|
||||
// 'description' => 'Freigegeben',
|
||||
// 'icon' => 'thumbs-up'
|
||||
// ));
|
||||
|
||||
$config['navigation_menu']['system/infocenter/InfoCenter/showDetails'] = array(
|
||||
'Freigegeben' => array(
|
||||
'link' => base_url('index.ci.php/system/infocenter/InfoCenter/infocenterFreigegeben'),
|
||||
'description' => 'Freigegeben',
|
||||
'icon' => 'thumbs-up'
|
||||
));
|
||||
|
||||
$config['navigation_menu']['system/infocenter/InfoCenter/infocenterFreigegeben'] = array(
|
||||
'Zurück' => array(
|
||||
'link' => base_url('index.ci.php/system/infocenter/InfoCenter/index'),
|
||||
'description' => 'Zurück',
|
||||
'icon' => 'angle-left'
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -22,20 +22,22 @@ class Phrase extends APIv1_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the phrases library
|
||||
$this->load->library('PhrasesLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function getPhrase()
|
||||
{
|
||||
$phrase_id = $this->get('phrase_id');
|
||||
|
||||
|
||||
if (isset($phrase_id))
|
||||
{
|
||||
$result = $this->phraseslib->getPhrase($phrase_id);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -43,9 +45,9 @@ class Phrase extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function getPhrases()
|
||||
{
|
||||
@@ -55,11 +57,11 @@ class Phrase extends APIv1_Controller
|
||||
$orgeinheit_kurzbz = $this->get('orgeinheit_kurzbz');
|
||||
$orgform_kurzbz = $this->get('orgform_kurzbz');
|
||||
$blockTags = $this->get('blockTags');
|
||||
|
||||
|
||||
if (isset($app) && isset($sprache))
|
||||
{
|
||||
$result = $this->phraseslib->getPhrases($app, $sprache, $phrase, $orgeinheit_kurzbz, $orgform_kurzbz, $blockTags);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -69,7 +71,7 @@ class Phrase extends APIv1_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function postPhrase()
|
||||
{
|
||||
@@ -83,7 +85,7 @@ class Phrase extends APIv1_Controller
|
||||
{
|
||||
$result = $this->PhraseModel->insert($this->post());
|
||||
}
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -91,9 +93,12 @@ class Phrase extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _validate($phrase = null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@ class InfoCenter extends VileSci_Controller
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Note added',
|
||||
'message' => 'Note with title %s was added'
|
||||
),
|
||||
'updatenotiz' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Note updated',
|
||||
'message' => 'Note with title %s was updated'
|
||||
)
|
||||
);
|
||||
private $uid; // contains the UID of the logged user
|
||||
@@ -88,7 +93,12 @@ class InfoCenter extends VileSci_Controller
|
||||
{
|
||||
$this->load->view('system/infocenter/infocenter.php');
|
||||
}
|
||||
|
||||
|
||||
public function infocenterFreigegeben()
|
||||
{
|
||||
$this->load->view('system/infocenter/infocenterFreigegeben.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization function, gets person and prestudent data and loads the view with the data
|
||||
* @param $person_id
|
||||
@@ -122,7 +132,7 @@ class InfoCenter extends VileSci_Controller
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* unlocks page from edit by a person, redirects to overview filter page
|
||||
* @param $person_id
|
||||
@@ -352,7 +362,7 @@ class InfoCenter extends VileSci_Controller
|
||||
|
||||
$this->_redirectToStart($prestudent_id, 'ZgvPruef');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves a new Notiz for a person
|
||||
* @param $person_id
|
||||
@@ -376,6 +386,44 @@ class InfoCenter extends VileSci_Controller
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($result->retval));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a new Notiz for a person
|
||||
* @param int $notiz_id
|
||||
* @param int $person_id
|
||||
* @return bool true if success
|
||||
*/
|
||||
public function updateNotiz($notiz_id, $person_id)
|
||||
{
|
||||
$titel = $this->input->post('notiztitel');
|
||||
$text = $this->input->post('notiz');
|
||||
|
||||
$result = $this->NotizModel->update(
|
||||
$notiz_id,
|
||||
array(
|
||||
'titel' => $titel,
|
||||
'text' => $text,
|
||||
'verfasser_uid' => $this->uid,
|
||||
"updateamum" => 'NOW()',
|
||||
"updatevon" => $this->uid
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$json = FALSE;
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$json = TRUE;
|
||||
|
||||
//set log "Notiz updated"
|
||||
$this->_log($person_id, 'updatenotiz', array($titel));
|
||||
}
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads Notizen view for a person, helper for reloading after ajax request
|
||||
@@ -499,7 +547,7 @@ class InfoCenter extends VileSci_Controller
|
||||
'children' => array()
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->_fillFilters($listFiltersSent, $filtersarray['abgeschickt']);
|
||||
$this->_fillFilters($listFiltersNotSent, $filtersarray['nichtabgeschickt']);
|
||||
|
||||
|
||||
@@ -10,7 +10,17 @@ class FHC_Controller extends CI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
||||
$this->load->helper('fhcauth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper to load phrases using the PhrasesLib
|
||||
* NOTE: The library is loaded with the alias 'p', so must me used with this alias in the rest of the code.
|
||||
* EX: $this->p->t(<category>, <phrase name>)
|
||||
*/
|
||||
public function loadPhrases($categories, $language = null)
|
||||
{
|
||||
$this->load->library('PhrasesLib', array($categories, $language), 'p');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,38 +4,40 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PhrasesLib
|
||||
{
|
||||
private $_ci; // Code igniter instance
|
||||
private $_phrases; // Contains the retrived phrases
|
||||
|
||||
/**
|
||||
* Loads parser library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//require_once APPPATH.'config/message.php';
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->ci =& get_instance();
|
||||
// CI parser
|
||||
$this->_ci->load->library('parser');
|
||||
|
||||
// Loads message configuration
|
||||
$this->ci->config->load('message');
|
||||
|
||||
$this->ci->load->library('parser');
|
||||
|
||||
$this->ci->load->model('system/Phrase_model', 'PhraseModel');
|
||||
$this->ci->load->model('system/Phrasentext_model', 'PhrasentextModel');
|
||||
$this->_ci->load->model('system/Phrase_model', 'PhraseModel');
|
||||
$this->_ci->load->model('system/Phrasentext_model', 'PhrasentextModel');
|
||||
|
||||
$this->ci->load->helper('language');
|
||||
// Loads helper message to manage returning messages
|
||||
$this->ci->load->helper('message');
|
||||
$this->_ci->load->helper('message');
|
||||
|
||||
// Workaround to use more parameters in the construct since PHP doesn't support many constructors
|
||||
$this->_extend_construct(func_get_args());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* getPhrase() - will load a spezific Phrase
|
||||
* getPhrase() - loads a specific Phrase
|
||||
*/
|
||||
public function getPhrase($phrase_id)
|
||||
{
|
||||
if (empty($phrase_id))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
if (empty($phrase_id)) return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$phrase = $this->ci->PhraseModel->load($phrase_id);
|
||||
return $phrase;
|
||||
return $this->_ci->PhraseModel->load($phrase_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,8 +45,7 @@ class PhrasesLib
|
||||
*/
|
||||
public function getPhraseByApp($app = null)
|
||||
{
|
||||
$phrases = $this->ci->PhraseModel->loadWhere(array('app' => $app));
|
||||
return $phrases;
|
||||
return $this->_ci->PhraseModel->loadWhere(array('app' => $app));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,11 +53,9 @@ class PhrasesLib
|
||||
*/
|
||||
public function getPhraseInhalt($phrase_id)
|
||||
{
|
||||
if (empty($phrase_id))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
if (empty($phrase_id)) return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$phrasentext = $this->ci->PhrasentextModel->loadWhere(array('phrase_id' => $phrase_id));
|
||||
return $phrasentext;
|
||||
return $this->_ci->PhrasentextModel->loadWhere(array('phrase_id' => $phrase_id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,11 +63,9 @@ class PhrasesLib
|
||||
*/
|
||||
public function delPhrasentext($phrasentext_id)
|
||||
{
|
||||
if (empty($phrasentext_id))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
if (empty($phrasentext_id)) return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$phrasentext = $this->ci->PhrasentextModel->delete(array('phrasentext_id' => $phrasentext_id));
|
||||
return $phrasentext;
|
||||
return $this->_ci->PhrasentextModel->delete(array('phrasentext_id' => $phrasentext_id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,11 +73,9 @@ class PhrasesLib
|
||||
*/
|
||||
public function savePhrase($phrase_id, $data)
|
||||
{
|
||||
if (empty($data))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
if (empty($data)) return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$phrase = $this->ci->PhraseModel->update($phrase_id, $data);
|
||||
return $phrase;
|
||||
return $this->_ci->PhraseModel->update($phrase_id, $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,32 +85,33 @@ class PhrasesLib
|
||||
public function getPhrasentextById($phrasentext_id)
|
||||
{
|
||||
if (empty($phrasentext_id))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
return error($this->_ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
|
||||
$phrasentext = $this->ci->PhrasentextModel->load($phrasentext_id);
|
||||
return $phrasentext;
|
||||
return $this->_ci->PhrasentextModel->load($phrasentext_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* getPhrases()
|
||||
* getPhrases() - Retrives phrases from the DB
|
||||
* The given parameter are the same needed to read from the table system.tb_phrase
|
||||
*/
|
||||
public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null, $blockTags = null)
|
||||
{
|
||||
if (isset($app) && isset($sprache))
|
||||
{
|
||||
$result = $this->ci->PhraseModel->getPhrases($app, $sprache, $phrase, $orgeinheit_kurzbz, $orgform_kurzbz);
|
||||
|
||||
$result = $this->_ci->PhraseModel->getPhrases($app, $sprache, $phrase, $orgeinheit_kurzbz, $orgform_kurzbz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$parser = new \Netcarver\Textile\Parser();
|
||||
|
||||
// Textile parser
|
||||
$textileParser = new \Netcarver\Textile\Parser();
|
||||
|
||||
for ($i = 0; $i < count($result->retval); $i++)
|
||||
{
|
||||
// If no <p> tags required
|
||||
if ($blockTags == 'no')
|
||||
{
|
||||
$tmpText = $parser->textileThis($result->retval[$i]->text); // Parse
|
||||
|
||||
$tmpText = $textileParser->textileThis($result->retval[$i]->text); // Parse
|
||||
|
||||
// Removes tags <p> and </p> from the beginning and from the end of the string if they are present
|
||||
// NOTE: Those tags are usually, but not always, added by the textile parser
|
||||
if (strlen($tmpText) >= 7)
|
||||
@@ -129,12 +125,12 @@ class PhrasesLib
|
||||
$tmpText = substr($tmpText, 0, strlen($tmpText) - 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result->retval[$i]->text = $tmpText;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result->retval[$i]->text = $parser->textileThis($result->retval[$i]->text);
|
||||
$result->retval[$i]->text = $textileParser->textileThis($result->retval[$i]->text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,8 +148,7 @@ class PhrasesLib
|
||||
*/
|
||||
public function insertPhraseinhalt($data)
|
||||
{
|
||||
$phrasentext = $this->ci->PhrasentextModel->insert($data);
|
||||
return $phrasentext;
|
||||
return $this->_ci->PhrasentextModel->insert($data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,8 +156,7 @@ class PhrasesLib
|
||||
*/
|
||||
public function getVorlagetextById($vorlagestudiengang_id)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id);
|
||||
return $vorlagetext;
|
||||
return $this->_ci->VorlageStudiengangModel->load($vorlagestudiengang_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,8 +164,7 @@ class PhrasesLib
|
||||
*/
|
||||
public function updatePhraseInhalt($phrasentext_id, $data)
|
||||
{
|
||||
$phrasentext = $this->ci->PhrasentextModel->update($phrasentext_id, $data);
|
||||
return $phrasentext;
|
||||
return $this->_ci->PhrasentextModel->update($phrasentext_id, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,8 +173,84 @@ class PhrasesLib
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
{
|
||||
if (empty($text))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
$text = $this->ci->parser->parse_string($text, $data, true);
|
||||
return $text;
|
||||
return error($this->_ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
|
||||
return $this->_ci->parser->parse_string($text, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function t($category, $phrase, $parameters = array(), $orgeinheit_kurzbz = null, $orgform_kurzbz = null)
|
||||
{
|
||||
if (isset($this->_phrases) && is_array($this->_phrases))
|
||||
{
|
||||
for ($i = 0; $i < count($this->_phrases); $i++)
|
||||
{
|
||||
$_phrase = $this->_phrases[$i];
|
||||
|
||||
if ($_phrase->category == $category
|
||||
&& $_phrase->phrase == $phrase
|
||||
&& $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz
|
||||
&& $_phrase->orgform_kurzbz== $orgform_kurzbz)
|
||||
{
|
||||
if ($parameters == null) $parameters = array();
|
||||
|
||||
echo $this->_ci->parser->parse_string($_phrase->text, $parameters, true)."\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Extends the functionalities of the constructor of this class
|
||||
* This is a workaround to use more parameters in the construct since PHP doesn't support many constructors
|
||||
* The new accepted parameters are:
|
||||
* - categories: could be a string or an array of strings. These are the categories used to load phrases
|
||||
* - language: optional parameter must be a string. It's used to load phrases
|
||||
*/
|
||||
private function _extend_construct($params)
|
||||
{
|
||||
// Checks if the $params is an array with at least one element
|
||||
if (is_array($params) && count($params) > 0)
|
||||
{
|
||||
$parameters = $params[0]; // temporary variable
|
||||
|
||||
// If there are parameters
|
||||
if (is_array($parameters) && count($parameters) > 0)
|
||||
{
|
||||
$categories = $parameters[0]; // categories is always the first parameter
|
||||
if (!is_array($categories)) // if it is not an array, then convert into one
|
||||
{
|
||||
$categories = array($categories);
|
||||
}
|
||||
|
||||
// Use the given language if present, otherwise retrives the language for the logged user
|
||||
$language = DEFAULT_LANGUAGE;
|
||||
if (count($parameters) == 2 && !empty($parameters[1]) && is_string($parameters[1]))
|
||||
{
|
||||
$language = $parameters[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$language = $this->_ci->PersonModel->getLanguage(getAuthUID());
|
||||
}
|
||||
|
||||
// Loads phrases
|
||||
$phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, $language);
|
||||
|
||||
// If there are phrases loaded then store them in the property _phrases
|
||||
if (hasData($phrases))
|
||||
{
|
||||
$this->_phrases = $phrases->retval;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,4 +213,37 @@ class Person_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array('uid' => $uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrives the language of the user by the UID
|
||||
* Gets all the persons related to the given UID and starting from the most recent person in DB
|
||||
* tries to find a valid language (!= null), if found is returned, otherwise is returned the
|
||||
* default global language of the system
|
||||
*/
|
||||
public function getLanguage($uid)
|
||||
{
|
||||
$language = DEFAULT_LANGUAGE;
|
||||
|
||||
$this->addJoin('public.tbl_benutzer', 'person_id');
|
||||
$this->addOrder('public.tbl_person.updateamum', 'DESC');
|
||||
$this->addOrder('public.tbl_person.insertvon', 'DESC');
|
||||
|
||||
$persons = $this->loadWhere(array('uid' => $uid));
|
||||
|
||||
if (hasData($persons))
|
||||
{
|
||||
for ($i = 0; $i < count($persons->retval); $i++)
|
||||
{
|
||||
$person = $persons->retval[$i];
|
||||
|
||||
if (!empty($person->sprache))
|
||||
{
|
||||
$language = $person->sprache;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $language;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class Phrase_model extends DB_Model
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('system.tbl_phrasentext', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
|
||||
$parametersArray = array('app' => $app, 'sprache' => $sprache);
|
||||
|
||||
$query = 'SELECT phrase,
|
||||
@@ -36,7 +36,7 @@ class Phrase_model extends DB_Model
|
||||
if (isset($phrase))
|
||||
{
|
||||
$parametersArray['phrase'] = $phrase;
|
||||
|
||||
|
||||
if (is_array($phrase))
|
||||
{
|
||||
$query .= ' AND phrase IN ?';
|
||||
@@ -57,7 +57,24 @@ class Phrase_model extends DB_Model
|
||||
$parametersArray['orgform_kurzbz'] = $orgform_kurzbz;
|
||||
$query .= ' AND orgform_kurzbz = ?';
|
||||
}
|
||||
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads phrases using category(s) and language as keys
|
||||
* The retrived fields are category, phrase, orgeinheit_kurzbz, orgform_kurzbz and text
|
||||
* They are ordered by p.category, p.phrase, pt.orgeinheit_kurzbz DESC and pt.orgform_kurzbz DESC'
|
||||
*/
|
||||
public function getPhrasesByCategoryAndLanguage($categories, $language)
|
||||
{
|
||||
$query = 'SELECT p.category, p.phrase, pt.orgeinheit_kurzbz, pt.orgform_kurzbz, pt.text
|
||||
FROM system.tbl_phrase p
|
||||
INNER JOIN system.tbl_phrasentext pt USING(phrase_id)
|
||||
WHERE p.category IN ?
|
||||
AND pt.sprache = ?
|
||||
ORDER BY p.category, p.phrase, pt.orgeinheit_kurzbz DESC, pt.orgform_kurzbz DESC';
|
||||
|
||||
return $this->execQuery($query, array($categories, $language));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<form method="post" action="#" id="notizform">
|
||||
<input type="hidden" name="hiddenNotizId" value="">
|
||||
<div class="form-group">
|
||||
<div class="text-center">
|
||||
<label>Notiz hinzufügen</label>
|
||||
@@ -19,6 +20,8 @@
|
||||
<textarea name="notiz" class="form-control" rows="10" cols="32"></textarea>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<!--abbrechen-button only shown when notice is clicked to be changed-->
|
||||
<button type="reset" class="btn btn-default" style="display: none">Abbrechen</button>
|
||||
<button type="submit" class="btn btn-default">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Info Center',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'customCSSs' => 'skin/tablesort_bootstrap.css',
|
||||
'customJSs' => array('include/js/bootstrapper.js', 'include/js/infocenter/infocenterPersonDataset.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Freigegebene Interessenten</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
|
||||
$APP = 'infocenter';
|
||||
$NOTBEFORE = '2018-03-01 18:00:00';
|
||||
$filterWidgetArray = array(
|
||||
'query' => '
|
||||
SELECT
|
||||
p.person_id AS "PersonId",
|
||||
p.vorname AS "Vorname",
|
||||
p.nachname AS "Nachname",
|
||||
p.gebdatum AS "Gebdatum",
|
||||
p.staatsbuergerschaft AS "Nation",
|
||||
(
|
||||
SELECT zeitpunkt
|
||||
FROM system.tbl_log
|
||||
WHERE taetigkeit_kurzbz IN(\'bewerbung\',\'kommunikation\')
|
||||
AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\')
|
||||
AND person_id = p.person_id
|
||||
ORDER BY zeitpunkt DESC
|
||||
LIMIT 1
|
||||
) AS "LastAction",
|
||||
(
|
||||
SELECT insertvon
|
||||
FROM system.tbl_log
|
||||
WHERE taetigkeit_kurzbz IN(\'bewerbung\',\'kommunikation\')
|
||||
AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\')
|
||||
AND person_id = p.person_id
|
||||
ORDER BY zeitpunkt DESC
|
||||
LIMIT 1
|
||||
) AS "User/Operator",
|
||||
(
|
||||
SELECT
|
||||
pss.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
|
||||
LIMIT 1
|
||||
) AS "Studiensemester",
|
||||
(
|
||||
SELECT pss.bewerbung_abgeschicktamum
|
||||
FROM
|
||||
public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
|
||||
LIMIT 1
|
||||
) AS "SendDate",
|
||||
(
|
||||
SELECT count(*)
|
||||
FROM
|
||||
public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
LIMIT 1
|
||||
) AS "AnzahlAbgeschickt",
|
||||
array_to_string(
|
||||
(
|
||||
SELECT array_agg(distinct UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz))
|
||||
FROM
|
||||
public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
LIMIT 1
|
||||
),\', \'
|
||||
) AS "StgAbgeschickt",
|
||||
pl.zeitpunkt AS "LockDate",
|
||||
pl.lockuser as "LockUser"
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN (SELECT person_id, zeitpunkt, uid as lockuser FROM system.tbl_person_lock WHERE app = \''.$APP.'\') pl USING(person_id)
|
||||
WHERE
|
||||
EXISTS(
|
||||
SELECT 1
|
||||
FROM
|
||||
public.tbl_prestudent
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE
|
||||
person_id=p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND \'Interessent\' = (SELECT status_kurzbz FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_prestudent.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
AND EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
public.tbl_prestudentstatus
|
||||
WHERE
|
||||
prestudent_id = tbl_prestudent.prestudent_id
|
||||
AND status_kurzbz = \'Interessent\'
|
||||
AND (bestaetigtam IS NOT NULL AND (bewerbung_abgeschicktamum is null OR bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\'))
|
||||
AND studiensemester_kurzbz IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
)
|
||||
)
|
||||
ORDER BY "LastAction" ASC
|
||||
',
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'checkboxes' => 'PersonId',
|
||||
'additionalColumns' => array('Details'),
|
||||
'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Nation','Letzte Aktion','Letzter Bearbeiter',
|
||||
'StSem','GesendetAm','NumAbgeschickt','Studiengänge','Sperrdatum','GesperrtVon'),
|
||||
'formatRaw' => function($datasetRaw) {
|
||||
|
||||
$datasetRaw->{'Details'} = sprintf(
|
||||
'<a href="%s%s">Details</a>',
|
||||
base_url('index.ci.php/system/infocenter/InfoCenter/showDetails/'),
|
||||
$datasetRaw->{'PersonId'}
|
||||
);
|
||||
|
||||
if ($datasetRaw->{'SendDate'} == null)
|
||||
{
|
||||
$datasetRaw->{'SendDate'} = 'Not sent';
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'SendDate'} = date_format(date_create($datasetRaw->{'SendDate'}),'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'LastAction'} == null)
|
||||
{
|
||||
$datasetRaw->{'LastAction'} = '-';
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'LastAction'} = date_format(date_create($datasetRaw->{'LastAction'}),'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'User/Operator'} == '')
|
||||
{
|
||||
$datasetRaw->{'User/Operator'} = 'NA';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'LockDate'} == null)
|
||||
{
|
||||
$datasetRaw->{'LockDate'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'LockUser'} == null)
|
||||
{
|
||||
$datasetRaw->{'LockUser'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'StgAbgeschickt'} == null)
|
||||
{
|
||||
$datasetRaw->{'StgAbgeschickt'} = 'N/A';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'Nation'} == null)
|
||||
{
|
||||
$datasetRaw->{'Nation'} = '-';
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
},
|
||||
'markRow' => function($datasetRaw) {
|
||||
|
||||
if ($datasetRaw->LockDate != null)
|
||||
{
|
||||
return FilterWidget::DEFAULT_MARK_ROW_CLASS;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$filterId = isset($_GET[InfoCenter::FILTER_ID]) ? $_GET[InfoCenter::FILTER_ID] : null;
|
||||
|
||||
if (isset($filterId) && is_numeric($filterId))
|
||||
{
|
||||
$filterWidgetArray[InfoCenter::FILTER_ID] = $filterId;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterWidgetArray['app'] = $APP;
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
$filterWidgetArray['filterKurzbz'] = 'InfoCenterNotSentApplicationAll';
|
||||
}
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
@@ -1,19 +1,20 @@
|
||||
<table id="notiztable" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Datum</th>
|
||||
<th>Notiz</th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($notizen as $notiz): ?>
|
||||
<tr data-toggle="tooltip"
|
||||
title="<?php echo isset($notiz->text) ? strip_tags($notiz->text) : '' ?>">
|
||||
<td><?php echo date_format(date_create($notiz->insertamum), 'd.m.Y H:i:s') ?></td>
|
||||
<td><?php echo html_escape($notiz->titel) ?></td>
|
||||
<td><?php echo $notiz->verfasser_uid ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<table id="notiztable" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Datum</th>
|
||||
<th>Notiz</th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($notizen as $notiz): ?>
|
||||
<tr data-toggle="tooltip"
|
||||
title="<?php echo isset($notiz->text) ? strip_tags($notiz->text) : '' ?>">
|
||||
<td><?php echo date_format(date_create($notiz->insertamum), 'd.m.Y H:i:s') ?></td>
|
||||
<td><?php echo html_escape($notiz->titel) ?></td>
|
||||
<td><?php echo $notiz->verfasser_uid ?></td>
|
||||
<td style="display: none"><?php echo $notiz->notiz_id ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -287,10 +287,25 @@
|
||||
</div>
|
||||
</div><!-- /.column-absage -->
|
||||
<div class="col-lg-6 text-right">
|
||||
<?php
|
||||
$disabled = $disabledTxt = '';
|
||||
if (empty($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum))
|
||||
{
|
||||
$disabled = 'disabled';
|
||||
$disabledTxt = 'Die Bewerbung muss erst abgeschickt worden sein.';
|
||||
}
|
||||
|
||||
if ($zgvpruefung->studiengangtyp !== 'b')
|
||||
{
|
||||
$disabled = 'disabled';
|
||||
$disabledTxt = 'Nur Bachelorstudiengänge können freigegeben werden.';;
|
||||
}
|
||||
?>
|
||||
<div>
|
||||
<button type="button" class="btn btn-default"
|
||||
<button type="button" class="btn btn-default" <?php echo $disabled ?>
|
||||
data-toggle="modal"
|
||||
data-target="#freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
data-target="#freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>"
|
||||
data-toggle="tooltip" title="<?php echo $disabledTxt ?>">
|
||||
Freigabe an Studiengang
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -96,11 +96,45 @@ $(document).ready(
|
||||
$("#notizform").on("submit", function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
var personId = $("#hiddenpersonid").val();
|
||||
var notizId = $("#notizform :input[name='hiddenNotizId']").val();
|
||||
var data = $(this).serializeArray();
|
||||
saveNotiz(personid, data);
|
||||
|
||||
if (notizId !== '')
|
||||
{
|
||||
updateNotiz(notizId, personId, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
saveNotiz(personId, data);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
//update notiz - autofill notizform
|
||||
$(document).on("click", "#notiztable tbody tr", function ()
|
||||
{
|
||||
var notizId = $(this).find("td:eq(3)").html();
|
||||
var notizTitle = $(this).find("td:eq(1)").text();
|
||||
var notizContent = this.title;
|
||||
|
||||
$("#notizform label:first").text("Notiz ändern").css("color", "red");
|
||||
$("#notizform :input[type='reset']").css("display", "inline-block");
|
||||
|
||||
$("#notizform :input[name='hiddenNotizId']").val(notizId);
|
||||
$("#notizform :input[name='notiztitel']").val(notizTitle);
|
||||
$("#notizform :input[name='notiz']").val(notizContent);
|
||||
}
|
||||
);
|
||||
|
||||
//update notiz - abbrechen-button: reset styles
|
||||
$("#notizform :input[type='reset']").click(function ()
|
||||
{
|
||||
resetNotizFields();
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
@@ -220,6 +254,29 @@ function saveNotiz(personid, data)
|
||||
});
|
||||
}
|
||||
|
||||
function updateNotiz(notizId, personId, data)
|
||||
{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: data,
|
||||
url: "../updateNotiz/" + notizId + "/" + personId,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
refreshNotizen();
|
||||
refreshLog();
|
||||
resetNotizFields();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// methods executed after ajax (refreshers)
|
||||
|
||||
@@ -252,7 +309,7 @@ function refreshNotizen()
|
||||
//readd tablesorter
|
||||
formatNotizTable()
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
function formatNotizTable()
|
||||
@@ -261,3 +318,10 @@ function formatNotizTable()
|
||||
tablesortAddPager("notiztable", "notizpager", 10);
|
||||
$("#notiztable").addClass("table-condensed");
|
||||
}
|
||||
|
||||
function resetNotizFields()
|
||||
{
|
||||
$("#notizform :input[name='hiddenNotizId']").val("");
|
||||
$("#notizform label:first").text("Notiz hinzufügen").css("color", "black");
|
||||
$("#notizform :input[type='reset']").css("display", "none");
|
||||
}
|
||||
|
||||
+528
-526
File diff suppressed because it is too large
Load Diff
+14
-1
@@ -1901,7 +1901,7 @@ if (!$result = @$db->db_query("SELECT category FROM system.tbl_phrase LIMIT 1"))
|
||||
echo '<br>Added comment to system.tbl_phrase.category';
|
||||
}
|
||||
|
||||
// UNIQUE INDEX uidx_filters_app_dataset_name_filter_kurzbz
|
||||
// UNIQUE INDEX uidx_phrase_category_phrase
|
||||
if ($result = $db->db_query("SELECT 0 FROM pg_class WHERE relname = 'uidx_phrase_category_phrase'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
@@ -1914,6 +1914,19 @@ if ($result = $db->db_query("SELECT 0 FROM pg_class WHERE relname = 'uidx_phrase
|
||||
}
|
||||
}
|
||||
|
||||
// UNIQUE INDEX uidx_phrasestext_phrase_id_sprache_orgeinheit_kurzbz_orgform_kurzbz
|
||||
if ($result = $db->db_query("SELECT 0 FROM pg_class WHERE relname = 'uidx_phrasestext_phrase_id_sprache_orgeinheit_kurzbz_orgform_kurzbz'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = 'CREATE UNIQUE INDEX uidx_phrasestext_phrase_id_sprache_orgeinheit_kurzbz_orgform_kurzbz ON system.tbl_phrasentext USING btree (phrase_id, sprache, orgeinheit_kurzbz, orgform_kurzbz);';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>uidx_phrasestext_phrase_id_sprache_orgeinheit_kurzbz_orgform_kurzbz '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Created unique uidx_phrasestext_phrase_id_sprache_orgeinheit_kurzbz_orgform_kurzbz';
|
||||
}
|
||||
}
|
||||
|
||||
// End changes to Phrases
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user