mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-19 21:19:29 +00:00
dokumententyp kann nun im Infocenter geaendert werden und zgv master wird angezeigt
This commit is contained in:
@@ -63,7 +63,13 @@ class InfoCenter extends Auth_Controller
|
||||
'name' => 'Note updated',
|
||||
'message' => 'Note with title %s was updated',
|
||||
'success' => null
|
||||
)
|
||||
),
|
||||
'updatedoctyp' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Document type updated',
|
||||
'message' => 'Type of Document %s was updated, set to %s',
|
||||
'success' => null
|
||||
),
|
||||
);
|
||||
|
||||
// Name of Interessentenstatus
|
||||
@@ -87,6 +93,7 @@ class InfoCenter extends Auth_Controller
|
||||
'showDetails' => 'infocenter:r',
|
||||
'unlockPerson' => 'infocenter:rw',
|
||||
'saveFormalGeprueft' => 'infocenter:rw',
|
||||
'saveDocTyp' => 'infocenter:rw',
|
||||
'getPrestudentData' => 'infocenter:r',
|
||||
'getLastPrestudentWithZgvJson' => 'infocenter:r',
|
||||
'getZgvInfoForPrestudent' => 'infocenter:r',
|
||||
@@ -114,6 +121,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
// Loads models
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->load->model('crm/Dokument_model', 'DokumentModel');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('crm/Statusgrund_model', 'StatusgrundModel');
|
||||
@@ -211,9 +219,12 @@ class InfoCenter extends Auth_Controller
|
||||
$persondata = $this->_loadPersonData($person_id);
|
||||
$prestudentdata = $this->_loadPrestudentData($person_id);
|
||||
|
||||
$dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load())));
|
||||
|
||||
$data = array_merge(
|
||||
$persondata,
|
||||
$prestudentdata
|
||||
$prestudentdata,
|
||||
$dokumentdata
|
||||
);
|
||||
|
||||
$data[self::FHC_CONTROLLER_ID] = $this->getControllerId();
|
||||
@@ -898,6 +909,41 @@ class InfoCenter extends Auth_Controller
|
||||
$this->outputJsonSuccess('success');
|
||||
}
|
||||
|
||||
public function saveDocTyp($person_id)
|
||||
{
|
||||
$akte_id = $this->input->post('akte_id');
|
||||
$typ = $this->input->post('typ');
|
||||
|
||||
if (!isset($akte_id) || !isset($typ) || !isset($person_id))
|
||||
$this->terminateWithJsonError("Nicht alle sind Parameter übergeben worden");
|
||||
|
||||
$akte = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (!hasData($akte))
|
||||
$this->terminateWithJsonError("Fehler beim Laden der Akte");
|
||||
|
||||
$result = $this->AkteModel->update($akte_id, array('dokument_kurzbz' => $typ));
|
||||
|
||||
if (!isSuccess($result))
|
||||
$this->terminateWithJsonError("Fehler beim Update aufgetreten");
|
||||
|
||||
$dokument = $this->DokumentModel->load($akte->retval[0]->dokument_kurzbz);
|
||||
|
||||
if (!hasData($dokument))
|
||||
$this->terminateWithJsonError("Fehler beim Laden des Dokumententypes");
|
||||
|
||||
$this->_log(
|
||||
$person_id,
|
||||
'updatedoctyp',
|
||||
array(
|
||||
isEmptyString($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel,
|
||||
isEmptyString($dokument->retval[0]->bezeichnung) ? $dokument->retval[0]->dokument_kurbz : $dokument->retval[0]->bezeichnung
|
||||
)
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess('success');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
@@ -18,7 +18,14 @@
|
||||
<td>
|
||||
<a href="outputAkteContent/<?php echo $dokument->akte_id ?>"><?php echo isEmptyString($dokument->titel) ? $dokument->bezeichnung : $dokument->titel ?></a>
|
||||
</td>
|
||||
<td><?php echo $dokument->dokument_bezeichnung ?></td>
|
||||
<td>
|
||||
<select class="aktenid" id="aktenid_<?php echo $dokument->akte_id ?>">
|
||||
<?php
|
||||
foreach($dokumententypen as $dokumenttyp)
|
||||
echo "<option " . ($dokumenttyp->bezeichnung === $dokument->dokument_bezeichnung ? 'selected' : '') . " value = " . $dokumenttyp->dokument_kurzbz . ">" . $dokumenttyp->bezeichnung . "</option>"
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td><?php echo date_format(date_create($dokument->erstelltam), 'd.m.Y') ?></td>
|
||||
<td><?php echo $dokument->langtext ?></td>
|
||||
<td>
|
||||
|
||||
@@ -208,10 +208,10 @@
|
||||
LIMIT 1
|
||||
) AS "StgAktiv",
|
||||
(
|
||||
SELECT ps.zgvnation
|
||||
SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\'))
|
||||
FROM public.tbl_prestudent ps
|
||||
WHERE ps.person_id = p.person_id
|
||||
ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
LIMIT 1
|
||||
) AS "ZGVNation"
|
||||
FROM public.tbl_person p
|
||||
|
||||
@@ -205,10 +205,10 @@
|
||||
LIMIT 1
|
||||
) AS "ReihungstestDate",
|
||||
(
|
||||
SELECT ps.zgvnation
|
||||
SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\'))
|
||||
FROM public.tbl_prestudent ps
|
||||
WHERE ps.person_id = p.person_id
|
||||
ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
LIMIT 1
|
||||
) AS "ZGVNation"
|
||||
FROM public.tbl_person p
|
||||
|
||||
@@ -161,10 +161,10 @@
|
||||
LIMIT 1
|
||||
) AS "ReihungstestDatum",
|
||||
(
|
||||
SELECT ps.zgvnation
|
||||
SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\'))
|
||||
FROM public.tbl_prestudent ps
|
||||
WHERE ps.person_id = p.person_id
|
||||
ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
LIMIT 1
|
||||
) AS "ZGVNation"
|
||||
FROM public.tbl_person p
|
||||
|
||||
@@ -114,7 +114,13 @@ $(document).ready(function ()
|
||||
{
|
||||
$('html,body').animate({scrollTop:0},250,'linear');
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
$('.aktenid').change(function(){
|
||||
var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
|
||||
var typ = $(this).val();
|
||||
InfocenterDetails.saveDocTyp(personid, akteid, typ);
|
||||
});
|
||||
});
|
||||
|
||||
var InfocenterDetails = {
|
||||
@@ -702,6 +708,25 @@ var InfocenterDetails = {
|
||||
);
|
||||
},
|
||||
|
||||
saveDocTyp: function(personid, akteid, typ)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid),
|
||||
{
|
||||
"akte_id": akteid,
|
||||
"typ" : typ
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
InfocenterDetails._refreshLog();
|
||||
},
|
||||
errorCallback: function() {
|
||||
FHC_DialogLib.alertWarning("Document type could not be updated");
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// (private) methods executed after ajax (refreshers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user