mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-20 05:29:29 +00:00
Funktion zum Ermitteln der Zeitsperren der letzten Woche hinzugefügt
This commit is contained in:
@@ -12,24 +12,27 @@ class Zeitaufzeichnung_model extends DB_Model
|
||||
$this->pk = 'zeitaufzeichnung_id';
|
||||
}
|
||||
|
||||
public function deleteEntriesForCurrentDay()
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$qry = "DELETE FROM " . $this->dbTable . "
|
||||
WHERE start >= '" . $today . " 00:00:00'
|
||||
AND start <= '" . $today . " 23:59:59';";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
public function zeitaufzeichnungExistsForLastWeekList()
|
||||
{
|
||||
$qry = "SELECT
|
||||
DISTINCT uid
|
||||
FROM campus.tbl_zeitaufzeichnung
|
||||
WHERE date_trunc('day',ende) >= (date_trunc('day', current_date-interval '7' day));";
|
||||
public function deleteEntriesForCurrentDay()
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$qry = "DELETE FROM " . $this->dbTable . "
|
||||
WHERE start >= '" . $today . " 00:00:00'
|
||||
AND start <= '" . $today . " 23:59:59';";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Get list of Persons with Timerecordings within the last week
|
||||
*/
|
||||
public function zeitaufzeichnungExistsForLastWeekList()
|
||||
{
|
||||
$qry = "SELECT
|
||||
DISTINCT uid
|
||||
FROM campus.tbl_zeitaufzeichnung
|
||||
WHERE date_trunc('day',ende) >= (date_trunc('day', current_date-interval '7' day));";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,68 +12,87 @@ class Zeitsperre_model extends DB_Model
|
||||
$this->pk = 'zeitsperre_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Save or update Zeitsperre.
|
||||
*
|
||||
* @param $zeitsperretyp_kurzbz
|
||||
* @param $mitarbeiter_uid
|
||||
* @param $vonDatum
|
||||
* @param $bisDatum
|
||||
* @param null $vonStunde
|
||||
* @param null $bisStunde
|
||||
* @param null $bezeichnung
|
||||
* @param null $vertretung_uid
|
||||
* @param null $erreichbarkeit_kurzbz
|
||||
* @param null $freigabeamum
|
||||
* @param null $freigabevon
|
||||
* @return array
|
||||
*/
|
||||
public function save($zeitsperretyp_kurzbz, $mitarbeiter_uid, $vonDatum, $bisDatum,
|
||||
$vonStunde = null, $bisStunde = null, $bezeichnung = null, $vertretung_uid = null,
|
||||
$erreichbarkeit_kurzbz = null, $freigabeamum = null, $freigabevon = null)
|
||||
{
|
||||
return $this->insert(array(
|
||||
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'vondatum' => $vonDatum,
|
||||
'bisdatum' => $bisDatum,
|
||||
'vonstunde' => $vonStunde,
|
||||
'bisstunde' => $bisStunde,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'vertretung_uid' => $vertretung_uid,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
|
||||
'freigabeamum' => $freigabeamum,
|
||||
'freigabevon' => $freigabevon
|
||||
));
|
||||
}
|
||||
/**
|
||||
* Save or update Zeitsperre.
|
||||
*
|
||||
* @param $zeitsperretyp_kurzbz
|
||||
* @param $mitarbeiter_uid
|
||||
* @param $vonDatum
|
||||
* @param $bisDatum
|
||||
* @param null $vonStunde
|
||||
* @param null $bisStunde
|
||||
* @param null $bezeichnung
|
||||
* @param null $vertretung_uid
|
||||
* @param null $erreichbarkeit_kurzbz
|
||||
* @param null $freigabeamum
|
||||
* @param null $freigabevon
|
||||
* @return array
|
||||
*/
|
||||
public function save($zeitsperretyp_kurzbz, $mitarbeiter_uid, $vonDatum, $bisDatum,
|
||||
$vonStunde = null, $bisStunde = null, $bezeichnung = null, $vertretung_uid = null,
|
||||
$erreichbarkeit_kurzbz = null, $freigabeamum = null, $freigabevon = null)
|
||||
{
|
||||
return $this->insert(array(
|
||||
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'vondatum' => $vonDatum,
|
||||
'bisdatum' => $bisDatum,
|
||||
'vonstunde' => $vonStunde,
|
||||
'bisstunde' => $bisStunde,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'vertretung_uid' => $vertretung_uid,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
|
||||
'freigabeamum' => $freigabeamum,
|
||||
'freigabevon' => $freigabevon
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Zeitsperre.
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function deleteEntriesForCurrentDay()
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$qry = "DELETE FROM " . $this->dbTable . "
|
||||
WHERE vondatum = '" . $today . "';";
|
||||
/**
|
||||
* Delete Zeitsperre.
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function deleteEntriesForCurrentDay()
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$qry = "DELETE FROM " . $this->dbTable . "
|
||||
WHERE vondatum = '" . $today . "';";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
public function getMitarbeiterListWithPendingVacation()
|
||||
{
|
||||
$qry = "SELECT
|
||||
/**
|
||||
* get Employees with pending Vacation entries
|
||||
*/
|
||||
public function getMitarbeiterListWithPendingVacation()
|
||||
{
|
||||
$qry = "SELECT
|
||||
DISTINCT mitarbeiter_uid
|
||||
FROM
|
||||
campus.tbl_zeitsperre
|
||||
WHERE
|
||||
freigabeamum is NULL
|
||||
AND zeitsperretyp_kurzbz='Urlaub'
|
||||
AND vondatum>=now()
|
||||
ORDER BY mitarbeiter_uid ASC;";
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of Persons with Zeitsperre within the last week
|
||||
*/
|
||||
public function zeitsperreExistsForLastWeekList()
|
||||
{
|
||||
$qry = "SELECT
|
||||
DISTINCT mitarbeiter_uid
|
||||
FROM
|
||||
campus.tbl_zeitsperre
|
||||
FROM campus.tbl_zeitsperre
|
||||
WHERE
|
||||
freigabeamum is NULL
|
||||
AND zeitsperretyp_kurzbz='Urlaub'
|
||||
AND vondatum>=now()
|
||||
ORDER BY mitarbeiter_uid ASC;";
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
(vondatum >= now()-'7 days'::interval AND vondatum <= now())
|
||||
OR
|
||||
(bisdatum >= now()-'7 days'::interval AND bisdatum <= now())";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user