mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-07 23:29:28 +00:00
Merge branch 'master' of https://github.com/FH-Complete/FHC-Core
This commit is contained in:
@@ -194,6 +194,26 @@ class InfoCenter extends VileSci_Controller
|
||||
redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'#DokPruef');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets prestudent that was last modified in json format, for ZGV übernehmen
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getLastPrestudentWithZgvJson($person_id)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getLastPrestudent($person_id, true);
|
||||
|
||||
if (isError($prestudent))
|
||||
{
|
||||
show_error($prestudent->retval);
|
||||
}
|
||||
|
||||
$jsonoutput = count($prestudent->retval) > 0 ? $prestudent->retval[0] : null;
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($jsonoutput));
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a zgv for a prestudent. includes Ort, Datum, Nation for bachelor and master.
|
||||
* @param $prestudent_id
|
||||
@@ -225,7 +245,8 @@ class InfoCenter extends VileSci_Controller
|
||||
'zgvmas_code' => $zgvmas_code,
|
||||
'zgvmaort' => $zgvmaort,
|
||||
'zgvmadatum' => $zgvmadatum,
|
||||
'zgvmanation' => $zgvmanation_code
|
||||
'zgvmanation' => $zgvmanation_code,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -249,7 +270,6 @@ class InfoCenter extends VileSci_Controller
|
||||
*/
|
||||
public function saveAbsage($prestudent_id)
|
||||
{
|
||||
//TODO email messaging
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
|
||||
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
@@ -646,7 +666,6 @@ class InfoCenter extends VileSci_Controller
|
||||
foreach ($prestudenten->retval as $prestudent)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent->prestudent_id);
|
||||
$personid = $this->_getPersonAndStudiengangFromPrestudent($person_id);
|
||||
|
||||
if (isError($prestudent))
|
||||
{
|
||||
@@ -668,15 +687,18 @@ class InfoCenter extends VileSci_Controller
|
||||
$zgvpruefungen[] = $zgvpruefung;
|
||||
}
|
||||
|
||||
// Interessenten come first
|
||||
usort($zgvpruefungen, function ($a, $b)
|
||||
{
|
||||
// Interessenten come first, otherwise by bewerbungsdatum desc, then by prestudent_id desc
|
||||
usort($zgvpruefungen, function ($a, $b) {
|
||||
$bewdatesort = strcmp($b->prestudentstatus->bewerbung_abgeschicktamum, $a->prestudentstatus->bewerbung_abgeschicktamum);
|
||||
$defaultsort = $bewdatesort === 0 ? (int)$b->prestudent_id - (int)$a->prestudent_id : $bewdatesort;
|
||||
if (!isset($a->prestudentstatus->status_kurzbz) || !isset($b->prestudentstatus->status_kurzbz))
|
||||
return 0;
|
||||
return $defaultsort;
|
||||
elseif ($a->prestudentstatus->status_kurzbz === 'Interessent' && $b->prestudentstatus->status_kurzbz === 'Interessent')
|
||||
{
|
||||
//infoonly Interessenten come after new Interessenten
|
||||
if ($a->infoonly)
|
||||
if ($a->infoonly === $b->infoonly)
|
||||
return $defaultsort;
|
||||
elseif ($a->infoonly)
|
||||
return 1;
|
||||
elseif ($b->infoonly)
|
||||
return -1;
|
||||
@@ -686,7 +708,7 @@ class InfoCenter extends VileSci_Controller
|
||||
elseif ($b->prestudentstatus->status_kurzbz === 'Interessent')
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return $defaultsort;
|
||||
});
|
||||
|
||||
$statusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Abgewiesener'))->retval;
|
||||
|
||||
@@ -640,7 +640,7 @@ class MessageLib
|
||||
}
|
||||
|
||||
// Using a template for the plain text email body
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML');
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailTXT');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
$altBody = $this->ci->parser->parse_string(
|
||||
|
||||
@@ -239,4 +239,27 @@ class Prestudent_model extends DB_Model
|
||||
return success($prestudent->retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the prestudent edited last.
|
||||
* if no updateamum, sort by insertamum
|
||||
* @param $person_id
|
||||
* @param bool $withzgv if true, only prestudenten with zgv_code are taken
|
||||
* @return array|null
|
||||
*/
|
||||
public function getLastPrestudent($person_id, $withzgv = false)
|
||||
{
|
||||
$qry = 'SELECT * FROM public.tbl_prestudent
|
||||
WHERE person_id = ?
|
||||
%s
|
||||
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
|
||||
LIMIT 1';
|
||||
|
||||
$zgvwhere = $withzgv === true ? 'AND zgv_code IS NOT NULL' : '';
|
||||
|
||||
$qry = sprintf($qry, $zgvwhere);
|
||||
|
||||
$parametersArray = array($person_id);
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<input type="hidden" id="hiddenpersonid" value="<?php echo $stammdaten->person_id ?>">
|
||||
<div class="row<?php if($lockedbyother) echo ' alert-danger' ?>">
|
||||
<div class="col-lg-8">
|
||||
<h3 class="page-header">
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
echo $this->widgetlib->widget(
|
||||
'Zgv_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgv_code),
|
||||
array('name' => 'zgv', 'id' => 'zgv')
|
||||
array('name' => 'zgv', 'id' => 'zgv_'.$zgvpruefung->prestudent_id)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,7 +89,7 @@
|
||||
?>
|
||||
<input type="text" class="form-control"
|
||||
value="<?php echo $zgvpruefung->zgvort ?>"
|
||||
name="zgvort">
|
||||
name="zgvort" id="zgvort_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,7 +103,7 @@
|
||||
<input type="text"
|
||||
class="dateinput form-control"
|
||||
value="<?php echo empty($zgvpruefung->zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y') ?>"
|
||||
name="zgvdatum">
|
||||
name="zgvdatum" id="zgvdatum_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,7 +116,7 @@
|
||||
echo $this->widgetlib->widget(
|
||||
'Nation_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvnation_code),
|
||||
array('name' => 'zgvnation', 'id' => 'zgvnation')
|
||||
array('name' => 'zgvnation', 'id' => 'zgvnation_'.$zgvpruefung->prestudent_id)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -183,7 +183,12 @@
|
||||
<?php endif; ?>
|
||||
<?php if (!$infoonly): ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-right">
|
||||
<div class="col-lg-6 text-left">
|
||||
<button type="button" class="btn btn-default zgvUebernehmen" id="zgvUebernehmen_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Letzte ZGV übernehmen
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-lg-6 text-right">
|
||||
<button type="submit" class="btn btn-default">
|
||||
Speichern
|
||||
</button>
|
||||
@@ -203,7 +208,7 @@
|
||||
<div class="form-inline">
|
||||
<form method="post"
|
||||
action="../saveAbsage/<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<div class="input-group" id="statusgrselect">
|
||||
<div class="input-group" id="statusgrselect_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<select name="statusgrund"
|
||||
class="d-inline float-right"
|
||||
required>
|
||||
@@ -216,15 +221,15 @@
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button id="absageBtn" type="button"
|
||||
class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#absageModal">
|
||||
Absage
|
||||
</button>
|
||||
</span>
|
||||
<button id="absageBtn" type="button"
|
||||
class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#absageModal_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Absage
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="modal fade" id="absageModal"
|
||||
<div class="modal fade absageModal" id="absageModal_<?php echo $zgvpruefung->prestudent_id ?>"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="absageModalLabel"
|
||||
@@ -280,12 +285,12 @@
|
||||
<div>
|
||||
<button type="button" class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#freigabeModal">
|
||||
data-target="#freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Freigabe an Studiengang
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="freigabeModal" tabindex="-1"
|
||||
<div class="modal fade" id="freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>" tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="freigabeModalLabel"
|
||||
aria-hidden="true">
|
||||
|
||||
@@ -55,20 +55,67 @@ $(document).ready(
|
||||
);
|
||||
|
||||
//prevent opening modal when Statusgrund not chosen
|
||||
$("#absageModal").on('show.bs.modal', function (e)
|
||||
$(".absageModal").on('show.bs.modal', function (e)
|
||||
{
|
||||
if ($("[name=statusgrund]").val() === "null")
|
||||
var id = this.id.substr(this.id.indexOf("_") + 1);
|
||||
var statusgrvalue = $("#statusgrselect_"+id+" select[name=statusgrund]").val();
|
||||
if (statusgrvalue === "null")
|
||||
{
|
||||
$("#statusgrselect").addClass("has-error");
|
||||
$("#statusgrselect_"+id).addClass("has-error");
|
||||
return e.preventDefault();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("[name=statusgrund]").change(function ()
|
||||
//remove red mark when statusgrund is selected again
|
||||
$("select[name=statusgrund]").change(
|
||||
function ()
|
||||
{
|
||||
$("#statusgrselect").removeClass("has-error");
|
||||
$(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(" <span id='nearzgv' class='text-warning'>keine ZGV vorhanden</span>");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1300,6 +1300,19 @@ if (!$result = @$db->db_query("SELECT 1 FROM system.tbl_person_lock LIMIT 1"))
|
||||
echo ' system.tbl_person_lock hinzugefügt<br>';
|
||||
}
|
||||
|
||||
// INSERT Berechtigungen fuer web User erteilen fuer tbl_msg_status
|
||||
if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_msg_status' AND table_schema='public' AND grantee='web' AND privilege_type='INSERT'"))
|
||||
{
|
||||
if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "GRANT SELECT, INSERT ON public.tbl_msg_status TO web;";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_msg_status Berechtigungen: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'INSERT Rechte fuer public.tbl_msg_status fuer web user gesetzt ';
|
||||
}
|
||||
}
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
Reference in New Issue
Block a user