diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php
index d97c1a86b..87abe4ef4 100644
--- a/application/controllers/api/frontend/v1/stv/Config.php
+++ b/application/controllers/api/frontend/v1/stv/Config.php
@@ -67,7 +67,7 @@ class Config extends FHCAPI_Controller
'title' => $this->p->t('stv', 'tab_prestudent'),
'component' => './Stv/Studentenverwaltung/Details/Prestudent.js'
];
- $result['multistatus'] = [
+ $result['status'] = [
'title' => 'Status',
'component' => './Stv/Studentenverwaltung/Details/MultiStatus.js'
];
@@ -114,7 +114,7 @@ class Config extends FHCAPI_Controller
'additionalCols' => []
]
];
- $result['multistatus'] = [
+ $result['status'] = [
'title' => 'Status',
'component' => './Stv/Studentenverwaltung/Details/MultiStatus.js',
'config' => [
diff --git a/application/controllers/api/frontend/v1/stv/Prestudent.php b/application/controllers/api/frontend/v1/stv/Prestudent.php
index d0606a5bb..e29736288 100644
--- a/application/controllers/api/frontend/v1/stv/Prestudent.php
+++ b/application/controllers/api/frontend/v1/stv/Prestudent.php
@@ -12,15 +12,15 @@ class Prestudent extends FHCAPI_Controller
'get' => ['admin:r', 'assistenz:r'],
'updatePrestudent' => ['admin:w', 'assistenz:w'],
'getHistoryPrestudents' => ['admin:r', 'assistenz:r'],
- 'getBezeichnungZGV' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getBezeichnungDZgv' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getBezeichnungMZgv' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getAusbildung' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getAufmerksamdurch' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getBerufstaetigkeit' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getTypenStg' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getStudiensemester' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
- 'getStudienplaene' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
+ 'getBezeichnungZGV' => self::PERM_LOGGED,
+ 'getBezeichnungDZgv' => self::PERM_LOGGED,
+ 'getBezeichnungMZgv' => self::PERM_LOGGED,
+ 'getAusbildung' => self::PERM_LOGGED,
+ 'getAufmerksamdurch' => self::PERM_LOGGED,
+ 'getBerufstaetigkeit' => self::PERM_LOGGED,
+ 'getTypenStg' => self::PERM_LOGGED,
+ 'getStudiensemester' => self::PERM_LOGGED,
+ 'getStudienplaene' => self::PERM_LOGGED
]);
// Load Libraries
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js
index ad402b5ed..149556508 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js
@@ -139,7 +139,7 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getStgs')
- .then(result => CoreRESTClient.getData(result.data) || [])
+ .then(result => result.data)
.then(result => {
this.listStgs = result;
})
@@ -174,8 +174,7 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
},
template: `
-
-
+
@@ -289,7 +288,7 @@ export default {
-
+
({ ...objekt, ...deltaData}));
console.log("in changeStatusToDiplomand" + prestudentIds);
- this.hideModal('addMultiStatus2');
+ this.hideModal('addMultiStatus');
this.addNewStatus(prestudentIds);
},
changeStatusToAbsolvent(prestudentIds){
@@ -462,45 +464,53 @@ export default{
this.newArray = this.updateData.map(objekt => ({ ...objekt, ...deltaData}));
console.log("in changeStatusToAbsolvent" + prestudentIds);
- this.hideModal('addMultiStatus2');
+ this.hideModal('addMultiStatus');
this.addNewStatus(prestudentIds);
},
addNewStatus(prestudentIds){
//Array.isArray(prestudentIds) ? this.modelValue.prestudent_id : [prestudentIds];
let changeData = {};
+ //for Feedback Sucess, Error
+ let countSuccess = 0;
+ let countError = 0;
+
if(!prestudentIds)
prestudentIds = [this.modelValue.prestudent_id];
const promises = prestudentIds.map(prestudentId => {
//TODO(manu) besserer check
- //if(!this.newArray)
- if(this.statusData.status_kurzbz)
- {
- changeData = this.statusData; //this.statusData = this.updateData.find(item => item.prestudent_id === prestudentId);
- }
- else
- {
- changeData = this.newArray.find(item => item.prestudent_id === prestudentId);
- }
+ changeData = this.statusData.status_kurzbz ? this.statusData : this.newArray.find(item => item.prestudent_id === prestudentId);
return this.$fhcApi.post('api/frontend/v1/stv/status/addNewStatus/' + prestudentId,
- //this.statusData
- //this.updateData.find(item => item.prestudent_id == prestudentId)
changeData
).then(response => {
- this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
- console.log(response);
+ countSuccess++;
return response;
- }).catch(this.$fhcAlert.handleSystemError)
- /*.finally(() => {
- window.scrollTo(0, 0);
- })*/;
+ })
+ //.catch(this.$fhcAlert.handleSystemError)
+ .catch(error => {
+ countError++;
+ //For each Prestudent show Error in Alert
+ this.$fhcAlert.handleSystemError(error);
+ });
});
Promise
.allSettled(promises)
.then(values => {
+ let newStatus = this.newArray[0].status_kurzbz;
+ console.log(`Successful: ${countSuccess}, Errors: ${countError}`);
+
+ //Feedback Success als infoalert
+ if (countSuccess > 0) {
+ this.$fhcAlert.alertInfo(this.$p.t('ui', 'successNewStatus', {
+ 'countSuccess': countSuccess,
+ 'status': newStatus,
+ 'countError': countError
+ }));
+ }
+
if (this.modelValue.prestudent_id) {
this.reload();
//TODO(manu) reload Detailtab after Abbrecher to see current status activ, verband and gruppe
@@ -511,7 +521,6 @@ export default{
this.hideModal('newStatusModal');
this.resetModal();
});
-
},
advanceStatus(statusId){
return this.$fhcApi.post('api/frontend/v1/stv/status/advanceStatus/' +
@@ -653,7 +662,7 @@ export default{
mounted(){},
template: `
-
+
{{$p.t('lehre', 'status_new')}}
@@ -844,7 +853,7 @@ export default{
-
@@ -1030,7 +1039,7 @@ export default{
-
+
Status ändern zu
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php
index ba4dcfa01..94834e54f 100644
--- a/system/phrasesupdate.php
+++ b/system/phrasesupdate.php
@@ -27761,6 +27761,7 @@ array(
)
)
),
+ //**************************** FHC-Core-Status
array(
'app' => 'core',
'category' => 'lehre',
@@ -27781,6 +27782,26 @@ array(
)
)
),
+ array(
+ 'app' => 'core',
+ 'category' => 'ui',
+ 'phrase' => 'successNewStatus',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => '{countSuccess} erfolgreiche Statusänderung(en) auf {status}, {countError} Fehler',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => '{countSuccess} successful status changes to {status}, {countError} errors',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
);