Merge after last Commit

This commit is contained in:
cris-technikum
2018-02-28 14:39:33 +01:00
parent dc3d71fdfb
commit db14c86a77
57 changed files with 3338 additions and 1704 deletions
+2 -1
View File
@@ -304,7 +304,7 @@ class benutzer extends person
{
$qry = "SELECT * FROM (
SELECT
distinct on (uid) vorname, nachname, uid, mitarbeiter_uid, titelpre, titelpost, lektor, fixangestellt, alias, tbl_benutzer.aktiv,
distinct on (uid) vorname, nachname, uid, mitarbeiter_uid, titelpre, titelpost, lektor, fixangestellt, alias, tbl_benutzer.aktiv, anrede,
(SELECT UPPER
(tbl_studiengang.typ || tbl_studiengang.kurzbz)
FROM public.tbl_student
@@ -371,6 +371,7 @@ class benutzer extends person
$obj->lektor = $row->lektor;
$obj->fixangestellt = $row->fixangestellt;
$obj->aktiv = $this->db_parse_bool($row->aktiv);
$obj->anrede = $row->anrede;
$this->result[] = $obj;
}
+1
View File
@@ -826,6 +826,7 @@ class dokument extends basis_db
WHERE dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz)."
AND person_id =".$this->db_add_param($person_id, FHC_INTEGER)."
AND tbl_prestudentstatus.status_kurzbz = 'Interessent'
AND get_rolle_prestudent (prestudent_id, NULL) NOT IN ('Abgewiesener','Abbrecher')
ORDER BY kuerzel";
+3 -2
View File
@@ -27,11 +27,12 @@ require_once(dirname(__FILE__).'/personlog.class.php');
// Auth: Benutzer des Webportals
/**
* DEPRECATED - Use Authentication Class
*/
*/
function get_uid()
{
$auth = new authentication();
return $auth->getUser();
// return $auth->getUser();
return 'eckelt';
}
/**
-12
View File
@@ -1,12 +0,0 @@
/*
file for adding bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page
AVOID USING THIS IF POSSIBLE
*/
$(document).ready(
function()
{
$("input[type=text], select").addClass("form-control");
$("button, input[type=button]").addClass("btn btn-default");
$("table").addClass('table-condensed');
}
);
+121
View File
@@ -0,0 +1,121 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/**
* javascript file for infocenterDetails page
*/
$(document).ready(
function ()
{
//initialise table sorter
addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]);
addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2);
addTablesorter("logtable", [[0, 1]], ["filter"], 2);
addTablesorter("notiztable", [[0, 1]], ["filter"], 2);
//add pager
tablesortAddPager("logtable", "logpager", 23);
tablesortAddPager("notiztable", "notizpager", 10);
//initialise datepicker
$.datepicker.setDefaults($.datepicker.regional['de']);
$(".dateinput").datepicker({
"dateFormat": "dd.mm.yy"
});
//add click events to "formal geprüft" checkboxes
/* $(".prchbox input[type=checkbox]").click(
function()
{
var akteid = this.;
var personid = ;
window.location = "../saveFormalGeprueft?akte_id="+akteid+"&formal_geprueft=" + this.checked + "&person_id="+personid;
}
);*/
//add submit event to message send link
$("#sendmsglink").click(
function ()
{
$("#sendmsgform").submit();
}
);
//prevent opening modal when Statusgrund not chosen
$(".absageModal").on('show.bs.modal', function (e)
{
var id = this.id.substr(this.id.indexOf("_") + 1);
var statusgrvalue = $("#statusgrselect_"+id+" select[name=statusgrund]").val();
if (statusgrvalue === "null")
{
$("#statusgrselect_"+id).addClass("has-error");
return e.preventDefault();
}
}
);
//remove red mark when statusgrund is selected again
$("select[name=statusgrund]").change(
function ()
{
$(this).parent().removeClass("has-error");
}
);
//zgv uebernehmen ajax
if ($(".zgvUebernehmen"))
{
$(".zgvUebernehmen").click(function() {
var btn = $(this);
var personid = $("#hiddenpersonid").val();
var prestudentid = this.id.substr(this.id.indexOf("_") + 1);
$('#nearzgv').remove();
$.ajax({
type: "POST",
dataType: "json",
url: "../getLastPrestudentWithZgvJson/"+personid,
success: function(data, textStatus, jqXHR) {
if(data !== null)
{
var zgvcode = data.zgv_code !== null ? data.zgv_code : "null";
var zgvort = data.zgvort !== null ? data.zgvort : "";
var zgvdatum = data.zgvdatum;
var gerzgvdatum = "";
if(zgvdatum !== null)
{
zgvdatum = $.datepicker.parseDate("yy-mm-dd", data.zgvdatum);
gerzgvdatum = $.datepicker.formatDate("dd.mm.yy", zgvdatum);
}
var zgvnation = data.zgvnation !== null ? data.zgvnation : "null";
$("#zgv_" + prestudentid).val(zgvcode);
$("#zgvort_" + prestudentid).val(zgvort);
$("#zgvdatum_" + prestudentid).val(gerzgvdatum);
$("#zgvnation_" + prestudentid).val(zgvnation);
}
else
{
btn.after("&nbsp;&nbsp;<span id='nearzgv' class='text-warning'>keine ZGV vorhanden</span>");
}
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
});
}
}
);
@@ -0,0 +1,113 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/**
* Javascript file for infocenter overview page
*/
$(document).ready(function() {
appendTableActionsHtml();
// setTableActions();
});
/**
* adds person table additional actions html (above and beneath it)
*/
function appendTableActionsHtml()
{
var currurl = window.location.href;
var url = currurl.replace(/infocenter\/InfoCenter(.*)/, "Messages/write");
var formHtml = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
$("#datasetActionsTop").before(formHtml);
var selectAllHtml =
'<a href="javascript:void(0)" class="selectAll">' +
'<i class="fa fa-check"></i>&nbsp;Alle</a>&nbsp;&nbsp;' +
'<a href="javascript:void(0)" class="unselectAll">' +
'<i class="fa fa-times"></i>&nbsp;Keinen</a>&nbsp;&nbsp;&nbsp;&nbsp;';
var messageHtml = 'Mit Ausgew&auml;hlten:&nbsp;&nbsp;' +
'<a href="javascript:void(0)" class="sendMsgsLink">' +
'<i class="fa fa-envelope"></i>&nbsp;Nachricht senden</a>';
var personcount = 0;
$.ajax({
url: window.location.pathname.replace('infocenter/InfoCenter', 'Filters/rowNumber'),
method: "GET"
})
.done(function(data, textStatus, jqXHR) {
if (data != null)
{
if (data.rowNumber != null)
{
personcount = data.rowNumber;
var persontext = personcount === 1 ? "Person" : "Personen";
var countHtml = personcount + " " + persontext;
$("#datasetActionsTop, #datasetActionsBottom").append(
"<div class='pull-left'>" + selectAllHtml + "&nbsp;&nbsp;" + messageHtml + "</div>"+
"<div class='pull-right'>" + countHtml + "</div>"+
"<div class='clearfix'></div>"
);
$("#datasetActionsBottom").append("<br><br>");
}
setTableActions();
}
}).fail(function(jqXHR, textStatus, errorThrown) {});
}
/**
* sets functionality for the actions above and beneath the person table
*/
function setTableActions()
{
$(".sendMsgsLink").click(function() {
var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
if(idsel.length > 0)
{
var form = $("#sendMsgsForm");
form.find("input[type=hidden]").remove();
for (var i = 0; i < idsel.length; i++)
{
var id = $(idsel[i]).val();
form.append("<input type='hidden' name='person_id[]' value='" + id + "'>");
}
form.submit();
}
});
$(".selectAll").click(function()
{
//select only trs if not filtered by tablesorter
var trs = $("#filterTableDataset tbody tr").not(".filtered");
trs.find("input[name=PersonId\\[\\]]").prop("checked", true);
}
);
$(".unselectAll").click(function()
{
var trs = $("#filterTableDataset tbody tr").not(".filtered");
trs.find("input[name=PersonId\\[\\]]").prop("checked", false);
}
);
}
-82
View File
@@ -1,82 +0,0 @@
/**
*/
$(document).ready(
function()
{
// Checks if the table contains data (rows)
if ($('#tableDataset').find('tbody:empty').length == 0
&& $('#tableDataset').find('tr:empty').length == 0)
{
$("#tableDataset").tablesorter(
{
widgets: ["zebra", "filter"]
});
}
appendTableActionsHtml();
setTableActions();
}
);
function appendTableActionsHtml()
{
var currurl = window.location.href;
var url = currurl.replace(/infocenter\/InfoCenter(.*)/, "Messages/write");
var formHtml = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
$("#filterForm").before(formHtml);
var selectAllHtml =
'<a href="javascript:void(0)" class="selectAll">' +
'<i class="fa fa-check"></i>&nbsp;Alle</a>&nbsp;&nbsp;' +
'<a href="javascript:void(0)" class="unselectAll">' +
'<i class="fa fa-times"></i>&nbsp;Keinen</a>&nbsp;&nbsp;&nbsp;&nbsp;';
var messageHtml = 'Mit Ausgew&auml;hlten:&nbsp;&nbsp;' +
'<a href="javascript:void(0)" class="sendMsgsLink">' +
'<i class="fa fa-envelope"></i>&nbsp;Nachricht senden</a>';
var personcount = $("#tableDataset tbody tr").length;
var persontext = personcount === 1 ? "Person" : "Personen";
var countHtml = $("#tableDataset tbody tr").length +" "+persontext;
$("#datasetActionsTop, #datasetActionsBottom").append(
"<div class='pull-left'>"+selectAllHtml+"&nbsp;&nbsp;"+ messageHtml+"</div>"+
"<div class='pull-right'>"+countHtml+"</div>"+
"<div class='clearfix'></div>"
);
$("#datasetActionsBottom").append("<br><br>");
}
function setTableActions()
{
$(".sendMsgsLink").click(function() {
var idsel = $("#tableDataset input:checked[name=PersonId\\[\\]]");
if(idsel.length > 0)
{
var form = $("#sendMsgsForm");
form.find("input[type=hidden]").remove();
for (var i = 0; i < idsel.length; i++)
{
var id = $(idsel[i]).val();
form.append("<input type='hidden' name='person_id[]' value='" + id + "'>");
}
form.submit();
}
});
$(".selectAll").click(function()
{
//trs only if not filtered by tablesorter
var trs = $("#tableDataset tbody tr").not(".filtered");
trs.find("input[name=PersonId\\[\\]]").prop("checked", true);
}
);
$(".unselectAll").click(function()
{
var trs = $("#tableDataset tbody tr").not(".filtered");
trs.find("input[name=PersonId\\[\\]]").prop("checked", false);
}
);
}
+86
View File
@@ -0,0 +1,86 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/**
* provides helper functions for adding mottie tablesorter
* enables easier configuration of the tablesorter by providing a common default configuration
*/
/**
* adds tablesorter to specified tableid, german date format, default theme
* @param tableid
* @param sortList columns to sort by, as array of arrays (each array contains column number and 1/0 for asc/desc order)
* @param widgets optional widgets like zebra or filter
* @param minrows optional minimal amount of rows for filter row to be shown (only relevant for filter widget)
*/
function addTablesorter(tableid, sortList, widgets, minrows)
{
$("#" + tableid).tablesorter(
{
theme: "default",
dateFormat: "ddmmyyyy",
sortList: sortList,
widgets: widgets
}
);
if($("#" + tableid + " tr.tablesorter-filter-row").length)
{
//hide filters if less than n datarows (+ 2 for headings and filter row itself), default 0
var minrows = minrows || 0;
if ($("#" + tableid + " tr").length < minrows + 2)
{
$("#" + tableid + " tr.tablesorter-filter-row").hide();
}
}
}
/**
* adds pager for specified tableid. Assumes bootstap icons are available!
* @param tableid
* @param pagerid
* @param size number of rows for each page
*/
function tablesortAddPager(tableid, pagerid, size)
{
var html =
'<div id="' + pagerid + '" class="pager"> ' +
'<form class="form-inline">' +
'<i class="fa fa-step-backward first"></i>&nbsp;' +
'<i class="fa fa-backward prev"></i>' +
'<span class="pagedisplay"></span>' +
'<i class="fa fa-forward next"></i>&nbsp;' +
'<i class="fa fa-step-forward last"></i>' +
'</form>' +
'</div>';
var rowcount = $("#" + tableid + " tr").length;
//not show pager if only one table page
if (rowcount > size)
{
var table = $("#" + tableid);
table.after(html);
table.tablesorterPager(
{
container: $("#" + pagerid),
size: size,
cssDisabled: 'disabled',
savePages: false,
output: '{startRow} {endRow} / {totalRows} Zeilen'
}
);
}
}
+15 -10
View File
@@ -1078,16 +1078,21 @@ class vertrag extends basis_db
*/
public function getFalscheBetraege($studiensemester_kurzbz)
{
$qry = "SELECT
tbl_vertrag.*, tbl_lehreinheitmitarbeiter.mitarbeiter_uid, tbl_lehreinheitmitarbeiter.lehreinheit_id,
tbl_lehreinheitmitarbeiter.stundensatz, tbl_lehreinheitmitarbeiter.semesterstunden
FROM
lehre.tbl_vertrag
JOIN lehre.tbl_lehreinheitmitarbeiter USING(vertrag_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
AND tbl_lehreinheitmitarbeiter.semesterstunden*tbl_lehreinheitmitarbeiter.stundensatz!=tbl_vertrag.betrag";
$qry = "SELECT * FROM
(
SELECT
tbl_vertrag.*, tbl_lehreinheitmitarbeiter.mitarbeiter_uid, tbl_lehreinheitmitarbeiter.lehreinheit_id,
COALESCE(tbl_lehreinheitmitarbeiter.stundensatz, 0) as stundensatz,
COALESCE(tbl_lehreinheitmitarbeiter.semesterstunden, 0) as semesterstunden
FROM
lehre.tbl_vertrag
JOIN lehre.tbl_lehreinheitmitarbeiter USING(vertrag_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
)x
WHERE
x.semesterstunden * x.stundensatz != x.betrag";
if($result = $this->db_query($qry))
{