mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-05 06:09:27 +00:00
Merge branch 'feature-39592/vereinfachte_Sicht_fuer_Assistenz'
This commit is contained in:
@@ -0,0 +1,387 @@
|
||||
<?php
|
||||
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class BetriebsmittelP extends FHCAPI_Controller
|
||||
{
|
||||
private $person_id = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAllBetriebsmittel' => ['admin:r', 'assistenz:r'],
|
||||
'addNewBetriebsmittel' => self::PERM_LOGGED,
|
||||
'updateBetriebsmittel' => self::PERM_LOGGED,
|
||||
'loadBetriebsmittel' => ['admin:r', 'assistenz:r'],
|
||||
'deleteBetriebsmittel' => self::PERM_LOGGED,
|
||||
'getTypenBetriebsmittel' => ['admin:r', 'assistenz:r'],
|
||||
'loadInventarliste' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
|
||||
//Load Models
|
||||
$this->load->model('ressource/Betriebsmittel_model', 'BetriebsmittelModel');
|
||||
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
|
||||
|
||||
// Additional Permission Checks
|
||||
if ($this->router->method == 'addNewBetriebsmittel') {
|
||||
$this->person_id = current(array_slice($this->uri->rsegments, 2));
|
||||
|
||||
$this->checkPermissionsForPerson(
|
||||
$this->person_id,
|
||||
['admin:rw', 'mitarbeiter:rw', 'basis/betriebsmittel:rw'],
|
||||
['admin:rw', 'assistenz:rw', 'basis/betriebsmittel:rw']
|
||||
);
|
||||
} elseif ($this->router->method == 'updateBetriebsmittel' || $this->router->method == 'deleteBetriebsmittel') {
|
||||
$betriebsmittelperson_id = current(array_slice($this->uri->rsegments, 2));
|
||||
$result = $this->BetriebsmittelpersonModel->load($betriebsmittelperson_id);
|
||||
if (!hasData($result))
|
||||
show_404();
|
||||
$this->person_id = current(getData($result))->person_id;
|
||||
|
||||
$this->checkPermissionsForPerson(
|
||||
$this->person_id,
|
||||
['admin:rw', 'mitarbeiter:rw', 'basis/betriebsmittel:rw'],
|
||||
['admin:rw', 'assistenz:rw', 'basis/betriebsmittel:rw']
|
||||
);
|
||||
}
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'wawi'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getAllBetriebsmittel($type_id, $id)
|
||||
{
|
||||
$result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($id, $type_id);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
protected function validateNewOrUpdate()
|
||||
{
|
||||
$this->form_validation->set_rules('betriebsmitteltyp', 'Typ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired')
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('kaution', 'Kaution', 'numeric|less_than_equal_to[9999.99]', [
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric')
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('ausgegebenam', 'Ausgegeben am', 'required|is_valid_date', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired')
|
||||
]);
|
||||
|
||||
if ($this->input->post('ausgegebenam') && $this->input->post('retouram')) {
|
||||
$this->form_validation->set_rules('retouram', 'Retour am', [
|
||||
'is_valid_date',
|
||||
['is_not_before_ausgegebenam', function ($value) {
|
||||
return (new DateTime($value) >= new DateTime($this->input->post('ausgegebenam')));
|
||||
}]
|
||||
], [
|
||||
'is_not_before_ausgegebenam' => $this->p->t('wawi', 'error_retourdatumVorAusgabe')
|
||||
]);
|
||||
} else {
|
||||
$this->form_validation->set_rules('retouram', 'Retour am', 'is_valid_date');
|
||||
}
|
||||
|
||||
$this->form_validation->set_rules('anmerkung', 'Anmerkung', 'max_length[256]');
|
||||
|
||||
if ($this->input->post('betriebsmitteltyp') == 'Inventar') {
|
||||
// Inventar
|
||||
$this->form_validation->set_rules('betriebsmittel_id', 'Inventarnummer', 'required');
|
||||
} elseif ($this->input->post('betriebsmitteltyp') == 'Zutrittskarte') {
|
||||
// Zutrittskarte
|
||||
if ($this->input->post('nummer') === null && $this->input->post('nummer') === null) {
|
||||
$this->form_validation->set_rules('nummer', 'Nummer', 'required', [
|
||||
'required' => $this->p->t('wawi', 'error_zutrittskarteOhneNummer')
|
||||
]);
|
||||
$this->form_validation->set_rules('nummer2', 'Nummer2', 'required', [
|
||||
'required' => $this->p->t('wawi', 'error_zutrittskarteOhneNummer')
|
||||
]);
|
||||
} else {
|
||||
if ($this->input->post('nummer') === null) {
|
||||
$result = $this->BetriebsmittelpersonModel->loadViewWhere([
|
||||
'betriebsmitteltyp' => $this->input->post('betriebsmitteltyp'),
|
||||
'nummer2' => $this->input->post('nummer2'),
|
||||
'person_id !=' => $this->person_id,
|
||||
'retouram IS NULL' => null
|
||||
]);
|
||||
if (hasData($result))
|
||||
$this->form_validation->set_rules('nummer2', 'Nummer2', 'is_array', [
|
||||
'is_array' => $this->p->t('wawi', 'error_bmZutrittskarteOccupied', (array)current(getData($result)))
|
||||
]);
|
||||
} else {
|
||||
$result = $this->BetriebsmittelpersonModel->loadViewWhere([
|
||||
'betriebsmitteltyp' => $this->input->post('betriebsmitteltyp'),
|
||||
'nummer' => $this->input->post('nummer'),
|
||||
'person_id !=' => $this->person_id,
|
||||
'retouram IS NULL' => null
|
||||
]);
|
||||
if (hasData($result))
|
||||
$this->form_validation->set_rules('nummer', 'Nummer', 'is_array', [
|
||||
'is_array' => $this->p->t('wawi', 'error_bmZutrittskarteOccupied', (array)current(getData($result)))
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
public function addNewBetriebsmittel($person_id)
|
||||
{
|
||||
$this->form_validation->set_rules('uid', 'UID', [
|
||||
['uid_in_person', function ($value) use ($person_id) {
|
||||
if ($value === null)
|
||||
return true;
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere([
|
||||
'uid' => $value,
|
||||
'person_id' => $person_id
|
||||
]);
|
||||
|
||||
return hasData($result);
|
||||
}]
|
||||
], [
|
||||
'uid_in_person' => $this->p->t('person', 'error_uidNotInPerson')
|
||||
]);
|
||||
$this->validateNewOrUpdate();
|
||||
|
||||
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');
|
||||
$nummer = $this->input->post('nummer');
|
||||
$nummer2 = $this->input->post('nummer2');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kaution = $this->input->post('kaution');
|
||||
$ausgegebenam = $this->input->post('ausgegebenam');
|
||||
$retouram = $this->input->post('retouram');
|
||||
$uid = $this->input->post('uid');
|
||||
|
||||
// NOTE(chris): transform_kartennummer
|
||||
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer)
|
||||
$nummer = is_numeric($nummer) ? ltrim($nummer, "0") : hexdec(implode("", array_reverse(str_split(trim($nummer)))));
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
if ($betriebsmitteltyp != 'Inventar') {
|
||||
$this->BetriebsmittelModel->addOrder('updateamum', 'DESC');
|
||||
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer === null) {
|
||||
$result = $this->BetriebsmittelModel->loadWhere([
|
||||
'betriebsmitteltyp' => $betriebsmitteltyp,
|
||||
'nummer2' => $nummer2
|
||||
]);
|
||||
} else {
|
||||
$result = $this->BetriebsmittelModel->loadWhere([
|
||||
'betriebsmitteltyp' => $betriebsmitteltyp,
|
||||
'nummer' => $nummer
|
||||
]);
|
||||
}
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($data) {
|
||||
$data = current($data);
|
||||
if ($data->nummer !== $nummer || $data->nummer2 !== $nummer2 || $data->beschreibung !== $beschreibung) {
|
||||
$result = $this->BetriebsmittelModel->update($data->betriebsmittel_id, [
|
||||
'nummer' => $nummer,
|
||||
'nummer2' => $nummer2,
|
||||
'beschreibung' => $beschreibung,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
$betriebsmittel_id = $data->betriebsmittel_id;
|
||||
} else {
|
||||
$result = $this->BetriebsmittelModel->insert([
|
||||
'betriebsmitteltyp' => $betriebsmitteltyp,
|
||||
'nummer' => $nummer,
|
||||
'nummer2' => $nummer2,
|
||||
'beschreibung' => $beschreibung,
|
||||
'reservieren' => false,
|
||||
'ort_kurzbz' => null,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
]);
|
||||
$betriebsmittel_id = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->BetriebsmittelpersonModel->insert([
|
||||
'person_id' => $person_id,
|
||||
'betriebsmittel_id' => $betriebsmittel_id,
|
||||
'anmerkung' => $anmerkung,
|
||||
'kaution' => $kaution,
|
||||
'ausgegebenam' => $ausgegebenam,
|
||||
'retouram' => $retouram,
|
||||
'uid' => $uid,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function updateBetriebsmittel($betriebsmittelperson_id)
|
||||
{
|
||||
$this->validateNewOrUpdate();
|
||||
|
||||
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');
|
||||
$nummer = $this->input->post('nummer');
|
||||
$nummer2 = $this->input->post('nummer2');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kaution = $this->input->post('kaution');
|
||||
$ausgegebenam = $this->input->post('ausgegebenam');
|
||||
$retouram = $this->input->post('retouram');
|
||||
|
||||
// NOTE(chris): transform_kartennummer
|
||||
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer)
|
||||
$nummer = is_numeric($nummer) ? ltrim($nummer, "0") : hexdec(implode("", array_reverse(str_split(trim($nummer)))));
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
if ($betriebsmitteltyp != 'Inventar') {
|
||||
$found = false;
|
||||
if ($nummer !== null && $betriebsmittel_id !== null) {
|
||||
$result = $this->BetriebsmittelModel->load($betriebsmittel_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if ($data && current($data)->nummer == $nummer) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$this->BetriebsmittelModel->addOrder('updateamum', 'DESC');
|
||||
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer === null) {
|
||||
$result = $this->BetriebsmittelModel->loadWhere([
|
||||
'betriebsmitteltyp' => $betriebsmitteltyp,
|
||||
'nummer2' => $nummer2
|
||||
]);
|
||||
} else {
|
||||
$result = $this->BetriebsmittelModel->loadWhere([
|
||||
'betriebsmitteltyp' => $betriebsmitteltyp,
|
||||
'nummer' => $nummer
|
||||
]);
|
||||
}
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
$data = current($data);
|
||||
if ($data->nummer !== $nummer || $data->nummer2 !== $nummer2 || $data->beschreibung !== $beschreibung) {
|
||||
$result = $this->BetriebsmittelModel->update($data->betriebsmittel_id, [
|
||||
'nummer' => $nummer,
|
||||
'nummer2' => $nummer2,
|
||||
'beschreibung' => $beschreibung,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
$betriebsmittel_id = $data->betriebsmittel_id;
|
||||
} else {
|
||||
$result = $this->BetriebsmittelModel->insert([
|
||||
'betriebsmitteltyp' => $betriebsmitteltyp,
|
||||
'nummer' => $nummer,
|
||||
'nummer2' => $nummer2,
|
||||
'beschreibung' => $beschreibung,
|
||||
'reservieren' => false,
|
||||
'ort_kurzbz' => null,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
]);
|
||||
$betriebsmittel_id = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->BetriebsmittelpersonModel->update($betriebsmittelperson_id, [
|
||||
'betriebsmittel_id' => $betriebsmittel_id,
|
||||
'anmerkung' => $anmerkung,
|
||||
'kaution' => $kaution,
|
||||
'ausgegebenam' => $ausgegebenam,
|
||||
'retouram' => $retouram,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function loadBetriebsmittel($betriebsmittelperson_id)
|
||||
{
|
||||
$result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($betriebsmittelperson_id, 'betriebsmittelperson_id');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!hasData($result)) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Betriebsmittelperson_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function deleteBetriebsmittel($betriebsmittelperson_id)
|
||||
{
|
||||
$result = $this->BetriebsmittelpersonModel->delete(
|
||||
array('betriebsmittelperson_id' => $betriebsmittelperson_id,
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Betriebsmittelperson_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function getTypenBetriebsmittel()
|
||||
{
|
||||
$this->load->model('ressource/Betriebsmitteltyp_model', 'BetriebsmitteltypModel');
|
||||
|
||||
$this->BetriebsmitteltypModel->addOrder('beschreibung', 'ASC');
|
||||
$result = $this->BetriebsmitteltypModel->load(); // load All
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function loadInventarliste($searchString)
|
||||
{
|
||||
$result = $this->BetriebsmittelModel->loadInventarliste($searchString);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,68 @@ abstract class Auth_Controller extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for Permissions depending if the given person is a
|
||||
* Mitarbeiter and/or Student
|
||||
* and exits/outputs an error if they are not met.
|
||||
*
|
||||
* @param integer $person_id
|
||||
* @param array $permMa Perms if the person is a Mitarbeiter
|
||||
* @param array $permStud Perms if the person is a Student
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function checkPermissionsForPerson($person_id, $permMa, $permStud)
|
||||
{
|
||||
$res = $this->hasPermissionsForPerson($person_id, $permMa, $permStud);
|
||||
|
||||
if ($res) {
|
||||
$perm = array_keys(array_flip(array_merge($res|1 ? $permMa : [], $res|2 ? $permStud : [])));
|
||||
$this->_outputAuthError([$this->router->method => $perm]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for Permissions depending if the given person is a
|
||||
* Mitarbeiter and/or Student
|
||||
* and returns the result.
|
||||
*
|
||||
* @param integer $person_id
|
||||
* @param array $permMa Perms if the person is a Mitarbeiter
|
||||
* @param array $permStud Perms if the person is a Student
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function hasPermissionsForPerson($person_id, $permMa, $permStud)
|
||||
{
|
||||
$res = 0;
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->PersonModel->addJoin('public.tbl_benutzer', 'person_id');
|
||||
$this->PersonModel->addJoin('public.tbl_mitarbeiter', 'uid = mitarbeiter_uid');
|
||||
$result = $this->PersonModel->load($person_id);
|
||||
if (hasData($result)) {
|
||||
if ($this->permissionlib->isEntitled(['a' => $permMa], 'a'))
|
||||
return 0;
|
||||
$res = 1;
|
||||
}
|
||||
$this->PersonModel->addJoin('public.tbl_prestudent', 'person_id');
|
||||
$result = $this->PersonModel->load($person_id);
|
||||
if (hasData($result)) {
|
||||
$permStudConverted = [];
|
||||
foreach (getData($result) as $row) {
|
||||
foreach ($permStud as $k => $v) {
|
||||
if (!isset($permStudConverted[$k])) {
|
||||
$permStudConverted[$k] = $this->permissionlib->convertAccessType($v);
|
||||
}
|
||||
if ($this->permissionlib->isBerechtigt($permStudConverted[$k][0], $permStudConverted[$k][1], $row->studiengang_kz))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
$res += 2;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs an error message and sets the HTTP Header.
|
||||
* This function is protected so that it can be overwritten.
|
||||
|
||||
@@ -422,3 +422,79 @@ function isValidDate($dateString)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Collection of utility functions for form validation purposes
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* check if string can be converted to a date
|
||||
*/
|
||||
function is_valid_date($dateString)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (new DateTime($dateString)) !== false;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check if given permissions are met
|
||||
*/
|
||||
function has_write_permissions($value, $permissions = '')
|
||||
{
|
||||
if (!$permissions)
|
||||
$permissions = $value;
|
||||
$permissions = explode(',', $permissions);
|
||||
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('AuthLib');
|
||||
$CI->load->library('PermissionLib');
|
||||
|
||||
return $CI->permissionlib->hasAtLeastOne(
|
||||
$permissions,
|
||||
'sometable',
|
||||
PermissionLib::WRITE_RIGHT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* check if has permissions for a studiengang_kz
|
||||
*/
|
||||
function has_permissions_for_stg($studiengang_kz, $permissions = '')
|
||||
{
|
||||
if (!$permissions)
|
||||
return false;
|
||||
$permissions = explode(',', $permissions);
|
||||
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('AuthLib');
|
||||
$CI->load->library('PermissionLib');
|
||||
|
||||
foreach ($permissions as $perm) {
|
||||
if (strpos($perm, PermissionLib::PERMISSION_SEPARATOR) === false) {
|
||||
$CI->addError(
|
||||
'The given permission does not use the correct format',
|
||||
FHCAPI_Controller::ERROR_TYPE_GENERAL
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
list($perm, $accesstype) = explode(PermissionLib::PERMISSION_SEPARATOR, $perm);
|
||||
$at = '';
|
||||
if (strpos($accesstype, PermissionLib::READ_RIGHT) !== false)
|
||||
$at = PermissionLib::SELECT_RIGHT; // S
|
||||
if (strpos($accesstype, PermissionLib::WRITE_RIGHT) !== false)
|
||||
$at .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID
|
||||
|
||||
if ($CI->permissionlib->isBerechtigt($perm, $at, $studiengang_kz))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* CodeIgniter
|
||||
*
|
||||
* An open source application development framework for PHP
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
*/
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$lang['form_validation_has_write_permissions'] = 'You have no rights to edit {field} field.';
|
||||
$lang['form_validation_is_valid_date'] = 'The date format is invalid or out of range.';
|
||||
$lang['form_validation_has_permissions_for_stg'] = 'You have no rights for stg {field}.';
|
||||
@@ -147,19 +147,7 @@ class PermissionLib
|
||||
if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false)
|
||||
{
|
||||
// Retrieves permission and required access type from the $requiredPermissions array
|
||||
list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]);
|
||||
|
||||
$accessType = '';
|
||||
|
||||
// Set the access type
|
||||
if (strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false)
|
||||
{
|
||||
$accessType = PermissionLib::SELECT_RIGHT; // S
|
||||
}
|
||||
if (strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false)
|
||||
{
|
||||
$accessType .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID
|
||||
}
|
||||
list($permission, $accessType) = $this->convertAccessType($permissions[$pCounter]);
|
||||
|
||||
if (!isEmptyString($accessType)) // if compliant
|
||||
{
|
||||
@@ -209,6 +197,24 @@ class PermissionLib
|
||||
return $checkPermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves permission and required access type from the newly formatted permission string
|
||||
*
|
||||
* @param string $permission
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function convertAccessType($permission)
|
||||
{
|
||||
list($permission, $reqAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permission);
|
||||
$accessType = '';
|
||||
if (strpos($reqAccessType, PermissionLib::READ_RIGHT) !== false)
|
||||
$accessType = PermissionLib::SELECT_RIGHT;
|
||||
if (strpos($reqAccessType, PermissionLib::WRITE_RIGHT) !== false)
|
||||
$accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT;
|
||||
return [$permission, $accessType];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if at least one of the permissions given as parameter (requiredPermissions) belongs to the authenticated user
|
||||
* It checks the given permissions against a given method (controller method name) and a given permission type (R and/or W)
|
||||
|
||||
@@ -11,4 +11,24 @@ class Betriebsmittel_model extends DB_Model
|
||||
$this->dbTable = 'wawi.tbl_betriebsmittel';
|
||||
$this->pk = 'betriebsmittel_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* load Liste Inventarnummern
|
||||
*/
|
||||
public function loadInventarliste($filter)
|
||||
{
|
||||
$filter = urldecode(strtoLower($filter));
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
bm.inventarnummer, bm.betriebsmitteltyp, bm.betriebsmittel_id, CONCAT(bm.inventarnummer, ' ', bm.beschreibung) as dropdowntext
|
||||
FROM
|
||||
wawi.tbl_betriebsmittel bm
|
||||
WHERE
|
||||
upper(bm.inventarnummer) LIKE '%" .$this->db->escape_like_str($filter)."%'
|
||||
OR
|
||||
lower(bm.inventarnummer) LIKE '%" .$this->db->escape_like_str($filter)."%'";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,49 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
public function getBetriebsmittelData($id, $type_id)
|
||||
{
|
||||
switch ($type_id) {
|
||||
case 'person_id':
|
||||
$cond = 'bmp.person_id';
|
||||
break;
|
||||
case 'uid':
|
||||
$cond = 'bmp.uid';
|
||||
break;
|
||||
case 'betriebsmittelperson_id':
|
||||
$cond = 'bmp.betriebsmittelperson_id';
|
||||
break;
|
||||
default:
|
||||
return error("ID nicht gültig");
|
||||
}
|
||||
|
||||
$query = "
|
||||
SELECT
|
||||
bm.nummer, bmp.person_id, bm.betriebsmitteltyp, bmp.anmerkung as anmerkung, bmp.retouram, TO_CHAR(bmp.retouram::timestamp, 'DD.MM.YYYY') AS format_retour, bmp.ausgegebenam, TO_CHAR(bmp.ausgegebenam::timestamp, 'DD.MM.YYYY') AS format_ausgabe, bm.beschreibung, bmp.uid, bmp.kaution, bm.betriebsmittel_id, bmp.betriebsmittelperson_id, bm.inventarnummer, bm.nummer2
|
||||
FROM
|
||||
wawi.tbl_betriebsmittelperson bmp
|
||||
JOIN
|
||||
wawi.tbl_betriebsmittel bm ON (bmp.betriebsmittel_id = bm.betriebsmittel_id)
|
||||
WHERE
|
||||
" . $cond . " = ? ";
|
||||
|
||||
return $this->execQuery($query, array($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a loadWhere on the vw_betriebsmittelperson DB View
|
||||
*
|
||||
* @param array $where
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function loadViewWhere($where)
|
||||
{
|
||||
$table = $this->dbTable;
|
||||
$this->dbTable = 'public.vw_betriebsmittelperson';
|
||||
$result = $this->loadWhere($where);
|
||||
$this->dbTable = $table;
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import person from "./betriebsmittel/person.js";
|
||||
|
||||
export default {
|
||||
person
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
export default {
|
||||
getAllBetriebsmittel(url, config, params){
|
||||
return this.$fhcApi.get('api/frontend/v1/betriebsmittel/betriebsmittelP/getAllBetriebsmittel/' + params.type + '/' + params.id);
|
||||
},
|
||||
addNewBetriebsmittel(form, person_id, formData) {
|
||||
return this.$fhcApi.post(form, 'api/frontend/v1/betriebsmittel/betriebsmittelP/addNewBetriebsmittel/' +
|
||||
person_id, formData
|
||||
);
|
||||
},
|
||||
loadBetriebsmittel(betriebsmittelperson_id){
|
||||
return this.$fhcApi.post('api/frontend/v1/betriebsmittel/betriebsmittelP/loadBetriebsmittel/' + betriebsmittelperson_id);
|
||||
},
|
||||
updateBetriebsmittel(form, betriebsmittelperson_id, formData) {
|
||||
return this.$fhcApi.post(form, 'api/frontend/v1/betriebsmittel/betriebsmittelP/updateBetriebsmittel/' + betriebsmittelperson_id,
|
||||
formData);
|
||||
},
|
||||
deleteBetriebsmittel(betriebsmittelperson_id){
|
||||
return this.$fhcApi.post('api/frontend/v1/betriebsmittel/betriebsmittelP/deleteBetriebsmittel/' + betriebsmittelperson_id);
|
||||
},
|
||||
getTypenBetriebsmittel(){
|
||||
return this.$fhcApi.get('api/frontend/v1/betriebsmittel/betriebsmittelP/getTypenBetriebsmittel/');
|
||||
},
|
||||
loadInventarliste(query){
|
||||
return this.$fhcApi.get('api/frontend/v1/betriebsmittel/betriebsmittelP/loadInventarliste/' + query);
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,13 @@ import phrasen from "./phrasen.js";
|
||||
import navigation from "./navigation.js";
|
||||
import filter from "./filter.js";
|
||||
import studstatus from "./studstatus.js";
|
||||
import betriebsmittel from "./betriebsmittel.js";
|
||||
|
||||
export default {
|
||||
search,
|
||||
phrasen,
|
||||
navigation,
|
||||
filter,
|
||||
studstatus
|
||||
studstatus,
|
||||
betriebsmittel
|
||||
};
|
||||
|
||||
@@ -0,0 +1,408 @@
|
||||
import {CoreFilterCmpt} from "../filter/Filter.js";
|
||||
|
||||
import BsModal from "../Bootstrap/Modal.js";
|
||||
import CoreForm from '../Form/Form.js';
|
||||
import FormInput from '../Form/Input.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CoreFilterCmpt,
|
||||
BsModal,
|
||||
CoreForm,
|
||||
FormInput
|
||||
},
|
||||
inject: {
|
||||
cisRoot: {
|
||||
from: 'cisRoot'
|
||||
},
|
||||
},
|
||||
props: {
|
||||
endpoint: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
typeId: String,
|
||||
id: {
|
||||
type: [Number, String],
|
||||
required: true
|
||||
},
|
||||
uid: {
|
||||
type: [Number, String],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabulatorOptions: {
|
||||
ajaxURL: 'dummy',
|
||||
ajaxRequestFunc: this.endpoint.getAllBetriebsmittel,
|
||||
ajaxParams: () => {
|
||||
return {
|
||||
type: this.typeId,
|
||||
id: this.id
|
||||
}
|
||||
},
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Nummer", field: "nummer", width: 150},
|
||||
{title: "PersonId", field: "person_id", visible: false},
|
||||
{title: "Typ", field: "betriebsmitteltyp", width: 125},
|
||||
{title: "Anmerkung", field: "anmerkung", visible: false},
|
||||
{title: "Retourdatum", field: "format_retour", width: 128},
|
||||
{title: "Beschreibung", field: "beschreibung"},
|
||||
{title: "UID", field: "uid", width: 87},
|
||||
{title: "Kaution", field: "kaution", visible: false},
|
||||
{title: "Ausgabedatum", field: "format_ausgabe", width: 144, visible: false},
|
||||
{title: "Betriebsmittel ID", field: "betriebsmittel_id", visible: false},
|
||||
{title: "Betriebsmittelperson ID", field: "betriebsmittelperson_id", visible: false},
|
||||
{
|
||||
title: 'Aktionen', field: 'actions',
|
||||
minWidth: 150, // Ensures Action-buttons will be always fully displayed
|
||||
maxWidth: 150,
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-2";
|
||||
|
||||
let button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-print"></i>';
|
||||
button.title = 'Übernahmebestätigung drucken';
|
||||
let cellData = cell.getData();
|
||||
button.addEventListener(
|
||||
'click',
|
||||
(event) =>
|
||||
{
|
||||
let linkToPdf = this.cisRoot +
|
||||
'/content/pdfExport.php?xml=betriebsmittelperson.rdf.php&xsl=Uebernahme&id=' + cellData.betriebsmittelperson_id + '&output=pdf';
|
||||
|
||||
window.open(linkToPdf, '_blank');
|
||||
});
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
button.title = 'Betriebsmittel bearbeiten';
|
||||
button.addEventListener(
|
||||
'click',
|
||||
(event) =>
|
||||
this.actionEditBetriebsmittel(cell.getData().betriebsmittelperson_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-xmark"></i>';
|
||||
button.title = 'Betriebsmittel löschen';
|
||||
button.addEventListener(
|
||||
'click',
|
||||
() =>
|
||||
this.actionDeleteBetriebsmittel(cell.getData().betriebsmittelperson_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
return container;
|
||||
},
|
||||
frozen: true
|
||||
}],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '550',
|
||||
selectableRangeMode: 'click',
|
||||
selectable: true,
|
||||
persistenceID: 'core-betriebsmittel'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async() => {
|
||||
|
||||
await this.$p.loadCategory(['wawi', 'global', 'infocenter']);
|
||||
|
||||
let cm = this.$refs.table.tabulator.columnManager;
|
||||
|
||||
cm.getColumnByField('nummer').component.updateDefinition({
|
||||
title: this.$p.t('wawi', 'nummer')
|
||||
});
|
||||
cm.getColumnByField('anmerkung').component.updateDefinition({
|
||||
title: this.$p.t('global', 'anmerkung')
|
||||
});
|
||||
cm.getColumnByField('format_retour').component.updateDefinition({
|
||||
title: this.$p.t('wawi', 'retourdatum')
|
||||
});
|
||||
cm.getColumnByField('kaution').component.updateDefinition({
|
||||
title: this.$p.t('infocenter', 'kaution')
|
||||
});
|
||||
cm.getColumnByField('format_ausgabe').component.updateDefinition({
|
||||
title: this.$p.t('wawi', 'ausgabedatum')
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
listBetriebsmitteltyp: [],
|
||||
formData: {
|
||||
ausgegebenam : new Date(),
|
||||
betriebsmitteltyp: 'Zutrittskarte'
|
||||
},
|
||||
statusNew: true,
|
||||
filteredInventar: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
id() {
|
||||
this.$refs.table.tabulator.setData('dummy');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
actionEditBetriebsmittel(betriebsmittelperson_id) {
|
||||
this.statusNew = false;
|
||||
this
|
||||
.loadBetriebsmittel(betriebsmittelperson_id)
|
||||
.then(this.$refs.betriebsmittelModal.show);
|
||||
},
|
||||
actionNewBetriebsmittel() {
|
||||
this.resetModal();
|
||||
this.$refs.betriebsmittelModal.show();
|
||||
},
|
||||
actionDeleteBetriebsmittel(betriebsmittelperson_id) {
|
||||
this.$fhcAlert
|
||||
.confirmDelete()
|
||||
.then(result => result
|
||||
? betriebsmittelperson_id
|
||||
: Promise.reject({handled: true}))
|
||||
.then(this.endpoint.deleteBetriebsmittel)
|
||||
.then(result => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
addNewBetriebsmittel() {
|
||||
//just append uid to formdata
|
||||
this.formData.uid = this.uid;
|
||||
if (this.formData.betriebsmitteltyp == 'Inventar')
|
||||
this.formData.betriebsmittel_id = this.formData.inventarData?.betriebsmittel_id;
|
||||
return this.endpoint
|
||||
.addNewBetriebsmittel(this.$refs.betriebsmittelData, this.id, this.formData)
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$refs.betriebsmittelModal.hide();
|
||||
this.resetModal();
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
updateBetriebsmittel(betriebsmittelperson_id) {
|
||||
if (this.formData.betriebsmitteltyp == 'Inventar')
|
||||
this.formData.betriebsmittel_id = this.formData.inventarData?.betriebsmittel_id;
|
||||
return this.endpoint
|
||||
.updateBetriebsmittel(this.$refs.betriebsmittelData, betriebsmittelperson_id, this.formData)
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$refs.betriebsmittelModal.hide();
|
||||
this.resetModal();
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
loadBetriebsmittel(betriebsmittelperson_id) {
|
||||
this.resetModal();
|
||||
this.statusNew = false;
|
||||
return this.endpoint
|
||||
.loadBetriebsmittel(betriebsmittelperson_id)
|
||||
.then(result => {
|
||||
this.formData = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
searchInventar(event) {
|
||||
const encodedQuery = encodeURIComponent(event.query);
|
||||
return this.endpoint
|
||||
.loadInventarliste(encodedQuery)
|
||||
.then(result => {
|
||||
this.filteredInventar = result.data;
|
||||
});
|
||||
},
|
||||
reload() {
|
||||
this.$refs.table.reloadTable();
|
||||
},
|
||||
resetModal() {
|
||||
this.formData = {};
|
||||
this.formData.ausgegebenam = new Date();
|
||||
this.formData.retouram = null;
|
||||
this.formData.betriebsmitteltyp = null;
|
||||
this.formData.nummer = null;
|
||||
this.formData.nummer2 = null;
|
||||
this.formData.kaution = null;
|
||||
this.formData.anmerkung = null;
|
||||
this.formData.beschreibung = null;
|
||||
this.statusNew = true;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
return this.endpoint
|
||||
.getTypenBetriebsmittel()
|
||||
.then(result => {
|
||||
this.listBetriebsmitteltyp = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
template: `
|
||||
<div class="core-betriebsmittel h-100 d-flex flex-column">
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Betriebsmittel"
|
||||
@click:new="actionNewBetriebsmittel"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
|
||||
<!--Modal: betriebsmittelModal-->
|
||||
<bs-modal ref="betriebsmittelModal">
|
||||
<template #title>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('ui', 'add_betriebsmittel')}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$p.t('ui', 'edit_betriebsmittel')}}</p>
|
||||
</template>
|
||||
|
||||
<core-form class="row g-3" ref="betriebsmittelData">
|
||||
<legend>Details</legend>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="select"
|
||||
:label="$p.t('global/typ')"
|
||||
name="betriebsmitteltyp"
|
||||
v-model="formData.betriebsmitteltyp"
|
||||
:disabled="!statusNew"
|
||||
>
|
||||
<option
|
||||
v-for="entry in listBetriebsmitteltyp"
|
||||
:key="entry.betriebsmitteltyp"
|
||||
:value="entry.betriebsmitteltyp"
|
||||
>
|
||||
{{entry.beschreibung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.betriebsmitteltyp == 'Inventar'" class="row mb-3">
|
||||
<form-input
|
||||
type="autocomplete"
|
||||
:label="$p.t('wawi/inventarnummer')"
|
||||
name="betriebsmittel_id"
|
||||
v-model="formData.inventarData"
|
||||
option-label="dropdowntext"
|
||||
:suggestions="filteredInventar"
|
||||
@complete="searchInventar"
|
||||
:min-length="3"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div v-else-if="formData.inventarnummer" class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('wawi/inventarnummer')"
|
||||
name="inventarnummer"
|
||||
v-model="formData.inventarnummer"
|
||||
:disabled="!statusNew"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.betriebsmitteltyp!='Inventar' && !formData.inventarnummer" class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('wawi/nummer')"
|
||||
name="nummer"
|
||||
v-model="formData.nummer"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.betriebsmitteltyp!='Inventar' && !formData.inventarnummer" class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('wawi/nummer') + ' 2'"
|
||||
name="nummer2"
|
||||
v-model="formData.nummer2"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.betriebsmitteltyp!='Inventar'" class="row mb-3">
|
||||
<form-input
|
||||
type="textarea"
|
||||
:label="$p.t('global/beschreibung')"
|
||||
name="beschreibung"
|
||||
v-model="formData.beschreibung"
|
||||
:disabled="formData.inventarnummer"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('infocenter/kaution')"
|
||||
name="kaution"
|
||||
v-model="formData.kaution"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="textarea"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
name="anmerkung"
|
||||
v-model="formData.anmerkung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="DatePicker"
|
||||
:label="$p.t('wawi/ausgegebenam')"
|
||||
name="ausgegebenam"
|
||||
v-model="formData.ausgegebenam"
|
||||
auto-apply
|
||||
:enable-time-picker="false"
|
||||
format="dd.MM.yyyy"
|
||||
preview-format="dd.MM.yyyy"
|
||||
:teleport="true"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="DatePicker"
|
||||
:label="$p.t('wawi/retouram')"
|
||||
name="retouram"
|
||||
v-model="formData.retouram"
|
||||
auto-apply
|
||||
:enable-time-picker="false"
|
||||
format="dd.MM.yyyy"
|
||||
preview-format="dd.MM.yyyy"
|
||||
:teleport="true"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</core-form>
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-primary" @click="statusNew ? addNewBetriebsmittel() : updateBetriebsmittel(formData.betriebsmittelperson_id)">{{$p.t('ui', 'speichern')}}</button>
|
||||
</template>
|
||||
</bs-modal>
|
||||
</div>`
|
||||
}
|
||||
|
||||
@@ -48,8 +48,7 @@ export const CoreFilterCmpt = {
|
||||
default: true
|
||||
},
|
||||
filterType: {
|
||||
type: String,
|
||||
required: true
|
||||
type: String
|
||||
},
|
||||
tabulatorOptions: Object,
|
||||
tabulatorEvents: Array,
|
||||
|
||||
@@ -1378,7 +1378,44 @@ $filters = array(
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'personalverwaltung',
|
||||
'dataset_name' => 'handyverwaltung',
|
||||
'filter_kurzbz' => 'ma4handyverwaltung',
|
||||
'description' => '{MA Handyverwaltung}',
|
||||
'sort' => 1,
|
||||
'default_filter' => true,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "MA Handyverwaltung",
|
||||
"columns": [
|
||||
{"name": "UID"},
|
||||
{"name": "PersonId"},
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "EMail"},
|
||||
{"name": "Unternehmen"},
|
||||
{"name": "Vertragsart"},
|
||||
{"name": "DV_von"},
|
||||
{"name": "DV_bis"},
|
||||
{"name": "Wochenstunden"},
|
||||
{"name": "WS_von"},
|
||||
{"name": "WS_bis"},
|
||||
{"name": "Standardkostenstelle"}
|
||||
],
|
||||
"filters": [
|
||||
{
|
||||
"name": "Nachname",
|
||||
"option": "",
|
||||
"operation": "",
|
||||
"condition": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
);
|
||||
|
||||
// Loop through the filters array
|
||||
|
||||
@@ -2261,6 +2261,26 @@ $phrases = array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'person',
|
||||
'phrase' => 'error_uidNotInPerson',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Die angegebene UID passt nicht zu der angegebenen Person',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Given UID is not assigned to the given Person',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
//**************** CORE/lehre
|
||||
array(
|
||||
@@ -22890,6 +22910,66 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'error_fieldRequired',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Eingabefeld {field} ist erforderlich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The Input Field {field} is required',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'error_fieldNotNumeric',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Eingabefeld {field} darf nur Zahlen enthalten.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The Field {Field} must contain only numbers.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'error_fieldNoValidEmail',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Eingabefeld {field} muss eine gültige Email-Adresse enthalten.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The field {field} must contain a valid email address.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
// Personalverwaltung begin
|
||||
array(
|
||||
'app' => 'core',
|
||||
@@ -26500,6 +26580,368 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
// Betriebsmittel begin
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'successSave',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Speichern erfolgreich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Successfully saved',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'successDelete',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Löschen erfolgreich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Delete successful',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'successAdvance',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Vorrückung Status erfolgreich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Advance status successful',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'successConfirm',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Bestätigung Status erfolgreich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Confirmation status successful',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'betriebsmittel',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betriebsmittel',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Resources',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'betriebsmittel_delete',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betriebsmittel löschen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'delete operating resource',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'betriebsmittel_confirm_delete',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betriebsmittel wirklich löschen?',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Really delete operating resource?',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'add_betriebsmittel',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betriebsmittel anlegen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'create operating resource',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'edit_betriebsmittel',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betriebsmittel bearbeiten',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'edit operating resource',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'nummer',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Nummer',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'number',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'ausgegebenam',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Ausgegeben am',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'issued on',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'retouram',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Retour am',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'returned on',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'retourdatum',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Retourdatum',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'return date',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'ausgabedatum',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Ausgabedatum',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'issue date',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'error_zutrittskarteOhneNummer',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Eine Zutrittskarte muss eine Nummer haben. Um die Zuordnung zu dieser Karte zu löschen entfernen Sie bitte den ganzen Datensatz!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'An access card must have a number. To delete the assignment to this card, please remove the entire data record!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'error_bmZutrittskarteOccupied',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Diese Zutrittskarte ist bereits ausgegeben an: {vorname} {nachname} ({uid})',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'This access card has already been issued to: {vorname} {nachname} ({uid})',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'error_inventarWaehlen',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Bitte wählen Sie das entsprechende Inventar aus dem Drop Down Menü Inventarnummer aus!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Please select the appropriate inventory from the inventory number drop down menu!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'wawi',
|
||||
'phrase' => 'error_retourdatumVorAusgabe',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Retourdatum darf nicht vor Datum der Ausgabe liegen!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The return date must not be before the issue date!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
// Betriebsmittel end
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user