mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
Injection ADDON KU for Multiselect and Print Honorarvertrag
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the VV Config
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Config extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(Manu): permissions
|
||||
parent::__construct([
|
||||
'printDocument' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'person',
|
||||
]);
|
||||
}
|
||||
|
||||
public function printDocument() {
|
||||
|
||||
$params = [];
|
||||
|
||||
Events::trigger('multiActionPrintHonorarvertrag',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($menu[0]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Vertraege extends FHCAPI_Controller
|
||||
@@ -24,11 +25,12 @@ class Vertraege extends FHCAPI_Controller
|
||||
'updateContractStatus' => self::PERM_LOGGED,
|
||||
'deleteLehrauftrag' => self::PERM_LOGGED,
|
||||
'deleteBetreuung' => self::PERM_LOGGED,
|
||||
//TODO(Manu) Berechtigung
|
||||
//TODO(Manu) Berechtigungen
|
||||
'getMitarbeiter' => self::PERM_LOGGED,
|
||||
'getHeader' => self::PERM_LOGGED,
|
||||
'getPersonAbteilung' => self::PERM_LOGGED,
|
||||
'getLeitungOrg' => self::PERM_LOGGED,
|
||||
'getMitarbeiter_uid' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
//Load Models and Libraries
|
||||
@@ -678,7 +680,6 @@ class Vertraege extends FHCAPI_Controller
|
||||
//TODO(Manu) rewrite better
|
||||
return $this->terminateWithSuccess("no benutzerdata", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'personID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
@@ -718,11 +719,29 @@ class Vertraege extends FHCAPI_Controller
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'personID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
/* $result = current(getData($result));
|
||||
$header = $result->name;*/
|
||||
|
||||
//return $this->terminateWithSuccess($header);
|
||||
return $this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
|
||||
public function getMitarbeiter_uid($person_id)
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'Mitarbeitermodel');
|
||||
|
||||
$result = $this->Mitarbeitermodel->getMitarbeiter_uid($person_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
//TODO(Manu) check ErrorLogic
|
||||
return $this->terminateWithSuccess($result);
|
||||
//return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'personID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user