mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'feature-18940/infocenter_loeschen_von_dokumenten'
This commit is contained in:
@@ -88,6 +88,12 @@ class InfoCenter extends Auth_Controller
|
||||
'message' => 'Type of Document %s was updated, set to %s',
|
||||
'success' => null
|
||||
),
|
||||
'deletedoc' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Document deleted',
|
||||
'message' => 'Document %s deleted',
|
||||
'success' => null
|
||||
),
|
||||
);
|
||||
|
||||
// Name of Interessentenstatus
|
||||
@@ -131,6 +137,7 @@ class InfoCenter extends Auth_Controller
|
||||
'reloadZgvPruefungen' => 'infocenter:r',
|
||||
'reloadMessages' => 'infocenter:r',
|
||||
'reloadDoks' => 'infocenter:r',
|
||||
'reloadUebersichtDoks' => 'infocenter:r',
|
||||
'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'reloadLogs' => 'infocenter:r',
|
||||
'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
@@ -142,7 +149,8 @@ class InfoCenter extends Auth_Controller
|
||||
'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'setNavigationMenuArrayJson' => 'infocenter:r',
|
||||
'getAbsageData' => 'infocenter:r',
|
||||
'saveAbsageForAll' => 'infocenter:rw'
|
||||
'saveAbsageForAll' => 'infocenter:rw',
|
||||
'deleteDoc' => 'infocenter:rw',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -398,6 +406,35 @@ class InfoCenter extends Auth_Controller
|
||||
$this->outputJsonSuccess(array($json));
|
||||
}
|
||||
|
||||
public function deleteDoc($person_id)
|
||||
{
|
||||
$akte_id = $this->input->post('akteid');
|
||||
|
||||
if (isset($akte_id) && isset($person_id))
|
||||
{
|
||||
$this->load->library('AkteLib');
|
||||
$akte = $this->aktelib->get($akte_id);
|
||||
|
||||
if (hasData($akte))
|
||||
{
|
||||
$akte = getData($akte);
|
||||
if ($akte->person_id === $person_id)
|
||||
{
|
||||
$result = $this->aktelib->remove($akte_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError('Error deleting document');
|
||||
}
|
||||
|
||||
$this->_log($person_id, 'deletedoc', array($akte->bezeichnung));
|
||||
|
||||
$this->outputJsonSuccess('success');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets prestudent data for a person in json format
|
||||
* @param $person_id
|
||||
@@ -1074,6 +1111,17 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval));
|
||||
}
|
||||
|
||||
public function reloadUebersichtDoks($person_id)
|
||||
{
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false);
|
||||
|
||||
$this->DokumentModel->addOrder('bezeichnung');
|
||||
$dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load())));
|
||||
$data = array_merge($dokumentdata, ['dokumente' => $dokumente->retval]);
|
||||
|
||||
$this->load->view('system/infocenter/dokpruefung.php', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs content of an Akte, sends appropriate headers (so the document can be downloaded)
|
||||
* @param $akte_id
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<div class="table-responsive">
|
||||
<table id="doctable" class="table table-bordered">
|
||||
<div class="table-responsive" id="uebersichtDoks">
|
||||
<table id="doctable" class="table table-bordered table-condensed tablesorter tablesorter-default">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo ucfirst($this->p->t('global','name')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','typ')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','uploaddatum')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('ui','loeschen')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('infocenter','ausstellungsnation')) ?></th>
|
||||
<?php
|
||||
if (!isset($formalReadonly))
|
||||
@@ -22,7 +23,7 @@
|
||||
<a href="outputAkteContent/<?php echo $dokument->akte_id ?>"><?php echo isEmptyString($dokument->titel) ? $dokument->bezeichnung : $dokument->titel ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<select class="aktenid" id="aktenid_<?php echo $dokument->akte_id?>" <?php echo (isset($formalReadonly) ? 'disabled' : '') ?> autocomplete="off">
|
||||
<select class="form-control aktenid" id="aktenid_<?php echo $dokument->akte_id?>" <?php echo (isset($formalReadonly) ? 'disabled' : '') ?> autocomplete="off">
|
||||
<?php
|
||||
foreach($dokumententypen as $dokumenttyp)
|
||||
echo "<option " . ($dokumenttyp->bezeichnung === $dokument->dokument_bezeichnung ? 'selected' : '') . " value = " . $dokumenttyp->dokument_kurzbz . ">" . $dokumenttyp->bezeichnung . "</option>"
|
||||
@@ -30,7 +31,7 @@
|
||||
</select>
|
||||
|
||||
<div class="row">
|
||||
<button class="nachreichungInfos hidden" id="nachreichungInfos_<?php echo $dokument->akte_id?>"><?php echo ucfirst($this->p->t('infocenter','dokumentWirdNachgereicht')) ?></button>
|
||||
<button class="nachreichungInfos hidden btn btn-default" id="nachreichungInfos_<?php echo $dokument->akte_id?>"><?php echo ucfirst($this->p->t('infocenter','dokumentWirdNachgereicht')) ?></button>
|
||||
</div>
|
||||
|
||||
<div class="nachreichungInputs hidden" id="nachreichungInputs_<?php echo $dokument->akte_id?>">
|
||||
@@ -49,7 +50,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="btn-group pull-right">
|
||||
<input type="button" value="OK" class="btn btn-primary nachreichungSpeichern" id="nachreichungSpeichern_<?php echo $dokument->akte_id?>">
|
||||
<input type="button" value="OK" class="btn btn-primary nachreichungSpeichern btn-default" id="nachreichungSpeichern_<?php echo $dokument->akte_id?>">
|
||||
<input type="button" value="Abbrechen" class="btn btn-default nachreichungAbbrechen" id="nachreichungAbbrechen_<?php echo $dokument->akte_id?>">
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,6 +61,7 @@
|
||||
|
||||
</td>
|
||||
<td><?php echo date_format(date_create($dokument->erstelltam), 'd.m.Y') ?></td>
|
||||
<td><input type="button" value="<?php echo ucfirst($this->p->t('ui','loeschen')); ?>" class="btn btn-default dokLoeschen" id="dokLoeschen_<?php echo $dokument->akte_id?>" <?php echo (isset($formalReadonly) ? 'disabled' : '') ?>></td>
|
||||
<td><?php echo $dokument->langtext ?></td>
|
||||
<?php
|
||||
if (!isset($formalReadonly)) :
|
||||
|
||||
@@ -7,58 +7,7 @@ $(document).ready(function ()
|
||||
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
|
||||
//add click events to "formal geprüft" checkboxes
|
||||
$(".prchbox").click(function ()
|
||||
{
|
||||
var boxid = this.id;
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid);
|
||||
var checked = this.checked;
|
||||
DocUeberpruefung.saveFormalGeprueft(personid, akteid, checked)
|
||||
});
|
||||
|
||||
$('select.aktenid').change(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
var typ = $(this).val();
|
||||
DocUeberpruefung.saveDocTyp(personid, akteid, typ);
|
||||
});
|
||||
|
||||
$('.nachreichungInfos').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
DocUeberpruefung.checkNachreichungInputs(akteid);
|
||||
});
|
||||
|
||||
$('.nachreichungAbbrechen').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
DocUeberpruefung.checkNachreichungInputs(akteid);
|
||||
});
|
||||
|
||||
$('.nachreichungSpeichern').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
var typ = $('#aktenid_' + akteid).val();
|
||||
|
||||
var nachreichungAm = $('#nachreichungAm_' + akteid).val();
|
||||
var nachreichungAnmerkung = $('#nachreichungAnmerkung_' + akteid).val();
|
||||
|
||||
if(nachreichungAm === '')
|
||||
{
|
||||
FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig'));
|
||||
return false;
|
||||
}
|
||||
|
||||
var regEx = /^\d{2}\.\d{2}\.(\d{2}|\d{4})$/;
|
||||
|
||||
if(nachreichungAm.match(regEx) === null)
|
||||
{
|
||||
FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig'))
|
||||
return false;
|
||||
}
|
||||
|
||||
DocUeberpruefung.saveNachreichung(personid, nachreichungAm, nachreichungAnmerkung, typ);
|
||||
})
|
||||
DocUeberpruefung._addDocUeberpruefungEvents(personid)
|
||||
});
|
||||
|
||||
var DocUeberpruefung = {
|
||||
@@ -158,6 +107,33 @@ var DocUeberpruefung = {
|
||||
);
|
||||
},
|
||||
|
||||
deleteDoc: function(personid, akteid)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + "/deleteDoc/" + encodeURIComponent(personid),
|
||||
{
|
||||
"akteid": akteid
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.isSuccess(data))
|
||||
{
|
||||
DocUeberpruefung._refreshUbersichtDoks();
|
||||
InfocenterDetails._refreshLog();
|
||||
}
|
||||
else
|
||||
{
|
||||
FHC_DialogLib.alertError(FHC_AjaxClient.getError(data));
|
||||
}
|
||||
},
|
||||
errorCallback: function(data)
|
||||
{
|
||||
FHC_DialogLib.alertWarning("Fehler beim Speichern!");
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
checkNachreichungInputs: function(akteid)
|
||||
{
|
||||
var inputs = $('#nachreichungInputs_' + akteid);
|
||||
@@ -197,6 +173,19 @@ var DocUeberpruefung = {
|
||||
}
|
||||
},
|
||||
|
||||
_refreshUbersichtDoks: function()
|
||||
{
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
|
||||
$("#uebersichtDoks").load(
|
||||
CONTROLLER_URL + '/reloadUebersichtDoks/' + personid + '?fhc_controller_id=' + FHC_AjaxClient.getUrlParameter('fhc_controller_id'),
|
||||
function () {
|
||||
DocUeberpruefung._formatDocTable();
|
||||
DocUeberpruefung._addDocUeberpruefungEvents(personid);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
_refreshNachzureichendeDoks: function()
|
||||
{
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
@@ -205,10 +194,79 @@ var DocUeberpruefung = {
|
||||
CONTROLLER_URL + '/reloadDoks/' + personid + '?fhc_controller_id=' + FHC_AjaxClient.getUrlParameter('fhc_controller_id'),
|
||||
function () {
|
||||
DocUeberpruefung._formatDocTable();
|
||||
DocUeberpruefung._addDocUeberpruefungEvents(personid);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
_addDocUeberpruefungEvents: function(personid)
|
||||
{
|
||||
//add click events to "formal geprüft" checkboxes
|
||||
$(".prchbox").click(function ()
|
||||
{
|
||||
var boxid = this.id;
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid);
|
||||
var checked = this.checked;
|
||||
DocUeberpruefung.saveFormalGeprueft(personid, akteid, checked)
|
||||
});
|
||||
|
||||
$('select.aktenid').change(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
var typ = $(this).val();
|
||||
DocUeberpruefung.saveDocTyp(personid, akteid, typ);
|
||||
});
|
||||
|
||||
$('.nachreichungInfos').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
DocUeberpruefung.checkNachreichungInputs(akteid);
|
||||
});
|
||||
|
||||
$('.nachreichungAbbrechen').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
DocUeberpruefung.checkNachreichungInputs(akteid);
|
||||
});
|
||||
|
||||
$('.nachreichungSpeichern').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
var typ = $('#aktenid_' + akteid).val();
|
||||
|
||||
var nachreichungAm = $('#nachreichungAm_' + akteid).val();
|
||||
var nachreichungAnmerkung = $('#nachreichungAnmerkung_' + akteid).val();
|
||||
|
||||
if(nachreichungAm === '')
|
||||
{
|
||||
FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig'));
|
||||
return false;
|
||||
}
|
||||
|
||||
var regEx = /^\d{2}\.\d{2}\.(\d{2}|\d{4})$/;
|
||||
|
||||
if(nachreichungAm.match(regEx) === null)
|
||||
{
|
||||
FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig'))
|
||||
return false;
|
||||
}
|
||||
|
||||
DocUeberpruefung.saveNachreichung(personid, nachreichungAm, nachreichungAnmerkung, typ);
|
||||
})
|
||||
|
||||
$('.dokLoeschen').click(function()
|
||||
{
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
|
||||
var confirmed = confirm('Wollen Sie sicher das Dokument des Dokumentypens: ' + $('#aktenid_' + akteid).find(':selected').text() + ' löschen?');
|
||||
|
||||
if (confirmed)
|
||||
{
|
||||
DocUeberpruefung.deleteDoc(personid, akteid);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_formatDocTable: function()
|
||||
{
|
||||
Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
|
||||
|
||||
Reference in New Issue
Block a user