mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
fix disappearing searchbar when session expires, add functions to fetch dvs at a certain duedate for valorisation
This commit is contained in:
@@ -21,7 +21,7 @@ class SearchBar extends FHC_Controller
|
||||
// NOTE:
|
||||
// - A user must be authenticated via another controller to access this one
|
||||
// - It is loaded to be able to call the isLogged function later
|
||||
$this->load->library('AuthLib', array(false));
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
// Load the library SearchBarLib
|
||||
$this->load->library('SearchBarLib');
|
||||
|
||||
@@ -247,7 +247,7 @@ EOTXT;
|
||||
$this->validationerrors[] = 'Das Beginndatum muss vor dem Endedatum liegen.';
|
||||
}
|
||||
|
||||
if( $this->checkoverlap && !($this->vertragsart_kurzbz === 'werkvertrag')
|
||||
if( $this->checkoverlap && !(in_array($this->vertragsart_kurzbz, array('werkvertrag', 'studentischehilfskr')) )
|
||||
&& $ci->VertragsbestandteilLib->isOverlappingExistingDV($this) )
|
||||
{
|
||||
$this->validationerrors[] = 'Es existiert bereits ein überlappendes Dienstverhältnis';
|
||||
|
||||
@@ -73,6 +73,11 @@ class VertragsbestandteilLib
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function fetchDienstverhaeltnisse($unternehmen, $stichtag=null, $mitarbeiteruid=null) {
|
||||
$dvs = $this->DienstverhaeltnisModel->fetchDienstverhaeltnisse($unternehmen, $stichtag, $mitarbeiteruid);
|
||||
return $dvs;
|
||||
}
|
||||
|
||||
public function fetchDienstverhaeltnis($dienstverhaeltnis_id)
|
||||
{
|
||||
$result = $this->DienstverhaeltnisModel->load($dienstverhaeltnis_id);
|
||||
|
||||
@@ -143,7 +143,7 @@ EODVIDC;
|
||||
AND
|
||||
dv.oe_kurzbz = ?
|
||||
AND
|
||||
dv.vertragsart_kurzbz != 'werkvertrag'
|
||||
dv.vertragsart_kurzbz NOT IN ('werkvertrag', 'studentischehilfskr')
|
||||
AND
|
||||
?::date <= COALESCE(dv.bis, '2170-12-31'::date)
|
||||
AND
|
||||
@@ -224,4 +224,22 @@ EOSQL;
|
||||
|
||||
}
|
||||
|
||||
public function fetchDienstverhaeltnisse($unternehmen, $stichtag=null, $mitarbeiteruid=null) {
|
||||
$where = "oe_kurzbz = " . $this->escape($unternehmen);
|
||||
if( !is_null($stichtag) )
|
||||
{
|
||||
$where .= " AND " . $this->escape($stichtag) . " BETWEEN COALESCE(von, '1970-01-01') AND COALESCE(bis, '2070-12-31')";
|
||||
}
|
||||
if( !is_null($mitarbeiteruid) )
|
||||
{
|
||||
$where .= " AND mitarbeiter_uid = " . $this->escape($mitarbeiteruid);
|
||||
}
|
||||
$res = $this->loadWhere($where);
|
||||
$dvs = array();
|
||||
if(hasData($res) )
|
||||
{
|
||||
$dvs = getData($res);
|
||||
}
|
||||
return $dvs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,11 @@ export default {
|
||||
this.showsearchresult();
|
||||
this.searchfunction(this.searchsettings)
|
||||
.then(function(response) {
|
||||
that.searchresult = response.data.data;
|
||||
if( response.data?.error === 1 ) {
|
||||
that.error = 'Bei der Suche ist ein Fehler aufgetreten.';
|
||||
} else {
|
||||
that.searchresult = response.data.data;
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
that.error = 'Bei der Suche ist ein Fehler aufgetreten.'
|
||||
|
||||
Reference in New Issue
Block a user