mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
neues Ajaxfile zeitaufzeichnung_bisverwendung.php
This commit is contained in:
@@ -45,6 +45,7 @@ require_once('../../../include/bisverwendung.class.php');
|
||||
require_once('../../../include/studiensemester.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
|
||||
|
||||
$sprache = getSprache();
|
||||
$p=new phrasen($sprache);
|
||||
$sprache_obj = new sprache();
|
||||
@@ -283,6 +284,20 @@ echo '
|
||||
}
|
||||
)
|
||||
|
||||
$("#von_datum").change(
|
||||
function()
|
||||
{
|
||||
var uid = $("#uidpass").val();
|
||||
var Datum = $(this).val();
|
||||
Tag=Datum.substring(0,2);
|
||||
Monat=Datum.substring(3,5);
|
||||
Jahr=Datum.substring(6,10);
|
||||
var day = Jahr + "-" + Monat + "-" + Tag;
|
||||
checkBisverwendung(day,uid);
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
function isVisible()
|
||||
{
|
||||
resetPhasen()
|
||||
@@ -718,6 +733,23 @@ echo '
|
||||
$("#pause_von").val("");
|
||||
$("#pause_bis").val("");
|
||||
}
|
||||
|
||||
function checkBisverwendung(day, uid)
|
||||
{
|
||||
$.ajax({
|
||||
url: "zeitaufzeichnung_bisverwendung.php",
|
||||
data: {
|
||||
day: day,
|
||||
uid: uid
|
||||
},
|
||||
success: function (daten) {
|
||||
$("#outputTest").html(daten);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -1503,6 +1535,8 @@ if ($projekt->getProjekteMitarbeiter($user, true))
|
||||
$von_ts = $datum->mktime_fromtimestamp($datum->formatDatum($von, $format='Y-m-d H:i:s'));
|
||||
$bis_ts = $datum->mktime_fromtimestamp($datum->formatDatum($bis, $format='Y-m-d H:i:s'));
|
||||
$diff = $bis_ts - $von_ts;
|
||||
|
||||
//outputTest Manu
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$p->t("global/von").' - '.$p->t("global/bis").'</td>
|
||||
@@ -1548,8 +1582,26 @@ if ($projekt->getProjekteMitarbeiter($user, true))
|
||||
|
||||
//Homeoffice Checkbox
|
||||
$verwendung = new bisverwendung();
|
||||
$verwendung->getLastAktVerwendung($user);
|
||||
$bvId = $verwendung->bisverwendung_id;
|
||||
|
||||
//Ok: passt
|
||||
//$verwendung->getLastAktVerwendung($user);
|
||||
|
||||
//geht nicht...liefert keine bisverwendung_id, Format?
|
||||
//sql-statement mit '2021-08-20' funktioniert einwandfrei..
|
||||
echo $vonForm = $datum->formatDatum($von, $format='Y-m-d');
|
||||
//echo $vonForm = '2021-08-20';
|
||||
echo $user;
|
||||
// echo $von_ts;
|
||||
$verwendung->getVerwendungDatum($user, $vonForm);
|
||||
|
||||
//gleiches Problem: liefert keine bisverwendung_id
|
||||
// $now = new DateTime('today');
|
||||
// var_dump($now);
|
||||
// echo $now->format('Y-m-d');
|
||||
// $verwendung->getVerwendungDatum($user, $now->format('Y-m-d'));
|
||||
|
||||
echo $bvId = $verwendung->bisverwendung_id;
|
||||
|
||||
|
||||
if ($verwendung->homeoffice)
|
||||
{
|
||||
@@ -1566,6 +1618,7 @@ if ($projekt->getProjekteMitarbeiter($user, true))
|
||||
<td>bisId: ' . $bvId . '</td>
|
||||
|
||||
</tr>
|
||||
|
||||
';
|
||||
}
|
||||
|
||||
@@ -1573,8 +1626,12 @@ if ($projekt->getProjekteMitarbeiter($user, true))
|
||||
{
|
||||
echo "<h2 class='text-warning'>Homeoffice nicht erlaubt</h2>";
|
||||
echo "<td>BisId: $bvId </td>";
|
||||
// echo "<td>Datum: $vonForm </td>";
|
||||
}
|
||||
|
||||
echo '<tr>
|
||||
<td id="outputTest">Manu</td>
|
||||
</tr>';
|
||||
|
||||
|
||||
//Beschreibung
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/* Copyright (C) 2021 Technikum-Wien
|
||||
*
|
||||
* 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 2 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Manuela Thamer <manuela.thamer@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Checks, if there is the possibility for homeoffice for the given bisverwendung of
|
||||
* a certain date.
|
||||
*/
|
||||
|
||||
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/globals.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
require_once('../../../include/Excel/excel.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/mitarbeiter.class.php');
|
||||
require_once('../../../include/zeitaufzeichnung.class.php');
|
||||
require_once('../../../include/projekt.class.php');
|
||||
require_once('../../../include/bisverwendung.class.php');
|
||||
|
||||
|
||||
// if (isset($_GET['day']))
|
||||
// {
|
||||
// $day = $_GET['day'];
|
||||
// echo " es ist ein schöner Tag: " . $day;
|
||||
// echo "<br> bisid: ";
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
// if (isset($_GET['uid'])){
|
||||
// $uid = $_GET['uid'];
|
||||
// $verwendung = new bisverwendung();
|
||||
// $verwendung->getLastAktVerwendung($uid);
|
||||
// echo $bvId = $verwendung->bisverwendung_id;
|
||||
// }
|
||||
|
||||
if ((isset($_GET['uid'])) && (isset($_GET['day']))) {
|
||||
|
||||
$uid = $_GET['uid'];
|
||||
//$day = $_GET['day'];
|
||||
|
||||
//$day = '2021-08-15';
|
||||
$day = "2021-08-15";
|
||||
|
||||
|
||||
$verwendung = new bisverwendung();
|
||||
$verwendung->getLastAktVerwendung($uid); //haut hin
|
||||
//$verwendung->getVerwendungDatum($uid, $day); //hier kommt nix
|
||||
//$verwendung ->getVerwendungDatumMonat($uid, $day);
|
||||
//
|
||||
echo $bvId = $verwendung->bisverwendung_id;
|
||||
echo "check " . $uid . " on day " . $day;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user