mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-21 14:09:27 +00:00
show Bezeichnung in Subject Vorlage, add adaption for Tinymce for openMode inSamePage
This commit is contained in:
@@ -16,7 +16,7 @@ class Messages extends FHCAPI_Controller
|
||||
'getNameOfDefaultRecipient' => ['admin:r', 'assistenz:r'],
|
||||
'sendMessage' => ['admin:r', 'assistenz:r'],
|
||||
'deleteMessage' => ['admin:r', 'assistenz:r'],
|
||||
'getVorlagentext' => ['admin:r', 'assistenz:r'],
|
||||
'getDataVorlage' => ['admin:r', 'assistenz:r'],
|
||||
'getPreviewText' => ['admin:r', 'assistenz:r'],
|
||||
'getReplyData' => ['admin:r', 'assistenz:r'],
|
||||
'getPersonId' => ['admin:r', 'assistenz:r'],
|
||||
@@ -89,10 +89,8 @@ class Messages extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getVorlagentext($vorlage_kurzbz)
|
||||
public function getDataVorlage($vorlage_kurzbz)
|
||||
{
|
||||
//$this->terminateWithError("vor " . $vorlage_kurzbz, self::ERROR_TYPE_GENERAL);
|
||||
//$studiengang_kz = 227; //TODO(Manu) dynamisieren NULL
|
||||
$studiengang_kz = 0;
|
||||
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
$this->VorlagestudiengangModel->addOrder('version', 'DESC');
|
||||
@@ -104,12 +102,8 @@ class Messages extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
//not correct with Vorlage
|
||||
$vorlage = current($data);
|
||||
|
||||
//$this->terminateWithSuccess($data);
|
||||
$this->terminateWithSuccess($vorlage->text);
|
||||
$this->terminateWithSuccess($vorlage);
|
||||
}
|
||||
|
||||
public function getMessageVarsPerson($id, $typeId)
|
||||
@@ -154,7 +148,7 @@ class Messages extends FHCAPI_Controller
|
||||
public function sendMessage($recipient_id)
|
||||
{
|
||||
//has to be uid
|
||||
// $this->terminateWithError("uid", $recipient_id, self::ERROR_TYPE_GENERAL);
|
||||
// $this->terminateWithError("uid", $recipient_id, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
//default setting
|
||||
$receiversPersonId = $this->_getPersonId($recipient_id, 'uid');
|
||||
@@ -223,7 +217,7 @@ class Messages extends FHCAPI_Controller
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
// $this->terminateWithError("prestudent_id ", self::ERROR_TYPE_GENERAL);
|
||||
// $this->terminateWithError("prestudent_id ", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
@@ -429,7 +423,7 @@ class Messages extends FHCAPI_Controller
|
||||
|
||||
private function _getPrestudentIdFromUid($uid)
|
||||
{
|
||||
// $this->terminateWithError($uid, self::ERROR_TYPE_GENERAL);
|
||||
// $this->terminateWithError($uid, self::ERROR_TYPE_GENERAL);
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->loadWhere(
|
||||
['student_uid' => $uid]
|
||||
|
||||
@@ -62,10 +62,10 @@ export default {
|
||||
url: 'api/frontend/v1/messages/messages/getUid/' + userParams.id + '/' + userParams.type_id
|
||||
};
|
||||
},
|
||||
getVorlagentext(vorlage_kurzbz){
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/messages/messages/getVorlagentext/' + vorlage_kurzbz
|
||||
url: 'api/frontend/v1/messages/messages/getDataVorlage/' + vorlage_kurzbz
|
||||
};
|
||||
},
|
||||
getNameOfDefaultRecipient(params){
|
||||
|
||||
@@ -20,8 +20,8 @@ export default {
|
||||
getUid(params){
|
||||
return this.$fhcApi.get('api/frontend/v1/messages/messages/getUid/'+ params.id + '/' + params.type_id);
|
||||
},
|
||||
getVorlagentext(vorlage_kurzbz){
|
||||
return this.$fhcApi.get('api/frontend/v1/messages/messages/getVorlagentext/' + vorlage_kurzbz);
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return this.$fhcApi.get('api/frontend/v1/messages/messages/getDataVorlage/' + vorlage_kurzbz);
|
||||
},
|
||||
getNameOfDefaultRecipient(params){
|
||||
return this.$fhcApi.get('api/frontend/v1/messages/messages/getNameOfDefaultRecipient/' + params.id + '/' + params.type_id);
|
||||
|
||||
@@ -136,17 +136,13 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
getVorlagentext(vorlage_kurzbz){
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return this.$api
|
||||
.call(this.endpoint.getVorlagentext(vorlage_kurzbz))
|
||||
.call(this.endpoint.getDataVorlage(vorlage_kurzbz))
|
||||
.then(response => {
|
||||
this.formData.body = response.data;
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
//this.resetForm();
|
||||
//closeModal
|
||||
//closewindwo
|
||||
});
|
||||
this.formData.body = response.data.text;
|
||||
this.formData.subject = response.data.subject;
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
getPreviewText(){
|
||||
const data = new FormData();
|
||||
@@ -197,8 +193,7 @@ export default {
|
||||
},
|
||||
handleSelectedVorlage(vorlage_kurzbz) {
|
||||
if (typeof vorlage_kurzbz === "string") {
|
||||
this.getVorlagentext(vorlage_kurzbz);
|
||||
this.formData.subject = vorlage_kurzbz;
|
||||
this.getDataVorlage(vorlage_kurzbz);
|
||||
}
|
||||
},
|
||||
showPreview(){
|
||||
@@ -240,7 +235,7 @@ export default {
|
||||
handler(newVal){
|
||||
if (newVal && newVal != null) {
|
||||
this.formData.subject = newVal;
|
||||
return this.getVorlagentext(newVal);
|
||||
return this.getDataVorlage(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -136,15 +136,13 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
getVorlagentext(vorlage_kurzbz){
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return this.$api
|
||||
.call(this.endpoint.getVorlagentext(vorlage_kurzbz))
|
||||
.call(this.endpoint.getDataVorlage(vorlage_kurzbz))
|
||||
.then(response => {
|
||||
this.formData.body = response.data;
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
//this.resetForm();
|
||||
});
|
||||
this.formData.body = response.data.text;
|
||||
this.formData.subject = response.data.subject;
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
getPreviewText(id, typeId){
|
||||
const data = new FormData();
|
||||
@@ -164,20 +162,11 @@ export default {
|
||||
insertVariable(selectedItem){
|
||||
if (this.editor) {
|
||||
this.editor.insertContent(selectedItem.value + " ");
|
||||
//TODO(Manu) check: Laden von Variblen geht nicht wenn kein Zeichen danach kommt
|
||||
// nicht mal mit Punkt adden gehts ohne eintrag nach vars
|
||||
//this.editor.focus();
|
||||
// this.editor.setDirty(true);
|
||||
|
||||
this.editor.setDirty(true);//seting dirty true if changes appear
|
||||
// console.log(tinyMCE.activeEditor.isDirty());//dirty output = true
|
||||
|
||||
|
||||
//this.editor.undoManager.add();
|
||||
|
||||
//this.editor.insertContent(selectedItem.value + "\u00A0");
|
||||
//this.editor.insertContent(`<span>${selectedItem.value} </span>`);
|
||||
//this.editor.selection.setCursorLocation(this.editor.getBody(), 1);
|
||||
this.editor.fire('input');
|
||||
this.editor.fire('change');
|
||||
this.editor.setDirty(true);
|
||||
this.editor.save();
|
||||
|
||||
} else {
|
||||
console.error("Editor instance is not available.");
|
||||
@@ -202,8 +191,7 @@ export default {
|
||||
},
|
||||
handleSelectedVorlage(vorlage_kurzbz) {
|
||||
if (typeof vorlage_kurzbz === "string") {
|
||||
this.getVorlagentext(vorlage_kurzbz);
|
||||
this.formData.subject = vorlage_kurzbz;
|
||||
this.getDataVorlage(vorlage_kurzbz);
|
||||
}
|
||||
},
|
||||
hideTemplate(){
|
||||
@@ -248,7 +236,7 @@ export default {
|
||||
|
||||
if (newVal && newVal != null) {
|
||||
this.formData.subject = newVal;
|
||||
return this.getVorlagentext(newVal);
|
||||
return this.getDataVorlage(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user