mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-12 17:49:28 +00:00
Injection ADDON KU for Multiselect and Print Honorarvertrag
This commit is contained in:
@@ -4,6 +4,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Vertragsverwaltung extends Auth_Controller
|
||||
{
|
||||
//TODO(Manu) Permissions
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class CI3_Events
|
||||
});
|
||||
self::$eventsSorted[$event] = true;
|
||||
}
|
||||
|
||||
|
||||
foreach (self::$events[$event] as $conf) {
|
||||
$conf[1](...$args);
|
||||
}
|
||||
@@ -46,6 +46,19 @@ class CI3_Events
|
||||
* NOTE(chris): Autoload Events config
|
||||
*/
|
||||
require_once(APPPATH.'config/Events.php');
|
||||
|
||||
foreach (scandir(APPPATH.'config/extensions') as $dir)
|
||||
if ($dir[0] != '.' && file_exists(APPPATH.'config/extensions/'.$dir.'/Events.php'))
|
||||
require_once APPPATH.'config/extensions/'.$dir.'/Events.php';
|
||||
|
||||
$active_addons_array = explode(";", ACTIVE_ADDONS);
|
||||
foreach (scandir(FHCPATH.'addons') as $dir)
|
||||
if ($dir[0] != '.' && file_exists(FHCPATH.'addons/'.$dir.'/Events.php'))
|
||||
{
|
||||
// only includes the Events of the addon if the addon is one of the active addons in the cis config
|
||||
if(in_array($dir,$active_addons_array))
|
||||
{
|
||||
require_once FHCPATH . 'addons/' . $dir . '/Events.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,63 +105,12 @@ class Mitarbeiter_model extends DB_Model
|
||||
*/
|
||||
public function getPersonenWithContractDetails($person_id=null)
|
||||
{
|
||||
/* $qry = "SELECT DISTINCT ON(mitarbeiter_uid) mitarbeiter_uid, person_id, titelpost, titelpre,
|
||||
nachname, vorname, vornamen,
|
||||
TO_CHAR(gebdatum::timestamp, 'DD.MM.YYYY') AS format_gebdatum
|
||||
FROM ((public.tbl_mitarbeiter JOIN public.tbl_benutzer ON(mitarbeiter_uid=uid))
|
||||
JOIN public.tbl_person USING(person_id))
|
||||
LEFT JOIN public.tbl_benutzerfunktion USING(uid)
|
||||
LEFT JOIN public.tbl_benutzerfunktion akt_funk ON tbl_mitarbeiter.mitarbeiter_uid = akt_funk.uid AND akt_funk.funktion_kurzbz = 'fachzuordnung'
|
||||
AND (akt_funk.datum_von IS NULL OR akt_funk.datum_von <= now()) AND (akt_funk.datum_bis IS NULL OR akt_funk.datum_bis >= now())
|
||||
WHERE true";
|
||||
|
||||
if ($fix === true)
|
||||
$qry .= " AND fixangestellt=true";
|
||||
elseif ($fix === false)
|
||||
$qry .= " AND fixangestellt=false";
|
||||
|
||||
if ($aktiv === true)
|
||||
$qry .= " AND tbl_benutzer.aktiv=true";
|
||||
elseif ($aktiv === false)
|
||||
$qry .= " AND tbl_benutzer.aktiv=false";
|
||||
|
||||
if ($verwendung === true)
|
||||
{
|
||||
$qry.=" AND EXISTS(SELECT * FROM bis.tbl_bisverwendung WHERE (ende>now() or ende is null) AND tbl_bisverwendung.mitarbeiter_uid=tbl_mitarbeiter.mitarbeiter_uid)";
|
||||
}
|
||||
elseif ($verwendung === false)
|
||||
{
|
||||
$qry.=" AND NOT EXISTS(SELECT * FROM bis.tbl_bisverwendung WHERE (ende>now() or ende is null) AND tbl_bisverwendung.mitarbeiter_uid=tbl_mitarbeiter.mitarbeiter_uid)";
|
||||
}
|
||||
|
||||
if ($personaccount === true)
|
||||
$qry .= " AND tbl_mitarbeiter.personalnummer >= 0";
|
||||
elseif ($personaccount === false)
|
||||
$qry .= " AND tbl_mitarbeiter.personalnummer < 0";
|
||||
|
||||
$params = array();
|
||||
if (!isEmptyArray($uids))
|
||||
{
|
||||
$qry .= " AND tbl_mitarbeiter.mitarbeiter_uid IN ?";
|
||||
$params[] = $uids;
|
||||
}
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
*/
|
||||
|
||||
//TODO(Manu) filter nach DV-Art? was, wenn mehrere? oder einfach wenn extern ODER fix?
|
||||
//TODO(Manu) email: plus dieses @domainzeugs: mohamed.aburaia@c3p0.ma0068.technikum-wien.at
|
||||
//Standardkostenstelle...
|
||||
//was wenn 2 echte DV? schmarrn
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
b.uid , p.person_id,
|
||||
p.vorname, p.nachname,
|
||||
TO_CHAR(gebdatum::timestamp, 'DD.MM.YYYY') AS format_gebdatum,
|
||||
COALESCE(b.alias, b.uid) AS email,
|
||||
--COALESCE(b.alias, b.uid) AS EMail,
|
||||
--u.bezeichnung AS Unternehmen,
|
||||
STRING_AGG(DISTINCT va.bezeichnung, ', ') AS Vertragsarten,
|
||||
STRING_AGG(DISTINCT u.bezeichnung, ', ') AS Unternehmen,
|
||||
STRING_AGG(d.dienstverhaeltnis_id::TEXT, ', ') AS ids,
|
||||
@@ -180,33 +129,11 @@ class Mitarbeiter_model extends DB_Model
|
||||
JOIN
|
||||
hr.tbl_vertragsart va ON d.vertragsart_kurzbz = va.vertragsart_kurzbz ";
|
||||
|
||||
/* if ($aktiv === true)
|
||||
$qry .= " WHERE b.aktiv = true";
|
||||
elseif ($aktiv === false)
|
||||
$qry .= " WHERE b.aktiv = false";
|
||||
|
||||
if($fix)
|
||||
{
|
||||
$filterVertragsart = "echterdv";
|
||||
|
||||
$filterVertragsart = addslashes($filterVertragsart); // Escaping von Sonderzeichen
|
||||
$qry .= " AND d.vertragsart_kurzbz = '" . $filterVertragsart . "'";
|
||||
}
|
||||
|
||||
if($extern)
|
||||
{
|
||||
$filterVertragsart2 = "externerlehrender";
|
||||
|
||||
$filterVertragsart2 = addslashes($filterVertragsart2); // Escaping von Sonderzeichen
|
||||
$qry .= " AND d.vertragsart_kurzbz = '" . $filterVertragsart2 . "'";
|
||||
}*/
|
||||
|
||||
if($person_id)
|
||||
{
|
||||
$qry .= " WHERE p.person_id = ?";
|
||||
}
|
||||
|
||||
|
||||
$qry.= "
|
||||
GROUP BY
|
||||
b.uid, p.person_id, p.vorname, p.nachname, b.alias
|
||||
@@ -229,37 +156,7 @@ class Mitarbeiter_model extends DB_Model
|
||||
*/
|
||||
function getPersonAbteilung($person_id)
|
||||
{
|
||||
/*
|
||||
$qry = "
|
||||
SELECT tbl_benutzer.uid
|
||||
FROM tbl_mitarbeiter
|
||||
JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text
|
||||
JOIN tbl_person USING (person_id)
|
||||
WHERE tbl_person.person_id=?
|
||||
";
|
||||
|
||||
|
||||
$result = $this->execQuery($qry, array($person_id));
|
||||
|
||||
$uid = current(getData($result));
|
||||
$uid = $uid->uid;
|
||||
|
||||
|
||||
$qry2 ="
|
||||
SELECT
|
||||
bf.benutzerfunktion_id,bf.fachbereich_kurzbz,bf.uid,bf.funktion_kurzbz,bf.updateamum,bf.updatevon,bf.insertamum,bf.insertvon,bf.ext_id,bf.semester,bf.oe_kurzbz,bf.datum_von,bf.datum_bis,bf.bezeichnung,bf.wochenstunden,
|
||||
oe.oe_kurzbz,oe.oe_parent_kurzbz,oe.bezeichnung,oe.organisationseinheittyp_kurzbz,oe.aktiv,oe.mailverteiler,oe.freigabegrenze,oe.kurzzeichen,oe.lehre,oe.standort,oe.warn_semesterstunden_frei,oe.warn_semesterstunden_fix,oe.standort_id
|
||||
FROM tbl_benutzerfunktion bf JOIN public.tbl_organisationseinheit oe USING(oe_kurzbz)
|
||||
WHERE uid = ? AND funktion_kurzbz='oezuordnung'
|
||||
AND datum_von<=now() AND (datum_bis is null OR datum_bis>=now())
|
||||
";
|
||||
|
||||
$result2 = $this->execQuery($qry2, array($uid));
|
||||
|
||||
|
||||
return $result2;*/
|
||||
|
||||
// First Query
|
||||
//TODO(Manu) use function getMitarbeiter_uid
|
||||
$qry = "
|
||||
SELECT tbl_benutzer.uid
|
||||
FROM tbl_mitarbeiter
|
||||
@@ -269,14 +166,12 @@ class Mitarbeiter_model extends DB_Model
|
||||
";
|
||||
$result = $this->execQuery($qry, [$person_id]);
|
||||
|
||||
// Validate and extract UID
|
||||
$data = getData($result);
|
||||
if (empty($data)) {
|
||||
return null; // No UID found
|
||||
}
|
||||
|
||||
$uid = isset($data[0]->uid) ? $data[0]->uid : null;
|
||||
// $uid = isset($data[0]['uid']) ? $data[0]['uid'] : null;
|
||||
|
||||
if (!$uid) {
|
||||
return null; // UID extraction failed
|
||||
@@ -475,4 +370,30 @@ class Mitarbeiter_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
public function getMitarbeiter_uid($person_id){
|
||||
//TODO(Manu) refactor function
|
||||
//and use in function getPersonAbteilung
|
||||
//check function in Vertraege.php
|
||||
$qry = "
|
||||
SELECT tbl_benutzer.uid
|
||||
FROM tbl_mitarbeiter
|
||||
JOIN tbl_benutzer ON CAST(tbl_mitarbeiter.mitarbeiter_uid AS TEXT) = CAST(tbl_benutzer.uid AS TEXT)
|
||||
JOIN tbl_person USING (person_id)
|
||||
WHERE tbl_person.person_id = ?
|
||||
";
|
||||
$result = $this->execQuery($qry, [$person_id]);
|
||||
|
||||
$data = getData($result);
|
||||
if (empty($data)) {
|
||||
return null; // No UID found
|
||||
}
|
||||
//else
|
||||
// $data = current($data);
|
||||
|
||||
// $uid = $data->uid;
|
||||
|
||||
$uid = isset($data[0]->uid) ? $data[0]->uid : null;
|
||||
return $uid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,20 @@ $includesArray = array(
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<?php
|
||||
$configArray = [
|
||||
'generateAlias' => !defined('GENERATE_ALIAS_STUDENT') ? 'notDefined' : GENERATE_ALIAS_STUDENT,
|
||||
'domain' => !defined('DOMAIN') ? 'notDefined' : DOMAIN,
|
||||
'chooseLayout' => !defined('CHOOSE_LAYOUT') ? 'notDefined' : CHOOSE_LAYOUT,
|
||||
];
|
||||
?>
|
||||
|
||||
<div id="main">
|
||||
<router-view
|
||||
stv-root="<?= site_url('Vertragsverwaltung'); ?>"
|
||||
cis-root="<?= CIS_ROOT; ?>"
|
||||
:permissions="<?= htmlspecialchars(json_encode($permissions)); ?>"
|
||||
:config="<?= htmlspecialchars(json_encode($configArray)); ?>"
|
||||
>
|
||||
</router-view>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import person from "./vertraege/person.js";
|
||||
|
||||
export default {
|
||||
person
|
||||
person,
|
||||
configPrintDocument() {
|
||||
return this.$fhcApi.get('api/frontend/v1/vertraege/config/printDocument');
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,9 @@ export default {
|
||||
},
|
||||
getLeitungOrg(oekurzbz){
|
||||
return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/getLeitungOrg/' + oekurzbz);
|
||||
}
|
||||
},
|
||||
getMitarbeiter_uid(person_id){
|
||||
return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getMitarbeiter_uid/' + person_id);
|
||||
},
|
||||
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export default {
|
||||
} else {
|
||||
this.clickedRows.push(rowData);
|
||||
this.sumBetragLehrauftraege += Number(rowData.betrag1);
|
||||
console.log(rowData.betrag1);
|
||||
//console.log(rowData.betrag1);
|
||||
this.handleSumUp();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,14 @@ export default {
|
||||
headerData: {},
|
||||
departmentData: {},
|
||||
leitungData: {},
|
||||
//TODO(Manu) get from config
|
||||
domain: 'c3p0.ma0068.technikum-wien.at',
|
||||
};
|
||||
},
|
||||
inject: {
|
||||
domain: {
|
||||
from: 'configDomain',
|
||||
default: 'technikum-wien.at'
|
||||
},
|
||||
},
|
||||
props: {
|
||||
person_id: Number
|
||||
},
|
||||
@@ -83,7 +87,7 @@ export default {
|
||||
</div>
|
||||
|
||||
<!--show Ma-Details-->
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-10">
|
||||
<h5>{{headerData.titelpre}} {{headerData.vorname}} {{headerData.nachname}} {{headerData.titelpost}} </h5>
|
||||
<strong class="text-muted">{{departmentData.organisationseinheittyp_kurzbz}}</strong> {{departmentData.bezeichnung}} <span v-if="leitungData.uid"> | </span><strong v-if="leitungData.uid" class="text-muted">Vorgesetzte/e </strong>{{leitungData.titelpre}} {{leitungData.vorname}} {{leitungData.nachname}} {{leitungData.titelpost}}
|
||||
<p>
|
||||
|
||||
@@ -59,7 +59,6 @@ export default {
|
||||
if (value == null) {
|
||||
return "0.00";
|
||||
}
|
||||
|
||||
return parseFloat(value).toFixed(2);
|
||||
}
|
||||
},
|
||||
@@ -162,7 +161,21 @@ export default {
|
||||
title: this.$p.t('global', 'aktionen')
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
//is just enabled for ADDON Injection KU: MultiprintHonorarvertrag
|
||||
//(maybe enable also for ADDON FH Burgenland: MultiAccept later)
|
||||
event: 'rowClick',
|
||||
handler: (e, row) => {
|
||||
if (this.dataPrintHonorar.multiselect) {
|
||||
const selectedContract = row.getData().vertrag_id;
|
||||
const status = row.getData().status;
|
||||
const bezeichnung = row.getData().bezeichnung;
|
||||
|
||||
this.toggleRowClick(selectedContract, status, bezeichnung);
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
statusNew: true,
|
||||
formData: { },
|
||||
@@ -174,13 +187,19 @@ export default {
|
||||
vertragsstatus_kurzbz: 'test',
|
||||
datum: new Date(),
|
||||
},
|
||||
dataPrintHonorar: [],
|
||||
triggeredData: [],
|
||||
childData: {},
|
||||
isFilterSet: false,
|
||||
ma_uid: null,
|
||||
clickedRows: [],
|
||||
arraySelectedContracts: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
person_id() {
|
||||
this.$refs.table.reloadTable();
|
||||
this.arraySelectedContracts = [];
|
||||
//this.$refs.table.tabulator.setData('api/frontend/v1/vertraege/vertraege/getAllVertraege/' + this.person_id);
|
||||
},
|
||||
},
|
||||
@@ -218,7 +237,7 @@ export default {
|
||||
const dataToSend = {
|
||||
person_id: this.person_id,
|
||||
formData: this.formData,
|
||||
clickedRows: this.childData, //do I need all Data, maybe smaller array?
|
||||
clickedRows: this.childData, //all data needed, maybe smaller array?
|
||||
};
|
||||
|
||||
return this.endpoint
|
||||
@@ -240,7 +259,7 @@ export default {
|
||||
vertrag_id: vertrag_id,
|
||||
person_id: this.person_id,
|
||||
formData: this.formData,
|
||||
clickedRows: this.childData, //do I need all Data, maybe smaller array?
|
||||
clickedRows: this.childData,
|
||||
};
|
||||
|
||||
return this.endpoint
|
||||
@@ -421,44 +440,111 @@ export default {
|
||||
this.$refs.table.tabulator.clearFilter("status");
|
||||
}
|
||||
},
|
||||
//methods for functionality ADDON KU
|
||||
printContract(){
|
||||
this.getMitarbeiter_uid().then(()=> {
|
||||
|
||||
//check if at least 2 contracts chosen
|
||||
if(this.arraySelectedContracts.length < 2) {
|
||||
this.$fhcAlert.alertError('Bitte mindestens 2 Verträge auswählen');
|
||||
return;
|
||||
}
|
||||
|
||||
//check if status=="Genehmigt"
|
||||
const statusNotGenehmigtExists = this.arraySelectedContracts.some(([_, status]) => status !== 'Genehmigt');
|
||||
if(statusNotGenehmigtExists) {
|
||||
this.$fhcAlert.alertError('Alle Verträge müssen genehmigt sein');
|
||||
return;
|
||||
}
|
||||
|
||||
//build String to Print PDF
|
||||
let vertragString = '';
|
||||
|
||||
this.arraySelectedContracts.forEach(element => {
|
||||
vertragString += '&vertrag_id[]=' + element[0].toString();
|
||||
});
|
||||
|
||||
let linkToPdf = this.dataPrintHonorar.link +
|
||||
'content/pdfExport.php?xml=' + this.dataPrintHonorar.xml + '&xsl=' + this.dataPrintHonorar.xsl + '&mitarbeiter_uid=' + this.ma_uid + vertragString + '&output=pdf&uid=' + this.ma_uid;
|
||||
window.open(linkToPdf, '_blank');
|
||||
});
|
||||
},
|
||||
getMitarbeiter_uid(){
|
||||
return this.endpoint
|
||||
.getMitarbeiter_uid(this.person_id)
|
||||
.then(response => {
|
||||
this.ma_uid = response.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
toggleRowClick(contractId, status, bezeichnung) {
|
||||
const index = this.arraySelectedContracts.findIndex(
|
||||
([id]) => id === contractId
|
||||
);
|
||||
if (index !== -1) {
|
||||
this.arraySelectedContracts.splice(index, 1);
|
||||
} else {
|
||||
this.arraySelectedContracts.push([contractId, status, bezeichnung]);
|
||||
}
|
||||
},
|
||||
clearSelection(){
|
||||
this.arraySelectedContracts = [];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
Promise.all([
|
||||
this.endpoint.getAllContractTypes(),
|
||||
this.endpoint.getAllContractsNotAssigned2(this.person_id),
|
||||
this.endpoint.getAllContractStati(),
|
||||
this.$fhcApi.factory.vertraege.configPrintDocument()
|
||||
])
|
||||
.then(([result1, result2, result3]) => {
|
||||
.then(([result1, result2, result3, result4]) => {
|
||||
this.listContractTypes = result1.data;
|
||||
this.listContractsUnassigned = result2.data;
|
||||
this.listContractStati = result3.data;
|
||||
this.dataPrintHonorar = result4.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
//TODO(Manu) check if necessary
|
||||
/* this.$nextTick(() => {
|
||||
this.$refs.table.tabulator.on("rowClick", (e, row) => {
|
||||
this.contractSelected = row.getData();
|
||||
console.log("selected Row ", this.contractSelected);
|
||||
});
|
||||
});
|
||||
});*/
|
||||
this.getFormattedDate();
|
||||
|
||||
},
|
||||
template: `
|
||||
<div class="core-contracts h-100 d-flex flex-column">
|
||||
|
||||
<!-- injected print functionality for KU Linz (printHonorarvertrag) -->
|
||||
<div v-if="arraySelectedContracts.length >= 2" class="container mt-2">
|
||||
|
||||
<div v-for="item in arraySelectedContracts" :key="item[0]" class="row">
|
||||
<div class="col-md-6">
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
:value="item[2] + ' | ' + item[1] + ' (ID: ' + item[0] + ')'"
|
||||
aria-label="readonly input example"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="ms-auto">
|
||||
<button type="button" class="btn btn-secondary mx-1" @click="clearSelection()"><i class="fa fa-trash"></i></button>
|
||||
<button type="button" class="btn btn-primary o" @click="printContract()">Honorarvertrag drucken</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div
|
||||
class="d-flex justify-content-start align-items-center w-100 pb-3 gap-3"
|
||||
style="max-height: 8rem; overflow: hidden;">
|
||||
<img class="d-block h-100 rounded" alt="profilbild" :src="appRoot + 'cis/public/bild.php?src=person&person_id=' + person_id">
|
||||
<!– <img class="d-block h-100 rounded" alt="profilbild" :src="appRoot + 'cis/public/bild.php?src=person&person_id=' + student.person_id">
|
||||
<h2 class="h4">{{students[0].titlepre}} {{students[0].vorname}} {{students[0].nachname}} {{students[0].titlepost}}</h2>–>
|
||||
</div>-->
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- filter: open means no status abgerechnet yet-->
|
||||
<div class="justify-content-end pb-3">
|
||||
<form-input
|
||||
|
||||
@@ -10,6 +10,21 @@ export default {
|
||||
MitarbeiterDetails,
|
||||
Vertraege
|
||||
},
|
||||
props: {
|
||||
config: Object,
|
||||
permissions: Object, //TODO(Manu)
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
// activeAddonBewerbung: this.activeAddons.split(';').includes('bewerbung'),
|
||||
// configGenerateAlias: this.config.generateAlias,
|
||||
// configChooseLayout: this.config.chooseLayout,
|
||||
configDomain: this.config.domain,
|
||||
//TODO(Manu) check permissions
|
||||
hasSchreibrechtAss: this.permissions['assistenz_schreibrechte'],
|
||||
hasAdminPermission: this.permissions['admin'],
|
||||
}
|
||||
},
|
||||
data() {
|
||||
//TODO(Manu) props for filter: actually not necessary
|
||||
return {
|
||||
@@ -30,6 +45,7 @@ export default {
|
||||
template: `
|
||||
<div>
|
||||
<div class="container-fluid overflow-hidden">
|
||||
<!-- DOM: {{configDomain}} alias {{configAlias}} layout {{configChooseLayout}}-->
|
||||
<div class="row h-100">
|
||||
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
|
||||
<!--<div class="col-md-12">-->
|
||||
|
||||
Reference in New Issue
Block a user