Merged in release/3.6.0 (pull request #7740)

Updating develop with last changes in 3.6.0

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2021-01-25 13:18:19 +00:00
committed by Julio Cesar Laura Avendaño
67 changed files with 2259 additions and 1323 deletions

View File

@@ -68,7 +68,8 @@ const services = {
SEARCH: "/home/search",
PROCESSES: "/home/processes",
USERS: "/home/users",
TASKS: "/home/tasks"
TASKS: "/home/tasks",
DEBUG_STATUS: "/home/process-debug-status?processUid={prj_uid}"
};
export default {

View File

@@ -45,6 +45,16 @@ export let cases = {
keys: {}
});
},
openSummary(data) {
var params = new FormData();
params.append('appUid', data.APP_UID);
params.append('delIndex', data.DEL_INDEX);
params.append('action', 'todo');
return axios.post(window.config.SYS_SERVER +
window.config.SYS_URI +
`appProxy/requestOpenSummary`, params);
},
inputdocuments(data) {
var params = new FormData();
params.append('appUid', data.APP_UID);
@@ -73,7 +83,11 @@ export let cases = {
return axios.post(window.config.SYS_SERVER +
window.config.SYS_URI +
`appProxy/getSummary`, params);
`appProxy/getSummary`, params, {
headers: {
'Cache-Control': 'no-cache'
}
});
},
casenotes(data) {
var params = new FormData();
@@ -125,6 +139,14 @@ export let cases = {
window.config.SYS_URI +
`cases/ajaxListener`, params);
},
actions(data) {
var params = new URLSearchParams();
params.append('action', 'getCaseMenu');
params.append('app_status', 'TO_DO');
return axios.post(window.config.SYS_SERVER +
window.config.SYS_URI +
`cases/ajaxListener`, params);
},
unpause(data) {
var params = new URLSearchParams();
params.append('action', 'unpauseCase');
@@ -164,8 +186,49 @@ export let cases = {
keys: {},
paged: dt.paged
})
}
},
/**
* Make a search request to the Api service
* @param {object} dt - filter parameters
*/
debugStatus(dt) {
return Api.get({
service: "DEBUG_STATUS",
params: {},
keys: {
prj_uid: dt.PRO_UID
}
})
},
/**
* Get debug Vars in ajax service
* @param {*} data
*/
debugVars(data) {
var params;
if (data.filter === "all") {
return axios.get(window.config.SYS_SERVER +
window.config.SYS_URI +
`cases/debug_vars`);
} else {
params = new URLSearchParams();
params.append('filter', data.filter);
return axios.post(window.config.SYS_SERVER +
window.config.SYS_URI +
`cases/debug_vars`, params);
}
},
/**
* Get triggers debug Vars in ajax service
* @param {*} data
*/
debugVarsTriggers(data) {
let dc = _.random(0, 10000000000),
r = _.random(1.0, 100.0);
return axios.get(window.config.SYS_SERVER +
window.config.SYS_URI +
`cases/debug_triggers?r=${r}&_dc=${dc}`);
},
};
export let casesHeader = {

View File

@@ -72,11 +72,12 @@ export let filters = {
/**
* Service to get the users list
*/
taskList(query) {
taskList(params) {
return Api.get({
service: "TASKS",
params: {
text: query,
text: params.query,
proId: params.proId
},
keys: {},
});

View File

@@ -80,4 +80,16 @@ export default {
display: flex;
justify-content: space-between;
}
.btn-warning {
color: white;
background-color: #ffc107;
border-color: #ffc107;
}
.btn-warning:hover {
color: white;
background-color: #e0a800;
border-color: #d39e00;
}
</style>

View File

@@ -5,7 +5,7 @@
<div class="card-text">
<div
v-for="item in data.items"
:key="item.title"
:key="item.data.id"
class="v-attached-block"
>
<div class="v-list v-list-row block">

View File

@@ -5,7 +5,7 @@
<div class="card-text">
<div
v-for="item in data.items"
:key="item.title"
:key="item.data.id"
class="v-attached-block"
>
<span>

View File

@@ -123,18 +123,22 @@ export default {
onDropFile(e) {
e.preventDefault();
e.stopPropagation();
if(this.data.noPerms === 1){
return;
}
let that = this,
fls = [];
_.each(e.dataTransfer.files, (f) => {
that.files.push(f);
});
that.files = that.files.slice(0,5);
_.each(that.files, (f) => {
fls.push({
data: f,
title: f.name,
extension: f.name.split(".").pop(),
onClick: () => {},
id: _.random(1000000)
});
});
@@ -143,6 +147,9 @@ export default {
},
onDragOver(e) {
e.preventDefault();
if(this.data.noPerms === 1){
return;
}
if (!this.showMaskDrop) {
this.showMaskDrop = true;
}

View File

@@ -52,8 +52,9 @@
</div>
</div>
<br />
<div v-if="data.onClick">
<h6 class="card-subtitle mb-2 text-muted">{{ data.titleActions }}</h6>
<div v-if="data.btnType" class="container v-case-summary-center">
<div class="container v-case-summary-center">
<button
type="button"
class="btn btn-success btn-sm"
@@ -62,14 +63,6 @@
{{ data.btnLabel }}
</button>
</div>
<div v-else class="container v-case-summary-center">
<button
type="button"
class="btn btn-success btn-sm"
@click="data.onClick"
>
{{ data.btnLabel }}
</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,47 @@
<template>
<div class="summaryForm">
<iframe
:width="width"
ref="IFrameSummaryForm"
frameborder="0"
:src="path"
:height="height"
allowfullscreen
>
</iframe>
</div>
</template>
<script>
export default {
name: "MoreInformation",
props: {
data: Object
},
data() {
return {
height: "500px",
width: "100%",
diffHeight: 10
};
},
computed: {
path() {
let url = "";
if (this.data && this.data.DYN_UID) {
url =
window.config.SYS_SERVER +
window.config.SYS_URI +
'/cases/summary?APP_UID='+this.data.APP_UID +
'&DEL_INDEX=' + this.data.DEL_INDEX +
'&DYN_UID=' + this.data.DYN_UID;
}
return url;
},
},
mounted() {},
methods: {
}
}
</script>

View File

@@ -0,0 +1,300 @@
<template>
<div class="debugger-container">
<tabs>
<tab name="Variables">
<div
class="btn-toolbar justify-content-between"
role="toolbar"
aria-label="Toolbar with button groups"
>
<b-form-radio-group
@change="changeOption"
v-model="optionsDebugVars.selected"
:options="optionsDebugVars.options"
button-variant="outline-secondary"
name="radio-btn-outline"
size="sm"
buttons
></b-form-radio-group>
</div>
<div style="padding-top: 10px">
<v-client-table
:data="dataTable"
:columns="columns"
:options="options"
ref="vueTable"
/>
</div>
</tab>
<tab name="Triggers">
<div>
<v-client-table
:data="dataTableTriggers"
:columns="columns"
:options="options"
ref="vueTableTriggers"
/>
</div>
</tab>
</tabs>
</div>
</template>
<script>
import Tabs from "../../../components/tabs/Tabs.vue";
import Tab from "../../../components/tabs/Tab.vue";
import api from "../../../api/index";
export default {
name: "ButtonFleft",
props: {
data: Object
},
components: {
Tabs,
Tab,
},
data() {
return {
debugFullPage: false,
debugTabs: [],
activetab: 1,
variableTabs: [],
debugSearch: "",
isRTL: false,
dataTable: [],
dataTableTriggers: [],
columns: ["key", "value"],
options: {
perPage: 200,
filterable: true,
pagination: {
show: false
},
headings: {
key: this.$i18n.t("ID_NAME"),
value: this.$i18n.t("ID_FIELD_DYNAFORM_TEXT")
},
},
optionsDebugVars: {
selected: "all",
options: [
{ text: this.$i18n.t("ID_OPT_ALL"), value: "all" },
{ text: this.$i18n.t("ID_DYNAFORM"), value: "dyn" },
{ text: this.$i18n.t("ID_SYSTEM"), value: "sys" }
]
}
};
},
mounted() {
this.getDebugVars({ filter: "all" });
this.getDebugVarsTriggers();
},
methods: {
classBtn(cls) {
return "btn v-btn-request " + cls;
},
showDebugger() {
this.$refs["modal-debugger"].show();
},
/**
* Get debug variables
*/
getDebugVars(data) {
let that = this,
dt = [];
api.cases.debugVars(data).then((response) => {
_.forIn(response.data.data[0], function (value, key) {
dt.push({
key,
value
});
});
this.dataTable = dt;
});
},
/**
* Get trigger variables
*/
getDebugVarsTriggers(data) {
let that = this,
dt = [];
api.cases.debugVarsTriggers(data).then((response) => {
if (response.data.length > 0) {
_.forIn(response.data.data[0], function (value, key) {
dt.push({
key,
value
});
});
this.dataTableTriggers = dt;
}
});
},
/**
* Change Radio option [All, Dynaform, System]
*/
changeOption(opt) {
this.getDebugVars({ filter: opt });
}
},
};
</script>
<style>
.debugger-container {
overflow: auto;
max-width: 25%;
min-width: 25%;
padding: 0.1rem;
margin-right: 0;
margin-left: 0;
border-width: 1px;
border-top-left-radius: 0.1rem;
border-top-right-radius: 0.1rem;
}
.tabs-component {
margin: 0 0;
}
.tabs-component-tabs {
border: solid 1px #ddd;
border-radius: 6px;
margin-bottom: 5px;
}
@media (min-width: 700px) {
.tabs-component-tabs {
border: 0;
align-items: stretch;
display: flex;
justify-content: flex-start;
margin-bottom: -1px;
}
}
.tabs-component-tab {
color: #999;
font-size: 14px;
font-weight: 600;
margin-right: 0;
list-style: none;
}
.tabs-component-tab:not(:last-child) {
border-bottom: dotted 1px #ddd;
}
.tabs-component-tab:hover {
color: #666;
}
.tabs-component-tab.is-active {
color: #000;
}
.tabs-component-tab.is-disabled * {
color: #cdcdcd;
cursor: not-allowed !important;
}
@media (min-width: 700px) {
.tabs-component-tab {
background-color: #fff;
border: solid 1px #ddd;
border-radius: 3px 3px 0 0;
margin-right: 0.5em;
transform: translateY(2px);
transition: transform 0.3s ease;
}
.tabs-component-tab.is-active {
border-bottom: solid 1px #fff;
z-index: 2;
transform: translateY(0);
}
}
.tabs-component-tab-a {
align-items: center;
color: inherit;
display: flex;
padding: 0.75em 1em;
text-decoration: none;
}
.tabs-component-panels {
padding: 4em 0;
}
@media (min-width: 700px) {
.tabs-component-panels {
border-top-left-radius: 0;
background-color: #fff;
border: solid 1px #ddd;
border-radius: 0 6px 6px 6px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
padding: 0.5em 0.5em;
}
}
.btn-group > input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
display: none;
}
.btn-outline-secondary-active {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.VueTables__search-field > label {
display: none;
}
.VueTables.VueTables--client .row {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: 0px;
margin-left: 0px;
}
.debugger-container .VueTables.VueTables--client > * {
font-size: smaller;
}
.debugger-container .VueTables.VueTables--client .table td,
.table th {
padding: 0.3rem;
vertical-align: top;
border-top: 1px solid #dee2e6;
}
.debugger-container .form-control {
display: block;
width: 100%;
height: 30px;
padding: 0.5rem 0.5rem;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.debugger-container .col-md-12 {
position: relative;
width: 100%;
padding-right: 0;
padding-left: 0;
}
</style>

View File

@@ -30,7 +30,7 @@ export default {
isOnMobile: false,
hideToggle: true,
selectedTheme: "",
sidebarWidth: "310px",
sidebarWidth: "260px",
};
},
computed: {
@@ -42,7 +42,6 @@ export default {
},
mounted() {
this.onResize();
window.addEventListener("resize", this.onResize);
},
methods: {
/**

View File

@@ -127,6 +127,7 @@
{{ tagContent(tag) }}
</div>
<component
:filters="filters"
v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)"
v-bind:tag="tag"
@@ -256,7 +257,7 @@ export default {
id: "CaseStatus",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CASE_STATUS')}`,
optionLabel: this.$i18n.t('ID_STATUS'),
detail: "ID_PLEASE_SELECT_THE_STATUS_FOR_THE_SEARCH",
detail: this.$i18n.t('ID_PLEASE_SELECT_THE_STATUS_FOR_THE_SEARCH'),
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_STATUS'),
items:[

View File

@@ -39,7 +39,7 @@ export default {
SearchPopover,
Multiselect
},
props: ["tag", "info", "filter"],
props: ["tag", "info", "filters", "filter"],
data() {
return {
taks: [],
@@ -53,9 +53,12 @@ export default {
*/
asyncFind(query) {
this.isLoading = true;
let params = {};
this.isLoading = true;
params.proId = this.getProcess();
params.query = query;
api.filters
.taskList(query)
.taskList(params)
.then((response) => {
this.taks = response.data;
this.isLoading = false;
@@ -64,6 +67,13 @@ export default {
console.error(err);
});
},
/**
* Get the process id to manage the dependency
*/
getProcess() {
let component = _.find(this.filters, function(o) { return o.fieldId === "processName"; });
return component ? component.value : null;
},
/**
* Form validations review
*/

View File

@@ -0,0 +1,81 @@
<template>
<div v-if="data.length" class="grouped-cell">
<div v-for="(item, index) in data" v-bind:key="item.TITLE" class="d-flex mb-3">
<div class="avatar" :id="id + index">
<b-avatar
variant="info"
:src="item.AVATAR"
size="2em"
></b-avatar>
</div>
<b-popover
:target="id + index"
placement="top"
ref="popover"
triggers="hover"
>
<b-row >
<b-col md="3">
<b-avatar
variant="info"
:src="item.AVATAR"
size="4em"
></b-avatar>
</b-col>
<b-col md="9">
<div class="font-weight-bold">{{item.USERNAME_DISPLAY_FORMAT}}</div>
<div v-if="item.POSITION !== ''">{{item.POSITION}}</div>
<b-link :href="mailto(item.EMAIL)" >{{item.EMAIL}}</b-link>
</b-col>
</b-row>
</b-popover>
<div class="col ellipsis">
{{ item.USERNAME_DISPLAY_FORMAT }}
</div>
</div>
</div>
</template>
<script>
export default {
name: "CurrentUserCell",
props: ["data"],
data() {
return {
id: "avatar-" + _.random(1000000)
};
},
methods: {
/**
* Generates the mail link
*/
mailto: function(email) {
return "mailto:" + email;
}
}
};
</script>
<style>
.popover {
max-width: 600px !important;
min-width: 200px !important;
}
.grouped-cell {
font-size: small;
}
.ellipsis {
white-space: nowrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
}
.color {
color: red;
}
.avatar {
color: "red";
width: "1.3em";
}
</style>

View File

@@ -1,22 +1,46 @@
<template>
<div v-if="data.length" class="grouped-cell">
<div v-for="item in data" v-bind:key="item.TITLE" class="d-flex mb-3">
<div v-for="(item, index) in data" v-bind:key="item.TITLE" class="d-flex mb-3">
<div
v-bind:style="{ color: activeColor(item.STATUS) }"
v-b-popover.hover.top="item.DELAYED_MSG"
:id="statusId + index"
>
<i class="fas fa-square"></i>
</div>
<b-popover :target="statusId + index" triggers="hover" placement="top">
<b> {{ item.DELAYED_TITLE }} </b> {{ item.DELAYED_MSG }}
</b-popover>
<div class="col ellipsis" v-b-popover.hover.top="item.TAS_NAME">
{{ item.TAS_NAME }}
</div>
<div class="avatar">
<div class="avatar" :id="id + index">
<b-avatar
variant="info"
:src="item.AVATAR"
size="1.2em"
size="2em"
></b-avatar>
</div>
<b-popover
:target="id + index"
placement="top"
ref="popover"
triggers="hover"
>
<b-row >
<b-col md="3">
<b-avatar
variant="info"
:src="item.AVATAR"
size="4em"
></b-avatar>
</b-col>
<b-col md="9">
<div class="font-weight-bold">{{item.USERNAME}}</div>
<div v-if="item.POSITION !== ''">{{item.POSITION}}</div>
<b-link :href="mailto(item.EMAIL)" >{{item.EMAIL}}</b-link>
</b-col>
</b-row>
</b-popover>
</div>
</div>
</template>
@@ -29,6 +53,8 @@ export default {
return {
//Color map for ["In Progress", "overdue", "inDraft", "paused", "unnasigned"]
colorMap: ["green", "red", "orange", "aqua", "silver"],
id: "avatar-" + _.random(1000000),
statusId: "status-" + _.random(1000000)
};
},
methods: {
@@ -40,13 +66,20 @@ export default {
activeColor: function(codeColor) {
return this.colorMap[codeColor - 1];
},
mailto: function(email) {
return "mailto:" + email;
}
}
};
</script>
<style>
<style>
.popover {
max-width: 600px !important;
min-width: 200px !important;
}
.grouped-cell {
font-size: smaller;
font-size: small;
}
.ellipsis {
@@ -55,9 +88,7 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
.color {
color: red;
}
.avatar {

View File

@@ -1,48 +1,65 @@
<template>
<div class="v-task-cell">
<div v-for="item in data" v-bind:key="item.TITLE" class="d-flex mb-3">
<div v-bind:style="{ color: activeColor(item.CODE_COLOR) }">
<i class="fas fa-square"></i>
</div>
<div class="col .v-task-cell-ellipsis">
{{ item.TITLE }}
</div>
<div v-if="data.length" class="task-cell">
<div v-for="(item, index) in data" class="d-flex mb-3">
<div
v-bind:style="{ color: activeColor(item.CODE_COLOR) }"
:id="statusId + index"
>
<i class="fas fa-square"></i>
</div>
<b-popover :target="statusId + index" triggers="hover" placement="top">
<b> {{ item.DELAYED_TITLE }} </b> {{ item.DELAYED_MSG }}
</b-popover>
<div class="col ellipsis" v-b-popover.hover.top="item.TITLE">
{{ item.TITLE }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TaskCell",
props: ["data"],
data() {
return {
//Color map for ["In Progress", "overdue", "inDraft", "paused", "unnasigned"]
colorMap: ["green", "red", "orange", "aqua", "silver"],
};
},
methods: {
/**
* Get the style color to be applied in the square icon
* @param {number} - status color(1-5)
* @return {string} - color atribute string
*/
activeColor: function (codeColor) {
return this.colorMap[codeColor - 1];
name: "TaskCell",
props: ["data"],
data() {
return {
colorMap: ["green", "red", "orange", "blue", "silver"],
statusId: "status-" + _.random(1000000)
};
},
},
methods: {
/**
* Get the style color to be applied in the square icon
* @param {number} - status color(1-5)
* @return {string} - color atribute string
*/
activeColor: function(codeColor) {
return this.colorMap[codeColor - 1];
}
}
};
</script>
<style>
.v-task-cell {
display: inline-flex;
<style>
.popover {
max-width: 600px !important;
min-width: 200px !important;
}
.task-cell {
font-size: normal;
}
.v-task-cell-ellipsis {
white-space: nowrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
.ellipsis {
white-space: nowrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
}
.color {
color: red;
}
.avatar {
color: "red";
width: "1.3em";
}
</style>

View File

@@ -30,6 +30,7 @@
:columns="columns"
:options="options"
ref="vueTable"
@row-click="onRowClick"
>
<div slot="info" slot-scope="props">
<b-icon
@@ -54,11 +55,7 @@
{{ props.row.STATUS }}
</div>
<div slot="current_user" slot-scope="props">
<div class="v-user-cell" v-for="item in props.row.USER">
<div class="col .v-user-cell-ellipsis">
{{ item.USER_DATA }}
</div>
</div>
<CurrentUserCell :data="props.row.USER_DATA" />
</div>
<div slot="start_date" slot-scope="props">
{{ props.row.START_DATE }}
@@ -86,9 +83,10 @@ import ButtonFleft from "../components/home/ButtonFleft.vue";
import ModalNewRequest from "./ModalNewRequest.vue";
import AdvancedFilter from "../components/search/AdvancedFilter";
import TaskCell from "../components/vuetable/TaskCell.vue";
import CurrentUserCell from "../components/vuetable/CurrentUserCell.vue";
import ModalComments from "./modal/ModalComments.vue";
import api from "./../api/index";
import { Event } from "vue-tables-2";
import utils from "./../utils/utils";
export default {
name: "AdvancedSearch",
@@ -97,6 +95,7 @@ export default {
ButtonFleft,
ModalNewRequest,
TaskCell,
CurrentUserCell,
ModalComments
},
props: ["id", "name", "filters"],
@@ -120,7 +119,6 @@ export default {
},
},
columns: [
"info",
"case_number",
"case_title",
"process_name",
@@ -159,7 +157,16 @@ export default {
},
customFilters: ["myfilter"],
},
pmDateFormat: window.config.FORMATS.dateFormat
pmDateFormat: window.config.FORMATS.dateFormat,
clickCount: 0,
singleClickTimer: null,
statusTitle: {
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
"PAUSED": this.$i18n.t("ID_PAUSED"),
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
}
};
},
watch: {
@@ -168,6 +175,23 @@ export default {
},
},
methods: {
/**
* Row click event handler
* @param {object} event
*/
onRowClick(event) {
let self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function() {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.openCaseDetail(event.row);
}
},
/**
* Get cases data by header
*/
@@ -212,7 +236,7 @@ export default {
CASE_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE,
TASK: this.formatTasks(v.THREAD_TASKS),
USER: this.formatUser(v.THREAD_USERS),
USER_DATA: this.formatUser(v.THREAD_USERS),
START_DATE: v.APP_CREATE_DATE_LABEL,
FINISH_DATE: v.APP_FINISH_DATE_LABEL,
DURATION: v.DURATION,
@@ -235,58 +259,35 @@ export default {
dataFormat.push({
TITLE: data[i].tas_title,
CODE_COLOR: data[i].tas_color,
DELAYED_TITLE: data[i].tas_status === "OVERDUE" ?
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[data[i].tas_status],
DELAYED_MSG: data[i].tas_status === "OVERDUE" ? data[i].delay : ""
});
}
return dataFormat;
},
formatUser(data) {
var i,
dataFormat = [];
for (i = 0; i < data.length; i += 1) {
dataFormat.push({
USER_DATA: this.nameFormatCases(
data[i].usr_firstname,
data[i].usr_lastname,
data[i].usr_username
)
USERNAME_DISPLAY_FORMAT: utils.userNameDisplayFormat({
userName: data[i].usr_firstname,
firstName: data[i].usr_lastname,
lastName: data[i].usr_username,
format: window.config.FORMATS.format || null
}),
EMAIL: data[i].user_tooltip.usr_email,
POSITION: data[i].user_tooltip.usr_position,
AVATAR: window.config.SYS_SERVER +
window.config.SYS_URI +
`users/users_ViewPhotoGrid?pUID=${data[i].user_id}`
});
}
return dataFormat;
},
/**
* Get for user format name configured in Processmaker Environment Settings
*
* @param {string} name
* @param {string} lastName
* @param {string} userName
* @return {string} nameFormat
*/
nameFormatCases(name, lastName, userName) {
let nameFormat = "";
if (/^\s*$/.test(name) && /^\s*$/.test(lastName)) {
return nameFormat;
}
if (this.nameFormat === "@firstName @lastName") {
nameFormat = name + " " + lastName;
} else if (this.nameFormat === "@firstName @lastName (@userName)") {
nameFormat = name + " " + lastName + " (" + userName + ")";
} else if (this.nameFormat === "@userName") {
nameFormat = userName;
} else if (this.nameFormat === "@userName (@firstName @lastName)") {
nameFormat = userName + " (" + name + " " + lastName + ")";
} else if (this.nameFormat === "@lastName @firstName") {
nameFormat = lastName + " " + name;
} else if (this.nameFormat === "@lastName, @firstName") {
nameFormat = lastName + ", " + name;
} else if (
this.nameFormat === "@lastName, @firstName (@userName)"
) {
nameFormat = lastName + ", " + name + " (" + userName + ")";
} else {
nameFormat = name + " " + lastName;
}
return nameFormat;
},
/**
* Convert string to date format
*

View File

@@ -107,8 +107,9 @@ import ButtonFleft from "../components/home/ButtonFleft.vue";
import ModalCancelCase from "../home/modal/ModalCancelCase.vue";
import ModalNewRequest from "./ModalNewRequest.vue";
import TaskCell from "../components/vuetable/TaskCell.vue";
import utils from "./../utils/utils";
import Api from "../api/index";
export default {
name: "CaseDetail",
components: {
@@ -155,7 +156,7 @@ export default {
headings: {
task: this.$i18n.t("ID_TASK"),
case_title: this.$i18n.t("ID_CASE_TITLE"),
assignee: this.$i18n.t("ID_ASSIGNEE"),
assignee: this.$i18n.t("ID_CURRENT_USER"),
status: this.$i18n.t("ID_STATUS"),
due_date: this.$i18n.t("ID_DUE_DATE"),
actions: this.$i18n.t("ID_ACTIONS"),
@@ -201,6 +202,7 @@ export default {
this.getInputDocuments();
this.getOutputDocuments();
this.getCasesNotes();
this.requestOpenSummary();
},
methods: {
postComment(comment, send, files) {
@@ -241,7 +243,9 @@ export default {
this.dataAttachedDocuments.items = att;
},
getDataCaseSummary() {
let that = this;
let action,
option,
that = this;
Api.cases
.casesummary(this.dataCase)
.then((response) => {
@@ -252,9 +256,7 @@ export default {
titleActions: this.$i18n.t("ID_ACTIONS"),
btnLabel: this.$i18n.t("ID_CANCEL_CASE"),
btnType: false,
onClick: () => {
that.$refs["modal-cancel-case"].show();
},
onClick: null,
label: {
numberCase: data[2].label,
process: data[0].label,
@@ -274,6 +276,19 @@ export default {
duration: response.data[11].value.split(" ")[1],
},
};
// Hack for identify the cancel case button
Api.cases
.actions(this.dataCase).then((response)=>{
action = _.find(response.data, function(o) { return o.id == "ACTIONS"; });
if(action){
option = _.find(action.options, function(o) { return o.fn == "cancelCase"; });
if(option && !option.hide){
that.dataCaseSummary.onClick = () => {
that.$refs["modal-cancel-case"].show();
};
}
}
});
})
.catch((err) => {
throw new Error(err);
@@ -387,6 +402,7 @@ export default {
let that = this,
notesArray = [];
_.each(notes, (n) => {
n.id = _.random(1000000);
notesArray.push({
user: that.nameFormatCases(
n.USR_FIRSTNAME,
@@ -451,7 +467,13 @@ export default {
COLOR: v.TAS_COLOR_LABEL,
}],
CASE_TITLE: v.DEL_TITLE,
ASSIGNEE: v.USR_FIRSTNAME + " " + v.USR_LASTNAME,
ASSIGNEE: v.USR_ID !== 0 ?
utils.userNameDisplayFormat({
userName: v.USR_USERNAME,
firstName: v.USR_LASTNAME,
lastName: v.USR_LASTNAME,
format: window.config.FORMATS.format || null
}) : this.$i18n.t("ID_UNASSIGNED"),
STATUS: v.DEL_THREAD_STATUS,
DUE_DATE: v.DEL_TASK_DUE_DATE,
TASK_COLOR: v.TAS_COLOR_LABEL,
@@ -490,7 +512,24 @@ export default {
ACTION: "todo",
});
this.$emit("onUpdatePage", "XCase");
}
},
/**
* Verify if the case has the permission Summary Form
* to add dynUid in dataCase
*/
requestOpenSummary() {
Api.cases
.openSummary(this.dataCase)
.then((response) => {
var data = response.data;
if (data.dynUid !== "") {
this.dataCase.DYN_UID = data.dynUid;
}
})
.catch((e) => {
console.error(e);
});
},
},
};
</script>

View File

@@ -13,6 +13,7 @@
:columns="columns"
:options="options"
ref="vueTable"
@row-click="onRowClick"
>
<div slot="detail" slot-scope="props">
<div class="btn-default" @click="openCaseDetail(props.row)">
@@ -48,6 +49,7 @@ import ModalNewRequest from "./ModalNewRequest.vue";
import CasesFilter from "../components/search/CasesFilter";
import TaskCell from "../components/vuetable/TaskCell.vue";
import api from "./../api/index";
import utils from "./../utils/utils";
export default {
name: "Draft",
@@ -58,7 +60,7 @@ export default {
TaskCell,
CasesFilter,
},
props: {},
props: ["defaultOption"],
data() {
return {
newCase: {
@@ -101,9 +103,20 @@ export default {
},
},
pmDateFormat: "Y-m-d H:i:s",
clickCount: 0,
singleClickTimer: null,
statusTitle: {
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
"PAUSED": this.$i18n.t("ID_PAUSED"),
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
}
};
},
mounted() {},
mounted() {
this.openDefaultCase();
},
watch: {},
computed: {
/**
@@ -116,6 +129,38 @@ export default {
updated() {},
beforeCreate() {},
methods: {
/**
* Open a case when the component was mounted
*/
openDefaultCase() {
let params;
if(this.defaultOption) {
params = utils.getAllUrlParams(this.defaultOption);
if (params && params.app_uid && params.del_index) {
this.openCase({
APP_UID: params.app_uid,
DEL_INDEX: params.del_index
});
}
}
},
/**
* On row click event handler
* @param {object} event
*/
onRowClick(event) {
let self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function() {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.openCase(event.row);
}
},
/**
* Get cases todo data
*/
@@ -164,6 +209,9 @@ export default {
TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR,
COLOR: v.TAS_COLOR_LABEL,
DELAYED_TITLE: v.TAS_STATUS === "OVERDUE" ?
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[v.TAS_STATUS],
DELAYED_MSG: v.TAS_STATUS === "OVERDUE" ? v.DELAY : ""
}],
PRIORITY: v.DEL_PRIORITY_LABEL,
PRO_UID: v.PRO_UID,
@@ -196,15 +244,17 @@ export default {
*/
openCaseDetail(item) {
let that = this;
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
api.cases.open(_.extend({ ACTION: "todo" }, item)).then(() => {
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
});
that.$emit("onUpdatePage", "case-detail");
});
that.$emit("onUpdatePage", "case-detail");
});
},
onRemoveFilter(data) {},

View File

@@ -24,6 +24,7 @@
:id="pageId"
:pageUri="pageUri"
:name="pageName"
:defaultOption="defaultOption"
@onSubmitFilter="onSubmitFilter"
@onRemoveFilter="onRemoveFilter"
@onUpdatePage="onUpdatePage"
@@ -78,7 +79,7 @@ export default {
collapsed: false,
selectedTheme: "",
isOnMobile: false,
sidebarWidth: "310px",
sidebarWidth: "260px",
pageId: null,
pageName: null,
pageUri: null,
@@ -93,12 +94,12 @@ export default {
CONSOLIDATED_CASES: "batch-routing",
CASES_TO_REASSIGN: "task-reassignments",
CASES_FOLDERS: "my-documents"
}
},
defaultOption: window.config.defaultOption || ''
};
},
mounted() {
this.onResize();
window.addEventListener("resize", this.onResize);
this.getMenu();
this.listenerIframe();
window.setInterval(
@@ -136,7 +137,7 @@ export default {
.get()
.then((response) => {
this.setDefaultCasesMenu(response.data);
this.menu = this.mappingMenu(response.data);
this.menu = this.mappingMenu(this.setDefaultIcon(response.data));
this.setCounter();
})
.catch((e) => {
@@ -174,6 +175,19 @@ export default {
}
return newData;
},
/**
* Set a default icon if the item doesn't have one
*/
setDefaultIcon(data){
var i,
auxData = data;
for (i = 0; i < auxData.length; i += 1) {
if (auxData[i].icon !== undefined && auxData[i].icon === "") {
auxData[i].icon = "fas fa-bars";
}
}
return auxData;
},
OnClickSidebarItem(item) {
if (item.item.page && item.item.page === "/advanced-search") {
this.page = "advanced-search";
@@ -312,7 +326,7 @@ export default {
<style lang="scss">
#home {
padding-left: 310px;
padding-left: 260px;
transition: 0.3s;
}
#home.collapsed {

View File

@@ -64,8 +64,10 @@ export default {
api.process.list
.start()
.then((response) => {
that.categories = that.formatCategories(response.data);
that.categoriesFiltered = that.categories;
if (response.data && response.data.success !== "failure") {
that.categories = that.formatCategories(response.data);
that.categoriesFiltered = that.categories;
}
})
.catch((e) => {
console.error(e);

View File

@@ -1,5 +1,14 @@
<template>
<div id="v-mycases" ref="v-mycases" class="v-container-mycases">
<b-alert
:show="dataAlert.dismissCountDown"
dismissible
:variant="dataAlert.variant"
@dismissed="dataAlert.dismissCountDown = 0"
@dismiss-count-down="countDownChanged"
>
{{ dataAlert.message }}
</b-alert>
<button-fleft :data="newCase"></button-fleft>
<MyCasesFilter
:filters="filters"
@@ -15,7 +24,13 @@
:columns="columns"
:options="options"
ref="vueTable"
@row-click="onRowClick"
>
<div slot="detail" slot-scope="props">
<div class="btn-default" @click="openCaseDetail(props.row)">
<i class="fas fa-info-circle"></i>
</div>
</div>
<div slot="case_number" slot-scope="props">
{{ props.row.CASE_NUMBER }}
</div>
@@ -56,6 +71,7 @@ import MyCasesFilter from "../components/search/MyCasesFilter";
import ModalComments from "./modal/ModalComments.vue";
import GroupedCell from "../components/vuetable/GroupedCell.vue";
import api from "./../api/index";
import utils from "./../utils/utils";
export default {
name: "MyCases",
@@ -70,6 +86,12 @@ export default {
props: ["filters"],
data() {
return {
dataAlert: {
dismissSecs: 5,
dismissCountDown: 0,
message: "",
variant: "info"
},
metrics: [],
title: this.$i18n.t('ID_MY_CASES'),
filter: "CASES_INBOX",
@@ -121,7 +143,16 @@ export default {
},
},
translations: null,
pmDateFormat: window.config.FORMATS.dateFormat
pmDateFormat: window.config.FORMATS.dateFormat,
clickCount: 0,
singleClickTimer: null,
statusTitle: {
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
"PAUSED": this.$i18n.t("ID_PAUSED"),
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
}
};
},
mounted() {
@@ -144,6 +175,43 @@ export default {
updated() {},
beforeCreate() {},
methods: {
/**
* Row click event handler
* @param {object} event
*/
onRowClick(event) {
let self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function() {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.openCaseDetail(event.row);
}
},
/**
* Open case detail
*
* @param {object} item
*/
openCaseDetail(item) {
let that = this;
api.cases.open(_.extend({ ACTION: "todo" }, item)).then(() => {
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
});
that.$emit("onUpdatePage", "case-detail");
});
});
},
/**
* Get Cases Headers from BE
*/
@@ -151,8 +219,26 @@ export default {
let that = this;
api.casesHeader.get().then((response) => {
that.headers = that.formatCasesHeaders(response.data);
that.setFilterHeader();
});
},
/**
* Set a filter in the header from Default Cases Menu option
*/
setFilterHeader() {
let header = window.config._nodeId,
filters = this.headers,
filter,
i;
if (header === "CASES_TO_REVISE") {
filter = "SUPERVISING";
}
for (i = 0; i < filters.length; i += 1) {
if (filters[i].item === filter) {
filters[i].onClick(filters[i]);
}
}
},
/**
* Get cases data by header
*/
@@ -223,46 +309,25 @@ export default {
{
TAS_NAME: data[i].tas_title,
STATUS: data[i].tas_color,
PENDING: ""
DELAYED_TITLE: data[i].tas_status === "OVERDUE" ?
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[data[i].tas_status],
DELAYED_MSG: data[i].tas_status === "OVERDUE" ? data[i].delay : "",
AVATAR: window.config.SYS_SERVER +
window.config.SYS_URI +
`users/users_ViewPhotoGrid?pUID=${data[i].user_id}`,
USERNAME: utils.userNameDisplayFormat({
userName: data[i].user_tooltip.usr_username,
firstName: data[i].user_tooltip.usr_firstname,
lastName: data[i].user_tooltip.usr_lastname,
format: window.config.FORMATS.format || null
}),
POSITION: data[i].user_tooltip.usr_position,
EMAIL: data[i].user_tooltip.usr_email
}
);
}
return dataFormat;
},
/**
* Get for user format name configured in Processmaker Environment Settings
*
* @param {string} name
* @param {string} lastName
* @param {string} userName
* @return {string} nameFormat
*/
nameFormatCases(name, lastName, userName) {
let nameFormat = "";
if (/^\s*$/.test(name) && /^\s*$/.test(lastName)) {
return nameFormat;
}
if (this.nameFormat === "@firstName @lastName") {
nameFormat = name + " " + lastName;
} else if (this.nameFormat === "@firstName @lastName (@userName)") {
nameFormat = name + " " + lastName + " (" + userName + ")";
} else if (this.nameFormat === "@userName") {
nameFormat = userName;
} else if (this.nameFormat === "@userName (@firstName @lastName)") {
nameFormat = userName + " (" + name + " " + lastName + ")";
} else if (this.nameFormat === "@lastName @firstName") {
nameFormat = lastName + " " + name;
} else if (this.nameFormat === "@lastName, @firstName") {
nameFormat = lastName + ", " + name;
} else if (
this.nameFormat === "@lastName, @firstName (@userName)"
) {
nameFormat = lastName + ", " + name + " (" + userName + ")";
} else {
nameFormat = name + " " + lastName;
}
return nameFormat;
},
/**
* Convert string to date format
*
@@ -349,32 +414,6 @@ export default {
}
return dateToConvert;
},
/**
* Open selected cases in the inbox
*
* @param {object} item
*/
openCase(item) {
const action = "todo";
if (this.isIE) {
window.open(
"../../../cases/open?APP_UID=" +
item.row.APP_UID +
"&DEL_INDEX=" +
item.row.DEL_INDEX +
"&action=" +
action
);
} else {
window.location.href =
"../../../cases/open?APP_UID=" +
item.row.APP_UID +
"&DEL_INDEX=" +
item.row.DEL_INDEX +
"&action=" +
action;
}
},
/**
* Format Response from HEADERS
* @param {*} response
@@ -401,18 +440,22 @@ export default {
},
};
_.forEach(response, (v) => {
data.push({
title: v.title,
counter: v.counter,
item: v.id,
icon: info[v.id].icon,
onClick: (obj) => {
that.title = obj.title;
that.filterHeader = obj.item;
that.$refs["vueTable"].getData();
},
class: info[v.id].class,
});
//Hack for display the SUPERVISING CARD
if(!(v.id === "SUPERVISING" && v.counter === 0)){
data.push({
title: v.title,
counter: v.counter,
item: v.id,
icon: info[v.id].icon,
onClick: (obj) => {
that.title = obj.title;
that.filterHeader = obj.item;
that.$refs["vueTable"].setPage(1); // Reset the page when change the header filter
that.$refs["vueTable"].getData();
},
class: info[v.id].class
});
}
});
return data;
},
@@ -442,7 +485,25 @@ export default {
*/
onPostNotes() {
this.$refs["vueTable"].getData();
}
},
/**
* Show the alert message
* @param {string} message - message to be displayen in the body
* @param {string} type - alert type
*/
showAlert(message, type) {
this.dataAlert.message = message;
this.dataAlert.variant = type || "info";
this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs;
},
/**
* Updates the alert dismiss value to update
* dismissCountDown and decrease
* @param {mumber}
*/
countDownChanged(dismissCountDown) {
this.dataAlert.dismissCountDown = dismissCountDown;
},
},
};
</script>
@@ -453,4 +514,4 @@ export default {
padding-left: 50px;
padding-right: 50px;
}
</style>
</style>

View File

@@ -13,6 +13,7 @@
:columns="columns"
:options="options"
ref="vueTable"
@row-click="onRowClick"
>
<div slot="detail" slot-scope="props">
<div class="btn-default" @click="openCaseDetail(props.row)">
@@ -33,15 +34,8 @@
<TaskCell :data="props.row.TASK" />
</div>
<div slot="current_user" slot-scope="props">
{{
nameFormatCases(
props.row.USR_FIRSTNAME,
props.row.USR_LASTNAME,
props.row.USR_USERNAME
)
}}
{{ props.row.USERNAME_DISPLAY_FORMAT }}
</div>
<div slot="due_date" slot-scope="props">
{{ props.row.DUE_DATE }}
</div>
@@ -70,6 +64,7 @@ import CasesFilter from "../components/search/CasesFilter";
import TaskCell from "../components/vuetable/TaskCell.vue";
import ModalUnpauseCase from "./modal/ModalUnpauseCase.vue";
import api from "./../api/index";
import utils from "./../utils/utils";
export default {
name: "Paused",
@@ -97,7 +92,6 @@ export default {
"case_title",
"process_name",
"task",
"current_user",
"due_date",
"delegation_date",
"priority",
@@ -132,6 +126,15 @@ export default {
},
},
pmDateFormat: "Y-m-d H:i:s",
clickCount: 0,
singleClickTimer: null,
statusTitle: {
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
"PAUSED": this.$i18n.t("ID_PAUSED"),
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
}
};
},
mounted() {},
@@ -147,6 +150,23 @@ export default {
updated() {},
beforeCreate() {},
methods: {
/**
* On row click event handler
* @param {object} event
*/
onRowClick(event) {
let self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function() {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.showModalUnpauseCase(event.row);
}
},
/**
* Get cases todo data
*/
@@ -195,10 +215,16 @@ export default {
TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR,
COLOR: v.TAS_COLOR_LABEL,
DELAYED_TITLE: v.TAS_STATUS === "OVERDUE" ?
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[v.TAS_STATUS],
DELAYED_MSG: v.TAS_STATUS === "OVERDUE" ? v.DELAY : ""
}],
USR_FIRSTNAME: v.USR_FIRSTNAME,
USR_LASTNAME: v.USR_LASTNAME,
USR_USERNAME: v.USR_USERNAME,
USERNAME_DISPLAY_FORMAT: utils.userNameDisplayFormat({
userName: v.USR_LASTNAME,
firstName: v.USR_LASTNAME,
lastName: v.USR_LASTNAME,
format: window.config.FORMATS.format || null
}),
DUE_DATE: v.DEL_TASK_DUE_DATE_LABEL,
DELEGATION_DATE: v.DEL_DELEGATE_DATE_LABEL,
PRIORITY: v.DEL_PRIORITY_LABEL,
@@ -210,38 +236,6 @@ export default {
});
return data;
},
/**
* Get for user format name configured in Processmaker Environment Settings
*
* @param {string} name
* @param {string} lastName
* @param {string} userName
* @return {string} nameFormat
*/
nameFormatCases(name, lastName, userName) {
let nameFormat = "";
if (/^\s*$/.test(name) && /^\s*$/.test(lastName)) {
return nameFormat;
}
if (this.nameFormat === "@firstName @lastName") {
nameFormat = name + " " + lastName;
} else if (this.nameFormat === "@firstName @lastName (@userName)") {
nameFormat = name + " " + lastName + " (" + userName + ")";
} else if (this.nameFormat === "@userName") {
nameFormat = userName;
} else if (this.nameFormat === "@userName (@firstName @lastName)") {
nameFormat = userName + " (" + name + " " + lastName + ")";
} else if (this.nameFormat === "@lastName @firstName") {
nameFormat = lastName + " " + name;
} else if (this.nameFormat === "@lastName, @firstName") {
nameFormat = lastName + ", " + name;
} else if (this.nameFormat === "@lastName, @firstName (@userName)") {
nameFormat = lastName + ", " + name + " (" + userName + ")";
} else {
nameFormat = name + " " + lastName;
}
return nameFormat;
},
/**
* Open case detail
*
@@ -249,15 +243,17 @@ export default {
*/
openCaseDetail(item) {
let that = this;
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
api.cases.open(_.extend({ ACTION: "todo" }, item)).then(() => {
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
});
that.$emit("onUpdatePage", "case-detail");
});
that.$emit("onUpdatePage", "case-detail");
});
},
showModalUnpauseCase(item) {

View File

@@ -4,6 +4,10 @@
<tab :name="$t('ID_SUMMARY')">
<PmCaseSummary :data="dataCaseSummary"> </PmCaseSummary>
</tab>
<tab :name="$t('ID_MORE_INFORMATION')">
<MoreInformation :data="dataCase" v-if="currentTab == $t('ID_MORE_INFORMATION')">
</MoreInformation>
</tab>
<tab :name="$t('ID_PROCESS_MAP')">
<ProcessMap :data="dataCase" v-if="currentTab == $t('ID_PROCESS_MAP')">
</ProcessMap>
@@ -25,6 +29,7 @@ import PmCaseSummary from "./../components/home/caseDetail/PmCaseSummary.vue";
import ProcessMap from "./../components/home/caseDetail/ProcessMap.vue";
import CaseHistory from "./../components/home/caseDetail/CaseHistory.vue";
import ChangeLog from "./../components/home/caseDetail/ChangeLog.vue";
import MoreInformation from './../components/home/caseDetail/MoreInformation.vue';
import Api from "../api/index";
export default {
@@ -36,6 +41,7 @@ export default {
PmCaseSummary,
CaseHistory,
ChangeLog,
MoreInformation
},
props: {
dataCase: Object,

View File

@@ -13,6 +13,7 @@
:columns="columns"
:options="options"
ref="vueTable"
@row-click="onRowClick"
>
<div slot="detail" slot-scope="props">
<div class="btn-default" @click="openCaseDetail(props.row)">
@@ -33,15 +34,8 @@
<TaskCell :data="props.row.TASK" />
</div>
<div slot="current_user" slot-scope="props">
{{
nameFormatCases(
props.row.USR_FIRSTNAME,
props.row.USR_LASTNAME,
props.row.USR_USERNAME
)
}}
{{ props.row.USERNAME_DISPLAY_FORMAT}}
</div>
<div slot="due_date" slot-scope="props">
{{ props.row.DUE_DATE }}
</div>
@@ -65,6 +59,7 @@ import ModalNewRequest from "./ModalNewRequest.vue";
import TaskCell from "../components/vuetable/TaskCell.vue";
import CasesFilter from "../components/search/CasesFilter";
import api from "./../api/index";
import utils from "./../utils/utils";
export default {
name: "Todo",
@@ -75,6 +70,7 @@ export default {
TaskCell,
CasesFilter,
},
props: ["defaultOption"],
data() {
return {
newCase: {
@@ -90,7 +86,6 @@ export default {
"case_title",
"process_name",
"task",
"current_user",
"due_date",
"delegation_date",
"priority",
@@ -124,6 +119,15 @@ export default {
},
},
pmDateFormat: "Y-m-d H:i:s",
clickCount: 0,
singleClickTimer: null,
statusTitle: {
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
"PAUSED": this.$i18n.t("ID_PAUSED"),
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
}
};
},
mounted() {},
@@ -139,6 +143,38 @@ export default {
updated() {},
beforeCreate() {},
methods: {
/**
* Open a case when the component was mounted
*/
openDefaultCase() {
let params;
if(this.defaultOption) {
params = utils.getAllUrlParams(this.defaultOption);
if (params && params.app_uid && params.del_index) {
this.openCase({
APP_UID: params.app_uid,
DEL_INDEX: params.del_index
});
}
}
},
/**
* On row click event handler
* @param {object} event
*/
onRowClick(event) {
let self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function() {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.openCase(event.row);
}
},
/**
* Get cases todo data
*/
@@ -187,10 +223,16 @@ export default {
TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR,
COLOR: v.TAS_COLOR_LABEL,
DELAYED_TITLE: v.TAS_STATUS === "OVERDUE" ?
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[v.TAS_STATUS],
DELAYED_MSG: v.TAS_STATUS === "OVERDUE" ? v.DELAY : ""
}],
USR_FIRSTNAME: v.USR_FIRSTNAME,
USR_LASTNAME: v.USR_LASTNAME,
USR_USERNAME: v.USR_USERNAME,
USERNAME_DISPLAY_FORMAT: utils.userNameDisplayFormat({
userName: v.USR_LASTNAME,
firstName: v.USR_LASTNAME,
lastName: v.USR_LASTNAME,
format: window.config.FORMATS.format || null
}),
DUE_DATE: v.DEL_TASK_DUE_DATE_LABEL,
DELEGATION_DATE: v.DEL_DELEGATE_DATE_LABEL,
PRIORITY: v.DEL_PRIORITY_LABEL,
@@ -202,38 +244,6 @@ export default {
});
return data;
},
/**
* Get for user format name configured in Processmaker Environment Settings
*
* @param {string} name
* @param {string} lastName
* @param {string} userName
* @return {string} nameFormat
*/
nameFormatCases(name, lastName, userName) {
let nameFormat = "";
if (/^\s*$/.test(name) && /^\s*$/.test(lastName)) {
return nameFormat;
}
if (this.nameFormat === "@firstName @lastName") {
nameFormat = name + " " + lastName;
} else if (this.nameFormat === "@firstName @lastName (@userName)") {
nameFormat = name + " " + lastName + " (" + userName + ")";
} else if (this.nameFormat === "@userName") {
nameFormat = userName;
} else if (this.nameFormat === "@userName (@firstName @lastName)") {
nameFormat = userName + " (" + name + " " + lastName + ")";
} else if (this.nameFormat === "@lastName @firstName") {
nameFormat = lastName + " " + name;
} else if (this.nameFormat === "@lastName, @firstName") {
nameFormat = lastName + ", " + name;
} else if (this.nameFormat === "@lastName, @firstName (@userName)") {
nameFormat = lastName + ", " + name + " (" + userName + ")";
} else {
nameFormat = name + " " + lastName;
}
return nameFormat;
},
/**
* Open selected cases in the inbox
*
@@ -256,16 +266,18 @@ export default {
*/
openCaseDetail(item) {
let that = this;
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
api.cases.open(_.extend({ ACTION: "todo" }, item)).then(() => {
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
});
that.$emit("onUpdatePage", "case-detail");
});
that.$emit("onUpdatePage", "case-detail");
});
});
},
onRemoveFilter(data) {},
onUpdateFilters(data) {

View File

@@ -13,6 +13,7 @@
:columns="columns"
:options="options"
ref="vueTable"
@row-click="onRowClick"
>
<div slot="detail" slot-scope="props">
<div class="btn-default" @click="openCaseDetail(props.row)">
@@ -32,16 +33,6 @@
<div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" />
</div>
<div slot="current_user" slot-scope="props">
{{
nameFormatCases(
props.row.USR_FIRSTNAME,
props.row.USR_LASTNAME,
props.row.USR_USERNAME
)
}}
</div>
<div slot="due_date" slot-scope="props">
{{ props.row.DUE_DATE }}
</div>
@@ -94,7 +85,6 @@ export default {
"case_title",
"process_name",
"task",
"current_user",
"due_date",
"delegation_date",
"priority",
@@ -129,6 +119,15 @@ export default {
},
},
pmDateFormat: "Y-m-d H:i:s",
clickCount: 0,
singleClickTimer: null,
statusTitle: {
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
"PAUSED": this.$i18n.t("ID_PAUSED"),
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
}
};
},
mounted() {},
@@ -144,6 +143,23 @@ export default {
updated() {},
beforeCreate() {},
methods: {
/**
* On row click event handler
* @param {object} event
*/
onRowClick(event) {
let self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function() {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.claimCase(event.row);
}
},
/**
* Get cases unassigned data
*/
@@ -192,10 +208,10 @@ export default {
TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR,
COLOR: v.TAS_COLOR_LABEL,
DELAYED_TITLE: v.TAS_STATUS === "OVERDUE" ?
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[v.TAS_STATUS],
DELAYED_MSG: v.TAS_STATUS === "OVERDUE" ? v.DELAY : ""
}],
USR_FIRSTNAME: v.USR_FIRSTNAME,
USR_LASTNAME: v.USR_LASTNAME,
USR_USERNAME: v.USR_USERNAME,
DUE_DATE: v.DEL_TASK_DUE_DATE_LABEL,
DELEGATION_DATE: v.DEL_DELEGATE_DATE_LABEL,
PRIORITY: v.DEL_PRIORITY_LABEL,
@@ -207,42 +223,6 @@ export default {
});
return data;
},
/**
* Get for user format name configured in Processmaker Environment Settings
*
* @param {string} name
* @param {string} lastName
* @param {string} userName
* @return {string} nameFormat
*/
nameFormatCases(name, lastName, userName) {
let nameFormat = "";
if (!(name && lastName && userName)) {
return "";
}
if (/^\s*$/.test(name) && /^\s*$/.test(lastName)) {
return nameFormat;
}
if (this.nameFormat === "@firstName @lastName") {
nameFormat = name + " " + lastName;
} else if (this.nameFormat === "@firstName @lastName (@userName)") {
nameFormat = name + " " + lastName + " (" + userName + ")";
} else if (this.nameFormat === "@userName") {
nameFormat = userName;
} else if (this.nameFormat === "@userName (@firstName @lastName)") {
nameFormat = userName + " (" + name + " " + lastName + ")";
} else if (this.nameFormat === "@lastName @firstName") {
nameFormat = lastName + " " + name;
} else if (this.nameFormat === "@lastName, @firstName") {
nameFormat = lastName + ", " + name;
} else if (this.nameFormat === "@lastName, @firstName (@userName)") {
nameFormat = lastName + ", " + name + " (" + userName + ")";
} else {
nameFormat = name + " " + lastName;
}
return nameFormat;
},
/**
* Claim case
*
@@ -251,8 +231,10 @@ export default {
claimCase(item) {
let that = this;
api.cases.open(_.extend({ ACTION: "unassigned" }, item)).then(() => {
that.$refs["modal-claim-case"].data = item;
that.$refs["modal-claim-case"].show();
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$refs["modal-claim-case"].data = item;
that.$refs["modal-claim-case"].show();
});
});
},
/**
@@ -262,15 +244,17 @@ export default {
*/
openCaseDetail(item) {
let that = this;
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
api.cases.open(_.extend({ ACTION: "todo" }, item)).then(() => {
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$emit("onUpdateDataCase", {
APP_UID: item.APP_UID,
DEL_INDEX: item.DEL_INDEX,
PRO_UID: item.PRO_UID,
TAS_UID: item.TAS_UID,
APP_NUMBER: item.CASE_NUMBER,
});
that.$emit("onUpdatePage", "case-detail");
});
that.$emit("onUpdatePage", "case-detail");
});
},
onRemoveFilter(data) {},

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div class="d-flex">
<iframe
:width="width"
ref="xIFrame"
@@ -7,21 +7,28 @@
:src="path"
:height="height"
allowfullscreen
@load="onLoadIframe"
></iframe>
<Debugger v-if="openDebug === true" :style="'height:' + height + 'px'" />
</div>
</template>
<script>
import Debugger from "../components/home/debugger/Debugger.vue";
import api from "../api/index";
export default {
name: "XCase",
components: {},
components: {
Debugger
},
props: {
data: Object,
data: Object
},
mounted() {
let that = this;
this.height = window.innerHeight - this.diffHeight;
this.dataCase = this.$parent.dataCase;
if(this.dataCase.ACTION =="jump") {
if (this.dataCase.ACTION === "jump") {
this.path =
window.config.SYS_SERVER +
window.config.SYS_URI +
@@ -33,24 +40,35 @@ export default {
`cases/open?APP_UID=${this.dataCase.APP_UID}&DEL_INDEX=${this.dataCase.DEL_INDEX}&action=${this.dataCase.ACTION}`;
}
setTimeout(() => {
api.cases.debugStatus(this.dataCase).then((response) => {
if (response.data) {
that.openDebug = true;
}
});
}, 2000);
},
data() {
return {
openDebug: false,
dataCase: null,
height: "100%",
width: "100%",
diffHeight: 10,
dataCase: null,
path: "",
};
},
methods: {
classBtn(cls) {
return "btn v-btn-request " + cls;
},
onLoadIframe() {},
},
};
</script>
<style>
.debugger-inline-cont {
overflow: hidden;
}
</style>

View File

@@ -3,7 +3,7 @@ import VueRouter from "vue-router";
import VueSidebarMenu from "vue-sidebar-menu";
import VueI18n from 'vue-i18n';
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue';
import { ServerTable, Event} from 'vue-tables-2';
import { ServerTable, Event, ClientTable} from 'vue-tables-2';
import "@fortawesome/fontawesome-free/css/all.css";
import "@fortawesome/fontawesome-free/js/all.js";
import 'bootstrap/dist/css/bootstrap-grid.css';
@@ -11,13 +11,13 @@ import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
import Home from "./Home";
Vue.use(VueRouter);
Vue.use(VueSidebarMenu);
Vue.use(BootstrapVue);
Vue.use(BootstrapVueIcons);
Vue.use(VueI18n);
Vue.use(ServerTable, {}, false, 'bootstrap3', {});
Vue.use(ClientTable, {}, false, 'bootstrap3', {});
window.ProcessMaker = {
apiClient: require('axios')
};

View File

@@ -52,6 +52,7 @@ export default {
mounted() {},
data() {
return {
permission: true,
dataAlert: {
dismissSecs: 5,
dismissCountDown: 0,
@@ -114,18 +115,33 @@ export default {
return "btn v-btn-request " + cls;
},
show() {
this.getCasesNotes();
this.$refs["modal-comments"].show();
let that = this;
//Clean the data attached documents for ever
this.dataAttachedDocuments.items = [];
this.getCasesNotes((response) => {
if (that.permission) {
that.$refs["modal-comments"].show();
} else {
that.$parent.showAlert(
that.$i18n.t("ID_CASES_NOTES_NO_PERMISSIONS"),
"danger"
);
}
});
},
cancel() {
this.$refs["modal-comments"].hide();
},
getCasesNotes() {
getCasesNotes(callback) {
let that = this;
Api.cases
.casenotes(this.dataCase)
.then((response) => {
that.formatResponseCaseNotes(response.data.notes);
that.permission = response.data.noPerms == 1 ? false : true;
if (_.isFunction(callback)) {
callback(response);
}
})
.catch((err) => {
throw new Error(err);
@@ -138,6 +154,7 @@ export default {
let that = this,
notesArray = [];
_.each(notes, (n) => {
n.id = _.random(1000000);
notesArray.push({
user: that.nameFormatCases(
n.USR_FIRSTNAME,
@@ -154,6 +171,7 @@ export default {
},
dropFiles(files) {
this.attachDocuments = true;
this.dataAttachedDocuments.items = [];
this.dataAttachedDocuments.items = files;
},
/**

View File

@@ -0,0 +1,91 @@
import _ from "lodash";
export default {
/**
* Environment Formats function for full name
* @param {object} params
*/
userNameDisplayFormat(params) {
let aux;
let defaultValues = {
userName: '',
firstName: '',
lastName: '',
format: '(@lastName, @firstName) @userName'
};
_.assignIn(defaultValues, params);
aux = defaultValues.format;
aux = aux.replace('@userName',defaultValues.userName);
aux = aux.replace('@firstName',defaultValues.firstName);
aux = aux.replace('@lastName',defaultValues.lastName);
return aux;
},
/**
* Parse an url string and prepare an object of the parameters
* @param {string} url
* @returns {object}
*/
getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
// stuff after # is not part of query string, so get rid of it
queryString = queryString.split('#')[0];
// split our query string into its component parts
var arr = queryString.split('&');
for (var i = 0; i < arr.length; i++) {
// separate the keys and the values
var a = arr[i].split('=');
// set parameter name and value (use 'true' if empty)
var paramName = a[0];
var paramValue = typeof (a[1]) === 'undefined' ? true : a[1];
// (optional) keep case consistent
paramName = paramName.toLowerCase();
if (typeof paramValue === 'string') paramValue = paramValue.toLowerCase();
// if the paramName ends with square brackets, e.g. colors[] or colors[2]
if (paramName.match(/\[(\d+)?\]$/)) {
// create key if it doesn't exist
var key = paramName.replace(/\[(\d+)?\]/, '');
if (!obj[key]) obj[key] = [];
// if it's an indexed array e.g. colors[2]
if (paramName.match(/\[\d+\]$/)) {
// get the index value and add the entry at the appropriate position
var index = /\[(\d+)\]/.exec(paramName)[1];
obj[key][index] = paramValue;
} else {
// otherwise add the value to the end of the array
obj[key].push(paramValue);
}
} else {
// we're dealing with a string
if (!obj[paramName]) {
// if it doesn't exist, create property
obj[paramName] = paramValue;
} else if (obj[paramName] && typeof obj[paramName] === 'string'){
// if property does exist and it's a string, convert it to an array
obj[paramName] = [obj[paramName]];
obj[paramName].push(paramValue);
} else {
// otherwise add the property
obj[paramName].push(paramValue);
}
}
}
}
return obj;
}
}

View File

@@ -405,5 +405,5 @@
}
.vsm--mobile-item {
max-width: 200px !important;
max-width: 210px !important;
}

View File

@@ -63,6 +63,9 @@ $_SESSION['__SYSTEM_UTC_TIME_ZONE__'] = (int) (env('MAIN_SYSTEM_UTC_TIME_ZONE',
ini_set('date.timezone', $_SESSION['__SYSTEM_UTC_TIME_ZONE__'] ? 'UTC' : env('MAIN_TIME_ZONE', 'America/New_York'));
define('TIME_ZONE', ini_get('date.timezone'));
// Only test async routing
define('DISABLE_TASK_MANAGER_ROUTING_ASYNC', false);
//This path includes PM tables model classes
set_include_path(get_include_path() . PATH_SEPARATOR . PATH_DB . SYS_SYS . "/");

View File

@@ -550,15 +550,5 @@ class SupervisingTest extends TestCase
$res = $supervising->getPagingCounters();
$this->assertEquals(3, $res);
$delegation = Delegation::select()->where('USR_ID', $cases->USR_ID)->first();
$supervising->setCaseNumber($delegation->APP_NUMBER);
$supervising->setProcessId($delegation->PRO_ID);
$supervising->setTaskId($delegation->TAS_ID);
$supervising->setCaseUid($delegation->APP_UID);
$res = $supervising->getPagingCounters();
$this->assertEquals(1, $res);
}
}

View File

@@ -154,4 +154,24 @@ class UserTest extends TestCase
$results = User::getId(G::generateUniqueID());
$this->assertEquals(0, $results);
}
/**
* It test get the user information
*
* @covers \ProcessMaker\Model\User::scopeUserId()
* @covers \ProcessMaker\Model\User::getInformation()
* @test
*/
public function it_get_information()
{
$user = factory(User::class)->create();
// When the user exist
$results = User::getInformation($user->USR_ID);
$this->assertNotEmpty($results);
$this->assertArrayHasKey('usr_username', $results);
$this->assertArrayHasKey('usr_firstname', $results);
$this->assertArrayHasKey('usr_lastname', $results);
$this->assertArrayHasKey('usr_email', $results);
$this->assertArrayHasKey('usr_position', $results);
}
}

View File

@@ -17,4 +17,16 @@ class ApplyMaskDateEnvironmentTest extends TestCase
$expected = '2020/11/12';
$this->assertEquals($expected, applyMaskDateEnvironment($date1, 'Y/m/d'));
}
/**
* When the mask is empty will return the same date
*
* @test
*/
public function it_should_return_date_without_mask()
{
$date1 = date("2020-11-12 09:09:10");
$expected = '2020-11-12 09:09:10';
$this->assertEquals($expected, applyMaskDateEnvironment($date1));
}
}

View File

@@ -927,9 +927,14 @@ class LdapAdvanced
$arrayData['countUser']++;
if ((is_array($username) && !empty($username)) || trim($username) != '') {
$dataUserLdap = $this->getUserDataFromAttribute($username, $arrayUserLdap);
$dataUserLdap["usrRole"] = "";
if (!empty($arrayAuthSourceData['AUTH_SOURCE_DATA']['USR_ROLE'])) {
$dataUserLdap["usrRole"] = $arrayAuthSourceData['AUTH_SOURCE_DATA']['USR_ROLE'];
}
$arrayData = $this->groupSynchronizeUser(
$groupUid,
$this->getUserDataFromAttribute($username, $arrayUserLdap),
$dataUserLdap,
$arrayData
);
}
@@ -1631,7 +1636,14 @@ class LdapAdvanced
}
}
public function automaticRegister($aAuthSource, $strUser, $strPass)
/**
* Automatic register.
* @param array $authSource
* @param string $strUser
* @param string $strPass
* @return bool
*/
public function automaticRegister($authSource, $strUser, $strPass)
{
$rbac = RBAC::getSingleton();
@@ -1645,52 +1657,56 @@ class LdapAdvanced
$user = $this->searchUserByUid($strUser);
$res = 0;
$result = 0;
if (!empty($user)) {
if ($this->VerifyLogin($user['sUsername'], $strPass) === true) {
$res = 1;
$result = 1;
}
if ($res == 0 && $this->VerifyLogin($user['sDN'], $strPass) === true) {
$res = 1;
if ($result == 0 && $this->VerifyLogin($user['sDN'], $strPass) === true) {
$result = 1;
}
} else {
return $res;
return $result;
}
if ($res == 0) {
$aAuthSource = $rbac->authSourcesObj->load($this->sAuthSource);
$aAttributes = array();
if ($result == 0) {
$authSource = $rbac->authSourcesObj->load($this->sAuthSource);
$attributes = [];
if (isset($aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'])) {
$aAttributes = $aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'];
if (isset($authSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'])) {
$attributes = $authSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'];
}
$aData = array();
$aData['USR_USERNAME'] = $user['sUsername'];
$aData["USR_PASSWORD"] = "00000000000000000000000000000000";
$aData['USR_FIRSTNAME'] = $user['sFirstname'];
$aData['USR_LASTNAME'] = $user['sLastname'];
$aData['USR_EMAIL'] = $user['sEmail'];
$aData['USR_DUE_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 2));
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$aData['USR_BIRTHDAY'] = date('Y-m-d');
$aData['USR_STATUS'] = (isset($user['USR_STATUS'])) ? (($user['USR_STATUS'] == 'ACTIVE') ? 1 : 0) : 1;
$aData['USR_AUTH_TYPE'] = strtolower($aAuthSource['AUTH_SOURCE_PROVIDER']);
$aData['UID_AUTH_SOURCE'] = $aAuthSource['AUTH_SOURCE_UID'];
$aData['USR_AUTH_USER_DN'] = $user['sDN'];
$aData['USR_ROLE'] = 'PROCESSMAKER_OPERATOR';
$usrRole = 'PROCESSMAKER_OPERATOR';
if (!empty($authSource['AUTH_SOURCE_DATA']['USR_ROLE'])) {
$usrRole = $authSource['AUTH_SOURCE_DATA']['USR_ROLE'];
}
$data = [];
$data['USR_USERNAME'] = $user['sUsername'];
$data["USR_PASSWORD"] = "00000000000000000000000000000000";
$data['USR_FIRSTNAME'] = $user['sFirstname'];
$data['USR_LASTNAME'] = $user['sLastname'];
$data['USR_EMAIL'] = $user['sEmail'];
$data['USR_DUE_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 2));
$data['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
$data['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$data['USR_BIRTHDAY'] = date('Y-m-d');
$data['USR_STATUS'] = (isset($user['USR_STATUS'])) ? (($user['USR_STATUS'] == 'ACTIVE') ? 1 : 0) : 1;
$data['USR_AUTH_TYPE'] = strtolower($authSource['AUTH_SOURCE_PROVIDER']);
$data['UID_AUTH_SOURCE'] = $authSource['AUTH_SOURCE_UID'];
$data['USR_AUTH_USER_DN'] = $user['sDN'];
$data['USR_ROLE'] = $usrRole;
if (!empty($aAttributes)) {
foreach ($aAttributes as $value) {
if (!empty($attributes)) {
foreach ($attributes as $value) {
if (isset($user[$value['attributeUser']])) {
$aData[$value['attributeUser']] = str_replace("*", "'", $user[$value['attributeUser']]);
$data[$value['attributeUser']] = str_replace("*", "'", $user[$value['attributeUser']]);
if ($value['attributeUser'] == 'USR_STATUS') {
$evalValue = $aData[$value['attributeUser']];
$evalValue = $data[$value['attributeUser']];
$statusValue = (isset($user['USR_STATUS'])) ? $user['USR_STATUS'] : 'ACTIVE';
$aData[$value['attributeUser']] = $statusValue;
$data[$value['attributeUser']] = $statusValue;
}
}
}
@@ -1698,23 +1714,23 @@ class LdapAdvanced
//req - accountexpires
if (isset($user["USR_DUE_DATE"]) && $user["USR_DUE_DATE"] != '') {
$aData["USR_DUE_DATE"] = $this->convertDateADtoPM($user["USR_DUE_DATE"]);
$data["USR_DUE_DATE"] = $this->convertDateADtoPM($user["USR_DUE_DATE"]);
}
//end
$sUserUID = $rbac->createUser($aData, 'PROCESSMAKER_OPERATOR');
$aData['USR_UID'] = $sUserUID;
$userUid = $rbac->createUser($data, $usrRole);
$data['USR_UID'] = $userUid;
require_once 'classes/model/Users.php';
$oUser = new Users();
$aData['USR_STATUS'] = (isset($user['USR_STATUS'])) ? $user['USR_STATUS'] : 'ACTIVE';
$oUser->create($aData);
$users = new Users();
$data['USR_STATUS'] = (isset($user['USR_STATUS'])) ? $user['USR_STATUS'] : 'ACTIVE';
$users->create($data);
$this->log(null, "Automatic Register for user $strUser ");
$res = 1;
$result = 1;
}
return $res;
return $result;
}
/**
@@ -2260,15 +2276,15 @@ class LdapAdvanced
}
/**
* creates an users using the data send in the array $aUsers
* creates an users using the data send in the array $user
* and then add the user to specific department
* this function is used in cron only
*
* @param array $aUser info taken from ldap
* @param array $user info taken from ldap
* @param string $depUid the department UID
* @return boolean
*/
public function createUserAndActivate($aUser, $depUid)
public function createUserAndActivate($user, $depUid)
{
$rbac = RBAC::getSingleton();
@@ -2284,41 +2300,42 @@ class LdapAdvanced
$rbac->usersRolesObj = new UsersRoles();
}
$sUsername = $aUser['sUsername'];
$sFullname = $aUser['sFullname'];
$sFirstname = $aUser['sFirstname'];
$sLastname = $aUser['sLastname'];
$sEmail = $aUser['sEmail'];
$sDn = $aUser['sDN'];
$sUsername = $user['sUsername'];
$sFullname = $user['sFullname'];
$sFirstname = $user['sFirstname'];
$sLastname = $user['sLastname'];
$sEmail = $user['sEmail'];
$sDn = $user['sDN'];
$usrRole = empty($user['usrRole']) ? 'PROCESSMAKER_OPERATOR' : $user['usrRole'];
$aData = array();
$aData['USR_USERNAME'] = $sUsername;
$aData["USR_PASSWORD"] = "00000000000000000000000000000000";
$aData['USR_FIRSTNAME'] = $sFirstname;
$aData['USR_LASTNAME'] = $sLastname;
$aData['USR_EMAIL'] = $sEmail;
$aData['USR_DUE_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 2));
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$aData['USR_BIRTHDAY'] = date('Y-m-d');
$aData['USR_STATUS'] = 1;
$aData['USR_AUTH_TYPE'] = 'ldapadvanced';
$aData['UID_AUTH_SOURCE'] = $this->sAuthSource;
$aData['USR_AUTH_USER_DN'] = $sDn;
$data = [];
$data['USR_USERNAME'] = $sUsername;
$data["USR_PASSWORD"] = "00000000000000000000000000000000";
$data['USR_FIRSTNAME'] = $sFirstname;
$data['USR_LASTNAME'] = $sLastname;
$data['USR_EMAIL'] = $sEmail;
$data['USR_DUE_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 2));
$data['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
$data['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$data['USR_BIRTHDAY'] = date('Y-m-d');
$data['USR_STATUS'] = 1;
$data['USR_AUTH_TYPE'] = 'ldapadvanced';
$data['UID_AUTH_SOURCE'] = $this->sAuthSource;
$data['USR_AUTH_USER_DN'] = $sDn;
$sUserUID = $rbac->createUser($aData, "PROCESSMAKER_OPERATOR");
$userUid = $rbac->createUser($data, $usrRole);
$aData['USR_STATUS'] = 'ACTIVE';
$aData['USR_UID'] = $sUserUID;
$aData['DEP_UID'] = $depUid;
$aData['USR_ROLE'] = 'PROCESSMAKER_OPERATOR';
$data['USR_STATUS'] = 'ACTIVE';
$data['USR_UID'] = $userUid;
$data['DEP_UID'] = $depUid;
$data['USR_ROLE'] = $usrRole;
require_once 'classes/model/Users.php';
$oUser = new Users();
$oUser->create($aData);
$users = new Users();
$users->create($data);
return $sUserUID;
return $userUid;
}
public function synchronizeManagers($managersHierarchy)

View File

@@ -4643,6 +4643,12 @@ msgstr "Config Directory"
msgid "Confirm"
msgstr "Confirm"
# TRANSLATION
# LABEL/ID_CONFIRMATION
#: LABEL/ID_CONFIRMATION
msgid "Confirmation"
msgstr "Confirmation"
# TRANSLATION
# LABEL/ID_CONFIRM_ADHOCUSER_CASE
#: LABEL/ID_CONFIRM_ADHOCUSER_CASE
@@ -5909,6 +5915,12 @@ msgstr "Definition"
msgid "Delay Field"
msgstr "Delay Field"
# TRANSLATION
# LABEL/ID_DELAYED
#: LABEL/ID_DELAYED
msgid "Delayed"
msgstr "Delayed"
# TRANSLATION
# LABEL/ID_DELEGATE_DATE_FROM
#: LABEL/ID_DELEGATE_DATE_FROM
@@ -6899,6 +6911,12 @@ msgstr "Duplicate category name."
msgid "Duplicate entry for primary key"
msgstr "Duplicate entry for primary key"
# TRANSLATION
# LABEL/ID_DURATION
#: LABEL/ID_DURATION
msgid "Duration"
msgstr "Duration"
# TRANSLATION
# LABEL/ID_DYANFORM_CREATED
#: LABEL/ID_DYANFORM_CREATED
@@ -10709,6 +10727,12 @@ msgstr "Invalid value for '{0}'. It must be a string."
msgid "Invalid value for \"{0}\". This value must be an array."
msgstr "Invalid value for \"{0}\". This value must be an array."
# TRANSLATION
# LABEL/ID_IN_DRAFT
#: LABEL/ID_IN_DRAFT
msgid "In Draft"
msgstr "In Draft"
# TRANSLATION
# LABEL/ID_IN_PROGRESS
#: LABEL/ID_IN_PROGRESS

View File

@@ -57593,6 +57593,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_CONFIGURE','en','Configure','2014-01-15') ,
( 'LABEL','ID_CONFIG_DIRECTORY','en','Config Directory','2014-01-15') ,
( 'LABEL','ID_CONFIRM','en','Confirm','2014-01-15') ,
( 'LABEL','ID_CONFIRMATION','en','Confirmation','2020-01-15') ,
( 'LABEL','ID_CONFIRM_ADHOCUSER_CASE','en','Are you sure you want to do it?','2014-01-15') ,
( 'LABEL','ID_CONFIRM_ASSIGNED_GRID','en','Do you want to delete the data in the row you just created?','2015-01-16') ,
( 'LABEL','ID_CONFIRM_CANCEL_CASE','en','Are you sure you want to cancel this case?','2014-01-15') ,
@@ -57810,6 +57811,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DEFAULT_SKIN','en','Default Skin','2014-01-15') ,
( 'LABEL','ID_DEFINITION','en','Definition','2014-01-15') ,
( 'LABEL','ID_DELAY_FIELD','en','Delay Field','2014-01-15') ,
( 'LABEL','ID_DELAYED','en','Delayed','2021-01-20') ,
( 'LABEL','ID_DELEGATE_DATE_FROM','en','Date from','2017-10-18') ,
( 'LABEL','ID_DELEGATE_DATE_TO','en','to','2014-01-15') ,
( 'LABEL','ID_DELEGATE_USER','en','Delegated User','2014-01-15') ,
@@ -57979,6 +57981,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DUPLICATE_CASE_SCHEDULER_NAME','en','Duplicate Case Scheduler name.','2014-01-15') ,
( 'LABEL','ID_DUPLICATE_CATEGORY_NAME','en','Duplicate category name.','2014-01-15') ,
( 'LABEL','ID_DUPLICATE_ENTRY_PRIMARY_KEY','en','Duplicate entry for primary key','2014-01-15') ,
( 'LABEL','ID_DURATION','en','Duration','2021-01-20') ,
( 'LABEL','ID_DYANFORM_CREATED','en','Dynaform has been created successfully','2014-01-15') ,
( 'LABEL','ID_DYANFORM_REMOVE','en','Dynaform has been removed successfully from Process','2014-01-15') ,
( 'LABEL','ID_DYNADOC','en','My Case Forms and Documents','2014-01-15') ,
@@ -58641,6 +58644,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_INVALID_VALUE_ONLY_ACCEPTS_VALUES','en','Invalid value for "{0}". It only accepts values: "{1}".','2014-10-21') ,
( 'LABEL','ID_INVALID_VALUE_STRING','en','Invalid value for ''{0}''. It must be a string.','2014-10-21') ,
( 'LABEL','ID_INVALID_VALUE_THIS_MUST_BE_ARRAY','en','Invalid value for "{0}". This value must be an array.','2014-10-21') ,
( 'LABEL','ID_IN_DRAFT','en','In Draft','2021-01-20') ,
( 'LABEL','ID_IN_PROGRESS','en','In Progress','2014-01-15') ,
( 'LABEL','ID_IP','en','IP Client','2014-10-08') ,
( 'LABEL','ID_ISNT_LICENSE','en','This isn''t the correct license.','2014-01-15') ,

File diff suppressed because it is too large Load Diff

View File

@@ -12,18 +12,18 @@
"@vue/cli": "^4.4.6",
"axios": "^0.19.2",
"bootstrap": "^4.5.0",
"bootstrap-vue": "^2.15.0",
"core-js": "^3.6.5",
"bootstrap-vue": "^2.20.1",
"core-js": "^3.8.1",
"lodash": "^4.17.19",
"save": "^2.4.0",
"vue": "^2.6.11",
"vue-tables-2": "^2.0.27",
"vue-tables-2": "^2.1.61",
"vuelidate": "^0.7.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/cli-plugin-babel": "^4.5.9",
"@vue/cli-plugin-eslint": "^4.5.9",
"@vue/cli-service": "^4.5.9",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",

View File

@@ -32,10 +32,26 @@
<b-form-invalid-feedback>{{$root.translation('ID_IS_REQUIRED')}}</b-form-invalid-feedback>
</b-form-group>
<b-form-group :label="$root.translation('ID_PORT')">
<b-form-input v-model="form.port"
:state="validateState('port')"
autocomplete="off"/>
<b-form-invalid-feedback>{{$root.translation('ID_IS_REQUIRED')}}</b-form-invalid-feedback>
<b-input-group>
<template #append>
<b-input-group-text class="p-0">
<b-button size="md"
variant="outline-light"
class="border-0"
@click="disabledField.port=!disabledField.port;">
<b-icon icon="pencil-fill"
aria-hidden="true"
variant="primary">
</b-icon>
</b-button>
</b-input-group-text>
</template>
<b-form-input v-model="form.port"
:state="validateState('port')"
:disabled="disabledField.port"
autocomplete="off"/>
<b-form-invalid-feedback>{{$root.translation('ID_IS_REQUIRED')}}</b-form-invalid-feedback>
</b-input-group>
</b-form-group>
<b-form-group :label="$root.translation('ID_ENABLE_AUTOMATIC_REGISTER')"
label-cols-lg="8">
@@ -93,30 +109,108 @@
<b-form-invalid-feedback>{{$root.translation('ID_IS_REQUIRED')}}</b-form-invalid-feedback>
</b-form-group>
<b-form-group :label="$root.translation('ID_USER_IDENTIFIER')">
<b-form-input v-model="form.userIdentifier"
autocomplete="off"
readonly/>
<b-input-group>
<template #append>
<b-input-group-text class="p-0">
<b-button size="md"
variant="outline-light"
class="border-0"
@click="disabledField.userIdentifier=!disabledField.userIdentifier;">
<b-icon icon="pencil-fill"
aria-hidden="true"
variant="primary">
</b-icon>
</b-button>
</b-input-group-text>
</template>
<b-form-input v-model="form.userIdentifier"
autocomplete="off"
:disabled="disabledField.userIdentifier"/>
</b-input-group>
</b-form-group>
<b-form-group :label="$root.translation('ID_GROUP_IDENTIFIER')">
<b-form-input v-model="form.groupIdentifier"
autocomplete="off"
readonly/>
<b-input-group>
<template #append>
<b-input-group-text class="p-0">
<b-button size="md"
variant="outline-light"
class="border-0"
@click="disabledField.groupIdentifier=!disabledField.groupIdentifier;">
<b-icon icon="pencil-fill"
aria-hidden="true"
variant="primary">
</b-icon>
</b-button>
</b-input-group-text>
</template>
<b-form-input v-model="form.groupIdentifier"
autocomplete="off"
:disabled="disabledField.groupIdentifier"/>
</b-input-group>
</b-form-group>
<b-form-group :label="$root.translation('ID_FILTER_TO_SEARCH_USERS')">
<b-form-input v-model="form.filterToSearchUsers"
autocomplete="off"/>
</b-form-group>
<b-form-group :label="$root.translation('ID_USER_CLASS_IDENTIFIER')">
<b-form-input v-model="form.userClassIdentifier"
autocomplete="off"/>
<b-input-group>
<template #append>
<b-input-group-text class="p-0">
<b-button size="md"
variant="outline-light"
class="border-0"
@click="disabledField.userClassIdentifier=!disabledField.userClassIdentifier;">
<b-icon icon="pencil-fill"
aria-hidden="true"
variant="primary">
</b-icon>
</b-button>
</b-input-group-text>
</template>
<b-form-input v-model="form.userClassIdentifier"
:disabled="disabledField.userClassIdentifier"
autocomplete="off"/>
</b-input-group>
</b-form-group>
<b-form-group :label="$root.translation('ID_GROUP_CLASS_IDENTIFIER')">
<b-form-input v-model="form.groupClassIdentifier"
autocomplete="off"/>
<b-input-group>
<template #append>
<b-input-group-text class="p-0">
<b-button size="md"
variant="outline-light"
class="border-0"
@click="disabledField.groupClassIdentifier=!disabledField.groupClassIdentifier;">
<b-icon icon="pencil-fill"
aria-hidden="true"
variant="primary">
</b-icon>
</b-button>
</b-input-group-text>
</template>
<b-form-input v-model="form.groupClassIdentifier"
:disabled="disabledField.groupClassIdentifier"
autocomplete="off"/>
</b-input-group>
</b-form-group>
<b-form-group :label="$root.translation('ID_DEPARTMENT_CLASS_IDENTIFIER')">
<b-form-input v-model="form.departmentClassIdentifier"
autocomplete="off"/>
<b-input-group>
<template #append>
<b-input-group-text class="p-0">
<b-button size="md"
variant="outline-light"
class="border-0"
@click="disabledField.departmentClassIdentifier=!disabledField.departmentClassIdentifier;">
<b-icon icon="pencil-fill"
aria-hidden="true"
variant="primary">
</b-icon>
</b-button>
</b-input-group-text>
</template>
<b-form-input v-model="form.departmentClassIdentifier"
:disabled="disabledField.departmentClassIdentifier"
autocomplete="off"/>
</b-input-group>
</b-form-group>
</b-col>
</b-row>
@@ -158,24 +252,35 @@
components: {
formUploadSource
},
validations: {
form: {
name: {
required
},
serverAddress: {
required
},
port: {
required
},
userName: {
required
},
password: {
required
validations() {
let fields = {
form: {
name: {
required
},
serverAddress: {
required
},
port: {
required
}
}
};
if (this.form.anonymous === '1') {
fields.form.userName = {
};
fields.form.password = {
};
}
if (this.form.anonymous === '0') {
fields.form.userName = {
required
};
fields.form.password = {
required
};
}
return fields;
},
data() {
return {
@@ -217,7 +322,14 @@
{value: "ds", text: "389 DS"}
],
roles: [],
show: true
disabledField: {
port: true,
userIdentifier: true,
groupIdentifier: true,
userClassIdentifier: true,
groupClassIdentifier: true,
departmentClassIdentifier: true
}
};
},
methods: {

View File

@@ -13,7 +13,7 @@
</b-form-file>
<b-form-invalid-feedback>{{$root.translation('ID_IS_REQUIRED')}}</b-form-invalid-feedback>
</b-form-group>
<b-form-group :label="$root.translation('ID_CONNECTION_WITH_THE_SAME_NAME_PLEASE_SELECT_AN_OPTION')" v-else>
<b-form-group :label="$root.translation('ID_CONNECTION_WITH_THE_SAME_NAME_PLEASE_SELECT_AN_OPTION',[fileContent.AUTH_SOURCE_NAME])" v-else>
<b-form-file v-model="form.connectionSettings"
@change="change"
:state="validateState('connectionSettings')"

View File

@@ -106,11 +106,17 @@ try {
$cases = new Cases();
$cases->routeCase($processUid, $application, $postForm, $sStatus, $flagGmail, $tasUid, $index, $userLogged);
};
JobsManager::getSingleton()->dispatch(RouteCase::class, $closure);
if (!DISABLE_TASK_MANAGER_ROUTING_ASYNC) {
// Routing the case asynchronically
JobsManager::getSingleton()->dispatch(RouteCase::class, $closure);
//We close the related threads.
$cases = new Cases();
$cases->CloseCurrentDelegation($application, $index);
// We close the related threads.
$cases = new Cases();
$cases->CloseCurrentDelegation($application, $index);
} else {
// Routing the case synchronically
$closure();
}
$debuggerAvailable = true;
$casesRedirector = 'casesListExtJsRedirector';
@@ -126,13 +132,42 @@ try {
}
}
$loc = $nextStep['PAGE'];
//Triggers After
// Triggers After
$isIE = Bootstrap::isIE();
unset($_SESSION['TRIGGER_DEBUG']);
//close tab only if IE11 add a validation was added if the current skin is uxs
// If the routing of cases asynchronically is disabled, use the old behaviour for debug option
if (DISABLE_TASK_MANAGER_ROUTING_ASYNC) {
// Determine the landing page
if (isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $nextStep['PAGE'];
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
} else {
$loc = $nextStep['PAGE'];
}
// If debug option is enabled for the process, load the debug template
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && !$isIE) {
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
$templatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$templatePower->prepare();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('template', '', '', '', $templatePower);
$_POST['NextStep'] = $loc;
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
G::RenderPage('publish', 'blank');
exit();
} else {
unset($_SESSION['TRIGGER_DEBUG']);
}
}
} else {
// If the case is routed synchronically, always redirect to the next step
$loc = $nextStep['PAGE'];
unset($_SESSION['TRIGGER_DEBUG']);
}
// Close tab only if IE11 add a validation was added if the current skin is uxs
if ($isIE && !isset($_SESSION['__OUTLOOK_CONNECTOR__']) && SYS_SKIN !== "uxs") {
$script = "
<script type='text/javascript'>

View File

@@ -51,7 +51,7 @@ if (!empty($_SESSION['GUEST_USER']) && $_SESSION['GUEST_USER'] === RBAC::GUEST_U
}
$access = $RBAC->userCanAccess('PM_FOLDERS_ALL') != 1 && defined('DISABLE_DOWNLOAD_DOCUMENTS_SESSION_VALIDATION') && DISABLE_DOWNLOAD_DOCUMENTS_SESSION_VALIDATION == 0;
if ($access && $isGuestUser === false) {
if (isset($_SESSION['USER_LOGGED']) && !$oAppDocument->canDownloadInput($_SESSION['USER_LOGGED'], $_GET['a'], $docVersion)) {
if ((isset($_SESSION['USER_LOGGED']) && !$oAppDocument->canDownloadInput($_SESSION['USER_LOGGED'], $_GET['a'], $docVersion)) || !isset($_SESSION['USER_LOGGED'])) {
G::header('Location: /errors/error403.php?url=' . urlencode($_SERVER['REQUEST_URI']));
die();
}

View File

@@ -61,7 +61,13 @@ if ($featureEnable) {
$cases = new Cases();
$cases->routeCaseActionByEmail($appUid, $delIndex, $aber, $dynUid, $forms, $remoteAddr, $files);
};
JobsManager::getSingleton()->dispatch(ActionByEmail::class, $closure);
if (!DISABLE_TASK_MANAGER_ROUTING_ASYNC) {
// Routing the case asynchronically
JobsManager::getSingleton()->dispatch(ActionByEmail::class, $closure);
} else {
// Routing the case synchronically
$closure();
}
$message = [];
$message['MESSAGE'] = '<strong>' . G::loadTranslation('ID_ABE_INFORMATION_SUBMITTED') . '</strong>';

View File

@@ -1,4 +0,0 @@
file.reference.userExtendedAttributes-public=public
files.encoding=UTF-8
site.root.folder=${file.reference.userExtendedAttributes-public}
source.folder=

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.clientproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
<name>userExtendedAttributes</name>
</data>
</configuration>
</project>

View File

@@ -224,7 +224,7 @@
this.statusNameMessage = this.$root.translation("ID_INVALID_MAX_PERMITTED", [this.$root.translation('ID_ATTRIBUTE_NAME'), '50']);
return;
}
if (/^[a-zA-Z][-_0-9a-zA-Z]+$/.test(this.form.name) === false) {
if (/^[a-zA-Z][-_0-9a-zA-Z\s]+$/.test(this.form.name) === false) {
this.statusName = false;
this.statusNameMessage = this.$root.translation("ID_USE_ALPHANUMERIC_CHARACTERS_INCLUDING", ["- _"]);
return;
@@ -360,7 +360,7 @@
formToFormData(form) {
let formData = new FormData();
formData.append("UEA_ID", form.id);
formData.append("UEA_NAME", form.name);
formData.append("UEA_NAME", form.name.trim());
formData.append("UEA_ATTRIBUTE_ID", form.attributeId);
formData.append("UEA_HIDDEN", form.hidden);
formData.append("UEA_REQUIRED", form.required);

View File

@@ -13,7 +13,7 @@
:options="options">
<div slot="roles"
slot-scope="props">
{{formatingRoles(props.row.rolesLabel)}}
{{formatingRoles(props.row)}}
</div>
<div slot="owner"
slot-scope="props">
@@ -187,8 +187,14 @@
refresh() {
this.$refs.vServerTable1.refresh();
},
formatingRoles(rolesLabel) {
return rolesLabel.join(", ");
formatingRoles(row) {
if (row.option === "allUser") {
return this.$root.translation("ID_ALL_USERS");
}
if (row.option === "byRol") {
return row.rolesLabel.join(", ");
}
return "";
}
}
}

View File

@@ -1,4 +0,0 @@
file.reference.userPersonalInformation-public=public
files.encoding=UTF-8
site.root.folder=${file.reference.userPersonalInformation-public}
source.folder=

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.clientproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
<name>userPersonalInformation</name>
</data>
</configuration>
</project>

View File

@@ -10,7 +10,7 @@
autocomplete="off"
:state="validate.USR_FIRSTNAME.state"
@keyup="validateFirstName"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_FIRSTNAME"></b-form-input>
<b-form-invalid-feedback>{{validate.USR_FIRSTNAME.message}}</b-form-invalid-feedback>
</b-form-group>
</b-col>
@@ -22,7 +22,7 @@
autocomplete="off"
:state="validate.USR_LASTNAME.state"
@keyup="validateLastName"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_LASTNAME"></b-form-input>
<b-form-invalid-feedback>{{validate.USR_LASTNAME.message}}</b-form-invalid-feedback>
</b-form-group>
</b-col>
@@ -36,7 +36,7 @@
@click="avatarClick"
badge-variant="light"
:src="urlImage"
:disabled="disabled">
:disabled="disabledField.USR_PHOTO">
</b-avatar>
</b-col>
</b-row>
@@ -45,7 +45,7 @@
<b-form-group :label="$root.translation('ID_ADDRESS')">
<b-form-input v-model="form.USR_ADDRESS"
autocomplete="off"
:disabled="disabled"/>
:disabled="disabledField.USR_ADDRESS"/>
</b-form-group>
</b-col>
<b-col cols="2">
@@ -54,7 +54,7 @@
<b-form-group :label="$root.translation('ID_ZIP_CODE')">
<b-form-input v-model="form.USR_ZIP_CODE"
autocomplete="off"
:disabled="disabled"/>
:disabled="disabledField.USR_ZIP_CODE"/>
</b-form-group>
</b-col>
<b-col cols="1">
@@ -65,7 +65,7 @@
autocomplete="off"
:state="validate.USR_USERNAME.state"
@keyup="validateUserName"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_USERNAME"></b-form-input>
<b-form-valid-feedback><span v-html="validate.USR_USERNAME.message"></span></b-form-valid-feedback>
<b-form-invalid-feedback><span v-html="validate.USR_USERNAME.message"></span></b-form-invalid-feedback>
</b-form-group>
@@ -77,7 +77,7 @@
<b-form-select v-model="form.USR_COUNTRY"
:options="countryList"
@change="getStateList"
:disabled="disabled"/>
:disabled="disabledField.USR_COUNTRY"/>
</b-form-group>
</b-col>
<b-col cols="2">
@@ -85,14 +85,14 @@
<b-form-select v-model="form.USR_CITY"
:options="stateList"
@change="getLocationList"
:disabled="disabled"/>
:disabled="disabledField.USR_CITY"/>
</b-form-group>
</b-col>
<b-col cols="3">
<b-form-group :label="$root.translation('ID_CITY')">
<b-form-select v-model="form.USR_LOCATION"
:options="locationList"
:disabled="disabled"/>
:disabled="disabledField.USR_LOCATION"/>
</b-form-group>
</b-col>
<b-col cols="1">
@@ -103,7 +103,7 @@
autocomplete="off"
:state="validate.USR_EMAIL.state"
@keyup="validateEmail"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_EMAIL"></b-form-input>
<b-form-invalid-feedback>{{validate.USR_EMAIL.message}}</b-form-invalid-feedback>
</b-form-group>
</b-col>
@@ -113,7 +113,7 @@
<b-form-group :label="$root.translation('ID_PHONE')">
<b-form-input v-model="form.USR_PHONE"
autocomplete="off"
:disabled="disabled"/>
:disabled="disabledField.USR_PHONE"/>
</b-form-group>
</b-col>
<b-col cols="2">
@@ -122,7 +122,7 @@
<b-form-group :label="$root.translation('ID_POSITION')">
<b-form-input v-model="form.USR_POSITION"
autocomplete="off"
:disabled="disabled"/>
:disabled="disabledField.USR_POSITION"/>
</b-form-group>
</b-col>
<b-col cols="1">
@@ -131,7 +131,7 @@
<b-form-group :label="$root.translation('ID_STATUS')">
<b-form-select v-model="form.USR_STATUS"
:options="userStatus"
:disabled="disabled"/>
:disabled="disabledField.USR_STATUS"/>
</b-form-group>
</b-col>
</b-row>
@@ -148,7 +148,7 @@
</b-input-group-prepend>
<b-form-select v-model="form.USR_REPLACED_BY"
:options="usersList"
:disabled="disabled"></b-form-select>
:disabled="disabledField.USR_REPLACED_BY"></b-form-select>
</b-input-group>
</b-form-group>
</b-col>
@@ -156,7 +156,7 @@
<b-form-group :label="$root.translation('ID_CALENDAR')">
<b-form-select v-model="form.USR_CALENDAR"
:options="availableCalendars"
:disabled="disabled"/>
:disabled="disabledField.USR_CALENDAR"/>
</b-form-group>
</b-col>
<b-col cols="1">
@@ -165,7 +165,7 @@
<b-form-group :label="$root.translation('ID_EXPIRATION_DATE')">
<b-form-datepicker v-model="form.USR_DUE_DATE"
:date-format-options="{year:'numeric',month:'numeric',day:'numeric'}"
:disabled="disabled"/>
:disabled="disabledField.USR_DUE_DATE"/>
</b-form-group>
</b-col>
</b-row>
@@ -174,7 +174,7 @@
<b-form-group :label="$root.translation('ID_TIME_ZONE')">
<b-form-select v-model="form.USR_TIME_ZONE"
:options="timeZoneList"
:disabled="disabled"/>
:disabled="disabledField.USR_TIME_ZONE"/>
</b-form-group>
</b-col>
<b-col cols="2">
@@ -183,7 +183,7 @@
<b-form-group :label="$root.translation('ID_DEFAULT_LANGUAGE')">
<b-form-select v-model="form.USR_DEFAULT_LANG"
:options="languagesList"
:disabled="disabled"/>
:disabled="disabledField.USR_DEFAULT_LANG"/>
</b-form-group>
</b-col>
<b-col cols="1">
@@ -193,7 +193,7 @@
<b-form-select v-model="form.USR_ROLE"
:options="rolesList"
@change="changeRole"
:disabled="disabled"/>
:disabled="disabledField.USR_ROLE"/>
</b-form-group>
</b-col>
</b-row>
@@ -202,7 +202,7 @@
<b-form-group :label="$root.translation('ID_DEFAULT_MAIN_MENU_OPTION')">
<b-form-select v-model="form.PREF_DEFAULT_MENUSELECTED"
:options="defaultMainMenuOptionList"
:disabled="disabled"/>
:disabled="disabledField.PREF_DEFAULT_MENUSELECTED"/>
</b-form-group>
</b-col>
<b-col cols="2">
@@ -211,7 +211,7 @@
<b-form-group :label="$root.translation('ID_DEFAULT_CASES_MENU_OPTION')">
<b-form-select v-model="form.PREF_DEFAULT_CASES_MENUSELECTED"
:options="defaultCasesMenuOptionList"
:disabled="disabled"/>
:disabled="disabledField.PREF_DEFAULT_CASES_MENUSELECTED"/>
</b-form-group>
</b-col>
<b-col cols="1">
@@ -225,7 +225,7 @@
type="password"
@keyup="validatePassword"
@change="editing=false;"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_NEW_PASS"></b-form-input>
<b-form-valid-feedback><span v-html="validate.USR_NEW_PASS.message"></span></b-form-valid-feedback>
<b-form-invalid-feedback><span v-html="validate.USR_NEW_PASS.message"></span></b-form-invalid-feedback>
</b-form-group>
@@ -245,7 +245,7 @@
type="password"
@keyup="validateConfirmationPassword"
@change="editing=false;"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_CNF_PASS"></b-form-input>
<b-form-invalid-feedback><span v-html="validate.USR_CNF_PASS.message"></span></b-form-invalid-feedback>
</b-form-group>
</b-col>
@@ -282,24 +282,24 @@
autocomplete="off"
:state="validate.USR_COST_BY_HOUR.state"
@keyup="validateCostByHour"
:disabled="disabled"></b-form-input>
:disabled="disabledField.USR_COST_BY_HOUR"></b-form-input>
<b-form-invalid-feedback>{{validate.USR_COST_BY_HOUR.message}}</b-form-invalid-feedback>
</b-form-group>
<b-form-group :label="$root.translation('ID_UNITS')">
<b-form-input v-model="form.USR_UNIT_COST"
autocomplete="off"
:disabled="disabled"/>
:disabled="disabledField.USR_UNIT_COST"/>
</b-form-group>
</fieldset>
</b-col>
</b-row>
<b-row :class="classCustom">
<b-row>
<b-col cols="12">
<b-form-group class="mt-4">
<b-form-checkbox v-model="form.USR_LOGGED_NEXT_TIME"
value="1"
unchecked-value="0"
:disabled="disabled">
:disabled="disabledField.USR_LOGGED_NEXT_TIME">
{{$root.translation('ID_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON')}}
</b-form-checkbox>
</b-form-group>
@@ -428,6 +428,35 @@
editing: false,
urlImage: "",
disabled: false,
disabledField: {
USR_FIRSTNAME: false,
USR_LASTNAME: false,
USR_ADDRESS: false,
USR_ZIP_CODE: false,
USR_COUNTRY: false,
USR_CITY: false,
USR_LOCATION: false,
USR_USERNAME: false,
USR_PHONE: false,
USR_POSITION: false,
USR_EMAIL: false,
USR_REPLACED_BY: false,
USR_CALENDAR: false,
USR_STATUS: false,
USR_TIME_ZONE: false,
USR_DEFAULT_LANG: false,
USR_DUE_DATE: false,
PREF_DEFAULT_MENUSELECTED: false,
PREF_DEFAULT_CASES_MENUSELECTED: false,
USR_ROLE: false,
USR_COST_BY_HOUR: false,
USR_UNIT_COST: false,
USR_NEW_PASS: false,
USR_CNF_PASS: false,
USR_LOGGED_NEXT_TIME: false,
USR_PHOTO: false
},
permission: {},
classCustom: "",
classCustom2: ""
};
@@ -449,11 +478,17 @@
//additional modes
if (this.$root.modeOfForm() === 1) {
this.disabled = false;
for (let i in this.disabledField) {
this.disabledField[i] = false;
}
this.classCustom = "";
this.classCustom2 = "sr-only sr-only-focusable";
}
if (this.$root.modeOfForm() === 2) {
this.disabled = true;
for (let i in this.disabledField) {
this.disabledField[i] = true;
}
this.classCustom = "sr-only sr-only-focusable";
this.classCustom2 = "";
}
@@ -467,6 +502,14 @@
this.classCustom = "";
this.classCustom2 = "sr-only sr-only-focusable";
this.disabled = false;
for (let i in this.disabledField) {
this.disabledField[i] = false;
}
for (let i in this.permission) {
if (i in this.disabledField) {
this.disabledField[i] = true;
}
}
},
cancel() {
if (this.$root.modeOfForm() === 1) {
@@ -476,6 +519,9 @@
this.classCustom = "sr-only sr-only-focusable";
this.classCustom2 = "";
this.disabled = true;
for (let i in this.disabledField) {
this.disabledField[i] = true;
}
for (let i in this.validate) {
this.validate[i].state = null;
}
@@ -583,6 +629,9 @@
this.classCustom = "sr-only sr-only-focusable";
this.classCustom2 = "";
this.disabled = true;
for (let i in this.disabledField) {
this.disabledField[i] = true;
}
for (let i in this.validate) {
this.validate[i].state = null;
}
@@ -627,6 +676,24 @@
return axios.post(this.$root.baseUrl() + "users/usersAjax", formData)
.then(response => {
response;
if ("error" in response.data && response.data.error !== "") {
this.$bvModal.msgBoxOk(this.$root.translation(response.data.error), {
title: " ", //is important because title disappear
hideHeaderClose: false,
okTitle: this.$root.translation('ID_OK'),
okVariant: "success",
okOnly: true
}).then(value => {
if (value === false) {
return;
}
}).catch(err => {
err;
});
this.disableButtonSave = false;
this.validate.USR_USERNAME.state = true;
return;
}
this.disableButtonSave = false;
this.validate.USR_USERNAME.message = response.data.descriptionText;
if (response.data.exists === false) {
@@ -736,6 +803,17 @@
return axios.post(this.$root.baseUrl() + "users/usersAjax", formData)
.then(response => {
response;
if ("permission" in response.data) {
this.permission = response.data.permission;
//match attribute
if ("USR_REGION" in this.permission) {
this.permission.USR_CITY = this.permission.USR_REGION;
delete this.permission.USR_REGION;
}
if ("USR_CUR_PASS" in this.permission) {
delete this.permission.USR_CUR_PASS;
}
}
if ("user" in response.data) {
for (let i in this.form) {
if (i in response.data.user) {
@@ -845,10 +923,14 @@
});
},
getUsersList() {
if (this.filterUser.trim() === "") {
this.usersList = [];
return null;
}
let formData = new FormData();
formData.append("action", "usersList");
formData.append("USR_UID", this.form.USR_UID);
formData.append("filter", this.filterUser);
formData.append("filter", this.filterUser.trim());
return axios.post(this.$root.baseUrl() + "users/usersAjax", formData)
.then(response => {
response;

View File

@@ -23,11 +23,12 @@ class AbstractCases implements CasesInterface
const PRIORITIES = [1 => 'VL', 2 => 'L', 3 => 'N', 4 => 'H', 5 => 'VH'];
// Task Colors
const TASK_COLORS = [1 => 'green', 2 => 'red', 3 => 'orange', 4 => 'blue', 5 => 'gray'];
const COLOR_OVERDUE = 1;
const COLOR_ON_TIME = 2;
const COLOR_DRAFT = 3;
const COLOR_PAUSED = 4;
const COLOR_UNASSIGNED = 5;
const TASK_STATUS = [1 => 'ON_TIME', 2 => 'OVERDUE', 3 => 'DRAFT', 4 => 'PAUSED', 5 => 'UNASSIGNED'];
const COLOR_ON_TIME = 1; // green
const COLOR_OVERDUE = 2; // red
const COLOR_DRAFT = 3; // orange
const COLOR_PAUSED = 4; // blue
const COLOR_UNASSIGNED = 5; // gray
// Status values
const STATUS_DRAFT = 1;
const STATUS_TODO = 2;
@@ -1063,24 +1064,27 @@ class AbstractCases implements CasesInterface
* Get task color according the due date
*
* @param string $dueDate
* @param string $statusThread
*
* @return int
*/
public function getTaskColor(string $dueDate)
public function getTaskColor(string $dueDate, string $statusThread = '')
{
$currentDate = new DateTime('now');
$dueDate = new DateTime($dueDate);
if ($dueDate > $currentDate) {
if ($currentDate > $dueDate) {
// Overdue: When the current date is mayor to the due date of the case
$taskColor = self::COLOR_OVERDUE;
} else {
// OnTime
$taskColor = self::COLOR_ON_TIME;
if (get_class($this) === Draft::class) {
if (get_class($this) === Draft::class || $statusThread === self::TASK_STATUS[3]) {
$taskColor = self::COLOR_DRAFT;
}
if (get_class($this) === Paused::class) {
if (get_class($this) === Paused::class || $statusThread === self::TASK_STATUS[4]) {
$taskColor = self::COLOR_PAUSED;
}
if (get_class($this) === Unassigned::class) {
if (get_class($this) === Unassigned::class || $statusThread === self::TASK_STATUS[5]) {
$taskColor = self::COLOR_UNASSIGNED;
}
}
@@ -1113,24 +1117,30 @@ class AbstractCases implements CasesInterface
}
if ($key === 'due_date') {
$threadTasks[$i][$key] = $row;
$threadTasks[$i]['delay'] = getDiffBetweenDates($row, date("Y-m-d H:i:s"));
// Get task color label
$threadTasks[$i]['tas_color'] = (!empty($row)) ? $this->getTaskColor($row) : '';
$threadTasks[$i]['tas_color_label'] = (!empty($row)) ? self::TASK_COLORS[$threadTasks[$i]['tas_color']] : '';
$threadTasks[$i]['tas_status'] = self::TASK_STATUS[$threadTasks[$i]['tas_color']];
}
// Review if require other information
if ($onlyTask) {
// Thread tasks
if($key === 'user_id') {
$threadTasks[$i][$key] = $row;
// Get the user tooltip information
$threadTasks[$i]['user_tooltip'] = User::getInformation($row);
}
} else {
// Thread users
if ($key === 'user_id') {
$threadUsers[$i][$key] = $row;
$user = (!empty($row)) ? User::where('USR_ID', $row)->first(): null;
$threadUsers[$i]['usr_username'] = $user ? $user->USR_USERNAME : '';
$threadUsers[$i]['usr_lastname'] = $user ? $user->USR_LASTNAME : '';
$threadUsers[$i]['usr_firstname'] = $user ? $user->USR_FIRSTNAME : '';
// Get user information
$userInfo = User::getInformation($row);
$threadUsers[$i]['usr_username'] = !empty($userInfo) ? $userInfo['usr_username'] : '';
$threadUsers[$i]['usr_lastname'] = !empty($userInfo) ? $userInfo['usr_lastname'] : '';
$threadUsers[$i]['usr_firstname'] = !empty($userInfo) ? $userInfo['usr_firstname'] : '';
$threadUsers[$i]['user_tooltip'] = User::getInformation($row);
}
// Thread titles
if ($key === 'del_id') {
@@ -1149,6 +1159,39 @@ class AbstractCases implements CasesInterface
return $result;
}
/**
* Get the thread information
*
* @param array $thread
*
* @return array
*/
public function threadInformation(array $thread)
{
$result = [];
$status = '';
// Define the task status
if ($thread['TAS_ASSIGN_TYPE'] === 'SELF_SERVICE') {
$status = 'UNASSIGNED';
}
if ($thread['APP_STATUS'] === 'DRAFT') {
$status = 'DRAFT';
}
// Define the thread information
$result['tas_title'] = $thread['TAS_TITLE'];
$result['user_id'] = $thread['USR_ID'];
$result['due_date'] = $thread['DEL_TASK_DUE_DATE'];
$result['delay'] = getDiffBetweenDates($thread['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
$result['tas_color'] = (!empty($thread['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($thread['DEL_TASK_DUE_DATE'], $status) : '';
$result['tas_color_label'] = (!empty($result['tas_color'])) ? self::TASK_COLORS[$result['tas_color']] : '';
$result['tas_status'] = self::TASK_STATUS[$result['tas_color']];
$result['unassigned'] = ($status === 'UNASSIGNED' ? true : false);
// Get the user tooltip information
$result['user_tooltip'] = User::getInformation($thread['USR_ID']);
return $result;
}
/**
* Set all properties
*

View File

@@ -99,6 +99,10 @@ class Draft extends AbstractCases
// Get task color label
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
// Get task status
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
// Get delay
$item['DELAY'] = getDiffBetweenDates($item['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
// Apply the date format defined in environment
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);

View File

@@ -103,6 +103,10 @@ class Inbox extends AbstractCases
// Get task color label
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
// Get task status
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
// Get delay
$item['DELAY'] = getDiffBetweenDates($item['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
// Apply the date format defined in environment
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);

View File

@@ -6,6 +6,7 @@ use ProcessMaker\Model\Application;
use ProcessMaker\Model\AppNotes;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
class Participated extends AbstractCases
{
@@ -16,11 +17,12 @@ class Participated extends AbstractCases
'APP_DELEGATION.DEL_TITLE', // Case Title
'PROCESS.PRO_TITLE', // Process Name
'TASK.TAS_TITLE', // Pending Task
'TASK.TAS_ASSIGN_TYPE', // Task assign rule
'APPLICATION.APP_STATUS', // Status
'APPLICATION.APP_CREATE_DATE', // Start Date
'APPLICATION.APP_FINISH_DATE', // Finish Date
'USERS.USR_ID', // Current UserId
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date related to the colors
'USERS.USR_ID', // Current UserId
// Additional column for other functionalities
'APP_DELEGATION.APP_UID', // Case Uid for Open case
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
@@ -113,30 +115,12 @@ class Participated extends AbstractCases
$filter = $this->getParticipatedStatus();
switch ($filter) {
case 'STARTED':
// Scope that search for the STARTED by user
// Scope that search for the STARTED by user: DRAFT, TO_DO, CANCELED AND COMPLETED
$query->caseStarted();
break;
case 'IN_PROGRESS':
// Scope that search for the TO_DO
$query->selectRaw(
'CONCAT(
\'[\',
GROUP_CONCAT(
CONCAT(
\'{"tas_id":\',
APP_DELEGATION.TAS_ID,
\', "user_id":\',
APP_DELEGATION.USR_ID,
\', "due_date":"\',
APP_DELEGATION.DEL_TASK_DUE_DATE,
\'"}\'
)
),
\']\'
) AS PENDING'
);
// Only cases in progress
$query->caseInProgress();
// Only cases in progress: TO_DO without DRAFT
$query->caseTodo();
// Group by AppNumber
$query->groupBy('APP_NUMBER');
break;
@@ -167,47 +151,36 @@ class Participated extends AbstractCases
$item['DURATION'] = getDiffBetweenDates($startDate, $endDate);
// Get total case notes
$item['CASE_NOTES_COUNT'] = AppNotes::total($item['APP_NUMBER']);
// Define the thread information
$thread = [];
$thread['TAS_TITLE'] = $item['TAS_TITLE'];
$thread['USR_ID'] = $item['USR_ID'];
$thread['DEL_TASK_DUE_DATE'] = $item['DEL_TASK_DUE_DATE'];
$thread['TAS_ASSIGN_TYPE'] = $item['TAS_ASSIGN_TYPE'];
$thread['APP_STATUS'] = $item['APP_STATUS'];
// Define data according to the filters
switch ($filter) {
case 'STARTED':
case 'IN_PROGRESS':
$result = [];
$i = 0;
if ($item['APP_STATUS'] === 'TO_DO') {
$taskPending = Delegation::getPendingThreads($item['APP_NUMBER']);
foreach ($taskPending as $thread) {
// todo this need to review
$result[$i]['tas_title'] = $thread['TAS_TITLE'];
$result[$i]['user_id'] = $thread['USR_ID'];
$result[$i]['due_date'] = $thread['DEL_TASK_DUE_DATE'];
$result[$i]['tas_color'] = (!empty($thread['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($thread['DEL_TASK_DUE_DATE']) : '';
$result[$i]['tas_color_label'] = (!empty($result[$i]['tas_color'])) ? self::TASK_COLORS[$result[$i]['tas_color']] : '';
$thread['APP_STATUS'] = $item['APP_STATUS'];
$result[$i] = $this->threadInformation($thread);
$i++;
}
$item['PENDING'] = $result;
} else {
$result[$i]['tas_title'] = $item['TAS_TITLE'];
$result[$i]['user_id'] = $item['USR_ID'];
$result[$i]['due_date'] = $item['DEL_TASK_DUE_DATE'];
$result[$i]['tas_color'] = (!empty($item['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($item['DEL_TASK_DUE_DATE']) : '';
$result[$i]['tas_color_label'] = (!empty($result[$i]['tas_color'])) ? self::TASK_COLORS[$result[$i]['tas_color']] : '';
$result[$i] = $this->threadInformation($thread);
$item['PENDING'] = $result;
}
break;
case 'IN_PROGRESS':
// Get the detail related to the open thread
if (!empty($item['PENDING'])) {
$result = $this->prepareTaskPending($item['PENDING']);
$item['PENDING'] = !empty($result['THREAD_TASKS']) ? $result['THREAD_TASKS'] : [];
}
break;
case 'COMPLETED':
$result = [];
$i = 0;
$result[$i]['tas_title'] = $item['TAS_TITLE'];
$result[$i]['user_id'] = $item['USR_ID'];
$result[$i]['due_date'] = $item['DEL_TASK_DUE_DATE'];
$result[$i]['tas_color'] = (!empty($item['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($item['DEL_TASK_DUE_DATE']) : '';
$result[$i]['tas_color_label'] = (!empty($result[$i]['tas_color'])) ? self::TASK_COLORS[$result[$i]['tas_color']] : '';
$result[$i] = $this->threadInformation($thread);
$item['PENDING'] = $result;
break;
}
@@ -223,6 +196,7 @@ class Participated extends AbstractCases
*
* @return int
*/
public function getCounter()
{
// Get base query
@@ -235,14 +209,14 @@ class Participated extends AbstractCases
$filter = $this->getParticipatedStatus();
switch ($filter) {
case 'STARTED':
// Scope that search for the STARTED by user
// Scope that search for the STARTED by user: DRAFT, TO_DO, CANCELED AND COMPLETED
$query->caseStarted();
break;
case 'IN_PROGRESS':
// Only distinct APP_NUMBER
$query->distinct();
// Scope for in progress cases
$query->statusIds([self::STATUS_DRAFT, self::STATUS_TODO]);
// Scope for in progress: TO_DO without DRAFT
$query->caseTodo();
break;
case 'COMPLETED':
// Scope that search for the COMPLETED
@@ -272,14 +246,14 @@ class Participated extends AbstractCases
$filter = $this->getParticipatedStatus();
switch ($filter) {
case 'STARTED':
// Scope that search for the STARTED by user
// Scope that search for the STARTED by user: DRAFT, TO_DO, CANCELED AND COMPLETED
$query->caseStarted();
break;
case 'IN_PROGRESS':
// Only distinct APP_NUMBER
$query->distinct();
// Scope for in progress cases
$query->statusIds([self::STATUS_DRAFT, self::STATUS_TODO]);
// Scope for in progress: TO_DO without DRAFT
$query->caseTodo();
break;
case 'COMPLETED':
// Scope that search for the COMPLETED

View File

@@ -98,6 +98,10 @@ class Paused extends AbstractCases
// Get task color label
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
// Get task status
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
// Get delay
$item['DELAY'] = getDiffBetweenDates($item['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
// Apply the date format defined in environment
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);

View File

@@ -122,6 +122,8 @@ class Search extends AbstractCases
$query->casesDone($casesClosed);
}
}
} else {
$query->isThreadOpen();
}
return $query;

View File

@@ -19,6 +19,7 @@ class Supervising extends AbstractCases
'APPLICATION.APP_CREATE_DATE', // Start Date
'APPLICATION.APP_FINISH_DATE', // Finish Date
'APP_DELEGATION.DEL_TASK_DUE_DATE', // Due Date related to the colors
'USERS.USR_ID', // Current UserId
// Additional column for other functionalities
'APP_DELEGATION.APP_UID', // Case Uid for Open case
'APP_DELEGATION.DEL_INDEX', // Del Index for Open case
@@ -128,10 +129,10 @@ class Supervising extends AbstractCases
$query->joinApplication();
// Only cases in to_do
$query->caseTodo();
// Scope that return the results for an specific user
$query->userId($this->getUserId());
// Scope the specific array of processes supervising
$query->processInList($processes);
// Only open threads
$query->isThreadOpen();
// Group by appNumber
$query->groupBy('APP_NUMBER');
/** Apply filters */
@@ -181,6 +182,12 @@ class Supervising extends AbstractCases
{
// Get base query
$query = Delegation::query()->select();
// Join with application
$query->joinApplication();
// Only cases in to_do
$query->caseTodo();
// Only open threads
$query->isThreadOpen();
// Only distinct APP_NUMBER
$query->distinct();
// Get the list of processes of the supervisor
@@ -200,6 +207,12 @@ class Supervising extends AbstractCases
{
// Get base query
$query = Delegation::query()->select();
// Join with application
$query->joinApplication();
// Only cases in to_do
$query->caseTodo();
// Only open threads
$query->isThreadOpen();
// Only distinct APP_NUMBER
$query->distinct();
// Get the list of processes of the supervisor

View File

@@ -106,8 +106,12 @@ class Unassigned extends AbstractCases
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
// Get task color label
$item['TAS_COLOR'] = 1; // green - onTime
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
// Get task status
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
// Get delay
$item['DELAY'] = getDiffBetweenDates($item['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
// Apply the date format defined in environment
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);

View File

@@ -82,7 +82,8 @@ class System
'report_table_batch_regeneration' => 1000,
'report_table_floating_number' => 4,
'report_table_double_number' => 4,
'ext_ajax_timeout' => 600000
'ext_ajax_timeout' => 600000,
'disable_task_manager_routing_async' => '0'
];
/**
@@ -1239,6 +1240,11 @@ class System
$config['highlight_home_folder_scope'] = self::$defaultConfig['highlight_home_folder_scope'];
}
$value = $config['disable_task_manager_routing_async'];
if (!is_numeric($value) || !in_array($value, [0, 1])) {
$config['disable_task_manager_routing_async'] = self::$defaultConfig['disable_task_manager_routing_async'];
}
return $config;
}

View File

@@ -1805,6 +1805,7 @@ class Delegation extends Model
{
$query = Delegation::query()->select([
'TASK.TAS_TITLE',
'TASK.TAS_ASSIGN_TYPE',
'APP_DELEGATION.USR_ID',
'APP_DELEGATION.DEL_TASK_DUE_DATE'
]);
@@ -1887,6 +1888,7 @@ class Delegation extends Model
{
$query = Delegation::query()->select([
'TASK.TAS_TITLE', // Task
'TASK.TAS_ASSIGN_TYPE', // Task assign rule
'APP_DELEGATION.DEL_TITLE', // Thread title
'APP_DELEGATION.DEL_THREAD_STATUS', // Thread status
'APP_DELEGATION.USR_ID', // Current UserId
@@ -1914,6 +1916,7 @@ class Delegation extends Model
$abs = new AbstractCases();
$item['TAS_COLOR'] = $abs->getTaskColor($item['DEL_TASK_DUE_DATE']);
$item['TAS_COLOR_LABEL'] = AbstractCases::TASK_COLORS[$item['TAS_COLOR']];
$item['UNASSIGNED'] = ($item['TAS_ASSIGN_TYPE'] === 'SELF_SERVICE' ? true : false);
return $item;
});

View File

@@ -45,6 +45,19 @@ class User extends Model
return $result;
}
/**
* Scope for query to get the user by USR_ID
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param int $usrId
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeUserId($query, string $usrId)
{
return $query->where('USR_ID', '=', $usrId);
}
/**
* Return the groups from a user
*
@@ -171,6 +184,7 @@ class User extends Model
throw new Exception("Error getting the users: {$e->getMessage()}.");
}
}
/**
* Get the user id
*
@@ -191,4 +205,35 @@ class User extends Model
return $id;
}
/**
* Get user information for the tooltip
*
* @param int $usrId
*
* @return array
*/
public static function getInformation($usrId)
{
$query = User::query()->select([
'USR_USERNAME',
'USR_FIRSTNAME',
'USR_LASTNAME',
'USR_EMAIL',
'USR_POSITION'
])
->userId($usrId)
->limit(1);
$results = $query->get();
$info = [];
$results->each(function ($item) use (&$info) {
$info['usr_username'] = $item->USR_USERNAME;
$info['usr_firstname'] = $item->USR_FIRSTNAME;
$info['usr_lastname'] = $item->USR_LASTNAME;
$info['usr_email'] = $item->USR_EMAIL;
$info['usr_position'] = $item->USR_POSITION;
});
return $info;
}
}

View File

@@ -554,7 +554,9 @@ class Home extends Api
// Adding filters to the "Advanced Search" option
$option->child = $child;
}
if ($menuInstance->Id[$i] === 'ID_CASE_ARCHIVE_SEARCH') {
$option->icon = "fas fa-archive";
}
// Add option to the menu
$menuHome[] = $option;
}
@@ -698,4 +700,35 @@ class Home extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Get the process debug status
*
* @url GET /process-debug-status
*
* @param string $processUid
*
* @return bool
*
* @throws Exception
*
* @access protected
* @class AccessControl {@permission PM_CASES}
*/
public function getProcessDebugStatus($processUid)
{
try {
// Get the process requested
$process = Process::query()->select(['PRO_DEBUG'])->where('PRO_UID', '=', $processUid)->first();
if (!is_null($process)) {
return $process->PRO_DEBUG === 1;
}
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
// If not exists the requested process throw an 404 error
if (is_null($process)) {
throw new RestException(404, "Process with Uid '{$processUid}'.");
}
}
}

View File

@@ -617,9 +617,11 @@ function applyMaskDateEnvironment(string $date, $mask = '')
$systemConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$mask = isset($systemConf->aConfig['dateFormat']) ? $systemConf->aConfig['dateFormat'] : '';
}
if (!empty($date)) {
if (!empty($date) && !empty($mask)) {
$date = new DateTime($date);
$result = $date->format($mask);
} else {
$result = $date;
}
return $result;

View File

@@ -1080,26 +1080,39 @@ Ext.onReady(function(){
var data = Ext.util.JSON.decode(result.responseText);
if (data.status == true) {
if (!isBrowserIE()) {
if (typeof parent.notify !== "undefined") {
// The case was cancelled
parent.notify('', _("ID_CASE_CANCELLED", stringReplace("\\: ", "", _APP_NUM)));
}
if (typeof parent.updateCasesTree !== "undefined") {
parent.updateCasesTree();
}
if (typeof parent.highlightCasesTree !== "undefined") {
parent.highlightCasesTree();
}
}
} else {
if (!isBrowserIE()) {
// The case wasn't cancel
parent.notify('', data.msg);
if (typeof parent.notify !== "undefined") {
// The case wasn't cancel
parent.notify('', data.msg);
}
}
}
} catch (e) {
if (isBrowserIE()) {
Ext.MessageBox.alert(_('ID_FAILED'), _('ID_SOMETHING_WRONG'));
} else {
parent.notify('', _('ID_SOMETHING_WRONG'));
if (typeof parent.notify !== "undefined") {
parent.notify('', _('ID_SOMETHING_WRONG'));
}
}
}
location.href = 'casesListExtJs';
if (typeof parent.postMessage !== "undefined") {
parent.postMessage("redirect=todo","*");
} else {
location.href = 'casesListExtJs';
}
},
failure: function (result, request) {
Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
@@ -1361,13 +1374,22 @@ Ext.onReady(function(){
var data = Ext.util.JSON.decode(result.responseText);
if( data.status == 0 ) {
try {
parent.notify('', data.msg);
parent.updateCasesTree();
parent.highlightCasesTree();
if (typeof parent.notify !== "undefined") {
parent.notify('', data.msg);
}
if (typeof parent.updateCasesTree !== "undefined") {
parent.updateCasesTree();
}
if (typeof parent.highlightCasesTree !== "undefined") {
parent.highlightCasesTree();
}
} catch (e) {
}
if (typeof parent.postMessage !== "undefined") {
parent.postMessage("redirect=todo", "*");
} else {
location.href = 'casesListExtJs';
}
catch (e) {
}
location.href = 'casesListExtJs';
} else {
alert(data.msg);
}
@@ -1562,12 +1584,22 @@ Ext.onReady(function(){
success : function(res, req) {
if(req.result.success) {
try {
parent.notify('PAUSE CASE', req.result.msg);
parent.updateCasesTree();
parent.highlightCasesTree();
}catch (e) {
if (typeof parent.notify !== "undefined") {
parent.notify('PAUSE CASE', req.result.msg);
}
if (typeof parent.updateCasesTree !== "undefined") {
parent.updateCasesTree();
}
if (typeof parent.highlightCasesTree !== "undefined") {
parent.highlightCasesTree();
}
} catch (e) {
}
if (typeof parent.postMessage !== "undefined") {
parent.postMessage("redirect=todo", "*");
} else {
location.href = urlToRedirectAfterPause;
}
location.href = urlToRedirectAfterPause;
} else {
PMExt.error(_('ID_ERROR'), req.result.msg);
}
@@ -1656,14 +1688,23 @@ Ext.onReady(function(){
loadMask.hide();
var data = Ext.util.JSON.decode(result.responseText);
if( data.success ) {
try {
parent.PMExt.notify(_('ID_DELETE_ACTION'), data.msg);
parent.updateCasesTree();
parent.highlightCasesTree();
}
catch (e) {
}
location.href = 'casesListExtJs';
try {
if (typeof parent.PMExt.updateCasesTree !== "undefined") {
parent.PMExt.notify(_('ID_DELETE_ACTION'), data.msg);
}
if (typeof parent.updateCasesTree !== "undefined") {
parent.updateCasesTree();
}
if (typeof parent.highlightCasesTree !== "undefined") {
parent.highlightCasesTree();
}
} catch (e) {
}
if (typeof parent.postMessage !== "undefined") {
parent.postMessage("redirect=todo", "*");
} else {
location.href = 'casesListExtJs';
}
} else {
PMExt.error(_('ID_ERROR'), data.msg);
}

View File

@@ -342,6 +342,7 @@ define('HIGHLIGHT_HOME_FOLDER_ENABLE', $config['highlight_home_folder_enable'] =
define('HIGHLIGHT_HOME_FOLDER_REFRESH_TIME', $config['highlight_home_folder_refresh_time']);
define('HIGHLIGHT_HOME_FOLDER_SCOPE', $config['highlight_home_folder_scope']);
/*----------------------------------********---------------------------------*/
define('DISABLE_TASK_MANAGER_ROUTING_ASYNC', $config['disable_task_manager_routing_async'] === "1");
// IIS Compatibility, SERVER_ADDR doesn't exist on that env, so we need to define it.
$_SERVER['SERVER_ADDR'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['SERVER_NAME'];