Merge branch 'develop' of bitbucket.org:colosa/processmaker into develop
This commit is contained in:
@@ -438,7 +438,6 @@ export default {
|
||||
if (err.response.data) {
|
||||
that.showAlert(err.response.data.error.message, "danger");
|
||||
}
|
||||
throw new Error(err);
|
||||
});
|
||||
},
|
||||
formatResponseCaseNotes(notes) {
|
||||
@@ -592,11 +591,16 @@ export default {
|
||||
* @param {object} data
|
||||
*/
|
||||
onClickUnpause(data) {
|
||||
Api.cases.unpause(data.row).then((response) => {
|
||||
if (response.statusText === "OK") {
|
||||
this.$refs["vueTable"].getData();
|
||||
}
|
||||
});
|
||||
let that = this;
|
||||
Api.cases.unpause(data.row)
|
||||
.then((response) => {
|
||||
if (response.statusText === "OK") {
|
||||
that.$refs["vueTable"].getData();
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
that.showAlert(error.response.data.error.message, 'danger');
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Claim case
|
||||
|
||||
@@ -24,6 +24,16 @@ export default {
|
||||
props: {
|
||||
data: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openDebug: false,
|
||||
dataCase: null,
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
diffHeight: 10,
|
||||
path: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
this.height = window.innerHeight - this.diffHeight;
|
||||
@@ -41,24 +51,21 @@ export default {
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
api.cases.debugStatus(this.dataCase).then((response) => {
|
||||
if (response.data) {
|
||||
that.openDebug = true;
|
||||
}
|
||||
});
|
||||
let that = this;
|
||||
if (this.dataCase.APP_UID) {
|
||||
api.cases.debugStatus(this.dataCase)
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
that.openDebug = true;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
that.openDebug = false;
|
||||
});
|
||||
}
|
||||
}, 2000);
|
||||
window.addEventListener("resize", this.handleIframeResize);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openDebug: false,
|
||||
dataCase: null,
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
diffHeight: 10,
|
||||
path: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
classBtn(cls) {
|
||||
return "btn v-btn-request " + cls;
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
:title="$t('ID_CANCEL_CASE')"
|
||||
size="md"
|
||||
>
|
||||
<b-alert
|
||||
:show="dataAlert.dismissCountDown"
|
||||
dismissible
|
||||
:variant="dataAlert.variant"
|
||||
@dismissed="dataAlert.dismissCountDown = 0"
|
||||
@dismiss-count-down="countDownChanged"
|
||||
>
|
||||
{{ dataAlert.message }}
|
||||
</b-alert>
|
||||
<p>
|
||||
You are tying to cancel the current case. Please be aware this action
|
||||
cannot be undone
|
||||
@@ -47,6 +56,7 @@
|
||||
|
||||
<script>
|
||||
import api from "./../../api/index";
|
||||
import eventBus from "../EventBus/eventBus";
|
||||
export default {
|
||||
name: "ModalCancelCase",
|
||||
components: {},
|
||||
@@ -56,6 +66,12 @@ export default {
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
dataAlert: {
|
||||
dismissSecs: 5,
|
||||
dismissCountDown: 0,
|
||||
message: "",
|
||||
variant: "danger",
|
||||
},
|
||||
filter: "",
|
||||
categories: [],
|
||||
categoriesFiltered: [],
|
||||
@@ -75,17 +91,42 @@ export default {
|
||||
cancelCase() {
|
||||
let that = this;
|
||||
api.cases
|
||||
.cancel(_.extend({}, this.dataCase, {
|
||||
COMMENT: this.$refs["comment"].value,
|
||||
SEND: this.$refs["send"].checked ? 1 : 0,
|
||||
}))
|
||||
.cancel(
|
||||
_.extend({}, this.dataCase, {
|
||||
COMMENT: this.$refs["comment"].value,
|
||||
SEND: this.$refs["send"].checked ? 1 : 0,
|
||||
})
|
||||
)
|
||||
.then((response) => {
|
||||
if (response.status === 200) {
|
||||
that.$refs["modal-cancel-case"].hide();
|
||||
that.$parent.$parent.page = "todo";
|
||||
eventBus.$emit("home-update-page", "inbox");
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
if(e.response.data && e.response.data.error){
|
||||
that.showAlert(e.response.data.error.message, "danger");
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Show the alert message
|
||||
* @param {string} message - message to be displayen in the body
|
||||
* @param {string} type - alert type
|
||||
*/
|
||||
showAlert(message, type) {
|
||||
this.dataAlert.message = message;
|
||||
this.dataAlert.variant = type || "info";
|
||||
this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs;
|
||||
},
|
||||
/**
|
||||
* Updates the alert dismiss value to update
|
||||
* dismissCountDown and decrease
|
||||
* @param {mumber}
|
||||
*/
|
||||
countDownChanged(dismissCountDown) {
|
||||
this.dataAlert.dismissCountDown = dismissCountDown;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
<i class="far fa-pause-circle"></i>
|
||||
</template>
|
||||
<b-container fluid>
|
||||
<b-alert
|
||||
:show="dataAlert.dismissCountDown"
|
||||
dismissible
|
||||
:variant="dataAlert.variant"
|
||||
@dismissed="dataAlert.dismissCountDown = 0"
|
||||
@dismiss-count-down="countDownChanged"
|
||||
>
|
||||
{{ dataAlert.message }}
|
||||
</b-alert>
|
||||
<b-row class="my-1">
|
||||
<b-col sm="3">
|
||||
<label for="pauseDate">{{ $t('ID_PAUSE_DATE') }}</label>
|
||||
@@ -113,6 +122,12 @@ export default {
|
||||
pauseTime: ''
|
||||
},
|
||||
minDate: '',
|
||||
dataAlert: {
|
||||
dismissSecs: 5,
|
||||
dismissCountDown: 0,
|
||||
message: "",
|
||||
variant: "info"
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -147,21 +162,43 @@ export default {
|
||||
this.data.unpausedTime = this.pauseData.unpauseTime;
|
||||
this.data.nofitfyUser = this.pauseData.nofitfyUser;
|
||||
this.data.reasonPause = this.pauseData.reasonPause;
|
||||
api.cases.pauseCase(this.data).then((response) => {
|
||||
if (response.statusText == "OK") {
|
||||
that.$refs["modal-pause-case"].hide();
|
||||
that.$parent.$refs['ellipsis-' + that.data.TAS_UID].hideActionButtons()
|
||||
if (that.$parent.$refs["vueTable"] !== undefined) {
|
||||
that.$parent.$refs["vueTable"].getData();
|
||||
api.cases.pauseCase(this.data)
|
||||
.then((response) => {
|
||||
if (response.statusText == "OK") {
|
||||
that.$refs["modal-pause-case"].hide();
|
||||
that.$parent.$refs['ellipsis-' + that.data.TAS_UID].hideActionButtons()
|
||||
if (that.$parent.$refs["vueTable"] !== undefined) {
|
||||
that.$parent.$refs["vueTable"].getData();
|
||||
}
|
||||
if (that.$parent.$refs["vueListView"] !== undefined) {
|
||||
that.$parent.$refs["vueListView"].getData();
|
||||
}
|
||||
if (that.$parent.$refs["vueCardView"] !== undefined) {
|
||||
that.$parent.$refs["vueCardView"].getData();
|
||||
}
|
||||
}
|
||||
if (that.$parent.$refs["vueListView"] !== undefined) {
|
||||
that.$parent.$refs["vueListView"].getData();
|
||||
}
|
||||
if (that.$parent.$refs["vueCardView"] !== undefined) {
|
||||
that.$parent.$refs["vueCardView"].getData();
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
that.showAlert(error.response.data.error.message, "danger");
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Show the alert message
|
||||
* @param {string} message - message to be displayen in the body
|
||||
* @param {string} type - alert type
|
||||
*/
|
||||
showAlert(message, type) {
|
||||
this.dataAlert.message = message;
|
||||
this.dataAlert.variant = type || "info";
|
||||
this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs;
|
||||
},
|
||||
/**
|
||||
* Updates the alert dismiss value to update
|
||||
* dismissCountDown and decrease
|
||||
* @param {mumber}
|
||||
*/
|
||||
countDownChanged(dismissCountDown) {
|
||||
this.dataAlert.dismissCountDown = dismissCountDown;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4196,11 +4196,10 @@ class Cases
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Get information about current $index row
|
||||
$delegation = new AppDelegation();
|
||||
$delRow = $delegation->Load($appUid, $index);
|
||||
//and creates a new AppDelegation row with the same user, task, process, etc.
|
||||
// Define the values for create a new index
|
||||
$proUid = $delRow['PRO_UID'];
|
||||
$appUid = $delRow['APP_UID'];
|
||||
$tasUid = $delRow['TAS_UID'];
|
||||
@@ -4209,7 +4208,13 @@ class Cases
|
||||
$application = new Application();
|
||||
$caseFields = $application->Load($appUid);
|
||||
$caseData = unserialize($caseFields['APP_DATA']);
|
||||
|
||||
// Update to PAUSED to CLOSED
|
||||
$row = [];
|
||||
$row['APP_UID'] = $appUid;
|
||||
$row['DEL_INDEX'] = $index;
|
||||
$row['DEL_THREAD_STATUS'] = 'CLOSED';
|
||||
$row['DEL_THREAD_STATUS_ID'] = 0;
|
||||
$delegation->update($row);
|
||||
// Create a new delegation
|
||||
$newIndex = $this->newAppDelegation(
|
||||
$proUid,
|
||||
@@ -4228,7 +4233,6 @@ class Cases
|
||||
$delRow['TAS_ID'],
|
||||
$caseData
|
||||
);
|
||||
|
||||
// Update other fields in the recent new appDelegation
|
||||
$row = [];
|
||||
$row['APP_UID'] = $delRow['APP_UID'];
|
||||
@@ -4240,7 +4244,6 @@ class Cases
|
||||
$row['DEL_INIT_DATE'] = date('Y-m-d H:i:s');
|
||||
$row['DEL_FINISH_DATE'] = null;
|
||||
$delegation->update($row);
|
||||
|
||||
// Get the APP_DELAY row with app_uid, del_index and app_type=pause
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->clearSelectColumns();
|
||||
@@ -4258,12 +4261,9 @@ class Cases
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$rowPaused = $dataset->getRow();
|
||||
|
||||
|
||||
$caseFields['APP_STATUS'] = $rowPaused['APP_STATUS'];
|
||||
$application->update($caseFields);
|
||||
|
||||
// Update the DEL_INDEX ? in APP_THREAD table?
|
||||
// Update the APP_THREAD table
|
||||
$rowUpdate = [
|
||||
'APP_UID' => $appUid,
|
||||
'APP_THREAD_INDEX' => $rowPaused['APP_THREAD_INDEX'],
|
||||
@@ -4271,14 +4271,13 @@ class Cases
|
||||
];
|
||||
$thread = new AppThread();
|
||||
$thread->update($rowUpdate);
|
||||
|
||||
// Update the APP_DELAY table
|
||||
$row['APP_DELAY_UID'] = $rowPaused['APP_DELAY_UID'];
|
||||
$row['APP_DISABLE_ACTION_USER'] = $usrUid;
|
||||
$row['APP_DISABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
|
||||
$delay = new AppDelay();
|
||||
$rowDelay = $delay->update($row);
|
||||
|
||||
// Update searchindex
|
||||
// Update solr
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->updateApplicationSearchIndex($appUid);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class ListPaused extends BaseListPaused implements ListInterface
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
$data['DEL_PREVIOUS_USR_UID'] = $aRow['USR_UID'];
|
||||
$data['DEL_PREVIOUS_USR_UID'] = isset($aRow['USR_UID']) ? $aRow['USR_UID'] : null ;
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
@@ -88,9 +88,9 @@ class ListPaused extends BaseListPaused implements ListInterface
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
$data['DEL_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
|
||||
$data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
|
||||
$data['DEL_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
|
||||
$data['DEL_PREVIOUS_USR_USERNAME'] = isset($aRow['USR_USERNAME']) ? $aRow['USR_USERNAME'] : null;
|
||||
$data['DEL_PREVIOUS_USR_FIRSTNAME'] = isset($aRow['USR_FIRSTNAME']) ? $aRow['USR_FIRSTNAME'] : null;
|
||||
$data['DEL_PREVIOUS_USR_LASTNAME'] = isset($aRow['USR_LASTNAME']) ? $aRow['USR_LASTNAME'] : null;
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
|
||||
@@ -58375,7 +58375,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_FRI','en','Fri','2014-01-15') ,
|
||||
( 'LABEL','ID_FROM','en','From','2014-01-15') ,
|
||||
( 'LABEL','ID_SENDER','en','Sender','2021-08-13') ,
|
||||
( 'LABEL','ID_FROM_DELEGATION_DATE','en','From Delegation Date','2021-08-31') ;
|
||||
( 'LABEL','ID_FROM_DELEGATION_DATE','en','From Delegation Date','2021-08-31') ,
|
||||
( 'LABEL','ID_FROM_EMAIL','en','Sender Email','2017-02-21') ,
|
||||
( 'LABEL','ID_FROM_FINISH_DATE','en','From Finish Date','2020-12-16') ,
|
||||
( 'LABEL','ID_FROM_NAME','en','Sender Name','2017-02-21') ,
|
||||
|
||||
@@ -113,6 +113,9 @@ class AbstractCases implements CasesInterface
|
||||
|
||||
// Filter by specific cases, know as "$appUidCheck" in the old lists classes
|
||||
private $casesUids = [];
|
||||
|
||||
// Filter by Send By
|
||||
private $sendBy = '';
|
||||
|
||||
// Filter range related to the start case date
|
||||
private $startCaseFrom = '';
|
||||
@@ -749,6 +752,26 @@ class AbstractCases implements CasesInterface
|
||||
return $this->casesUids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set send by.
|
||||
*
|
||||
* @param type $sendBy
|
||||
*/
|
||||
public function setSendBy(string $sendBy)
|
||||
{
|
||||
$this->sendBy = $sendBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get send by.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSendBy()
|
||||
{
|
||||
return $this->sendBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Cases Numbers
|
||||
*
|
||||
@@ -1381,6 +1404,10 @@ class AbstractCases implements CasesInterface
|
||||
if (get_class($this) === Inbox::class && !empty($properties['delegateTo'])) {
|
||||
$this->setDelegateTo($properties['delegateTo']);
|
||||
}
|
||||
// Filter by Send By
|
||||
if (get_class($this) === Inbox::class && !empty($properties['sendBy'])) {
|
||||
$this->setSendBy($properties['sendBy']);
|
||||
}
|
||||
/** Apply filters related to PAUSED */
|
||||
// Filter date related to delegate from
|
||||
if (get_class($this) === Paused::class && !empty($properties['delegateFrom'])) {
|
||||
@@ -1390,6 +1417,10 @@ class AbstractCases implements CasesInterface
|
||||
if (get_class($this) === Paused::class && !empty($properties['delegateTo'])) {
|
||||
$this->setDelegateTo($properties['delegateTo']);
|
||||
}
|
||||
// Filter by Send By
|
||||
if (get_class($this) === Paused::class && !empty($properties['sendBy'])) {
|
||||
$this->setSendBy($properties['sendBy']);
|
||||
}
|
||||
/** Apply filters related to UNASSIGNED */
|
||||
// Filter date related to delegate from
|
||||
if (get_class($this) === Unassigned::class && !empty($properties['delegateFrom'])) {
|
||||
@@ -1399,6 +1430,10 @@ class AbstractCases implements CasesInterface
|
||||
if (get_class($this) === Unassigned::class && !empty($properties['delegateTo'])) {
|
||||
$this->setDelegateTo($properties['delegateTo']);
|
||||
}
|
||||
// Filter by Send By
|
||||
if (get_class($this) === Unassigned::class && !empty($properties['sendBy'])) {
|
||||
$this->setSendBy($properties['sendBy']);
|
||||
}
|
||||
|
||||
/** Apply filters related to MY CASES */
|
||||
// My cases filter: started, in-progress, completed, supervising
|
||||
|
||||
@@ -78,6 +78,7 @@ class Home
|
||||
$sort = explode(',', $sort);
|
||||
$properties['sort'] = $sort[0];
|
||||
$properties['dir'] = $sort[1];
|
||||
$properties['sendBy'] = $sendBy;
|
||||
$list->setProperties($properties);
|
||||
$result = [];
|
||||
$result['data'] = DateTime::convertUtcToTimeZone($list->getData($callback));
|
||||
@@ -97,6 +98,7 @@ class Home
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @param callable $callback
|
||||
* @return array
|
||||
*/
|
||||
@@ -111,6 +113,7 @@ class Home
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = '',
|
||||
callable $callback = null
|
||||
)
|
||||
{
|
||||
@@ -133,6 +136,7 @@ class Home
|
||||
$sort = explode(',', $sort);
|
||||
$properties['sort'] = $sort[0];
|
||||
$properties['dir'] = $sort[1];
|
||||
$properties['sendBy'] = $sendBy;
|
||||
$list->setProperties($properties);
|
||||
$result = [];
|
||||
$result['data'] = DateTime::convertUtcToTimeZone($list->getData($callback));
|
||||
@@ -152,6 +156,7 @@ class Home
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @param callable $callback
|
||||
* @return array
|
||||
*/
|
||||
@@ -166,6 +171,7 @@ class Home
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = '',
|
||||
callable $callback = null
|
||||
)
|
||||
{
|
||||
@@ -188,6 +194,7 @@ class Home
|
||||
$sort = explode(',', $sort);
|
||||
$properties['sort'] = $sort[0];
|
||||
$properties['dir'] = $sort[1];
|
||||
$properties['sendBy'] = $sendBy;
|
||||
// todo: some queries related to the unassigned are using the USR_UID
|
||||
$list->setUserUid($usrUid);
|
||||
$list->setProperties($properties);
|
||||
@@ -209,6 +216,7 @@ class Home
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @param callable $callback
|
||||
* @return array
|
||||
*/
|
||||
@@ -223,6 +231,7 @@ class Home
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = '',
|
||||
callable $callback = null
|
||||
)
|
||||
{
|
||||
@@ -245,6 +254,7 @@ class Home
|
||||
$sort = explode(',', $sort);
|
||||
$properties['sort'] = $sort[0];
|
||||
$properties['dir'] = $sort[1];
|
||||
$properties['sendBy'] = $sendBy;
|
||||
$list->setProperties($properties);
|
||||
$result = [];
|
||||
$result['data'] = DateTime::convertUtcToTimeZone($list->getData($callback));
|
||||
@@ -349,6 +359,7 @@ class Home
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @return array
|
||||
*/
|
||||
public function getCustomInbox(
|
||||
@@ -362,7 +373,8 @@ class Home
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
$arguments = func_get_args();
|
||||
@@ -390,6 +402,7 @@ class Home
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @return array
|
||||
*/
|
||||
public function getCustomUnassigned(
|
||||
@@ -403,7 +416,8 @@ class Home
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
$arguments = func_get_args();
|
||||
@@ -431,6 +445,7 @@ class Home
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @return array
|
||||
*/
|
||||
public function getCustomPaused(
|
||||
@@ -444,7 +459,8 @@ class Home
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
$arguments = func_get_args();
|
||||
|
||||
@@ -91,6 +91,11 @@ class Inbox extends AbstractCases
|
||||
$query->delegateDateTo($this->getDelegateTo());
|
||||
}
|
||||
|
||||
// Specific usrId represented by sendBy.
|
||||
if (!empty($this->getSendBy())) {
|
||||
$query->sendBy($this->getSendBy());
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,11 @@ class Paused extends AbstractCases
|
||||
$query->delegateDateTo($this->getDelegateTo());
|
||||
}
|
||||
|
||||
// Specific usrId represented by sendBy.
|
||||
if (!empty($this->getSendBy())) {
|
||||
$query->sendBy($this->getSendBy());
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@ class Unassigned extends AbstractCases
|
||||
$query->delegateDateTo($this->getDelegateTo());
|
||||
}
|
||||
|
||||
// Specific usrId represented by sendBy.
|
||||
if (!empty($this->getSendBy())) {
|
||||
$query->sendBy($this->getSendBy());
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
@@ -1032,6 +1032,24 @@ class Delegation extends Model
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope sendBy.
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param int $usrId
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeSendBy($query, int $usrId)
|
||||
{
|
||||
$query->where(DB::raw($usrId), function ($sql) {
|
||||
$sql->from('APP_DELEGATION AS B')
|
||||
->select('B.USR_ID')
|
||||
->where('B.APP_NUMBER', '=', DB::raw('APP_DELEGATION.APP_NUMBER'))
|
||||
->where('B.DEL_INDEX', '=', DB::raw('APP_DELEGATION.DEL_PREVIOUS'))
|
||||
->limit(1);
|
||||
});
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get specific cases unassigned that the user can view
|
||||
*
|
||||
|
||||
@@ -101,6 +101,7 @@ class Home extends Api
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -119,7 +120,8 @@ class Home extends Api
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
try {
|
||||
@@ -145,6 +147,7 @@ class Home extends Api
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -163,7 +166,8 @@ class Home extends Api
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
try {
|
||||
@@ -189,6 +193,7 @@ class Home extends Api
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -207,7 +212,8 @@ class Home extends Api
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
try {
|
||||
@@ -269,6 +275,7 @@ class Home extends Api
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @return array
|
||||
* @throws RestException
|
||||
* @access protected
|
||||
@@ -285,7 +292,8 @@ class Home extends Api
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
try {
|
||||
@@ -310,6 +318,7 @@ class Home extends Api
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @return array
|
||||
* @throws RestException
|
||||
* @access protected
|
||||
@@ -326,7 +335,8 @@ class Home extends Api
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
try {
|
||||
@@ -351,6 +361,7 @@ class Home extends Api
|
||||
* @param string $delegateTo
|
||||
* @param string $filterCases
|
||||
* @param string $sort
|
||||
* @param string $sendBy
|
||||
* @return array
|
||||
* @throws RestException
|
||||
* @access protected
|
||||
@@ -367,7 +378,8 @@ class Home extends Api
|
||||
string $delegateFrom = '',
|
||||
string $delegateTo = '',
|
||||
string $filterCases = '',
|
||||
string $sort = 'APP_NUMBER,DESC'
|
||||
string $sort = 'APP_NUMBER,DESC',
|
||||
string $sendBy = ''
|
||||
)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user