mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
Task #404: GUI zum Schreiben von Nachrichten im FAS: 2nd part
This commit is contained in:
@@ -75,7 +75,7 @@ class Message extends APIv1_Controller
|
||||
|
||||
if (isset($token))
|
||||
{
|
||||
$result = $this->messagelib->getMessagesByToken($token);
|
||||
$result = $this->messagelib->getMessageByToken($token);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
@@ -96,6 +96,7 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
$result = $this->messagelib->sendMessage(
|
||||
$this->post()['person_id'],
|
||||
$this->post()['receiver_id'],
|
||||
$this->post()['subject'],
|
||||
$this->post()['body'],
|
||||
PRIORITY_NORMAL,
|
||||
@@ -215,4 +216,4 @@ class Message extends APIv1_Controller
|
||||
|
||||
return $this->_success('Input data are valid');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
<?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 message_old extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* message_old API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model message_oldModel
|
||||
$this->load->model('system/message_old_model', 'message_oldModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getmessage_old()
|
||||
{
|
||||
$message_oldID = $this->get('message_old_id');
|
||||
|
||||
if (isset($message_oldID))
|
||||
{
|
||||
$result = $this->message_oldModel->load($message_oldID);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postmessage_old()
|
||||
{
|
||||
if ($this->_validate($this->post()))
|
||||
{
|
||||
if (isset($this->post()['message_old_id']))
|
||||
{
|
||||
$result = $this->message_oldModel->update($this->post()['message_old_id'], $this->post());
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->message_oldModel->insert($this->post());
|
||||
}
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
private function _validate($message_old = NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user