fix conflicts

This commit is contained in:
Rodrigo Quelca
2021-12-08 13:16:38 +00:00
39 changed files with 1038 additions and 431 deletions

View File

@@ -17,6 +17,7 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
'TAS_DURATION' => 1, 'TAS_DURATION' => 1,
'TAS_ASSIGN_TYPE' => 'BALANCED', 'TAS_ASSIGN_TYPE' => 'BALANCED',
'TAS_DEF_TITLE' => $faker->sentence(2), 'TAS_DEF_TITLE' => $faker->sentence(2),
'TAS_DEF_DESCRIPTION' => $faker->sentence(2),
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED', 'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE', 'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE', 'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',
@@ -47,6 +48,7 @@ $factory->state(\ProcessMaker\Model\Task::class, 'foreign_keys', function (Faker
'TAS_DURATION' => 1, 'TAS_DURATION' => 1,
'TAS_ASSIGN_TYPE' => 'BALANCED', 'TAS_ASSIGN_TYPE' => 'BALANCED',
'TAS_DEF_TITLE' => $faker->sentence(2), 'TAS_DEF_TITLE' => $faker->sentence(2),
'TAS_DEF_DESCRIPTION' => $faker->sentence(2),
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED', 'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE', 'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE', 'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',

View File

@@ -1,81 +1,89 @@
<template> <template>
<div> <div>
<SearchPopover <SearchPopover
target="popover-target-1" target="popover-target-1"
@savePopover="onOk" @savePopover="onOk"
:title="addSearchTitle" :title="addSearchTitle"
> >
<template v-slot:body> <template v-slot:body>
<b-form-group> <b-form-group>
<b-form-radio-group <b-form-radio-group
v-model="selected" v-model="selected"
:options="criteriaItems" :options="criteriaItems"
value-field="id" value-field="id"
text-field="optionLabel" text-field="optionLabel"
name="flavour-2a" name="flavour-2a"
stacked stacked
></b-form-radio-group> ></b-form-radio-group>
<b-form-group> <b-form-group> </b-form-group>
</b-form-group> <b-form-checkbox
<b-form-checkbox id="checkbox-1"
id="checkbox-1" v-model="byProcessName"
v-model="byProcessName" name="checkbox-1"
name="checkbox-1" value="processName"
value="processName" >
> {{ $t("ID_BY_PROCESS_NAME") }}
{{$t('ID_BY_PROCESS_NAME') }} </b-form-checkbox>
</b-form-checkbox> <b-form-checkbox
</b-form-group> id="checkbox-2"
</template> v-model="byProcessCategory"
</SearchPopover> name="checkbox-2"
value="processCategory"
<div class="p-1 filter-field"> >
<h5 class="v-search-title">{{ title }}</h5> {{ $t("ID_BY_PROCESS_CATEGORY") }}
<div class="pm-in-text-icon"> </b-form-checkbox>
<i :class="icon"></i> </b-form-group>
</div>
<b-input-group class="w-75 p-1">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span
class="input-group-text bg-primary-pm text-white"
id="popover-target-1"
@click="searchClickHandler"
>
<b-icon icon="search"></b-icon
></span>
</div>
<b-form-tags input-id="tags-pills" v-model="searchTags">
<template v-slot="{ tags, tagVariant, removeTag }">
<div class="d-inline-block" style="font-size: 1rem">
<b-form-tag
v-for="tag in tags"
@remove="customRemove(removeTag, tag)"
:key="tag"
:title="tag"
:variant="tagVariant"
class="mr-1 badge badge-light"
>
<div :id="tag">
<i class="fas fa-tags"></i>
{{ tagContent(tag) }}
</div>
<component
v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)"
v-bind:tag="tag"
v-bind:filter="dataToFilter(tag)"
@updateSearchTag="updateSearchTag"
/>
</b-form-tag>
</div>
</template> </template>
</b-form-tags> </SearchPopover>
<div class="p-1 filter-field">
<h5 class="v-search-title">{{ title }}</h5>
<div class="pm-in-text-icon">
<i :class="icon"></i>
</div>
<b-input-group class="w-75 p-1">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span
class="input-group-text bg-primary-pm text-white"
id="popover-target-1"
@click="searchClickHandler"
>
<b-icon icon="search"></b-icon
></span>
</div>
<b-form-tags input-id="tags-pills" v-model="searchTags">
<template v-slot="{ tags, tagVariant, removeTag }">
<div class="d-inline-block" style="font-size: 1rem">
<b-form-tag
v-for="tag in tags"
@remove="customRemove(removeTag, tag)"
:key="tag"
:title="tag"
:variant="tagVariant"
class="mr-1 badge badge-light"
>
<div :id="tag">
<i class="fas fa-tags"></i>
{{ tagContent(tag) }}
</div>
<component
:filters="filters"
v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)"
v-bind:tag="tag"
v-bind:filter="dataToFilter(tag)"
@updateSearchTag="updateSearchTag"
/>
</b-form-tag>
</div>
</template>
</b-form-tags>
</div>
</b-input-group>
</div> </div>
</b-input-group>
</div> </div>
</div>
</template> </template>
<script> <script>
@@ -83,363 +91,456 @@ import SearchPopover from "./popovers/SearchPopover.vue";
import CaseNumber from "./popovers/CaseNumber.vue"; import CaseNumber from "./popovers/CaseNumber.vue";
import CaseTitle from "./popovers/CaseTitle.vue"; import CaseTitle from "./popovers/CaseTitle.vue";
import ProcessName from "./popovers/ProcessName.vue"; import ProcessName from "./popovers/ProcessName.vue";
import ProcessCategory from "./popovers/ProcessCategory.vue";
import DateFilter from "./popovers/DateFilter.vue"; import DateFilter from "./popovers/DateFilter.vue";
import TaskTitle from "./popovers/TaskTitle.vue"; import TaskTitle from "./popovers/TaskTitle.vue";
import CurrentUser from "./popovers/CurrentUser.vue"; import CurrentUser from "./popovers/CurrentUser.vue";
import api from "./../../api/index"; import api from "./../../api/index";
export default { export default {
name: "Cases", name: "Cases",
props: ["filters", "title", "icon" , "hiddenItems"], props: ["filters", "title", "icon", "hiddenItems"],
components: { components: {
SearchPopover, SearchPopover,
CaseNumber, CaseNumber,
CaseTitle, CaseTitle,
ProcessName, ProcessName,
DateFilter, ProcessCategory,
TaskTitle, DateFilter,
CurrentUser TaskTitle,
}, CurrentUser,
data() { },
return { data() {
searchLabel: this.$i18n.t("ID_SEARCH"), return {
addSearchTitle: this.$i18n.t("ID_ADD_SEARCH_FILTER_CRITERIA"), searchLabel: this.$i18n.t("ID_SEARCH"),
searchTags: [], addSearchTitle: this.$i18n.t("ID_ADD_SEARCH_FILTER_CRITERIA"),
dataLoaded: false, searchTags: [],
filterItems: [ dataLoaded: false,
{ filterItems: [
type: "CaseNumber", {
id: "caseNumber", type: "CaseNumber",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( id: "caseNumber",
"ID_BY_CASE_NUMBER" title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
)}`, "ID_BY_CASE_NUMBER"
optionLabel: this.$i18n.t("ID_BY_CASE_NUMBER"), )}`,
detail: this.$i18n.t("ID_PLEASE_SET_THE_CASE_NUMBER_TO_BE_SEARCHED"), optionLabel: this.$i18n.t("ID_BY_CASE_NUMBER"),
tagText: "", detail: this.$i18n.t(
tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_NUMBER"), "ID_PLEASE_SET_THE_CASE_NUMBER_TO_BE_SEARCHED"
items: [ ),
{ tagText: "",
id: "filterCases", tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_NUMBER"),
value: "", items: [
{
id: "filterCases",
value: "",
},
],
autoShow: true,
makeTagText: function(params, data) {
return `${params.tagPrefix}: ${data[0].value}`;
}, },
],
autoShow: true,
makeTagText: function (params, data) {
return `${params.tagPrefix}: ${data[0].value}`;
}, },
}, {
{ type: "CaseTitle",
type: "CaseTitle", id: "caseTitle",
id: "caseTitle", title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( "ID_BY_CASE_THREAD_TITLE"
"ID_BY_CASE_THREAD_TITLE" )}`,
)}`, optionLabel: this.$i18n.t("ID_BY_CASE_THREAD_TITLE"),
optionLabel: this.$i18n.t("ID_BY_CASE_THREAD_TITLE"), tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_THREAD_TITLE"),
tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_THREAD_TITLE"), detail: "",
detail: "", tagText: "",
tagText: "", items: [
items: [ {
{ id: "caseTitle",
id: "caseTitle", value: "",
value: "", },
],
autoShow: true,
makeTagText: function(params, data) {
return `${this.tagPrefix} ${data[0].value}`;
}, },
],
autoShow: true,
makeTagText: function (params, data) {
return `${this.tagPrefix} ${data[0].value}`;
}, },
}, {
{ type: "DateFilter",
type: "DateFilter", id: "delegationDate",
id: "delegationDate", title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_DELEGATION_DATE')}`, "ID_BY_DELEGATION_DATE"
optionLabel: this.$i18n.t('ID_BY_DELEGATION_DATE'), )}`,
detail: this.$i18n.t('ID_PLEASE_SELECT_THE_DELEGATION_DATE_TO_BE_SEARCHED'), optionLabel: this.$i18n.t("ID_BY_DELEGATION_DATE"),
tagText: "", detail: this.$i18n.t(
tagPrefix: this.$i18n.t('ID_SEARCH_BY_DELEGATION_DATE'), "ID_PLEASE_SELECT_THE_DELEGATION_DATE_TO_BE_SEARCHED"
items:[ ),
{ tagText: "",
id: "delegateFrom", tagPrefix: this.$i18n.t("ID_SEARCH_BY_DELEGATION_DATE"),
value: "", items: [
label: this.$i18n.t('ID_FROM_DELEGATION_DATE') {
id: "delegateFrom",
value: "",
label: this.$i18n.t("ID_FROM_DELEGATION_DATE"),
},
{
id: "delegateTo",
value: "",
label: this.$i18n.t("ID_TO_DELEGATION_DATE"),
},
],
makeTagText: function(params, data) {
return `${params.tagPrefix} ${data[0].value} - ${data[1].value}`;
}, },
{
id: "delegateTo",
value: "",
label: this.$i18n.t('ID_TO_DELEGATION_DATE')
}
],
makeTagText: function (params, data) {
return `${params.tagPrefix} ${data[0].value} - ${data[1].value}`;
}
},
{
type: "CurrentUser",
id: "bySendBy",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_SEND_BY')}`,
optionLabel: this.$i18n.t('ID_BY_SEND_BY'),
detail: this.$i18n.t('ID_PLEASE_SELECT_USER_NAME_TO_BE_SEARCHED'),
placeholder: this.$i18n.t('ID_USER_NAME'),
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_SEND_BY'),
autoShow: true,
items:[
{
id: "sendBy",
value: "",
options: [],
placeholder: this.$i18n.t('ID_USER_NAME')
}
],
makeTagText: function (params, data) {
return `${params.tagPrefix} : ${data[0].label || ''}`;
}
},
{
type: "TaskTitle",
id: "taskTitle",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_TASK_NAME"
)}`,
optionLabel: this.$i18n.t("ID_BY_TASK"),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_TASK_NAME"),
autoShow: true,
items: [
{
id: "task",
value: "",
options: [],
placeholder: this.$i18n.t("ID_TASK_NAME"),
},
],
makeTagText: function (params, data) {
return `${this.tagPrefix}: ${data[0].label || ""}`;
}, },
}, {
], type: "CurrentUser",
processName: { id: "bySendBy",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_BY_SEND_BY"
)}`,
optionLabel: this.$i18n.t("ID_BY_SEND_BY"),
detail: this.$i18n.t(
"ID_PLEASE_SELECT_USER_NAME_TO_BE_SEARCHED"
),
placeholder: this.$i18n.t("ID_USER_NAME"),
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_SEND_BY"),
autoShow: true,
items: [
{
id: "sendBy",
value: "",
options: [],
placeholder: this.$i18n.t("ID_USER_NAME"),
},
],
makeTagText: function(params, data) {
return `${params.tagPrefix} : ${data[0].label || ""}`;
},
},
{
type: "TaskTitle",
id: "taskTitle",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_TASK_NAME"
)}`,
optionLabel: this.$i18n.t("ID_BY_TASK"),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_TASK_NAME"),
autoShow: true,
items: [
{
id: "task",
value: "",
options: [],
placeholder: this.$i18n.t("ID_TASK_NAME"),
},
],
makeTagText: function(params, data) {
return `${this.tagPrefix}: ${data[0].label || ""}`;
},
},
],
processName: {
type: "ProcessName", type: "ProcessName",
id: "processName", id: "processName",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_PROCESS_NAME')}`, title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
optionLabel: this.$i18n.t('ID_BY_PROCESS_NAME'), "ID_BY_PROCESS_NAME"
)}`,
optionLabel: this.$i18n.t("ID_BY_PROCESS_NAME"),
detail: "", detail: "",
tagText: "", tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_NAME'), tagPrefix: this.$i18n.t("ID_SEARCH_BY_PROCESS_NAME"),
autoShow: true, autoShow: true,
items:[ items: [
{ {
id: "process", id: "process",
value: "", value: "",
options: [], options: [],
placeholder: this.$i18n.t('ID_PROCESS_NAME') placeholder: this.$i18n.t("ID_PROCESS_NAME"),
} },
], ],
makeTagText: function (params, data) { makeTagText: function(params, data) {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; return `${this.tagPrefix} ${(data[0].options &&
data[0].options.label) ||
""}`;
},
},
processCategory: {
type: "ProcessCategory",
id: "processCategory",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_BY_PROCESS_CATEGORY"
)}`,
optionLabel: this.$i18n.t("ID_BY_PROCESS_CATEGORY"),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_PROCESS_CATEGORY"),
autoShow: true,
items: [
{
id: "category",
value: "",
options: [],
placeholder: "",
},
],
makeTagText: function(params, data) {
return `${params.tagPrefix}: ${data[0].label || ""}`;
},
},
selected: "",
itemModel: {},
byProcessName: "",
byProcessCategory: "",
};
},
computed: {
// a computed getter
criteriaItems: function() {
let found,
criteria = [];
if (this.hiddenItems && this.hiddenItems.length) {
this.filterItems.forEach((item) => {
found = this.hiddenItems.find((elem) => elem !== item.id);
if (found) {
criteria.push(item);
}
});
return criteria;
} else {
return this.filterItems;
}
},
},
mounted() {},
watch: {
filters: {
immediate: true,
handler(newVal, oldVal) {
this.searchTags = [];
this.selected = [];
//Prevent show popover at the first time
if (newVal.length) {
this.setFilters(newVal, oldVal);
this.searchClickHandler();
} }
}, },
selected: "", },
itemModel: {}, },
byProcessName: "" methods: {
}; /**
}, * Add filter criteria save button handler
computed: { */
// a computed getter onOk() {
criteriaItems: function () { let self = this,
let found, element,
criteria = []; initialFilters = [],
if (this.hiddenItems && this.hiddenItems.length) { item;
this.filterItems.forEach(item => { this.$root.$emit("bv::hide::popover");
found = this.hiddenItems.find( elem => elem !== item.id); element = _.find(this.filterItems, function(o) {
if (found) { return o.id === self.selected;
criteria.push(item); });
} if (element) {
}); initialFilters = this.prepareFilterItems(
return criteria; element.items,
} else { this.selected,
return this.filterItems; true
} );
}
},
mounted() {
},
watch: {
filters: {
immediate: true,
handler(newVal, oldVal) {
this.searchTags = [];
this.selected = [];
//Prevent show popover at the first time
if (newVal.length) {
this.setFilters(newVal, oldVal);
this.searchClickHandler();
} }
} //adding process name filter
} if (self.byProcessName !== "") {
}, if (element !== undefined) {
methods: { this.processName.autoShow = false;
/** } else {
* Add filter criteria save button handler this.processName.autoShow = true;
*/ }
onOk() { initialFilters = [
let self = this, ...new Set([
element, ...initialFilters,
initialFilters = [], ...this.prepareFilterItems(
item; this.processName.items,
this.$root.$emit("bv::hide::popover"); self.byProcessName,
element = _.find(this.filterItems, function (o) { true
return o.id === self.selected; ),
}); ]),
if (element) { ];
initialFilters = this.prepareFilterItems(element.items, this.selected, true);
}
//adding process name filter
if (self.byProcessName !== "") {
if (element !== undefined) {
this.processName.autoShow = false;
} else {
this.processName.autoShow = true;
} }
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; if (self.byProcessCategory !== "") {
} if (element !== undefined) {
this.$emit("onUpdateFilters", {params: initialFilters, refresh: false}); this.processCategory.autoShow = false;
}, } else {
/** this.processCategory.autoShow = true;
* Prepare the filter items }
* @param {array} items initialFilters = [
* @param {id} string ...new Set([
* @param {boolean} restore ...initialFilters,
*/ ...this.prepareFilterItems(
prepareFilterItems(items, id, restore){ this.processCategory.items,
let initialFilters = [], self.byProcessCategory,
self = this, true
filter, ),
item; ]),
_.forEach(items, function(value, key) { ];
filter = _.find(self.filters, function(o) { return o.filterVar === value.id; });
if (filter && restore) {
initialFilters.push(filter);
} else {
item = {
filterVar: value.id,
fieldId: id,
value: '',
label: "",
options: [],
autoShow: true
};
initialFilters.push(item);
} }
}); this.$emit("onUpdateFilters", {
return initialFilters; params: initialFilters,
}, refresh: false,
/** });
* Set Filters and make the tag labels },
* @param {object} filters json to manage the query /**
*/ * Prepare the filter items
setFilters(filters, oldVal) { * @param {array} items
let self = this; * @param {id} string
_.forEach(filters, function (item, key) { * @param {boolean} restore
let component = _.find(self.filterItems, function (o) { */
return o.id === item.fieldId; prepareFilterItems(items, id, restore) {
}); let initialFilters = [],
if (component) { self = this,
self.searchTags.push(component.id); filter,
self.selected = component.id; item;
self.itemModel[component.id] = component; _.forEach(items, function(value, key) {
self.itemModel[component.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : true; filter = _.find(self.filters, function(o) {
} return o.filterVar === value.id;
if(item.fieldId === "processName") { });
self.searchTags.push(self.processName.id); if (filter && restore) {
self.byProcessName = self.processName.id; initialFilters.push(filter);
self.itemModel[self.processName.id] = self.processName; } else {
self.itemModel[self.processName.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : self.processName.autoShow; item = {
} filterVar: value.id,
}); fieldId: id,
}, value: "",
dataToFilter(id) { label: "",
let data = []; options: [],
_.forEach(this.filters, function (item) { autoShow: true,
if (item.fieldId === id) { };
data.push(item); initialFilters.push(item);
} }
}); });
return data; return initialFilters;
}, },
/** /**
* * Set Filters and make the tag labels
*/ * @param {object} filters json to manage the query
tagContent(id) { */
if ( setFilters(filters, oldVal) {
this.itemModel[id] && let self = this;
typeof this.itemModel[id].makeTagText === "function" _.forEach(filters, function(item, key) {
) { let component = _.find(self.filterItems, function(o) {
return this.itemModel[id].makeTagText( return o.id === item.fieldId;
this.itemModel[id], });
this.dataToFilter(id) if (component) {
); self.searchTags.push(component.id);
} self.selected = component.id;
return ""; self.itemModel[component.id] = component;
}, self.itemModel[component.id].autoShow =
tagComponent(id) { typeof item.autoShow !== "undefined"
if (this.itemModel[id]) { ? item.autoShow
return this.itemModel[id].type; : true;
} }
return null; if (item.fieldId === "processName") {
}, self.searchTags.push(self.processName.id);
self.byProcessName = self.processName.id;
self.itemModel[self.processName.id] = self.processName;
self.itemModel[self.processName.id].autoShow =
typeof item.autoShow !== "undefined"
? item.autoShow
: self.processName.autoShow;
}
if (item.fieldId === "processCategory") {
self.searchTags.push(self.processCategory.id);
self.byProcessCategory = self.processCategory.id;
self.itemModel[self.processCategory.id] =
self.processCategory;
self.itemModel[self.processCategory.id].autoShow =
typeof self.processCategory.autoShow !== "undefined"
? self.processCategory.autoShow
: true;
}
});
},
dataToFilter(id) {
let data = [];
_.forEach(this.filters, function(item) {
if (item.fieldId === id) {
data.push(item);
}
});
return data;
},
/**
*
*/
tagContent(id) {
if (
this.itemModel[id] &&
typeof this.itemModel[id].makeTagText === "function"
) {
return this.itemModel[id].makeTagText(
this.itemModel[id],
this.dataToFilter(id)
);
}
return "";
},
tagComponent(id) {
if (this.itemModel[id]) {
return this.itemModel[id].type;
}
return null;
},
tagInfo(id) { tagInfo(id) {
if (this.itemModel[id]) { if (this.itemModel[id]) {
return this.itemModel[id]; return this.itemModel[id];
}
return null;
},
/**
* Remove from tag button
* @param {function} removeTag - default callback
* @param {string} tag filter identifier
*/
customRemove(removeTag, tag) {
let temp = [];
_.forEach(this.filters, function(item, key) {
if(item.fieldId !== tag) {
temp.push(item);
} }
}); return null;
if (tag === "processName") { },
this.byProcessName = ""; /**
} * Remove from tag button
this.$emit("onUpdateFilters", {params: temp, refresh: true}); * @param {function} removeTag - default callback
* @param {string} tag filter identifier
*/
customRemove(removeTag, tag) {
let temp = [];
_.forEach(this.filters, function(item, key) {
if (item.fieldId !== tag) {
temp.push(item);
}
});
if (tag === "processName") {
this.byProcessName = "";
}
if (tag === "processCategory") {
this.byProcessCategory = "";
}
this.$emit("onUpdateFilters", { params: temp, refresh: true });
},
/**
* Update the filter model this is fired from filter popaver save action
* @param {object} params - arrives the settings
* @param {string} tag filter identifier
*/
updateSearchTag(params) {
let temp = this.filters.concat(params);
temp = [...new Set([...this.filters, ...params])];
this.$emit("onUpdateFilters", { params: temp, refresh: true });
},
searchClickHandler() {
this.$root.$emit("bv::hide::popover");
},
}, },
/**
* Update the filter model this is fired from filter popaver save action
* @param {object} params - arrives the settings
* @param {string} tag filter identifier
*/
updateSearchTag(params) {
let temp = this.filters.concat(params);
temp = [...new Set([...this.filters, ...params])];
this.$emit("onUpdateFilters", { params: temp, refresh: true });
},
searchClickHandler() {
this.$root.$emit("bv::hide::popover");
},
},
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.bv-example-row .row + .row { .bv-example-row .row + .row {
margin-top: 1rem; margin-top: 1rem;
} }
.bv-example-row-flex-cols .row { .bv-example-row-flex-cols .row {
min-height: 10rem; min-height: 10rem;
} }
.bg-primary-pm { .bg-primary-pm {
background-color: #0099dd; background-color: #0099dd;
} }
.filter-field { .filter-field {
@@ -447,12 +548,12 @@ export default {
} }
.v-search-title { .v-search-title {
padding-right: 10px; padding-right: 10px;
line-height: 40px; line-height: 40px;
} }
.pm-in-text-icon { .pm-in-text-icon {
font-size: 1.40rem; font-size: 1.4rem;
padding-right: 10px; padding-right: 10px;
line-height: 40px; line-height: 40px;
} }
</style> </style>

View File

@@ -17,7 +17,7 @@
></b-form-radio-group> ></b-form-radio-group>
<b-form-group> </b-form-group> <b-form-group> </b-form-group>
<b-form-checkbox-group <b-form-checkbox-group
id="checkbox-1" id="checkbox-custom-filter"
v-model="selectedCheckbox" v-model="selectedCheckbox"
:options="getFilterColletion('checkbox')" :options="getFilterColletion('checkbox')"
value-field="id" value-field="id"
@@ -61,6 +61,7 @@
{{ tagContent(tag) }} {{ tagContent(tag) }}
</div> </div>
<component <component
:filters="filters"
v-bind:is="tagComponent(tag)" v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)" v-bind:info="tagInfo(tag)"
v-bind:tag="tag" v-bind:tag="tag"
@@ -82,6 +83,7 @@ import SearchPopover from "./popovers/SearchPopover.vue";
import CaseNumber from "./popovers/CaseNumber.vue"; import CaseNumber from "./popovers/CaseNumber.vue";
import CaseTitle from "./popovers/CaseTitle.vue"; import CaseTitle from "./popovers/CaseTitle.vue";
import ProcessName from "./popovers/ProcessName.vue"; import ProcessName from "./popovers/ProcessName.vue";
import ProcessCategory from "./popovers/ProcessCategory.vue";
import DateFilter from "./popovers/DateFilter.vue"; import DateFilter from "./popovers/DateFilter.vue";
import TaskTitle from "./popovers/TaskTitle.vue"; import TaskTitle from "./popovers/TaskTitle.vue";
import CurrentUser from "./popovers/CurrentUser.vue"; import CurrentUser from "./popovers/CurrentUser.vue";
@@ -97,6 +99,7 @@ export default {
CaseNumber, CaseNumber,
CaseTitle, CaseTitle,
ProcessName, ProcessName,
ProcessCategory,
DateFilter, DateFilter,
TaskTitle, TaskTitle,
CurrentUser, CurrentUser,
@@ -113,11 +116,13 @@ export default {
selectedCheckbox: [], selectedCheckbox: [],
itemModel: {}, itemModel: {},
byProcessName: "", byProcessName: "",
byProcessCategory: "",
criteriaItemsRadio: [], criteriaItemsRadio: [],
criteriaItemsCheckbox: [], criteriaItemsCheckbox: [],
showProcessName: true, showProcessName: true,
}; };
}, },
mounted(){},
watch: { watch: {
filters: { filters: {
immediate: true, immediate: true,
@@ -365,3 +370,9 @@ export default {
line-height: 3vw; line-height: 3vw;
} }
</style> </style>
<style>
#checkbox-custom-filter > .custom-control-inline{
display: block !important;
margin-right: 1rem;
}
</style>

View File

@@ -6,6 +6,7 @@
:title="addSearchTitle" :title="addSearchTitle"
> >
<template v-slot:body> <template v-slot:body>
<b-form-group> <b-form-group>
<b-form-radio-group <b-form-radio-group
v-model="selected" v-model="selected"
@@ -24,6 +25,15 @@
> >
{{$t('ID_BY_PROCESS_NAME') }} {{$t('ID_BY_PROCESS_NAME') }}
</b-form-checkbox> </b-form-checkbox>
<b-form-checkbox
id="checkbox-2"
v-model="byProcessCategory"
name="checkbox-2"
value="processCategory"
>
{{$t('ID_BY_PROCESS_CATEGORY') }}
</b-form-checkbox>
</template> </template>
</SearchPopover> </SearchPopover>
@@ -61,6 +71,7 @@
</div> </div>
<component <component
:filters="filters"
v-bind:is="tagComponent(tag)" v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)" v-bind:info="tagInfo(tag)"
v-bind:tag="tag" v-bind:tag="tag"
@@ -82,6 +93,7 @@ import SearchPopover from "./popovers/SearchPopover.vue";
import CaseNumber from "./popovers/CaseNumber.vue"; import CaseNumber from "./popovers/CaseNumber.vue";
import CaseTitle from "./popovers/CaseTitle.vue"; import CaseTitle from "./popovers/CaseTitle.vue";
import ProcessName from "./popovers/ProcessName.vue"; import ProcessName from "./popovers/ProcessName.vue";
import ProcessCategory from "./popovers/ProcessCategory.vue";
import DateFilter from "./popovers/DateFilter.vue"; import DateFilter from "./popovers/DateFilter.vue";
import TaskTitle from "./popovers/TaskTitle.vue"; import TaskTitle from "./popovers/TaskTitle.vue";
import api from "./../../api/index"; import api from "./../../api/index";
@@ -94,6 +106,7 @@ export default {
CaseNumber, CaseNumber,
CaseTitle, CaseTitle,
ProcessName, ProcessName,
ProcessCategory,
DateFilter, DateFilter,
TaskTitle TaskTitle
}, },
@@ -235,9 +248,31 @@ export default {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`;
} }
}, },
processCategory:{
type: "ProcessCategory",
id: "processCategory",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_PROCESS_CATEGORY')}`,
optionLabel: this.$i18n.t('ID_BY_PROCESS_CATEGORY'),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_CATEGORY'),
autoShow: true,
items:[
{
id: "category",
value: "",
options: [],
placeholder: ""
}
],
makeTagText: function (params, data) {
return `${params.tagPrefix}: ${data[0].label || ''}`;
}
},
selected: "", selected: "",
itemModel: {}, itemModel: {},
byProcessName: "" byProcessName: "",
byProcessCategory: "",
}; };
}, },
mounted() { mounted() {
@@ -284,6 +319,15 @@ export default {
} }
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])];
} }
//adding process name filter
if (self.byProcessCategory !== "") {
if (element !== undefined) {
this.processCategory.autoShow = false;
} else {
this.processCategory.autoShow = true;
}
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processCategory.items, self.byProcessCategory, true)])];
}
this.$emit("onUpdateFilters", {params: initialFilters, refresh: false}); this.$emit("onUpdateFilters", {params: initialFilters, refresh: false});
}, },
/** /**
@@ -334,6 +378,12 @@ export default {
self.itemModel[self.processName.id] = self.processName; self.itemModel[self.processName.id] = self.processName;
self.itemModel[self.processName.id].autoShow = typeof self.processName.autoShow !== "undefined" ? self.processName.autoShow : true; self.itemModel[self.processName.id].autoShow = typeof self.processName.autoShow !== "undefined" ? self.processName.autoShow : true;
} }
if(item.fieldId === "processCategory") {
self.searchTags.push(self.processCategory.id);
self.byProcessCategory = self.processCategory.id;
self.itemModel[self.processCategory.id] = self.processCategory;
self.itemModel[self.processCategory.id].autoShow = typeof self.processCategory.autoShow !== "undefined" ? self.processCategory.autoShow : true;
}
}); });
}, },
dataToFilter(id) { dataToFilter(id) {
@@ -382,6 +432,9 @@ export default {
if (tag === "processName") { if (tag === "processName") {
this.byProcessName = ""; this.byProcessName = "";
} }
if (tag === "processCategory") {
this.byProcessCategory = "";
}
this.$emit("onUpdateFilters", {params: temp, refresh: true}); this.$emit("onUpdateFilters", {params: temp, refresh: true});
}, },
/** /**

View File

@@ -38,6 +38,7 @@
import SearchPopover from "./SearchPopover.vue"; import SearchPopover from "./SearchPopover.vue";
import Multiselect from "vue-multiselect"; import Multiselect from "vue-multiselect";
import api from "./../../../api/index"; import api from "./../../../api/index";
import _ from "lodash";
export default { export default {
components: { components: {
@@ -57,11 +58,16 @@ export default {
* @param {string} query - string from the text field * @param {string} query - string from the text field
*/ */
asyncFind(query) { asyncFind(query) {
let self = this; let self = this,
cat = this.verifyCategory(),
params = { text: query };
this.isLoading = true; this.isLoading = true;
if (cat) {
params.category = cat;
}
self.processes = []; self.processes = [];
api.filters api.filters
.processList(query) .processListPaged(params)
.then((response) => { .then((response) => {
self.processes = []; self.processes = [];
_.forEach(response.data, function(elem, key) { _.forEach(response.data, function(elem, key) {
@@ -76,6 +82,13 @@ export default {
console.error(err); console.error(err);
}); });
}, },
verifyCategory() {
let cat = _.find(
this.$attrs.filters,
(o) => o.fieldId == "processCategory"
);
return cat ? cat.value : null;
},
/** /**
* Form validations review * Form validations review
*/ */

View File

@@ -52,6 +52,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -143,6 +146,7 @@ export default {
columns: [ columns: [
"case_number", "case_number",
"process_name", "process_name",
"process_category",
"status", "status",
"thread_title", "thread_title",
"task", "task",
@@ -158,6 +162,7 @@ export default {
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
status: this.$i18n.t("ID_STATUS"), status: this.$i18n.t("ID_STATUS"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
@@ -296,6 +301,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.THREAD_TITLES, THREAD_TITLE: v.THREAD_TITLES,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: this.formatTasks(v.THREAD_TASKS), TASK: this.formatTasks(v.THREAD_TASKS),
USER_DATA: this.formatUser(v.THREAD_USERS), USER_DATA: this.formatUser(v.THREAD_USERS),
START_DATE: v.APP_CREATE_DATE_LABEL, START_DATE: v.APP_CREATE_DATE_LABEL,

View File

@@ -58,7 +58,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -131,6 +133,9 @@
<span v-if="column === 'process_name'" class="v-card-text-highlight"> <span v-if="column === 'process_name'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_NAME"] }} {{ props["item"]["PROCESS_NAME"] }}
</span> </span>
<span v-if="column === 'process_category'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
<span v-if="column === 'due_date'" class="v-card-text-highlight"> <span v-if="column === 'due_date'" class="v-card-text-highlight">
{{ props["item"]["DUE_DATE"] }} {{ props["item"]["DUE_DATE"] }}
</span> </span>
@@ -185,6 +190,9 @@
<span v-if="column === 'process_name'" class="v-card-text-highlight"> <span v-if="column === 'process_name'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_NAME"] }} {{ props["item"]["PROCESS_NAME"] }}
</span> </span>
<span v-if="column === 'process_category'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
<span v-if="column === 'due_date'" class="v-card-text-highlight"> <span v-if="column === 'due_date'" class="v-card-text-highlight">
{{ props["item"]["DUE_DATE"] }} {{ props["item"]["DUE_DATE"] }}
</span> </span>
@@ -317,6 +325,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
due_date: this.$i18n.t("ID_DUE_DATE"), due_date: this.$i18n.t("ID_DUE_DATE"),
@@ -393,7 +402,8 @@ export default {
thread_title: "caseTitle", thread_title: "caseTitle",
delegation_date: "delegationDate", delegation_date: "delegationDate",
send_by: "bySendBy", send_by: "bySendBy",
process_name: "processName" process_name: "processName",
process_category: "processCategory"
}, },
customItems:{ customItems:{
VARCHAR: { VARCHAR: {
@@ -576,7 +586,30 @@ export default {
makeTagText: function (params, data) { makeTagText: function (params, data) {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`;
} }
} },
processCategory: {
group: "checkbox",
type: "ProcessCategory",
id: "processCategory",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_PROCESS_CATEGORY')}`,
optionLabel: this.$i18n.t('ID_BY_PROCESS_CATEGORY'),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_CATEGORY'),
autoShow: false,
items:[
{
id: "process",
value: "",
options: [],
placeholder: this.$i18n.t('ID_CATEGORY_PROCESS')
}
],
makeTagText: function (params, data) {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`;
}
},
showUserTooltip: true
} }
}; };
}, },
@@ -844,6 +877,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [ TASK: [
{ {
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,

View File

@@ -54,6 +54,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -104,6 +107,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -178,6 +189,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -296,6 +315,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
priority: this.$i18n.t("ID_PRIORITY"), priority: this.$i18n.t("ID_PRIORITY"),
actions: "" actions: ""
@@ -523,6 +543,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [{ TASK: [{
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR, CODE_COLOR: v.TAS_COLOR,

View File

@@ -54,6 +54,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
current_user: this.$i18n.t("ID_CURRENT_USER"), current_user: this.$i18n.t("ID_CURRENT_USER"),
due_date: this.$i18n.t("ID_DUE_DATE"), due_date: this.$i18n.t("ID_DUE_DATE"),

View File

@@ -49,7 +49,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -112,6 +114,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -193,6 +203,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -328,6 +346,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
due_date: this.$i18n.t("ID_DUE_DATE"), due_date: this.$i18n.t("ID_DUE_DATE"),
@@ -558,6 +577,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [ TASK: [
{ {
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,

View File

@@ -54,6 +54,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
current_user: this.$i18n.t("ID_CURRENT_USER"), current_user: this.$i18n.t("ID_CURRENT_USER"),
@@ -65,6 +66,7 @@ export default {
"case_number", "case_number",
"thread_title", "thread_title",
"process_name", "process_name",
"process_category",
"due_date", "due_date",
"delegation_date", "delegation_date",
"priority", "priority",

View File

@@ -50,6 +50,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="pending_taks" slot-scope="props"> <div slot="pending_taks" slot-scope="props">
<GroupedCell :data="props.row.PENDING_TASKS" /> <GroupedCell :data="props.row.PENDING_TASKS" />
</div> </div>
@@ -161,6 +164,7 @@ export default {
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
pending_taks: this.$i18n.t("ID_PENDING_TASKS"), pending_taks: this.$i18n.t("ID_PENDING_TASKS"),
status: this.$i18n.t("ID_CASESLIST_APP_STATUS"), status: this.$i18n.t("ID_CASESLIST_APP_STATUS"),
@@ -454,6 +458,8 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.THREAD_TITLES, THREAD_TITLE: v.THREAD_TITLES,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
STATUS: v.APP_STATUS, STATUS: v.APP_STATUS,
START_DATE: v.APP_CREATE_DATE_LABEL || "", START_DATE: v.APP_CREATE_DATE_LABEL || "",
FINISH_DATE: v.APP_FINISH_DATE_LABEL || "", FINISH_DATE: v.APP_FINISH_DATE_LABEL || "",

View File

@@ -1,8 +1,12 @@
import _ from "lodash";
import api from "../../api/index"; import api from "../../api/index";
export default { export default {
data() { data() {
return { return {
random: 1 random: 1,
defaultColumnsDisabled: [
"process_category"
]
}; };
}, },
methods: { methods: {

View File

@@ -48,6 +48,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -110,6 +113,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -191,6 +202,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -327,6 +346,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
due_date: this.$i18n.t("ID_DUE_DATE"), due_date: this.$i18n.t("ID_DUE_DATE"),
@@ -556,6 +576,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [{ TASK: [{
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR, CODE_COLOR: v.TAS_COLOR,

View File

@@ -53,6 +53,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
current_user: this.$i18n.t("ID_CURRENT_USER"), current_user: this.$i18n.t("ID_CURRENT_USER"),
@@ -64,6 +65,7 @@ export default {
"case_number", "case_number",
"thread_title", "thread_title",
"process_name", "process_name",
"process_category",
"due_date", "due_date",
"delegation_date", "delegation_date",
"priority", "priority",

View File

@@ -46,6 +46,9 @@
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -105,6 +108,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -186,6 +197,14 @@
>{{ props["item"]["PROCESS_NAME"] }} >{{ props["item"]["PROCESS_NAME"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="due_date" slot-scope="props" class="v-card-text"> <div slot="due_date" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -319,6 +338,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
due_date: this.$i18n.t("ID_DUE_DATE"), due_date: this.$i18n.t("ID_DUE_DATE"),
@@ -519,6 +539,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [{ TASK: [{
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR, CODE_COLOR: v.TAS_COLOR,

View File

@@ -53,6 +53,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
current_user: this.$i18n.t("ID_CURRENT_USER"), current_user: this.$i18n.t("ID_CURRENT_USER"),
@@ -64,6 +65,7 @@ export default {
"case_number", "case_number",
"thread_title", "thread_title",
"process_name", "process_name",
"process_category",
"due_date", "due_date",
"delegation_date", "delegation_date",
"priority", "priority",

View File

@@ -6,6 +6,9 @@ use Exception;
use G; use G;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\BusinessModel\Cases\AbstractCases; use ProcessMaker\BusinessModel\Cases\AbstractCases;
use ProcessMaker\BusinessModel\Cases\Draft;
use ProcessMaker\BusinessModel\Cases\Paused;
use ProcessMaker\BusinessModel\Cases\Unassigned;
use ProcessMaker\Model\Application; use ProcessMaker\Model\Application;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process; use ProcessMaker\Model\Process;
@@ -738,6 +741,8 @@ class AbstractCasesTest extends TestCase
$absCases = new AbstractCases(); $absCases = new AbstractCases();
$properties = []; $properties = [];
$absCases->setProperties($properties); $absCases->setProperties($properties);
$actual = $absCases->getCategoryId();
$this->assertEquals(0, $actual);
$actual = $absCases->getProcessId(); $actual = $absCases->getProcessId();
$this->assertEquals(0, $actual); $this->assertEquals(0, $actual);
$actual = $absCases->getTaskId(); $actual = $absCases->getTaskId();
@@ -784,6 +789,7 @@ class AbstractCasesTest extends TestCase
* This check the setter related all the properties * This check the setter related all the properties
* *
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProperties() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProperties()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setCategoryId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProcessId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProcessId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setTaskId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setTaskId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setUserId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setUserId()
@@ -799,6 +805,7 @@ class AbstractCasesTest extends TestCase
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setOffset() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setOffset()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setLimit() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setLimit()
* *
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getCategoryId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getProcessId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getProcessId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getTaskId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getTaskId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getUserId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getUserId()
@@ -820,6 +827,7 @@ class AbstractCasesTest extends TestCase
$absCases = new AbstractCases(); $absCases = new AbstractCases();
$properties = [ $properties = [
// Filters that works for all list // Filters that works for all list
'category' => rand(),
'process' => rand(), 'process' => rand(),
'task' => rand(), 'task' => rand(),
'user' => rand(), 'user' => rand(),
@@ -836,6 +844,8 @@ class AbstractCasesTest extends TestCase
]; ];
$absCases->setProperties($properties); $absCases->setProperties($properties);
// Tasks - Cases // Tasks - Cases
$actual = $absCases->getCategoryId();
$this->assertEquals($properties['category'], $actual);
$actual = $absCases->getProcessId(); $actual = $absCases->getProcessId();
$this->assertEquals($properties['process'], $actual); $this->assertEquals($properties['process'], $actual);
$actual = $absCases->getTaskId(); $actual = $absCases->getTaskId();
@@ -887,6 +897,33 @@ class AbstractCasesTest extends TestCase
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
/**
* This check the get task color
*
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getTaskColor()
* @test
*/
public function it_return_task_color_class()
{
$absCases = new Draft();
$dueDate = date('Y-m-d');
// Review on-time
$result = $absCases->getTaskColor($dueDate,'DRAFT' ,'2000-01-01');
$this->assertNotEmpty($result);
$absCases = new Paused();
$dueDate = date('Y-m-d');
// Review on-time
$result = $absCases->getTaskColor($dueDate,'PAUSED' ,'2000-01-01');
$this->assertNotEmpty($result);
$absCases = new Unassigned();
$dueDate = date('Y-m-d');
// Review on-time
$result = $absCases->getTaskColor($dueDate,'UNASSIGNED' ,'2000-01-01');
$this->assertNotEmpty($result);
}
/** /**
* This check task color according the due date * This check task color according the due date
* *
@@ -925,5 +962,31 @@ class AbstractCasesTest extends TestCase
$result = $absCases->threadInformation($thread, true, true); $result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
// APP_STATUS = DRAFT
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'DRAFT';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
// APP_STATUS = COMPLETED
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'COMPLETED';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
// DEL_THREAD_STATUS = PAUSED
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'TO_DO';
$thread['DEL_THREAD_STATUS'] = 'PAUSED';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
// TAS_ASSIGN_TYPE = SELF_SERVICE
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'TO_DO';
$thread['TAS_ASSIGN_TYPE'] = 'SELF_SERVICE';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
} }
} }

View File

@@ -789,7 +789,7 @@ class DraftTest extends TestCase
'APP_INIT_USER' => $user->USR_UID, 'APP_INIT_USER' => $user->USR_UID,
'APP_CUR_USER' => $user->USR_UID, 'APP_CUR_USER' => $user->USR_UID,
]); ]);
factory(Delegation::class)->states('foreign_keys')->create([ $del = factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN', 'DEL_THREAD_STATUS' => 'OPEN',
'DEL_INDEX' => 1, 'DEL_INDEX' => 1,
'USR_UID' => $application[0]->APP_INIT_USER, 'USR_UID' => $application[0]->APP_INIT_USER,
@@ -805,7 +805,7 @@ class DraftTest extends TestCase
$draft = new Draft(); $draft = new Draft();
$draft->setUserId($user->USR_ID); $draft->setUserId($user->USR_ID);
$draft->setUserUid($user->USR_ID); $draft->setUserUid($user->USR_ID);
$res = $draft->getCasesRisk($process->PRO_ID); $res = $draft->getCasesRisk($process->PRO_ID, $currentDate, $currentDate, 'ON_TIME', 10);
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }

View File

@@ -291,7 +291,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application->APP_INIT_USER); $home = new Home($application->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);
@@ -344,7 +344,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application->APP_INIT_USER); $home = new Home($application->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);
@@ -423,7 +423,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application->APP_INIT_USER); $home = new Home($application->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);
@@ -522,7 +522,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application1->APP_INIT_USER); $home = new Home($application1->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);

View File

@@ -3425,7 +3425,7 @@ class DelegationTest extends TestCase
public function it_get_thread_title() public function it_get_thread_title()
{ {
$delegation = factory(Delegation::class)->states('foreign_keys')->create(); $delegation = factory(Delegation::class)->states('foreign_keys')->create();
$result = Delegation::getThreadTitle($delegation->TAS_UID, $delegation->APP_NUMBER, $delegation->DEL_INDEX, []); $result = Delegation::getThreadTitle($delegation->TAS_UID, $delegation->APP_NUMBER, $delegation->DEL_PREVIOUS, []);
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
@@ -3584,6 +3584,19 @@ class DelegationTest extends TestCase
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
/**
* This check the return cases thread title
*
* @covers \ProcessMaker\Model\Delegation::casesThreadTitle()
* @test
*/
public function it_get_cases_thread_title()
{
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
$result = Delegation::casesThreadTitle($delegation->DEL_TITLE);
$this->assertNotEmpty($result);
}
/** /**
* Test the scopeParticipatedUser * Test the scopeParticipatedUser
* *

View File

@@ -3401,10 +3401,11 @@ class Cases
$lastFields = $this->executeTriggerFromList($triggersList, $fieldsCase, $stepType, $stepUidObj, $triggerType); $lastFields = $this->executeTriggerFromList($triggersList, $fieldsCase, $stepType, $stepUidObj, $triggerType);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$usrUid = empty($fieldsCase['USER_LOGGED']) ? '' : $fieldsCase['USER_LOGGED']; $usrUid = empty($_SESSION['USER_LOGGED']) ? '' : $_SESSION['USER_LOGGED'];
ChangeLog::getChangeLog() ChangeLog::getChangeLog()
->setObjectUid($stepUidObj) ->setObjectUid($stepUidObj)
->getUsrIdByUsrUid($usrUid) ->getUsrIdByUsrUid($usrUid, true)
->getTasIdByTasUid($tasUid, true)
->getExecutedAtIdByTriggerType($triggerType); ->getExecutedAtIdByTriggerType($triggerType);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/

View File

@@ -4403,6 +4403,12 @@ msgstr "The category name with {0}: \"{1}\" already exists."
msgid "The category with {0}: '{1}' does not exist." msgid "The category with {0}: '{1}' does not exist."
msgstr "The category with {0}: '{1}' does not exist." msgstr "The category with {0}: '{1}' does not exist."
# TRANSLATION
# LABEL/ID_CATEGORY_PROCESS
#: LABEL/ID_CATEGORY_PROCESS
msgid "Process Category"
msgstr "Process Category"
# TRANSLATION # TRANSLATION
# LABEL/ID_CATEGORY_SUCCESS_DELETE # LABEL/ID_CATEGORY_SUCCESS_DELETE
#: LABEL/ID_CATEGORY_SUCCESS_DELETE #: LABEL/ID_CATEGORY_SUCCESS_DELETE

View File

@@ -393,6 +393,11 @@ class AppProxy extends HttpProxyController
'label' => G::LoadTranslation('ID_PROCESS_NAME') . ': ', 'label' => G::LoadTranslation('ID_PROCESS_NAME') . ': ',
'value' => $processInfo['PRO_TITLE'], 'value' => $processInfo['PRO_TITLE'],
], ],
$i++ => [ // Process Category
'id' => 'CATEGORY',
'label' => G::LoadTranslation('ID_CATEGORY_PROCESS') . ': ',
'value' => $processInfo['PRO_CATEGORY_LABEL'],
],
$i++ => [ // Process description $i++ => [ // Process description
'id' => 'PRO_DESCRIPTION', 'id' => 'PRO_DESCRIPTION',
'label' => G::LoadTranslation('ID_PRO_DESCRIPTION') . ': ', 'label' => G::LoadTranslation('ID_PRO_DESCRIPTION') . ': ',

View File

@@ -57548,6 +57548,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_CATEGORY_NAME','en','Category Name','2014-01-15') , ( 'LABEL','ID_CATEGORY_NAME','en','Category Name','2014-01-15') ,
( 'LABEL','ID_CATEGORY_NAME_ALREADY_EXISTS','en','The category name with {0}: "{1}" already exists.','2014-06-12') , ( 'LABEL','ID_CATEGORY_NAME_ALREADY_EXISTS','en','The category name with {0}: "{1}" already exists.','2014-06-12') ,
( 'LABEL','ID_CATEGORY_NOT_EXIST','en','The category with {0}: ''{1}'' does not exist.','2014-05-29') , ( 'LABEL','ID_CATEGORY_NOT_EXIST','en','The category with {0}: ''{1}'' does not exist.','2014-05-29') ,
( 'LABEL','ID_CATEGORY_PROCESS','en','Process Category','2021-11-25') ,
( 'LABEL','ID_CATEGORY_SUCCESS_DELETE','en','Process category has been deleted correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_DELETE','en','Process category has been deleted correctly.','2014-01-15') ,
( 'LABEL','ID_CATEGORY_SUCCESS_NEW','en','Process category has been created correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_NEW','en','Process category has been created correctly.','2014-01-15') ,
( 'LABEL','ID_CATEGORY_SUCCESS_UPDATE','en','Process category has been updated correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_UPDATE','en','Process category has been updated correctly.','2014-01-15') ,

View File

@@ -1343,6 +1343,10 @@ class AbstractCases implements CasesInterface
*/ */
public function setProperties(array $properties) public function setProperties(array $properties)
{ {
// Filter by category
if (!empty($properties['category'])) {
$this->setCategoryId($properties['category']);
}
// Filter by process // Filter by process
if (!empty($properties['process'])) { if (!empty($properties['process'])) {
$this->setProcessId($properties['process']); $this->setProcessId($properties['process']);

View File

@@ -7,6 +7,7 @@ use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList; use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task; use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User; use ProcessMaker\Model\User;
class Draft extends AbstractCases class Draft extends AbstractCases
@@ -16,6 +17,7 @@ class Draft extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case # 'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title 'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process 'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task 'TASK.TAS_TITLE', // Task
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date 'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date
@@ -67,6 +69,10 @@ class Draft extends AbstractCases
if (!empty($this->getCaseTitle())) { if (!empty($this->getCaseTitle())) {
$query->title($this->getCaseTitle()); $query->title($this->getCaseTitle());
} }
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process // Specific process
if ($this->getProcessId()) { if ($this->getProcessId()) {
$query->processId($this->getProcessId()); $query->processId($this->getProcessId());
@@ -113,6 +119,9 @@ class Draft extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) { $results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label // Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']]; $priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}"); $item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -199,6 +208,11 @@ class Draft extends AbstractCases
$query = Delegation::query()->select(); $query = Delegation::query()->select();
// Add the initial scope for draft cases // Add the initial scope for draft cases
$query->draft($this->getUserId()); $query->draft($this->getUserId());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters // Apply filters
$this->filters($query); $this->filters($query);
// Return the number of rows // Return the number of rows

View File

@@ -38,7 +38,9 @@ class Home
/** /**
* Get the draft cases. * Get the draft cases.
*
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -47,10 +49,12 @@ class Home
* @param string $filterCases * @param string $filterCases
* @param string $sort * @param string $sort
* @param callable $callback * @param callable $callback
*
* @return array * @return array
*/ */
public function getDraft( public function getDraft(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -67,6 +71,7 @@ class Home
$properties['caseNumber'] = $caseNumber; $properties['caseNumber'] = $caseNumber;
$properties['caseTitle'] = $caseTitle; $properties['caseTitle'] = $caseTitle;
$properties['filterCases'] = $filterCases; $properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process; $properties['process'] = $process;
$properties['task'] = $task; $properties['task'] = $task;
// Get the user that access to the API // Get the user that access to the API
@@ -87,7 +92,9 @@ class Home
/** /**
* Get the inbox cases. * Get the inbox cases.
*
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -99,10 +106,12 @@ class Home
* @param string $sort * @param string $sort
* @param string $sendBy * @param string $sendBy
* @param callable $callback * @param callable $callback
*
* @return array * @return array
*/ */
public function getInbox( public function getInbox(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -124,6 +133,7 @@ class Home
$properties['delegateFrom'] = $delegateFrom; $properties['delegateFrom'] = $delegateFrom;
$properties['delegateTo'] = $delegateTo; $properties['delegateTo'] = $delegateTo;
$properties['filterCases'] = $filterCases; $properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process; $properties['process'] = $process;
$properties['task'] = $task; $properties['task'] = $task;
// Get the user that access to the API // Get the user that access to the API
@@ -145,7 +155,9 @@ class Home
/** /**
* Get the unassigned cases. * Get the unassigned cases.
*
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -157,10 +169,12 @@ class Home
* @param string $sort * @param string $sort
* @param string $sendBy * @param string $sendBy
* @param callable $callback * @param callable $callback
*
* @return array * @return array
*/ */
public function getUnassigned( public function getUnassigned(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -182,6 +196,7 @@ class Home
$properties['delegateFrom'] = $delegateFrom; $properties['delegateFrom'] = $delegateFrom;
$properties['delegateTo'] = $delegateTo; $properties['delegateTo'] = $delegateTo;
$properties['filterCases'] = $filterCases; $properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process; $properties['process'] = $process;
$properties['task'] = $task; $properties['task'] = $task;
// Get the user that access to the API // Get the user that access to the API
@@ -205,7 +220,9 @@ class Home
/** /**
* Get the paused cases. * Get the paused cases.
*
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -217,10 +234,12 @@ class Home
* @param string $sort * @param string $sort
* @param string $sendBy * @param string $sendBy
* @param callable $callback * @param callable $callback
*
* @return array * @return array
*/ */
public function getPaused( public function getPaused(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -242,6 +261,7 @@ class Home
$properties['delegateFrom'] = $delegateFrom; $properties['delegateFrom'] = $delegateFrom;
$properties['delegateTo'] = $delegateTo; $properties['delegateTo'] = $delegateTo;
$properties['filterCases'] = $filterCases; $properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process; $properties['process'] = $process;
$properties['task'] = $task; $properties['task'] = $task;
// Get the user that access to the API // Get the user that access to the API
@@ -263,6 +283,7 @@ class Home
/** /**
* Build the columns and data from the custom list. * Build the columns and data from the custom list.
*
* @param string $type * @param string $type
* @param int $id * @param int $id
* @param array $arguments * @param array $arguments
@@ -339,14 +360,16 @@ class Home
} }
}; };
} }
$arguments[1] = $proId; $arguments[2] = $proId;
} }
} }
/** /**
* Get the custom draft cases. * Get the custom draft cases.
*
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -355,11 +378,13 @@ class Home
* @param string $filterCases * @param string $filterCases
* @param string $sort * @param string $sort
* @param array $customFilters * @param array $customFilters
*
* @return array * @return array
*/ */
public function getCustomDraft( public function getCustomDraft(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -372,6 +397,7 @@ class Home
{ {
$arguments = [ $arguments = [
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -382,7 +408,7 @@ class Home
]; ];
//clear duplicate indexes //clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'filterCases', 'sort']; $keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'filterCases', 'sort'];
foreach ($keys as $value) { foreach ($keys as $value) {
unset($customFilters[$value]); unset($customFilters[$value]);
} }
@@ -398,8 +424,10 @@ class Home
/** /**
* Get the custom inbox cases. * Get the custom inbox cases.
*
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -411,11 +439,13 @@ class Home
* @param string $sort * @param string $sort
* @param string $sendBy * @param string $sendBy
* @param array $customFilters * @param array $customFilters
*
* @return array * @return array
*/ */
public function getCustomInbox( public function getCustomInbox(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -431,6 +461,7 @@ class Home
{ {
$arguments = [ $arguments = [
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -444,7 +475,7 @@ class Home
]; ];
//clear duplicate indexes //clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy']; $keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
foreach ($keys as $value) { foreach ($keys as $value) {
unset($customFilters[$value]); unset($customFilters[$value]);
} }
@@ -460,8 +491,10 @@ class Home
/** /**
* Get the custom unassigned cases. * Get the custom unassigned cases.
*
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -473,11 +506,13 @@ class Home
* @param string $sort * @param string $sort
* @param string $sendBy * @param string $sendBy
* @param array $customFilters * @param array $customFilters
*
* @return array * @return array
*/ */
public function getCustomUnassigned( public function getCustomUnassigned(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -493,6 +528,7 @@ class Home
{ {
$arguments = [ $arguments = [
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -506,7 +542,7 @@ class Home
]; ];
//clear duplicate indexes //clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy']; $keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
foreach ($keys as $value) { foreach ($keys as $value) {
unset($customFilters[$value]); unset($customFilters[$value]);
} }
@@ -522,8 +558,10 @@ class Home
/** /**
* Get the custom paused cases. * Get the custom paused cases.
*
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -535,11 +573,13 @@ class Home
* @param string $sort * @param string $sort
* @param string $sendBy * @param string $sendBy
* @param array $customFilters * @param array $customFilters
*
* @return array * @return array
*/ */
public function getCustomPaused( public function getCustomPaused(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -555,6 +595,7 @@ class Home
{ {
$arguments = [ $arguments = [
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -568,7 +609,7 @@ class Home
]; ];
//clear duplicate indexes //clear duplicate indexes
$keys = ['caseNumber', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy']; $keys = ['caseNumber', 'category', 'process', 'task', 'limit', 'offset', 'caseTitle', 'delegateFrom', 'delegateTo', 'filterCases', 'sort', 'sendBy'];
foreach ($keys as $value) { foreach ($keys as $value) {
unset($customFilters[$value]); unset($customFilters[$value]);
} }

View File

@@ -7,6 +7,7 @@ use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList; use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task; use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User; use ProcessMaker\Model\User;
class Inbox extends AbstractCases class Inbox extends AbstractCases
@@ -16,6 +17,7 @@ class Inbox extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case # 'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title 'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process 'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task 'TASK.TAS_TITLE', // Task
'USERS.USR_USERNAME', // Current UserName 'USERS.USR_USERNAME', // Current UserName
@@ -70,6 +72,10 @@ class Inbox extends AbstractCases
if (!empty($this->getCaseTitle())) { if (!empty($this->getCaseTitle())) {
$query->title($this->getCaseTitle()); $query->title($this->getCaseTitle());
} }
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process // Specific process
if ($this->getProcessId()) { if ($this->getProcessId()) {
$query->processId($this->getProcessId()); $query->processId($this->getProcessId());
@@ -131,6 +137,9 @@ class Inbox extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) { $results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label // Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']]; $priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}"); $item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -216,6 +225,11 @@ class Inbox extends AbstractCases
$query = Delegation::query()->select(); $query = Delegation::query()->select();
// Scope that sets the queries for List Inbox // Scope that sets the queries for List Inbox
$query->inbox($this->getUserId()); $query->inbox($this->getUserId());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters // Apply filters
$this->filters($query); $this->filters($query);
// Return the number of rows // Return the number of rows

View File

@@ -2,10 +2,12 @@
namespace ProcessMaker\BusinessModel\Cases; namespace ProcessMaker\BusinessModel\Cases;
use G;
use ProcessMaker\Model\Application; use ProcessMaker\Model\Application;
use ProcessMaker\Model\AppNotes; use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task; use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User; use ProcessMaker\Model\User;
class Participated extends AbstractCases class Participated extends AbstractCases
@@ -15,6 +17,7 @@ class Participated extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case # 'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title 'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process Name 'PROCESS.PRO_TITLE', // Process Name
'TASK.TAS_TITLE', // Pending Task 'TASK.TAS_TITLE', // Pending Task
'TASK.TAS_ASSIGN_TYPE', // Task assign rule 'TASK.TAS_ASSIGN_TYPE', // Task assign rule
@@ -68,10 +71,14 @@ class Participated extends AbstractCases
// Specific case title // Specific case title
if (!empty($this->getCaseTitle())) { if (!empty($this->getCaseTitle())) {
// Get the result // Get the result
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit()); $result = Delegation::casesThreadTitle($this->getCaseTitle());
// Add the filter // Add the filter
$query->specificCases($result); $query->specificCases($result);
} }
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Scope to search for an specific process // Scope to search for an specific process
if ($this->getProcessId()) { if ($this->getProcessId()) {
$query->processId($this->getProcessId()); $query->processId($this->getProcessId());
@@ -168,6 +175,9 @@ class Participated extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) use ($filter) { $results->transform(function ($item, $key) use ($filter) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Apply the date format defined in environment // Apply the date format defined in environment
$item['APP_CREATE_DATE_LABEL'] = !empty($item['APP_CREATE_DATE']) ? applyMaskDateEnvironment($item['APP_CREATE_DATE']): null; $item['APP_CREATE_DATE_LABEL'] = !empty($item['APP_CREATE_DATE']) ? applyMaskDateEnvironment($item['APP_CREATE_DATE']): null;
$item['APP_FINISH_DATE_LABEL'] = !empty($item['APP_FINISH_DATE']) ? applyMaskDateEnvironment($item['APP_FINISH_DATE']): null; $item['APP_FINISH_DATE_LABEL'] = !empty($item['APP_FINISH_DATE']) ? applyMaskDateEnvironment($item['APP_FINISH_DATE']): null;
@@ -367,6 +377,11 @@ class Participated extends AbstractCases
$query->lastThread(); $query->lastThread();
break; break;
} }
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters // Apply filters
$this->filters($query); $this->filters($query);
// Return the number of rows // Return the number of rows

View File

@@ -6,6 +6,7 @@ use G;
use ProcessMaker\Model\CaseList; use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task; use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User; use ProcessMaker\Model\User;
class Paused extends AbstractCases class Paused extends AbstractCases
@@ -15,6 +16,7 @@ class Paused extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case # 'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title 'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process 'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task 'TASK.TAS_TITLE', // Task
'USERS.USR_USERNAME', // Current UserName 'USERS.USR_USERNAME', // Current UserName
@@ -125,6 +127,9 @@ class Paused extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) { $results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label // Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']]; $priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}"); $item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -210,6 +215,11 @@ class Paused extends AbstractCases
$query = Delegation::query()->select(); $query = Delegation::query()->select();
// Scope that set the paused cases // Scope that set the paused cases
$query->paused($this->getUserId()); $query->paused($this->getUserId());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters // Apply filters
$this->filters($query); $this->filters($query);
// Return the number of rows // Return the number of rows

View File

@@ -7,8 +7,7 @@ use ProcessMaker\Model\Application;
use ProcessMaker\Model\AppNotes; use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process; use ProcessMaker\Model\Process;
use ProcessMaker\Model\Task; use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User;
class Search extends AbstractCases class Search extends AbstractCases
{ {
@@ -17,6 +16,7 @@ class Search extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APPLICATION.APP_NUMBER', // Case # 'APPLICATION.APP_NUMBER', // Case #
'APPLICATION.APP_TITLE AS DEL_TITLE', // Case Title 'APPLICATION.APP_TITLE AS DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process 'PROCESS.PRO_TITLE', // Process
'APPLICATION.APP_STATUS', // Status 'APPLICATION.APP_STATUS', // Status
'APPLICATION.APP_CREATE_DATE', // Case create date 'APPLICATION.APP_CREATE_DATE', // Case create date
@@ -156,6 +156,9 @@ class Search extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) { $results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Apply the date format defined in environment // Apply the date format defined in environment
$item['APP_CREATE_DATE_LABEL'] = !empty($item['APP_CREATE_DATE']) ? applyMaskDateEnvironment($item['APP_CREATE_DATE']): null; $item['APP_CREATE_DATE_LABEL'] = !empty($item['APP_CREATE_DATE']) ? applyMaskDateEnvironment($item['APP_CREATE_DATE']): null;
$item['APP_FINISH_DATE_LABEL'] = !empty($item['APP_FINISH_DATE']) ? applyMaskDateEnvironment($item['APP_FINISH_DATE']): null; $item['APP_FINISH_DATE_LABEL'] = !empty($item['APP_FINISH_DATE']) ? applyMaskDateEnvironment($item['APP_FINISH_DATE']): null;

View File

@@ -2,9 +2,11 @@
namespace ProcessMaker\BusinessModel\Cases; namespace ProcessMaker\BusinessModel\Cases;
use G;
use ProcessMaker\Model\AppNotes; use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\ProcessUser; use ProcessMaker\Model\ProcessUser;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User; use ProcessMaker\Model\User;
class Supervising extends AbstractCases class Supervising extends AbstractCases
@@ -14,6 +16,7 @@ class Supervising extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case # 'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title 'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process Name 'PROCESS.PRO_TITLE', // Process Name
'TASK.TAS_TITLE', // Pending Task 'TASK.TAS_TITLE', // Pending Task
'APPLICATION.APP_STATUS', // Status 'APPLICATION.APP_STATUS', // Status
@@ -66,10 +69,14 @@ class Supervising extends AbstractCases
// Specific case title // Specific case title
if (!empty($this->getCaseTitle())) { if (!empty($this->getCaseTitle())) {
// Get the result // Get the result
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit()); $result = Delegation::casesThreadTitle($this->getCaseTitle());
// Add the filter // Add the filter
$query->specificCases($result); $query->specificCases($result);
} }
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Scope to search for an specific process // Scope to search for an specific process
if ($this->getProcessId()) { if ($this->getProcessId()) {
$query->processId($this->getProcessId()); $query->processId($this->getProcessId());
@@ -144,6 +151,9 @@ class Supervising extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) { $results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get task color label // Get task color label
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']); $item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']]; $item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
@@ -243,6 +253,11 @@ class Supervising extends AbstractCases
$processes = ProcessUser::getProcessesOfSupervisor($this->getUserUid()); $processes = ProcessUser::getProcessesOfSupervisor($this->getUserUid());
// Scope the specific array of processes supervising // Scope the specific array of processes supervising
$query->processInList($processes); $query->processInList($processes);
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters // Apply filters
$this->filters($query); $this->filters($query);
// Return the number of rows // Return the number of rows

View File

@@ -7,6 +7,7 @@ use ProcessMaker\Model\Application;
use ProcessMaker\Model\CaseList; use ProcessMaker\Model\CaseList;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task; use ProcessMaker\Model\Task;
use ProcessMaker\Model\ProcessCategory;
use ProcessMaker\Model\User; use ProcessMaker\Model\User;
class Unassigned extends AbstractCases class Unassigned extends AbstractCases
@@ -16,6 +17,7 @@ class Unassigned extends AbstractCases
// Columns view in the cases list // Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case # 'APP_DELEGATION.APP_NUMBER', // Case #
'APP_DELEGATION.DEL_TITLE', // Case Title 'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.CATEGORY_ID', // Category
'PROCESS.PRO_TITLE', // Process 'PROCESS.PRO_TITLE', // Process
'TASK.TAS_TITLE', // Task 'TASK.TAS_TITLE', // Task
'USERS.USR_USERNAME', // Current UserName 'USERS.USR_USERNAME', // Current UserName
@@ -70,6 +72,10 @@ class Unassigned extends AbstractCases
if ($this->getCaseTitle()) { if ($this->getCaseTitle()) {
$query->title($this->getCaseTitle()); $query->title($this->getCaseTitle());
} }
// Specific category
if ($this->getCategoryId()) {
$query->categoryId($this->getCategoryId());
}
// Specific process // Specific process
if ($this->getProcessId()) { if ($this->getProcessId()) {
$query->processId($this->getProcessId()); $query->processId($this->getProcessId());
@@ -134,6 +140,9 @@ class Unassigned extends AbstractCases
$results = $query->get(); $results = $query->get();
// Prepare the result // Prepare the result
$results->transform(function ($item, $key) { $results->transform(function ($item, $key) {
// Get the category
$category = !empty($item['CATEGORY_ID']) ? ProcessCategory::getCategory($item['CATEGORY_ID']) : '';
$item['CATEGORY'] = !empty($category) ? $category : G::LoadTranslation('ID_PROCESS_NONE_CATEGORY');
// Get priority label // Get priority label
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']]; $priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}"); $item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
@@ -219,6 +228,11 @@ class Unassigned extends AbstractCases
$query = Delegation::query()->select(); $query = Delegation::query()->select();
// Add the initial scope for self-service cases // Add the initial scope for self-service cases
$query->selfService($this->getUserUid()); $query->selfService($this->getUserUid());
// Check if the category was defined
if ($this->getCategoryId()) {
// Join with process if the filter with category exist
$query->joinProcess();
}
// Apply filters // Apply filters
$this->filters($query); $this->filters($query);
// Return the number of rows // Return the number of rows

View File

@@ -390,6 +390,15 @@ class CaseList extends Model
'typeSearch' => 'search text', 'typeSearch' => 'search text',
'enableFilter' => false, 'enableFilter' => false,
'set' => true 'set' => true
], [
'list' => ['inbox', 'draft', 'paused', 'unassigned'],
'field' => 'process_category',
'name' => G::LoadTranslation('ID_PROCESS_CATEGORY'),
'type' => 'string',
'source' => 'APPLICATION',
'typeSearch' => 'search text',
'enableFilter' => false,
'set' => true
], [ ], [
'list' => ['inbox', 'draft', 'paused', 'unassigned'], 'list' => ['inbox', 'draft', 'paused', 'unassigned'],
'field' => 'task', 'field' => 'task',

View File

@@ -2181,12 +2181,10 @@ class Delegation extends Model
* Get cases filter by thread title * Get cases filter by thread title
* *
* @param string $search * @param string $search
* @param int $offset
* @param int $limit
* *
* @return array * @return array
*/ */
public static function casesThreadTitle(string $search, int $offset = 0, int $limit = 15) public static function casesThreadTitle(string $search)
{ {
// Get the case numbers related to this filter // Get the case numbers related to this filter
$query = Delegation::query()->select(['APP_NUMBER']); $query = Delegation::query()->select(['APP_NUMBER']);
@@ -2194,8 +2192,6 @@ class Delegation extends Model
$query->title($search); $query->title($search);
// Group by // Group by
$query->groupBy('APP_NUMBER'); $query->groupBy('APP_NUMBER');
// Apply the limit
$query->offset($offset)->limit($limit);
// Get the result // Get the result
$results = $query->get(); $results = $query->get();

View File

@@ -17,6 +17,18 @@ class ProcessCategory extends Model
public $timestamps = false; public $timestamps = false;
/**
* Scope a query to specific category id
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param int $category
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeCategory($query, $category)
{
return $query->where('CATEGORY_ID', $category);
}
/** /**
* Scope a query to specific category name * Scope a query to specific category name
* *
@@ -92,4 +104,22 @@ class ProcessCategory extends Model
return $query->first()->CATEGORY_ID; return $query->first()->CATEGORY_ID;
} }
} }
/**
* Get category name
*
* @param int $category
*
* @return string
*/
public static function getCategory(int $category)
{
$query = ProcessCategory::query()->select(['CATEGORY_NAME']);
$query->category($category);
if ($query->first()) {
return $query->first()->CATEGORY_NAME;
} else {
return '';
}
}
} }

View File

@@ -51,6 +51,7 @@ class Home extends Api
* @url GET /draft * @url GET /draft
* *
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -68,6 +69,7 @@ class Home extends Api
*/ */
public function doGetDraftCases( public function doGetDraftCases(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -81,6 +83,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId()); $bmHome = new BMHome($this->getUserId());
return $bmHome->getDraft( return $bmHome->getDraft(
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -101,6 +104,7 @@ class Home extends Api
* @url GET /todo [This is kept for compatibility should not be used 'todo', the reason is to only handle the same verb (inbox) for all 'normal case list' and 'custom case list'] * @url GET /todo [This is kept for compatibility should not be used 'todo', the reason is to only handle the same verb (inbox) for all 'normal case list' and 'custom case list']
* *
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -121,6 +125,7 @@ class Home extends Api
*/ */
public function doGetTodoCases( public function doGetTodoCases(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -137,6 +142,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId()); $bmHome = new BMHome($this->getUserId());
return $bmHome->getInbox( return $bmHome->getInbox(
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -159,6 +165,7 @@ class Home extends Api
* @url GET /unassigned * @url GET /unassigned
* *
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -179,6 +186,7 @@ class Home extends Api
*/ */
public function doGetUnassignedCases( public function doGetUnassignedCases(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -195,6 +203,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId()); $bmHome = new BMHome($this->getUserId());
return $bmHome->getUnassigned( return $bmHome->getUnassigned(
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -217,6 +226,7 @@ class Home extends Api
* @url GET /paused * @url GET /paused
* *
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -237,6 +247,7 @@ class Home extends Api
*/ */
public function doGetPausedCases( public function doGetPausedCases(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -253,6 +264,7 @@ class Home extends Api
$bmHome = new BMHome($this->getUserId()); $bmHome = new BMHome($this->getUserId());
return $bmHome->getPaused( return $bmHome->getPaused(
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -274,6 +286,7 @@ class Home extends Api
* @url POST /draft/:id * @url POST /draft/:id
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -290,6 +303,7 @@ class Home extends Api
public function doGetCustomDraftCases( public function doGetCustomDraftCases(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -305,6 +319,7 @@ class Home extends Api
return $bmHome->getCustomDraft( return $bmHome->getCustomDraft(
$id, $id,
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -324,6 +339,7 @@ class Home extends Api
* @url POST /inbox/:id * @url POST /inbox/:id
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -343,6 +359,7 @@ class Home extends Api
public function doGetCustomInboxCases( public function doGetCustomInboxCases(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -361,6 +378,7 @@ class Home extends Api
return $bmHome->getCustomInbox( return $bmHome->getCustomInbox(
$id, $id,
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -383,6 +401,7 @@ class Home extends Api
* @url POST /unassigned/:id * @url POST /unassigned/:id
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -402,6 +421,7 @@ class Home extends Api
public function doGetCustomUnassignedCases( public function doGetCustomUnassignedCases(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -420,6 +440,7 @@ class Home extends Api
return $bmHome->getCustomUnassigned( return $bmHome->getCustomUnassigned(
$id, $id,
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -442,6 +463,7 @@ class Home extends Api
* @url POST /paused/:id * @url POST /paused/:id
* @param int $id * @param int $id
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -461,6 +483,7 @@ class Home extends Api
public function doGetCustomPausedCases( public function doGetCustomPausedCases(
int $id, int $id,
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -479,6 +502,7 @@ class Home extends Api
return $bmHome->getCustomPaused( return $bmHome->getCustomPaused(
$id, $id,
$caseNumber, $caseNumber,
$category,
$process, $process,
$task, $task,
$limit, $limit,
@@ -502,6 +526,7 @@ class Home extends Api
* @url GET /mycases * @url GET /mycases
* *
* @param int $caseNumber * @param int $caseNumber
* @param int $category
* @param int $process * @param int $process
* @param int $task * @param int $task
* @param int $limit * @param int $limit
@@ -525,6 +550,7 @@ class Home extends Api
*/ */
public function doGetMyCases( public function doGetMyCases(
int $caseNumber = 0, int $caseNumber = 0,
int $category = 0,
int $process = 0, int $process = 0,
int $task = 0, int $task = 0,
int $limit = 15, int $limit = 15,
@@ -544,6 +570,7 @@ class Home extends Api
$properties['caseNumber'] = $caseNumber; $properties['caseNumber'] = $caseNumber;
$properties['caseTitle'] = $caseTitle; $properties['caseTitle'] = $caseTitle;
$properties['filterCases'] = $filterCases; $properties['filterCases'] = $filterCases;
$properties['category'] = $category;
$properties['process'] = $process; $properties['process'] = $process;
$properties['task'] = $task; $properties['task'] = $task;
// Get the user that access to the API // Get the user that access to the API

View File

@@ -6,7 +6,7 @@ Ext.onReady(function () {
layout: 'border', layout: 'border',
items: [ items: [
new Ext.grid.GridPanel({ new Ext.grid.GridPanel({
region: 'center', "region": 'center',
"width": "100%", "width": "100%",
"height": 300, "height": 300,
"stateful": true, "stateful": true,
@@ -56,13 +56,18 @@ Ext.onReady(function () {
header: _('ID_FIELD_NAME'), header: _('ID_FIELD_NAME'),
width: 120, width: 120,
sortable: false, sortable: false,
dataIndex: 'field' dataIndex: 'field',
menuDisabled: true,
renderer: function (value, metaData, record, rowIndex, colIndex, store) {
return "<b>"+value+"</b>";
}
}, },
{ {
header: _('ID_PREV_VALUES'), header: _('ID_PREV_VALUES'),
flex: 1, flex: 1,
sortable: false, sortable: false,
dataIndex: 'previousValue', dataIndex: 'previousValue',
menuDisabled: true,
renderer: function (value, p, record) { renderer: function (value, p, record) {
return value; return value;
} }
@@ -72,6 +77,7 @@ Ext.onReady(function () {
flex: 1, flex: 1,
sortable: false, sortable: false,
dataIndex: 'currentValue', dataIndex: 'currentValue',
menuDisabled: true,
renderer: function (value, p, record) { renderer: function (value, p, record) {
return value; return value;
} }