PMCORE-4087
This commit is contained in:
@@ -146,7 +146,7 @@ export default {
|
|||||||
let that = this;
|
let that = this;
|
||||||
this.data.userSelected = this.userSelected;
|
this.data.userSelected = this.userSelected;
|
||||||
this.data.reasonAssign = this.reasonAssign;
|
this.data.reasonAssign = this.reasonAssign;
|
||||||
this.notifyUser = this.notifyUser;
|
this.data.notifyUser = this.notifyUser;
|
||||||
api.cases.assignCase(this.data).then((response) => {
|
api.cases.assignCase(this.data).then((response) => {
|
||||||
if (response.statusText == "OK" || response.status === 200) {
|
if (response.statusText == "OK" || response.status === 200) {
|
||||||
that.$refs["modal-assign-case"].hide();
|
that.$refs["modal-assign-case"].hide();
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ export default {
|
|||||||
let that = this;
|
let that = this;
|
||||||
this.data.userSelected = this.userSelected;
|
this.data.userSelected = this.userSelected;
|
||||||
this.data.reasonReassign = this.reasonReassign;
|
this.data.reasonReassign = this.reasonReassign;
|
||||||
this.notifyUser = this.notifyUser;
|
this.data.notifyUser = this.notifyUser;
|
||||||
if (!this.data.FLAG){
|
if (!this.data.FLAG){
|
||||||
api.cases.reassingCase(this.data).then((response) => {
|
api.cases.reassingCase(this.data).then((response) => {
|
||||||
if (response.statusText == "OK" || response.status === 200) {
|
if (response.statusText == "OK" || response.status === 200) {
|
||||||
|
|||||||
@@ -2533,6 +2533,12 @@ msgstr "Assign group to"
|
|||||||
msgid "Assign Manager To Department"
|
msgid "Assign Manager To Department"
|
||||||
msgstr "Assign Manager To Department"
|
msgstr "Assign Manager To Department"
|
||||||
|
|
||||||
|
# TRANSLATION
|
||||||
|
# LABEL/ID_ASSIGN_NOTIFICATION
|
||||||
|
#: LABEL/ID_ASSIGN_NOTIFICATION
|
||||||
|
msgid "You were assigned to case #{0}."
|
||||||
|
msgstr "You were assigned to case #{0}."
|
||||||
|
|
||||||
# TRANSLATION
|
# TRANSLATION
|
||||||
# LABEL/ID_ASSIGN_ROLE
|
# LABEL/ID_ASSIGN_ROLE
|
||||||
#: LABEL/ID_ASSIGN_ROLE
|
#: LABEL/ID_ASSIGN_ROLE
|
||||||
|
|||||||
@@ -57226,6 +57226,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
|||||||
( 'LABEL','ID_ASSIGN_GROUP_TASK','en','Assign Group Task','2015-02-20') ,
|
( 'LABEL','ID_ASSIGN_GROUP_TASK','en','Assign Group Task','2015-02-20') ,
|
||||||
( 'LABEL','ID_ASSIGN_GROUP_TO','en','Assign group to','2014-01-15') ,
|
( 'LABEL','ID_ASSIGN_GROUP_TO','en','Assign group to','2014-01-15') ,
|
||||||
( 'LABEL','ID_ASSIGN_MANAGER_TO_DEPARTAMENT','en','Assign Manager To Department','2014-10-21') ,
|
( 'LABEL','ID_ASSIGN_MANAGER_TO_DEPARTAMENT','en','Assign Manager To Department','2014-10-21') ,
|
||||||
|
( 'LABEL','ID_ASSIGN_NOTIFICATION','en','You were assigned to case #{0}.','2022-12-08') ,
|
||||||
( 'LABEL','ID_ASSIGN_ROLE','en','Assign user','2014-01-15') ,
|
( 'LABEL','ID_ASSIGN_ROLE','en','Assign user','2014-01-15') ,
|
||||||
( 'LABEL','ID_ASSIGN_RULES','en','Error: There is a problem with the next tasks of this process. One of them has manual assignment. Manual assignment shouldn''t be used with sub-processes','2015-02-24') ,
|
( 'LABEL','ID_ASSIGN_RULES','en','Error: There is a problem with the next tasks of this process. One of them has manual assignment. Manual assignment shouldn''t be used with sub-processes','2015-02-24') ,
|
||||||
( 'LABEL','ID_ASSIGN_SCREEN','en','Assign Screen','2014-01-15') ,
|
( 'LABEL','ID_ASSIGN_SCREEN','en','Assign Screen','2014-01-15') ,
|
||||||
|
|||||||
@@ -962,10 +962,7 @@ class Cases
|
|||||||
|
|
||||||
/** Add the note */
|
/** Add the note */
|
||||||
if (!empty($reason)) {
|
if (!empty($reason)) {
|
||||||
$noteContent = $reason;
|
$this->sendMail($appUid, $usrUid, $reason, $sendMail, $userTarget);
|
||||||
// Define the Case for register a case note
|
|
||||||
$cases = new BmCases();
|
|
||||||
$response = $cases->addNote($appUid, $usrUid, $noteContent, $sendMail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
@@ -4059,6 +4056,47 @@ class Cases
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send mail to notify and Add a case note
|
||||||
|
*
|
||||||
|
* @param string $appUid
|
||||||
|
* @param string $userUid
|
||||||
|
* @param string $note
|
||||||
|
* @param bool $sendMail
|
||||||
|
* @param string $toUser
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function sendMail($appUid, $userUid, $note, $sendMail = false, $toUser = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
$appNumber = ModelApplication::getCaseNumber($appUid);
|
||||||
|
|
||||||
|
// Register the note
|
||||||
|
$attributes = [
|
||||||
|
"APP_UID" => $appUid,
|
||||||
|
"APP_NUMBER" => $appNumber,
|
||||||
|
"USR_UID" => $userUid,
|
||||||
|
"NOTE_DATE" => date("Y-m-d H:i:s"),
|
||||||
|
"NOTE_CONTENT" => $note,
|
||||||
|
"NOTE_TYPE" => "USER",
|
||||||
|
"NOTE_AVAILABILITY" => "PUBLIC",
|
||||||
|
"NOTE_RECIPIENTS" => ""
|
||||||
|
];
|
||||||
|
$newNote = Notes::create($attributes);
|
||||||
|
|
||||||
|
// Send the email
|
||||||
|
if ($sendMail) {
|
||||||
|
// Get the FK
|
||||||
|
$noteId = $newNote->NOTE_ID;
|
||||||
|
|
||||||
|
$note = G::LoadTranslation('ID_ASSIGN_NOTIFICATION', [$appNumber]) . '<br />' . G::LoadTranslation('ID_REASON') . ': ' . stripslashes($note);
|
||||||
|
|
||||||
|
// Send the notification
|
||||||
|
$appNote = new AppNotes();
|
||||||
|
$appNote->sendNoteNotification($appUid, $userUid, $note, $toUser, '', 0, $noteId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload file related to the case notes
|
* Upload file related to the case notes
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1086,7 +1086,7 @@ class Cases extends Api
|
|||||||
/** Add the note */
|
/** Add the note */
|
||||||
if (!empty($reason)) {
|
if (!empty($reason)) {
|
||||||
$currentUserUid = $this->getUserId();
|
$currentUserUid = $this->getUserId();
|
||||||
$cases->addNote($appUid, $currentUserUid, $reason, $sendMail);
|
$cases->sendMail($appUid, $currentUserUid, $reason, $sendMail, $usrUid);
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user