mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-13 18:19:27 +00:00
Merge origin/ci into ci
This commit is contained in:
@@ -91,16 +91,16 @@ class DBTools extends FHC_Controller
|
||||
*/
|
||||
public function migrate($version = 'latest')
|
||||
{
|
||||
if ($this->cli && $this->migration->current() === false)
|
||||
{
|
||||
show_error($this->migration->error_string());
|
||||
}
|
||||
elseif ($version != 'latest' && $version != 'current')
|
||||
echo 'DB-Migration';
|
||||
if ($version != 'latest' && $version != 'current')
|
||||
{
|
||||
$this->__failed('Migration version must be either latest or current');
|
||||
}
|
||||
|
||||
if (!$this->migration->$version())
|
||||
elseif ($this->cli && !$this->migration->$version())
|
||||
{
|
||||
show_error($this->migration->error_string());
|
||||
}
|
||||
elseif (!$this->migration->$version())
|
||||
{
|
||||
$this->__failed();
|
||||
}
|
||||
@@ -181,6 +181,8 @@ class DBTools extends FHC_Controller
|
||||
|
||||
$method = 'seed';
|
||||
$pending = array();
|
||||
|
||||
|
||||
foreach ($seeds as $number => $file)
|
||||
{
|
||||
include_once($file);
|
||||
@@ -203,13 +205,24 @@ class DBTools extends FHC_Controller
|
||||
|
||||
$pending[$number] = array($class, $method);
|
||||
}
|
||||
|
||||
// Now just run the necessary seeds
|
||||
foreach ($pending as $number => $seed)
|
||||
{
|
||||
log_message('debug', 'Seeding '.$method);
|
||||
|
||||
$seed[0] = new $seed[0];
|
||||
call_user_func($seed);
|
||||
if (is_null($name))
|
||||
{
|
||||
log_message('debug', 'Seeding '.$method);
|
||||
|
||||
$seed[0] = new $seed[0];
|
||||
call_user_func($seed);
|
||||
}
|
||||
elseif ($seed[0] == 'Seed_'.$name)
|
||||
{
|
||||
log_message('debug', 'Seeding '.$method);
|
||||
|
||||
$seed[0] = new $seed[0];
|
||||
call_user_func($seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class Adresse extends APIv1_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model PersonModel
|
||||
$this->load->model('person/adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
// Load set the uid of the model to let to check the permissions
|
||||
$this->AdresseModel->setUID($this->_getUID());
|
||||
}
|
||||
@@ -67,4 +67,4 @@ class Adresse extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class TblStudiengang extends FHC_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('organisation/studiengang_model');
|
||||
$this->load->library('form_validation');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$keyword = '';
|
||||
$this->load->library('pagination');
|
||||
|
||||
$config['base_url'] = base_url() . 'studiengang/index/';
|
||||
$config['total_rows'] = $this->studiengang_model->total_rows();
|
||||
$config['per_page'] = 10;
|
||||
$config['uri_segment'] = 3;
|
||||
$config['suffix'] = '.html';
|
||||
$config['first_url'] = base_url() . 'studiengang.html';
|
||||
$this->pagination->initialize($config);
|
||||
|
||||
$start = $this->uri->segment(3, 0);
|
||||
$studiengang = $this->studiengang_model->index_limit($config['per_page'], $start);
|
||||
|
||||
$data = array(
|
||||
'studiengang_data' => $studiengang,
|
||||
'keyword' => $keyword,
|
||||
'pagination' => $this->pagination->create_links(),
|
||||
'total_rows' => $config['total_rows'],
|
||||
'start' => $start,
|
||||
);
|
||||
|
||||
$this->load->view('tbl_studiengang_list', $data);
|
||||
}
|
||||
|
||||
public function search()
|
||||
{
|
||||
$keyword = $this->uri->segment(3, $this->input->post('keyword', TRUE));
|
||||
$this->load->library('pagination');
|
||||
|
||||
if ($this->uri->segment(2)=='search') {
|
||||
$config['base_url'] = base_url() . 'studiengang/search/' . $keyword;
|
||||
} else {
|
||||
$config['base_url'] = base_url() . 'studiengang/index/';
|
||||
}
|
||||
|
||||
$config['total_rows'] = $this->studiengang_model->search_total_rows($keyword);
|
||||
$config['per_page'] = 10;
|
||||
$config['uri_segment'] = 4;
|
||||
$config['suffix'] = '.html';
|
||||
$config['first_url'] = base_url() . 'studiengang/search/'.$keyword.'.html';
|
||||
$this->pagination->initialize($config);
|
||||
|
||||
$start = $this->uri->segment(4, 0);
|
||||
$studiengang = $this->studiengang_model->search_index_limit($config['per_page'], $start, $keyword);
|
||||
|
||||
$data = array(
|
||||
'studiengang_data' => $studiengang,
|
||||
'keyword' => $keyword,
|
||||
'pagination' => $this->pagination->create_links(),
|
||||
'total_rows' => $config['total_rows'],
|
||||
'start' => $start,
|
||||
);
|
||||
$this->load->view('tbl_studiengang_list', $data);
|
||||
}
|
||||
|
||||
public function read($id)
|
||||
{
|
||||
$row = $this->studiengang_model->get_by_id($id);
|
||||
if ($row) {
|
||||
$data = array(
|
||||
);
|
||||
$this->load->view('tbl_studiengang_read', $data);
|
||||
} else {
|
||||
$this->session->set_flashdata('message', 'Record Not Found');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = array(
|
||||
'button' => 'Create',
|
||||
'action' => site_url('studiengang/create_action'),
|
||||
);
|
||||
$this->load->view('tbl_studiengang_form', $data);
|
||||
}
|
||||
|
||||
public function create_action()
|
||||
{
|
||||
$this->_rules();
|
||||
|
||||
if ($this->form_validation->run() == FALSE) {
|
||||
$this->create();
|
||||
} else {
|
||||
$data = array(
|
||||
);
|
||||
|
||||
$this->studiengang_model->insert($data);
|
||||
$this->session->set_flashdata('message', 'Create Record Success');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$row = $this->studiengang_model->get_by_id($id);
|
||||
|
||||
if ($row) {
|
||||
$data = array(
|
||||
'button' => 'Update',
|
||||
'action' => site_url('studiengang/update_action'),
|
||||
);
|
||||
$this->load->view('tbl_studiengang_form', $data);
|
||||
} else {
|
||||
$this->session->set_flashdata('message', 'Record Not Found');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function update_action()
|
||||
{
|
||||
$this->_rules();
|
||||
|
||||
if ($this->form_validation->run() == FALSE) {
|
||||
$this->update($this->input->post('', TRUE));
|
||||
} else {
|
||||
$data = array(
|
||||
);
|
||||
|
||||
$this->studiengang_model->update($this->input->post('', TRUE), $data);
|
||||
$this->session->set_flashdata('message', 'Update Record Success');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$row = $this->studiengang_model->get_by_id($id);
|
||||
|
||||
if ($row) {
|
||||
$this->studiengang_model->delete($id);
|
||||
$this->session->set_flashdata('message', 'Delete Record Success');
|
||||
redirect(site_url('studiengang'));
|
||||
} else {
|
||||
$this->session->set_flashdata('message', 'Record Not Found');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function _rules()
|
||||
{
|
||||
|
||||
$this->form_validation->set_rules('', '', 'trim');
|
||||
$this->form_validation->set_error_delimiters('<span class="text-danger">', '</span>');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/* End of file Studiengang.php */
|
||||
/* Location: ./application/controllers/Studiengang.php */
|
||||
@@ -1,22 +1,62 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Message extends FHC_Controller {
|
||||
class Message extends FHC_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
//$this->load->library('Messaging');
|
||||
$this->load->model('message/Message_model');
|
||||
$this->load->model('person/Person_model');
|
||||
$this->load->library('messaging');
|
||||
//$this->load->model('person/Person_model');
|
||||
//$this->load->model('system/Message_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$person=$this->Person_model->getPersonFromBenutzerUID('pam');
|
||||
$msg_id=1;
|
||||
$msg = $this->Message_model->getMessage($msg_id, $person[0]->person_id);
|
||||
//$this->load->view('welcome_message');
|
||||
//$msg = $this->Message_model->send_new_message(1, $msg_id, 'test', 'This is a test!', 1);
|
||||
//$messages = $this->Message_model->getMessages();
|
||||
$msg = $this->Message_model->load(1);
|
||||
if ($msg->error)
|
||||
show_error($msg->retval);
|
||||
|
||||
$data = array
|
||||
(
|
||||
'message' => $msg->retval[0]
|
||||
);
|
||||
$v = $this->load->view('test.php', $data);
|
||||
}
|
||||
|
||||
public function view($msg_id)
|
||||
{
|
||||
$msg = $this->messaging->getMessage($msg_id);
|
||||
//var_dump($msg);
|
||||
if ($msg->error)
|
||||
show_error($msg->retval);
|
||||
if (count($msg->retval) != 1)
|
||||
show_error('Nachricht nicht vorhanden! ID: '.$msg_id);
|
||||
|
||||
$data = array
|
||||
(
|
||||
'message' => $msg->retval[0]
|
||||
);
|
||||
var_dump($data['message']);
|
||||
$v = $this->load->view('system/message', $data);
|
||||
}
|
||||
|
||||
public function neu()
|
||||
{
|
||||
//$messages = $this->Message_model->getMessages();
|
||||
$msg = $this->Message_model->load($id);
|
||||
if ($msg->error)
|
||||
show_error($msg->retval);
|
||||
if (count($msg->retval) != 1)
|
||||
show_error('Nachricht nicht vorhanden! ID: '.$id);
|
||||
|
||||
$data = array
|
||||
(
|
||||
'message' => $msg->retval[0]
|
||||
);
|
||||
var_dump($data);
|
||||
$v = $this->load->view('system/message', $data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user