mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Added parameter "sprache" to method postMessageVorlage of controller Message. It's required.
This commit is contained in:
@@ -118,8 +118,6 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
$validation = $this->_validatePostMessageVorlage($this->post());
|
||||
|
||||
// $this->response($this->post(), REST_Controller::HTTP_OK);
|
||||
|
||||
if (is_object($validation) && $validation->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result = $this->messagelib->sendMessageVorlage(
|
||||
@@ -128,6 +126,7 @@ class Message extends APIv1_Controller
|
||||
$this->post()['vorlage_kurzbz'],
|
||||
$this->post()['oe_kurzbz'],
|
||||
$this->post()['data'],
|
||||
$this->post()['sprache'],
|
||||
isset($this->post()['relationmessage_id']) ? $this->post()['relationmessage_id'] : null,
|
||||
isset($this->post()['orgform_kurzbz']) ? $this->post()['orgform_kurzbz'] : null
|
||||
);
|
||||
@@ -214,6 +213,10 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
return $this->_error('data is not set');
|
||||
}
|
||||
if (!isset($message['sprache']))
|
||||
{
|
||||
return $this->_error('sprache is not set');
|
||||
}
|
||||
|
||||
return $this->_success('Input data are valid');
|
||||
}
|
||||
|
||||
@@ -268,12 +268,12 @@ class MessageLib
|
||||
* @param integer $priority
|
||||
* @return array
|
||||
*/
|
||||
function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null)
|
||||
function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $sprache, $relationmessage_id = null, $orgform_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($sender_id) || !is_numeric($receiver_id))
|
||||
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$result = $this->ci->vorlagelib->loadVorlagetext($vorlage_kurzbz, $oe_kurzbz, $orgform_kurzbz);
|
||||
$result = $this->ci->vorlagelib->loadVorlagetext($vorlage_kurzbz, $oe_kurzbz, $orgform_kurzbz, $sprache);
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS)
|
||||
{
|
||||
if (is_array($result->retval) && count($result->retval) > 0 &&
|
||||
|
||||
@@ -88,12 +88,13 @@ class VorlageLib
|
||||
/**
|
||||
* loadVorlagetext() - will load the best fitting Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @param string $oe_kurzbz OPTIONAL
|
||||
* @param string $orgform_kurzbz OPTIONAL
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @param string $oe_kurzbz OPTIONAL
|
||||
* @param string $orgform_kurzbz OPTIONAL
|
||||
* @param string $sprache OPTIONAL
|
||||
* @return array
|
||||
*/
|
||||
function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz=null, $orgform_kurzbz=null)
|
||||
function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return $this->_error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
@@ -101,7 +102,8 @@ class VorlageLib
|
||||
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array(
|
||||
'vorlage_kurzbz' => $vorlage_kurzbz,
|
||||
'oe_kurzbz' => $oe_kurzbz,
|
||||
'orgform_kurzbz' => $orgform_kurzbz)
|
||||
'orgform_kurzbz' => $orgform_kurzbz,
|
||||
'sprache' => $sprache)
|
||||
);
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user