mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
Minor code enhancement
Signed-off-by: cris-technikum <[email protected]>
This commit is contained in:
@@ -88,7 +88,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Approve multiple Anrechnungen.
|
* Approve Anrechnungen.
|
||||||
*/
|
*/
|
||||||
public function approve()
|
public function approve()
|
||||||
{
|
{
|
||||||
@@ -102,6 +102,9 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
|||||||
// Get statusbezeichnung for 'approved'
|
// Get statusbezeichnung for 'approved'
|
||||||
$this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig');
|
$this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig');
|
||||||
$approved = getData($this->AnrechnungstatusModel->load('approved'))[0];
|
$approved = getData($this->AnrechnungstatusModel->load('approved'))[0];
|
||||||
|
$approved = getUserLanguage() == 'German'
|
||||||
|
? $approved->bezeichnung_mehrsprachig[0]
|
||||||
|
: $approved->bezeichnung_mehrsprachig[1];
|
||||||
|
|
||||||
foreach ($data as $item)
|
foreach ($data as $item)
|
||||||
{
|
{
|
||||||
@@ -110,9 +113,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
|||||||
{
|
{
|
||||||
$json[]= array(
|
$json[]= array(
|
||||||
'anrechnung_id' => $item['anrechnung_id'],
|
'anrechnung_id' => $item['anrechnung_id'],
|
||||||
'status_bezeichnung' => getUserLanguage() == 'German'
|
'status_bezeichnung' => $approved
|
||||||
? $approved->bezeichnung_mehrsprachig[0]
|
|
||||||
: $approved->bezeichnung_mehrsprachig[1]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,6 +129,9 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reject Anrechnungen.
|
||||||
|
*/
|
||||||
public function reject()
|
public function reject()
|
||||||
{
|
{
|
||||||
$data = $this->input->post('data');
|
$data = $this->input->post('data');
|
||||||
@@ -137,7 +141,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
|||||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get statusbezeichnung for 'approved'
|
// Get statusbezeichnung for 'rejected'
|
||||||
$this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig');
|
$this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig');
|
||||||
$rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0];
|
$rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0];
|
||||||
$rejected = getUserLanguage() == 'German'
|
$rejected = getUserLanguage() == 'German'
|
||||||
@@ -146,7 +150,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
|||||||
|
|
||||||
foreach ($data as $item)
|
foreach ($data as $item)
|
||||||
{
|
{
|
||||||
// Approve Anrechnung
|
// Reject Anrechnung
|
||||||
if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'])))
|
if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'])))
|
||||||
{
|
{
|
||||||
$json[]= array(
|
$json[]= array(
|
||||||
|
|||||||
@@ -225,6 +225,11 @@ class AnrechnungLib
|
|||||||
return success(true); // approved
|
return success(true); // approved
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reject Anrechnung.
|
||||||
|
* @param $anrechnung_id
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function rejectAnrechnung($anrechnung_id)
|
public function rejectAnrechnung($anrechnung_id)
|
||||||
{
|
{
|
||||||
// Check last Anrechnungstatus
|
// Check last Anrechnungstatus
|
||||||
|
|||||||
@@ -41,19 +41,8 @@ function func_selectableCheck(row){
|
|||||||
|
|
||||||
// Performes after row was updated
|
// Performes after row was updated
|
||||||
function func_rowUpdated(row){
|
function func_rowUpdated(row){
|
||||||
// TODO: check better solution...
|
|
||||||
// status_kurzbz is not updated until page reload...therefor use the updated status_bezeichnung
|
|
||||||
let status_bezeichnung = row.getData().status_bezeichnung;
|
|
||||||
|
|
||||||
// Deselect and disable new selection of updated rows, but not when
|
|
||||||
if (status_bezeichnung == 'genehmigt' ||
|
|
||||||
status_bezeichnung == 'approved' ||
|
|
||||||
status_bezeichnung == 'abgelehnt' ||
|
|
||||||
status_bezeichnung == 'rejected')
|
|
||||||
{
|
|
||||||
row.deselect();
|
row.deselect();
|
||||||
row.getElement().style["pointerEvents"] = "none";
|
row.getElement().style["pointerEvents"] = "none";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formats null values to '-'
|
// Formats null values to '-'
|
||||||
|
|||||||
Reference in New Issue
Block a user