update level one
This commit is contained in:
@@ -60,6 +60,11 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function
|
|||||||
'APP_CUR_USER' => $user->USR_UID
|
'APP_CUR_USER' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$delegateDate = $faker->dateTime();
|
||||||
|
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||||
|
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||||
|
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||||
|
|
||||||
// Return with default values
|
// Return with default values
|
||||||
return [
|
return [
|
||||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||||
@@ -74,10 +79,10 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function
|
|||||||
'DEL_THREAD' => 1,
|
'DEL_THREAD' => 1,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'DEL_PRIORITY' => 3,
|
'DEL_PRIORITY' => 3,
|
||||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||||
'DEL_INIT_DATE' => $faker->dateTime(),
|
'DEL_INIT_DATE' => $initDate,
|
||||||
'DEL_TASK_DUE_DATE' => $faker->dateTime(),
|
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||||
'DEL_RISK_DATE' => $faker->dateTime(),
|
'DEL_RISK_DATE' => $riskDate,
|
||||||
'DEL_LAST_INDEX' => 1,
|
'DEL_LAST_INDEX' => 1,
|
||||||
'USR_ID' => $user->USR_ID,
|
'USR_ID' => $user->USR_ID,
|
||||||
'PRO_ID' => $process->PRO_ID,
|
'PRO_ID' => $process->PRO_ID,
|
||||||
@@ -138,7 +143,7 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'open', function (Faker $
|
|||||||
$delegateDate = $faker->dateTime();
|
$delegateDate = $faker->dateTime();
|
||||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+1 day');
|
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
@@ -156,7 +161,7 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'closed', function (Faker
|
|||||||
$delegateDate = $faker->dateTime();
|
$delegateDate = $faker->dateTime();
|
||||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+1 day');
|
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||||
$finishDate = $faker->dateTimeInInterval($initDate, '+10 days');
|
$finishDate = $faker->dateTimeInInterval($initDate, '+10 days');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -68,5 +68,9 @@
|
|||||||
TASKS: "/home/tasks",
|
TASKS: "/home/tasks",
|
||||||
CATEGORIES: "/home/categories",
|
CATEGORIES: "/home/categories",
|
||||||
DEBUG_STATUS: "/home/process-debug-status?processUid={prj_uid}",
|
DEBUG_STATUS: "/home/process-debug-status?processUid={prj_uid}",
|
||||||
LIST_TOTAL_CASES: "/metrics/list-total-cases"
|
LIST_TOTAL_CASES: "/metrics/list-total-cases",
|
||||||
|
PAUSE_CASE: "/cases/{app_uid}/pause",
|
||||||
|
REASSIGN_CASE: "/cases/{app_uid}/reassign-case",
|
||||||
|
REASSIGN_USERS: "/light/userstoreassign/{task_uid}",
|
||||||
|
CATEGORIES: "/processcategory/categories"
|
||||||
};
|
};
|
||||||
@@ -6,13 +6,20 @@
|
|||||||
:style="{height: height + 'px'}"
|
:style="{height: height + 'px'}"
|
||||||
>
|
>
|
||||||
<vue-card v-for="item in data" :key="item.id" :item="item" :options="options">
|
<vue-card v-for="item in data" :key="item.id" :item="item" :options="options">
|
||||||
<slot
|
<b-row>
|
||||||
v-for="column in options.columns"
|
<b-col sm="9">
|
||||||
:name="column"
|
<slot
|
||||||
:item="item"
|
v-for="column in options.columns"
|
||||||
:column="column"
|
:name="column"
|
||||||
:headings="options.headings"
|
:item="item"
|
||||||
></slot>
|
:column="column"
|
||||||
|
:headings="options.headings"
|
||||||
|
></slot>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="3">
|
||||||
|
<slot name="actions"></slot>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</vue-card>
|
</vue-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,21 @@
|
|||||||
:style="{height: height + 'px'}"
|
:style="{height: height + 'px'}"
|
||||||
>
|
>
|
||||||
<vue-list v-for="item in data" :key="item.id" :item="item" :options="options">
|
<vue-list v-for="item in data" :key="item.id" :item="item" :options="options">
|
||||||
<slot
|
<b-row>
|
||||||
v-for="column in options.columns"
|
<b-col sm="10">
|
||||||
:name="column"
|
<slot
|
||||||
:item="item"
|
v-for="column in options.columns"
|
||||||
:column="column"
|
:name="column"
|
||||||
:headings="options.headings"
|
:item="item"
|
||||||
></slot>
|
:column="column"
|
||||||
|
:headings="options.headings"
|
||||||
|
ref="containerList"
|
||||||
|
></slot>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="2">
|
||||||
|
<slot name="actions"></slot>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</vue-list>
|
</vue-list>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export default {
|
|||||||
width: 0px;
|
width: 0px;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
display: inline-flex !important;
|
display: inline-flex !important;
|
||||||
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
.btn-outline-info {
|
.btn-outline-info {
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@@ -48,10 +48,19 @@
|
|||||||
:options="optionsVueView"
|
:options="optionsVueView"
|
||||||
ref="vueCardView"
|
ref="vueCardView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
@@ -105,10 +114,19 @@
|
|||||||
:options="optionsVueView"
|
:options="optionsVueView"
|
||||||
ref="vueListView"
|
ref="vueListView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
@@ -523,5 +541,7 @@ export default {
|
|||||||
padding-left: 50px;
|
padding-left: 50px;
|
||||||
padding-right: 50px;
|
padding-right: 50px;
|
||||||
}
|
}
|
||||||
|
.ellipsis-container {
|
||||||
|
margin-top: 5em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -61,10 +61,19 @@
|
|||||||
:options="optionsVueView"
|
:options="optionsVueView"
|
||||||
ref="vueCardView"
|
ref="vueCardView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div @click="updateDataEllipsis(props.row)">
|
<b-row>
|
||||||
<ellipsis v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
@@ -118,12 +127,21 @@
|
|||||||
:options="optionsVueView"
|
:options="optionsVueView"
|
||||||
ref="vueListView"
|
ref="vueListView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div ref="text" slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
>{{ props["headings"][props.column] }} : {{ props["item"]["CASE_NUMBER"] }}</span
|
>{{ props["headings"][props.column] }} : {{ props["item"]["CASE_NUMBER"] }}</span
|
||||||
>
|
>
|
||||||
@@ -608,7 +626,8 @@ export default {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-card-text {
|
.ellipsis-container {
|
||||||
|
margin-top: 5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-pm-card-info{
|
.v-pm-card-info{
|
||||||
|
|||||||
@@ -59,10 +59,19 @@
|
|||||||
:options="optionsVueView"
|
:options="optionsVueView"
|
||||||
ref="vueCardView"
|
ref="vueCardView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
@@ -116,10 +125,19 @@
|
|||||||
:options="optionsVueView"
|
:options="optionsVueView"
|
||||||
ref="vueListView"
|
ref="vueListView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
|
|||||||
@@ -1,339 +1,216 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
|
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
|
||||||
<div class="p-1 v-flex">
|
<div class="p-1 v-flex">
|
||||||
<h6 class="v-search-title">Number of tasks per Task Status</h6>
|
<h6 class="v-search-title">Number of tasks per Task Status</h6>
|
||||||
<apexchart
|
<div>
|
||||||
v-show="typeView === 'donut'"
|
<label class="vp-inline-block">{{ $t("ID_PROCESS_CATEGORY") }}</label>
|
||||||
ref="apexchart1"
|
<div class="vp-width-p40 vp-inline-block">
|
||||||
:width="width"
|
<multiselect
|
||||||
:options="chartOptions1"
|
v-model="category"
|
||||||
:series="series1"
|
:options="optionsCategory"
|
||||||
></apexchart>
|
:searchable="false"
|
||||||
<apexchart
|
:close-on-select="false"
|
||||||
v-show="typeView === 'bar'"
|
:show-labels="false"
|
||||||
ref="apexchart2"
|
placeholder="Pick a value"
|
||||||
:width="width"
|
></multiselect>
|
||||||
:options="chartOptions2"
|
</div>
|
||||||
:series="series2"
|
</div>
|
||||||
></apexchart>
|
<apexchart
|
||||||
|
ref="apexchart1"
|
||||||
<div class="row">
|
:width="width"
|
||||||
<div class="col-sm vp-center">
|
:options="optionsBar"
|
||||||
<button
|
:series="seriesBar"
|
||||||
@click="changeView('donut')"
|
></apexchart>
|
||||||
type="button"
|
</div>
|
||||||
class="btn btn-primary"
|
</div>
|
||||||
>
|
|
||||||
<i class="fas fa-chart-pie"></i
|
|
||||||
><span class="vp-padding-l10">View</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm">
|
|
||||||
<button
|
|
||||||
@click="changeView('bar')"
|
|
||||||
type="button"
|
|
||||||
class="btn btn-primary"
|
|
||||||
>
|
|
||||||
<i class="fas fa-chart-bar"></i
|
|
||||||
><span class="vp-padding-l10">View</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import Api from "../../api/index";
|
import Api from "../../api/index";
|
||||||
|
import Multiselect from "vue-multiselect";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "VueChartLvOne",
|
name: "VueChartLvOne",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
components: {},
|
components: {
|
||||||
props: [],
|
Multiselect,
|
||||||
data() {
|
},
|
||||||
let that = this;
|
props: [],
|
||||||
return {
|
data() {
|
||||||
typeView: "bar",
|
let that = this;
|
||||||
width: 0,
|
return {
|
||||||
series1: [],
|
category: null,
|
||||||
chartOptions1: {
|
optionsCategory: [],
|
||||||
labels: ["Team A", "Team B", "Team C", "Team D", "Team E"],
|
width: 0,
|
||||||
chart: {
|
seriesBar: [
|
||||||
id: "apexchart1",
|
{
|
||||||
type: "pie",
|
data: [400, 430, 448, 470],
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
series2: [
|
optionsBar: {
|
||||||
{
|
chart: {
|
||||||
name: "Inflation",
|
type: "bar",
|
||||||
data: [2.3, 3.1, 4.0, 10.1, 4.0, 3.6, 3.2, 2.3, 1.4, 0.8, 0.5, 0.2],
|
id: "apexchart2",
|
||||||
},
|
toolbar: {
|
||||||
],
|
show: false,
|
||||||
chartOptions2: {
|
},
|
||||||
chart: {
|
events: {
|
||||||
id: "apexchart2",
|
legendClick: function (chartContext, seriesIndex, config) {
|
||||||
type: "bar",
|
console.log("click");
|
||||||
},
|
},
|
||||||
plotOptions: {
|
},
|
||||||
bar: {
|
},
|
||||||
borderRadius: 10,
|
plotOptions: {
|
||||||
dataLabels: {
|
bar: {
|
||||||
position: "top", // top, center, bottom
|
barHeight: "100%",
|
||||||
},
|
distributed: true,
|
||||||
},
|
horizontal: true,
|
||||||
},
|
},
|
||||||
dataLabels: {
|
},
|
||||||
enabled: true,
|
legend: {
|
||||||
formatter: function (val) {
|
position: "left",
|
||||||
return val + "%";
|
offsetY: 50,
|
||||||
},
|
fontSize: "18px",
|
||||||
offsetY: -20,
|
},
|
||||||
style: {
|
colors: ["#33b2df", "#546E7A", "#d4526e", "#13d8aa"],
|
||||||
fontSize: "12px",
|
dataLabels: {
|
||||||
colors: ["#304758"],
|
enabled: false,
|
||||||
},
|
},
|
||||||
},
|
xaxis: {
|
||||||
|
categories: [
|
||||||
xaxis: {
|
this.$i18n.t("ID_INBOX"),
|
||||||
categories: [
|
this.$i18n.t("ID_DRAFT"),
|
||||||
"Jan",
|
this.$i18n.t("ID_PAUSED"),
|
||||||
"Feb",
|
this.$i18n.t("ID_UNASSIGNED"),
|
||||||
"Mar",
|
],
|
||||||
"Apr",
|
},
|
||||||
"May",
|
tooltip: {
|
||||||
"Jun",
|
x: {
|
||||||
"Jul",
|
show: false,
|
||||||
"Aug",
|
},
|
||||||
"Sep",
|
y: {
|
||||||
"Oct",
|
title: {
|
||||||
"Nov",
|
formatter: function () {
|
||||||
"Dec",
|
return "";
|
||||||
],
|
},
|
||||||
position: "top",
|
},
|
||||||
axisBorder: {
|
},
|
||||||
show: false,
|
},
|
||||||
},
|
},
|
||||||
axisTicks: {
|
};
|
||||||
show: false,
|
},
|
||||||
},
|
created() {},
|
||||||
crosshairs: {
|
mounted() {
|
||||||
fill: {
|
this.getBodyHeight();
|
||||||
type: "gradient",
|
this.getCategories();
|
||||||
gradient: {
|
//this.getDataDonut();
|
||||||
colorFrom: "#D8E3F0",
|
//this.getData();
|
||||||
colorTo: "#BED1E6",
|
},
|
||||||
stops: [0, 100],
|
watch: {},
|
||||||
opacityFrom: 0.4,
|
computed: {},
|
||||||
opacityTo: 0.5,
|
updated() {},
|
||||||
},
|
beforeCreate() {},
|
||||||
},
|
methods: {
|
||||||
},
|
/**
|
||||||
tooltip: {
|
* Return the height for Vue Card View body
|
||||||
enabled: true,
|
*/
|
||||||
},
|
getBodyHeight() {
|
||||||
},
|
this.width = window.innerHeight * 0.8;
|
||||||
yaxis: {
|
},
|
||||||
axisBorder: {
|
/**
|
||||||
show: false,
|
* Change view - donut/bar
|
||||||
},
|
*/
|
||||||
axisTicks: {
|
changeView(view) {
|
||||||
show: false,
|
this.typeView = view;
|
||||||
},
|
this.getData();
|
||||||
labels: {
|
},
|
||||||
show: false,
|
/**
|
||||||
formatter: function (val) {
|
* Get data from rest API
|
||||||
return val + "%";
|
*/
|
||||||
},
|
getData() {
|
||||||
},
|
let that = this;
|
||||||
},
|
Api.cases
|
||||||
title: {
|
.listTotalCases()
|
||||||
text: "Monthly Inflation in Argentina, 2002",
|
.then((response) => {
|
||||||
floating: true,
|
that.formatData(response.data);
|
||||||
offsetY: 330,
|
})
|
||||||
align: "center",
|
.catch((response) => {});
|
||||||
style: {
|
},
|
||||||
color: "#444",
|
/**
|
||||||
},
|
* Format the data for chart
|
||||||
},
|
*/
|
||||||
},
|
formatData(data) {
|
||||||
};
|
let l = [],
|
||||||
},
|
c = [],
|
||||||
created() {},
|
s = [];
|
||||||
mounted() {
|
_.each(data, (el) => {
|
||||||
this.getBodyHeight();
|
l.push(el["List Name"]);
|
||||||
this.getDataDonut();
|
s.push(el["Total"]);
|
||||||
this.getData();
|
if (el["Color"] == "green") {
|
||||||
},
|
c.push("#179a6e");
|
||||||
watch: {},
|
}
|
||||||
computed: {},
|
if (el["Color"] == "yellow") {
|
||||||
updated() {},
|
c.push("#feb019");
|
||||||
beforeCreate() {},
|
}
|
||||||
methods: {
|
if (el["Color"] == "blue") {
|
||||||
/**
|
c.push("#008ffb");
|
||||||
* Return the height for Vue Card View body
|
}
|
||||||
*/
|
if (el["Color"] == "gray") {
|
||||||
getBodyHeight() {
|
c.push("#8f99a0");
|
||||||
this.width = window.innerHeight * 0.8;
|
}
|
||||||
},
|
});
|
||||||
/**
|
this.seriesDonut = s;
|
||||||
* Change view - donut/bar
|
this.seriesBar = [
|
||||||
*/
|
{
|
||||||
changeView(view) {
|
data: s,
|
||||||
this.typeView = view;
|
},
|
||||||
if (view == "donut") {
|
];
|
||||||
this.getDataDonut();
|
this.$refs["apexchart1"].updateOptions({ labels: l, colors: c });
|
||||||
} else {
|
this.$refs["apexchart2"].updateOptions({ labels: l, colors: c });
|
||||||
//this.getDataBar();
|
this.$apexcharts.exec("apexchart1", "updateSeries", s);
|
||||||
}
|
this.$apexcharts.exec("apexchart2", "updateSeries", [
|
||||||
},
|
{
|
||||||
getDataDonut() {
|
data: s,
|
||||||
this.chartOptions1 = {
|
},
|
||||||
labels: ["Team A", "Team B", "Team C", "Team D", "Team E"],
|
]);
|
||||||
chart: {
|
},
|
||||||
id: "apexchart1",
|
getCategories() {
|
||||||
type: "donut",
|
let that = this;
|
||||||
},
|
console.log("jonas");
|
||||||
responsive: [
|
Api.process
|
||||||
{
|
.categories({
|
||||||
breakpoint: 480,
|
name:""
|
||||||
options: {
|
})
|
||||||
chart: {
|
.then((response) => {
|
||||||
width: 200,
|
that.formatDataCategories(response.data);
|
||||||
},
|
})
|
||||||
legend: {
|
.catch((e) => {
|
||||||
position: "bottom",
|
console.error(err);
|
||||||
},
|
});
|
||||||
},
|
},
|
||||||
},
|
formatDataCategories(data) {
|
||||||
],
|
let array = [];
|
||||||
};
|
_.each(data, (el) => {
|
||||||
this.series1 = [44, 55, 41, 17, 15];
|
array.push(el["cat_name"]);
|
||||||
},
|
});
|
||||||
getDataBar() {
|
this.optionsCategory = array;
|
||||||
this.chartOptions2 = {
|
this.category = array[0];
|
||||||
chart: {
|
},
|
||||||
id: "apexchart2",
|
},
|
||||||
type: "bar",
|
|
||||||
},
|
|
||||||
plotOptions: {
|
|
||||||
bar: {
|
|
||||||
borderRadius: 10,
|
|
||||||
dataLabels: {
|
|
||||||
position: "top", // top, center, bottom
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dataLabels: {
|
|
||||||
enabled: true,
|
|
||||||
formatter: function (val) {
|
|
||||||
return val + "%";
|
|
||||||
},
|
|
||||||
offsetY: -20,
|
|
||||||
style: {
|
|
||||||
fontSize: "12px",
|
|
||||||
colors: ["#304758"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
xaxis: {
|
|
||||||
categories: [
|
|
||||||
"Jan",
|
|
||||||
"Feb",
|
|
||||||
"Mar",
|
|
||||||
"Apr",
|
|
||||||
"May",
|
|
||||||
"Jun",
|
|
||||||
"Jul",
|
|
||||||
"Aug",
|
|
||||||
"Sep",
|
|
||||||
"Oct",
|
|
||||||
"Nov",
|
|
||||||
"Dec",
|
|
||||||
],
|
|
||||||
position: "top",
|
|
||||||
axisBorder: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
axisTicks: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
crosshairs: {
|
|
||||||
fill: {
|
|
||||||
type: "gradient",
|
|
||||||
gradient: {
|
|
||||||
colorFrom: "#D8E3F0",
|
|
||||||
colorTo: "#BED1E6",
|
|
||||||
stops: [0, 100],
|
|
||||||
opacityFrom: 0.4,
|
|
||||||
opacityTo: 0.5,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
yaxis: {
|
|
||||||
axisBorder: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
axisTicks: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
labels: {
|
|
||||||
show: false,
|
|
||||||
formatter: function (val) {
|
|
||||||
return val + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
text: "Monthly Inflation in Argentina, 2002",
|
|
||||||
floating: true,
|
|
||||||
offsetY: 330,
|
|
||||||
align: "center",
|
|
||||||
style: {
|
|
||||||
color: "#444",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
/*
|
|
||||||
this.$apexcharts.exec("apexchart2", "updateSeries", [
|
|
||||||
{
|
|
||||||
name: "Inflation",
|
|
||||||
data: [2.3, 3.1, 4.0, 10.1, 4.0, 3.6, 3.2, 2.3, 1.4, 0.8, 0.5, 0.2],
|
|
||||||
},
|
|
||||||
]);*/
|
|
||||||
|
|
||||||
/*this.series2 = [
|
|
||||||
{
|
|
||||||
name: "Inflation",
|
|
||||||
data: [2.3, 3.1, 4.0, 10.1, 4.0, 3.6, 3.2, 2.3, 1.4, 0.8, 0.5, 0.2],
|
|
||||||
},
|
|
||||||
];*/
|
|
||||||
},
|
|
||||||
getData() {
|
|
||||||
Api.cases
|
|
||||||
.listTotalCases()
|
|
||||||
.then((response) => {
|
|
||||||
console.log("response");
|
|
||||||
console.log(response);
|
|
||||||
})
|
|
||||||
.catch((response) => {
|
|
||||||
console.log("error");
|
|
||||||
console.log(response);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.vp-center {
|
.vp-task-metrics-label {
|
||||||
text-align: center;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vp-padding-l10 {
|
.vp-width-p40 {
|
||||||
padding-left: 10px;
|
width: 40%;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.vp-inline-block {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
||||||
211
resources/assets/js/home/TaskMetrics/VueChartLvZero.vue
Normal file
211
resources/assets/js/home/TaskMetrics/VueChartLvZero.vue
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
<template>
|
||||||
|
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
|
||||||
|
<div class="p-1 v-flex">
|
||||||
|
<h6 class="v-search-title">Number of tasks per Task Status</h6>
|
||||||
|
<apexchart
|
||||||
|
v-show="typeView === 'donut'"
|
||||||
|
ref="apexchart1"
|
||||||
|
:width="width"
|
||||||
|
:options="optionsDonut"
|
||||||
|
:series="seriesDonut"
|
||||||
|
></apexchart>
|
||||||
|
<apexchart
|
||||||
|
v-show="typeView === 'bar'"
|
||||||
|
ref="apexchart2"
|
||||||
|
:width="width"
|
||||||
|
:options="optionsBar"
|
||||||
|
:series="seriesBar"
|
||||||
|
></apexchart>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm vp-center">
|
||||||
|
<button
|
||||||
|
@click="changeView('donut')"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary"
|
||||||
|
>
|
||||||
|
<i class="fas fa-chart-pie"></i
|
||||||
|
><span class="vp-padding-l10">View</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<button
|
||||||
|
@click="changeView('bar')"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary"
|
||||||
|
>
|
||||||
|
<i class="fas fa-chart-bar"></i
|
||||||
|
><span class="vp-padding-l10">View</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import _ from "lodash";
|
||||||
|
import Api from "../../api/index";
|
||||||
|
export default {
|
||||||
|
name: "VueChartLvZero",
|
||||||
|
mixins: [],
|
||||||
|
components: {},
|
||||||
|
props: [],
|
||||||
|
data() {
|
||||||
|
let that = this;
|
||||||
|
return {
|
||||||
|
typeView: "bar",
|
||||||
|
width: 0,
|
||||||
|
seriesDonut: [],
|
||||||
|
optionsDonut: {
|
||||||
|
labels: [
|
||||||
|
this.$i18n.t("ID_INBOX"),
|
||||||
|
this.$i18n.t("ID_DRAFT"),
|
||||||
|
this.$i18n.t("ID_PAUSED"),
|
||||||
|
this.$i18n.t("ID_UNASSIGNED"),
|
||||||
|
],
|
||||||
|
chart: {
|
||||||
|
id: "apexchart1",
|
||||||
|
type: "donut",
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
position: "top",
|
||||||
|
offsetY: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
seriesBar: [
|
||||||
|
{
|
||||||
|
data: [400, 430, 448, 470],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
optionsBar: {
|
||||||
|
chart: {
|
||||||
|
type: "bar",
|
||||||
|
id: "apexchart2",
|
||||||
|
toolbar: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
bar: {
|
||||||
|
barHeight: "100%",
|
||||||
|
distributed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
position: "top",
|
||||||
|
offsetY: 0,
|
||||||
|
},
|
||||||
|
colors: ["#33b2df", "#546E7A", "#d4526e", "#13d8aa"],
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
categories: [
|
||||||
|
this.$i18n.t("ID_INBOX"),
|
||||||
|
this.$i18n.t("ID_DRAFT"),
|
||||||
|
this.$i18n.t("ID_PAUSED"),
|
||||||
|
this.$i18n.t("ID_UNASSIGNED"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
x: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
title: {
|
||||||
|
formatter: function () {
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getBodyHeight();
|
||||||
|
//this.getDataDonut();
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
computed: {},
|
||||||
|
updated() {},
|
||||||
|
beforeCreate() {},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* Return the height for Vue Card View body
|
||||||
|
*/
|
||||||
|
getBodyHeight() {
|
||||||
|
this.width = window.innerHeight * 0.8;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Change view - donut/bar
|
||||||
|
*/
|
||||||
|
changeView(view) {
|
||||||
|
this.typeView = view;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get data from rest API
|
||||||
|
*/
|
||||||
|
getData() {
|
||||||
|
let that = this;
|
||||||
|
Api.cases
|
||||||
|
.listTotalCases()
|
||||||
|
.then((response) => {
|
||||||
|
that.formatData(response.data);
|
||||||
|
})
|
||||||
|
.catch((response) => {});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Format the data for chart
|
||||||
|
*/
|
||||||
|
formatData(data) {
|
||||||
|
let l = [],
|
||||||
|
c = [],
|
||||||
|
s = [];
|
||||||
|
_.each(data, (el) => {
|
||||||
|
l.push(el["List Name"]);
|
||||||
|
s.push(el["Total"]);
|
||||||
|
if (el["Color"] == "green") {
|
||||||
|
c.push("#179a6e");
|
||||||
|
}
|
||||||
|
if (el["Color"] == "yellow") {
|
||||||
|
c.push("#feb019");
|
||||||
|
}
|
||||||
|
if (el["Color"] == "blue") {
|
||||||
|
c.push("#008ffb");
|
||||||
|
}
|
||||||
|
if (el["Color"] == "gray") {
|
||||||
|
c.push("#8f99a0");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.seriesDonut = s;
|
||||||
|
this.seriesBar = [
|
||||||
|
{
|
||||||
|
data: s,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
this.$refs["apexchart1"].updateOptions({ labels: l, colors: c });
|
||||||
|
this.$refs["apexchart2"].updateOptions({ labels: l, colors: c });
|
||||||
|
this.$apexcharts.exec("apexchart1", "updateSeries", s);
|
||||||
|
this.$apexcharts.exec("apexchart2", "updateSeries", [
|
||||||
|
{
|
||||||
|
data: s,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.vp-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vp-padding-l10 {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -9,12 +9,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import VueChartLvZero from "./VueChartLvZero.vue";
|
||||||
import VueChartLvOne from "./VueChartLvOne.vue";
|
import VueChartLvOne from "./VueChartLvOne.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "VueCharts",
|
name: "VueCharts",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
components: {
|
components: {
|
||||||
|
VueChartLvZero,
|
||||||
VueChartLvOne,
|
VueChartLvOne,
|
||||||
},
|
},
|
||||||
props: [],
|
props: [],
|
||||||
|
|||||||
@@ -54,10 +54,19 @@
|
|||||||
:options="optionsVueList"
|
:options="optionsVueList"
|
||||||
ref="vueCardView"
|
ref="vueCardView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
@@ -110,10 +119,19 @@
|
|||||||
:options="optionsVueList"
|
:options="optionsVueList"
|
||||||
ref="vueListView"
|
ref="vueListView"
|
||||||
>
|
>
|
||||||
<div slot="detail" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
<b-row>
|
||||||
<i class="fas fa-info-circle"></i>
|
<b-col sm="12">
|
||||||
</div>
|
<div class="v-pm-card-info" @click="openCaseDetail(props.item)">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
<b-col sm="12">
|
||||||
|
<div class="ellipsis-container" @click="updateDataEllipsis(props.row)">
|
||||||
|
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
|
</div>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
<div slot="case_number" slot-scope="props" class="v-card-text">
|
<div slot="case_number" slot-scope="props" class="v-card-text">
|
||||||
<span class="v-card-text-highlight"
|
<span class="v-card-text-highlight"
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class EmailServerAjaxTest extends TestCase
|
|||||||
$content = $this->requireOnceForEmailServerAjax();
|
$content = $this->requireOnceForEmailServerAjax();
|
||||||
$data = json_decode($content, JSON_OBJECT_AS_ARRAY);
|
$data = json_decode($content, JSON_OBJECT_AS_ARRAY);
|
||||||
|
|
||||||
$this->assertContains(200, $data);
|
$this->assertContains(500, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -426,6 +426,42 @@ class DelegationTest extends TestCase
|
|||||||
$this->assertCount(1, $table->dueTo($table->DEL_TASK_DUE_DATE)->get());
|
$this->assertCount(1, $table->dueTo($table->DEL_TASK_DUE_DATE)->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeOnTime
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\Delegation::scopeOnTime()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_on_time()
|
||||||
|
{
|
||||||
|
$table = factory(Delegation::class)->states('closed')->create();
|
||||||
|
$this->assertCount(1, $table->onTime($table->DEL_DELEGATE_DATE)->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeAtRisk
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\Delegation::scopeAtRisk()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_at_risk()
|
||||||
|
{
|
||||||
|
$table = factory(Delegation::class)->states('closed')->create();
|
||||||
|
$this->assertCount(1, $table->atRisk($table->DEL_DELEGATE_DATE)->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeOverdue
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\Delegation::scopeOverdue()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_overdue()
|
||||||
|
{
|
||||||
|
$table = factory(Delegation::class)->states('closed')->create();
|
||||||
|
$this->assertCount(1, $table->overdue($table->DEL_DELEGATE_DATE)->get());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test scopeCase
|
* This test scopeCase
|
||||||
*
|
*
|
||||||
@@ -3196,6 +3232,28 @@ class DelegationTest extends TestCase
|
|||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This check the return of thread info
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\Delegation::getDatesFromThread()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_thread_dates()
|
||||||
|
{
|
||||||
|
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
$task = new Task();
|
||||||
|
$taskInfo = $task->load($delegation->TAS_UID);
|
||||||
|
$taskInfo = head($taskInfo);
|
||||||
|
$taskType = $taskInfo['TAS_TYPE'];
|
||||||
|
$result = Delegation::getDatesFromThread(
|
||||||
|
$delegation->APP_UID,
|
||||||
|
$delegation->DEL_INDEX,
|
||||||
|
$delegation->TAS_UID,
|
||||||
|
$taskType
|
||||||
|
);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This check the return of pending threads
|
* This check the return of pending threads
|
||||||
*
|
*
|
||||||
@@ -3207,6 +3265,8 @@ class DelegationTest extends TestCase
|
|||||||
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
|
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
$result = Delegation::getPendingThreads($delegation->APP_NUMBER);
|
$result = Delegation::getPendingThreads($delegation->APP_NUMBER);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
$result = Delegation::getPendingThreads($delegation->APP_NUMBER, false);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3283,9 +3343,9 @@ class DelegationTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$res = Delegation::hasActiveParentsCases($parents);
|
$res = Delegation::hasActiveParentsCases($parents);
|
||||||
|
|
||||||
// Assert the result is true
|
|
||||||
$this->assertTrue($res);
|
$this->assertTrue($res);
|
||||||
|
$res = Delegation::hasActiveParentsCases([]);
|
||||||
|
$this->assertFalse($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3296,9 +3356,9 @@ class DelegationTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_get_cases_completed_by_specific_user()
|
public function it_get_cases_completed_by_specific_user()
|
||||||
{
|
{
|
||||||
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
|
$delegation = factory(Delegation::class)->states('last_thread')->create();
|
||||||
$result = Delegation::casesCompletedBy($delegation->USR_ID);
|
$result = Delegation::casesCompletedBy($delegation->USR_ID);
|
||||||
$this->assertEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -799,41 +799,45 @@ class Calendar extends CalendarDefinition
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate date adding a duration, will considerate the calendar
|
||||||
|
*
|
||||||
|
* @param string $initialDate
|
||||||
|
* @param string $duration
|
||||||
|
* @param string $formatDuration
|
||||||
|
* @param array $calendarData
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function dashCalculateDate($initialDate, $duration, $formatDuration, $calendarData = [])
|
||||||
|
{
|
||||||
|
if (G::toUpper($formatDuration) == 'DAYS') {
|
||||||
|
$duration = $duration * $calendarData['HOURS_FOR_DAY'];
|
||||||
|
}
|
||||||
|
if (G::toUpper($formatDuration) == 'MINUTES') {
|
||||||
|
$duration = $duration / 60;
|
||||||
|
}
|
||||||
|
$hoursDuration = (float)$duration;
|
||||||
|
$newDate = $initialDate;
|
||||||
|
|
||||||
|
while ($hoursDuration > 0) {
|
||||||
|
$newDate = $this->dashGetIniDate($newDate, $calendarData);
|
||||||
|
$rangeWorkHour = $this->dashGetRangeWorkHours($newDate, $calendarData['BUSINESS_DAY']);
|
||||||
/**************SLA classes***************/
|
$onlyDate = (date('Y-m-d', strtotime($newDate))) . ' ' . $rangeWorkHour['END'];
|
||||||
public function dashCalculateDate ($iniDate, $duration, $formatDuration, $calendarData = array())
|
$rangeWorkHourTotal = (float)$rangeWorkHour['TOTAL'];
|
||||||
{
|
if ($hoursDuration >= $rangeWorkHourTotal ||
|
||||||
if ( G::toUpper($formatDuration) == 'DAYS' ) {
|
((strtotime($onlyDate) - strtotime($newDate)) < (($hoursDuration) * 3600))
|
||||||
$duration = $duration*$calendarData['HOURS_FOR_DAY'];
|
) {
|
||||||
}
|
$secondRes = (float)(strtotime($onlyDate) - strtotime($newDate));
|
||||||
if ( G::toUpper($formatDuration) == 'MINUTES' ) {
|
$newDate = $onlyDate;
|
||||||
$duration = $duration/60;
|
$hoursDuration -= (float)($secondRes / 3600);
|
||||||
}
|
} else {
|
||||||
$hoursDuration = (float)$duration;
|
$newDate = date('Y-m-d H:i:s', strtotime('+' . round((($hoursDuration) * 3600), 5) . ' seconds', strtotime($newDate)));
|
||||||
$newDate = $iniDate;
|
$hoursDuration = 0;
|
||||||
|
}
|
||||||
while ($hoursDuration > 0) {
|
}
|
||||||
$newDate = $this->dashGetIniDate($newDate, $calendarData);
|
return $newDate;
|
||||||
|
}
|
||||||
$rangeWorkHour = $this->dashGetRangeWorkHours($newDate, $calendarData['BUSINESS_DAY']);
|
|
||||||
$onlyDate = (date('Y-m-d',strtotime($newDate))) . ' ' . $rangeWorkHour['END'];
|
|
||||||
|
|
||||||
if ( (((float)$hoursDuration) >= ((float)$rangeWorkHour['TOTAL'])) ||
|
|
||||||
((strtotime($onlyDate) - strtotime($newDate)) < (((float)$hoursDuration)*3600))
|
|
||||||
) {
|
|
||||||
$secondRes = (float)(strtotime($onlyDate) - strtotime($newDate));
|
|
||||||
$newDate = $onlyDate;
|
|
||||||
$hoursDuration -= (float)($secondRes/3600);
|
|
||||||
} else {
|
|
||||||
$newDate = date('Y-m-d H:i:s', strtotime('+' . round((((float)$hoursDuration)*3600), 5) . ' seconds', strtotime($newDate)));
|
|
||||||
$hoursDuration = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $newDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Calculate the duration betwen two dates with a calendar
|
//Calculate the duration betwen two dates with a calendar
|
||||||
public function dashCalculateDurationWithCalendar ($iniDate, $finDate = null, $calendarData = array())
|
public function dashCalculateDurationWithCalendar ($iniDate, $finDate = null, $calendarData = array())
|
||||||
|
|||||||
@@ -41,6 +41,22 @@ use ProcessMaker\Plugins\PluginRegistry;
|
|||||||
*/
|
*/
|
||||||
class AppDelegation extends BaseAppDelegation
|
class AppDelegation extends BaseAppDelegation
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Get the risk value
|
||||||
|
*
|
||||||
|
* @return double
|
||||||
|
*/
|
||||||
|
public function getRisk()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$risk = 2;
|
||||||
|
|
||||||
|
return $risk;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get previous delegation (Valid Task)
|
* Get previous delegation (Valid Task)
|
||||||
*
|
*
|
||||||
@@ -91,42 +107,59 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create an application delegation
|
* Create an application delegation
|
||||||
*
|
*
|
||||||
* @param $sProUid process Uid
|
* @param string $proUid process Uid
|
||||||
* @param $sAppUid Application Uid
|
* @param string $appUid Application Uid
|
||||||
* @param $sTasUid Task Uid
|
* @param string $tasUid Task Uid
|
||||||
* @param $sUsrUid User Uid
|
* @param string $usrUid User Uid
|
||||||
* @param $iPriority delegation priority
|
* @param int $priority delegation priority
|
||||||
* @param $isSubprocess is a subprocess inside a process?
|
* @param bool $isSubprocess is a subprocess inside a process?
|
||||||
* @return delegation index of the application delegation.
|
*
|
||||||
|
* @return int index of the application delegation.
|
||||||
*/
|
*/
|
||||||
public function createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null, $flagControl = false, $flagControlMulInstance = false, $delPrevious = 0, $appNumber = 0, $taskId = 0, $userId = 0, $proId = 0)
|
public function createAppDelegation(
|
||||||
{
|
$proUid,
|
||||||
if (! isset($sProUid) || strlen($sProUid) == 0) {
|
$appUid,
|
||||||
throw (new Exception('Column "PRO_UID" cannot be null.'));
|
$tasUid,
|
||||||
|
$usrUid,
|
||||||
|
$sAppThread,
|
||||||
|
$priority = 3,
|
||||||
|
$isSubprocess = false,
|
||||||
|
$previous = -1,
|
||||||
|
$nextTasParam = null,
|
||||||
|
$flagControl = false,
|
||||||
|
$flagControlMulInstance = false,
|
||||||
|
$delPrevious = 0,
|
||||||
|
$appNumber = 0,
|
||||||
|
$taskId = 0,
|
||||||
|
$userId = 0,
|
||||||
|
$proId = 0
|
||||||
|
){
|
||||||
|
if (! isset($proUid) || strlen($proUid) == 0) {
|
||||||
|
throw new Exception('Column "PRO_UID" cannot be null.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($sAppUid) || strlen($sAppUid) == 0) {
|
if (! isset($appUid) || strlen($appUid) == 0) {
|
||||||
throw (new Exception('Column "APP_UID" cannot be null.'));
|
throw new Exception('Column "APP_UID" cannot be null.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($sTasUid) || strlen($sTasUid) == 0) {
|
if (! isset($tasUid) || strlen($tasUid) == 0) {
|
||||||
throw (new Exception('Column "TAS_UID" cannot be null.'));
|
throw new Exception('Column "TAS_UID" cannot be null.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($sUsrUid) /*|| strlen($sUsrUid ) == 0*/) {
|
if (! isset($usrUid)) {
|
||||||
throw (new Exception('Column "USR_UID" cannot be null.'));
|
throw new Exception('Column "USR_UID" cannot be null.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($sAppThread) || strlen($sAppThread) == 0) {
|
if (! isset($sAppThread) || strlen($sAppThread) == 0) {
|
||||||
throw (new Exception('Column "APP_THREAD" cannot be null.'));
|
throw new Exception('Column "APP_THREAD" cannot be null.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->delegation_id = null;
|
$this->delegation_id = null;
|
||||||
//Get max DEL_INDEX
|
// Get max DEL_INDEX
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
$criteria->add(AppDelegationPeer::APP_UID, $sAppUid);
|
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||||
$criteria->add(AppDelegationPeer::DEL_LAST_INDEX, 1);
|
$criteria->add(AppDelegationPeer::DEL_LAST_INDEX, 1);
|
||||||
$criteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
$criteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||||
|
|
||||||
@@ -136,8 +169,8 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
$delIndex = 1;
|
$delIndex = 1;
|
||||||
$delPreviusUsrUid = $sUsrUid;
|
$delPreviusUsrUid = $usrUid;
|
||||||
$delPreviousFather = $sPrevious;
|
$delPreviousFather = $previous;
|
||||||
if ($rs->next()) {
|
if ($rs->next()) {
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
|
|
||||||
@@ -149,7 +182,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
|
|
||||||
$criteriaDelIndex->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
$criteriaDelIndex->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||||
$criteriaDelIndex->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
$criteriaDelIndex->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||||
$criteriaDelIndex->add(AppDelegationPeer::APP_UID, $sAppUid);
|
$criteriaDelIndex->add(AppDelegationPeer::APP_UID, $appUid);
|
||||||
$criteriaDelIndex->addDescendingOrderByColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
$criteriaDelIndex->addDescendingOrderByColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||||
|
|
||||||
$rsCriteriaDelIndex = AppDelegationPeer::doSelectRS($criteriaDelIndex);
|
$rsCriteriaDelIndex = AppDelegationPeer::doSelectRS($criteriaDelIndex);
|
||||||
@@ -161,23 +194,23 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
$delIndex = (isset($row["DEL_INDEX"]))? $row["DEL_INDEX"] + 1 : 1;
|
$delIndex = (isset($row["DEL_INDEX"]))? $row["DEL_INDEX"] + 1 : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Verify successors: parrallel submit in the same time
|
// Verify successors: parallel submit in the same time
|
||||||
if ($flagControl) {
|
if ($flagControl) {
|
||||||
$nextTaskUid = $sTasUid;
|
$nextTaskUid = $tasUid;
|
||||||
$index = $this->getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid, $delPreviousFather);
|
$index = $this->getAllTasksBeforeSecJoin($nextTaskUid, $appUid, $delPreviousFather);
|
||||||
if ($this->createThread($index, $sAppUid)) {
|
if ($this->createThread($index, $appUid)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($flagControlMulInstance) {
|
if ($flagControlMulInstance) {
|
||||||
$nextTaskUid = $sTasUid;
|
$nextTaskUid = $tasUid;
|
||||||
$index = $this->getAllTheardMultipleInstance($delPreviousFather, $sAppUid);
|
$index = $this->getAllTheardMultipleInstance($delPreviousFather, $appUid);
|
||||||
if ($this->createThread($index, $sAppUid, $sUsrUid)) {
|
if ($this->createThread($index, $appUid, $usrUid)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update set
|
// Update set
|
||||||
$criteriaUpdate = new Criteria('workflow');
|
$criteriaUpdate = new Criteria('workflow');
|
||||||
$criteriaUpdate->add(AppDelegationPeer::DEL_LAST_INDEX, 0);
|
$criteriaUpdate->add(AppDelegationPeer::DEL_LAST_INDEX, 0);
|
||||||
BasePeer::doUpdate($criteria, $criteriaUpdate, Propel::getConnection('workflow'));
|
BasePeer::doUpdate($criteria, $criteriaUpdate, Propel::getConnection('workflow'));
|
||||||
@@ -185,15 +218,15 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
// Define the status of the thread, if is subprocess we need to CLOSED the thread
|
// Define the status of the thread, if is subprocess we need to CLOSED the thread
|
||||||
$theadStatus = !$isSubprocess ? 'OPEN' : 'CLOSED';
|
$theadStatus = !$isSubprocess ? 'OPEN' : 'CLOSED';
|
||||||
|
|
||||||
$this->setAppUid($sAppUid);
|
$this->setAppUid($appUid);
|
||||||
$this->setProUid($sProUid);
|
$this->setProUid($proUid);
|
||||||
$this->setTasUid($sTasUid);
|
$this->setTasUid($tasUid);
|
||||||
$this->setDelIndex($delIndex);
|
$this->setDelIndex($delIndex);
|
||||||
$this->setDelLastIndex(1);
|
$this->setDelLastIndex(1);
|
||||||
$this->setDelPrevious($sPrevious == - 1 ? 0 : $sPrevious);
|
$this->setDelPrevious($previous == - 1 ? 0 : $previous);
|
||||||
$this->setUsrUid($sUsrUid);
|
$this->setUsrUid($usrUid);
|
||||||
$this->setDelType('NORMAL');
|
$this->setDelType('NORMAL');
|
||||||
$this->setDelPriority(($iPriority != '' ? $iPriority : '3'));
|
$this->setDelPriority(($priority != '' ? $priority : '3'));
|
||||||
$this->setDelThread($sAppThread);
|
$this->setDelThread($sAppThread);
|
||||||
$this->setDelThreadStatus($theadStatus);
|
$this->setDelThreadStatus($theadStatus);
|
||||||
$this->setDelThreadStatusId(Delegation::$thread_status[$theadStatus]);
|
$this->setDelThreadStatusId(Delegation::$thread_status[$theadStatus]);
|
||||||
@@ -203,24 +236,22 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
$this->setUsrId($userId);
|
$this->setUsrId($userId);
|
||||||
$this->setProId($proId);
|
$this->setProId($proId);
|
||||||
|
|
||||||
//The function return an array now. By JHL
|
// The function return an array now. By JHL
|
||||||
$delTaskDueDate = $this->calculateDueDate($sNextTasParam);
|
$delTaskDueDate = $this->calculateDueDate($nextTasParam);
|
||||||
$delRiskDate = $this->calculateRiskDate($sNextTasParam, $this->getRisk());
|
$delRiskDate = $this->calculateRiskDate($nextTasParam, $this->getRisk());
|
||||||
|
|
||||||
//$this->setDelTaskDueDate( $delTaskDueDate['DUE_DATE'] ); // Due date formatted
|
|
||||||
$this->setDelTaskDueDate($delTaskDueDate);
|
$this->setDelTaskDueDate($delTaskDueDate);
|
||||||
$this->setDelRiskDate($delRiskDate);
|
$this->setDelRiskDate($delRiskDate);
|
||||||
|
|
||||||
if ((defined("DEBUG_CALENDAR_LOG")) && (DEBUG_CALENDAR_LOG)) {
|
if ((defined("DEBUG_CALENDAR_LOG")) && (DEBUG_CALENDAR_LOG)) {
|
||||||
//$this->setDelData( $delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
|
// Log of actions made by Calendar Engine
|
||||||
$this->setDelData($delTaskDueDate);
|
$this->setDelData($delTaskDueDate);
|
||||||
} else {
|
} else {
|
||||||
$this->setDelData('');
|
$this->setDelData('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// this condition assures that an internal delegation like a subprocess dont have an initial date setted
|
// This condition assures that an internal delegation like a subprocess don't have an initial date set
|
||||||
if ($delIndex == 1 && ! $isSubprocess) {
|
if ($delIndex == 1 && ! $isSubprocess) {
|
||||||
//the first delegation, init date this should be now for draft applications, in other cases, should be null.
|
// The first delegation, init date this should be now for draft applications, in other cases, should be null.
|
||||||
$this->setDelInitDate('now');
|
$this->setDelInitDate('now');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,16 +278,16 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
$bpmn = new \ProcessMaker\Project\Bpmn();
|
$bpmn = new \ProcessMaker\Project\Bpmn();
|
||||||
$flagActionsByEmail = true;
|
$flagActionsByEmail = true;
|
||||||
|
|
||||||
$arrayAppDelegationPrevious = $this->getPreviousDelegationValidTask($sAppUid, $delIndex);
|
$arrayAppDelegationPrevious = $this->getPreviousDelegationValidTask($appUid, $delIndex);
|
||||||
|
|
||||||
$data = new stdclass();
|
$data = new stdclass();
|
||||||
$data->TAS_UID = $sTasUid;
|
$data->TAS_UID = $tasUid;
|
||||||
$data->APP_UID = $sAppUid;
|
$data->APP_UID = $appUid;
|
||||||
$data->DEL_INDEX = $delIndex;
|
$data->DEL_INDEX = $delIndex;
|
||||||
$data->USR_UID = $sUsrUid;
|
$data->USR_UID = $usrUid;
|
||||||
$data->PREVIOUS_USR_UID = ($arrayAppDelegationPrevious !== false)? $arrayAppDelegationPrevious['USR_UID'] : $delPreviusUsrUid;
|
$data->PREVIOUS_USR_UID = ($arrayAppDelegationPrevious !== false)? $arrayAppDelegationPrevious['USR_UID'] : $delPreviusUsrUid;
|
||||||
|
|
||||||
if ($bpmn->exists($sProUid)) {
|
if ($bpmn->exists($proUid)) {
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
// this section evaluates the actions by email trigger execution please
|
// this section evaluates the actions by email trigger execution please
|
||||||
// modify this section carefully, the if evaluation checks if the license has been
|
// modify this section carefully, the if evaluation checks if the license has been
|
||||||
@@ -265,8 +296,8 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
::getSingleton()
|
::getSingleton()
|
||||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||||
$criteriaAbe = new Criteria();
|
$criteriaAbe = new Criteria();
|
||||||
$criteriaAbe->add(AbeConfigurationPeer::PRO_UID, $sProUid);
|
$criteriaAbe->add(AbeConfigurationPeer::PRO_UID, $proUid);
|
||||||
$criteriaAbe->add(AbeConfigurationPeer::TAS_UID, $sTasUid);
|
$criteriaAbe->add(AbeConfigurationPeer::TAS_UID, $tasUid);
|
||||||
$resultAbe = AbeConfigurationPeer::doSelectRS($criteriaAbe);
|
$resultAbe = AbeConfigurationPeer::doSelectRS($criteriaAbe);
|
||||||
$resultAbe->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$resultAbe->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
if ($resultAbe->next()) {
|
if ($resultAbe->next()) {
|
||||||
@@ -289,7 +320,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
$pmGoogle = new PmGoogleApi();
|
$pmGoogle = new PmGoogleApi();
|
||||||
if ($pmGoogle->getServiceGmailStatus()) {
|
if ($pmGoogle->getServiceGmailStatus()) {
|
||||||
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
|
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
|
||||||
$Pmgmail->gmailsForRouting($sUsrUid, $sTasUid, $sAppUid, $delIndex, $isSubprocess);
|
$Pmgmail->gmailsForRouting($usrUid, $tasUid, $appUid, $delIndex, $isSubprocess);
|
||||||
}
|
}
|
||||||
} catch (Exception $oError) {
|
} catch (Exception $oError) {
|
||||||
error_log($oError->getMessage());
|
error_log($oError->getMessage());
|
||||||
@@ -299,8 +330,8 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($flagActionsByEmail) {
|
if ($flagActionsByEmail) {
|
||||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||||
$oPluginRegistry->executeTriggers(PM_CREATE_NEW_DELEGATION, $data);
|
$pluginRegistry->executeTriggers(PM_CREATE_NEW_DELEGATION, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,30 +505,38 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
//Calendar - Use the dates class to calculate dates
|
//Calendar - Use the dates class to calculate dates
|
||||||
$calendar = new Calendar();
|
$calendar = new Calendar();
|
||||||
|
|
||||||
$arrayCalendarData = $calendar->getCalendarData($aCalendarUID);
|
$calendarData = $calendar->getCalendarData($aCalendarUID);
|
||||||
|
|
||||||
if ($calendar->pmCalendarUid == "") {
|
if ($calendar->pmCalendarUid == "") {
|
||||||
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
|
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
|
||||||
|
|
||||||
$arrayCalendarData = $calendar->getCalendarData();
|
$calendarData = $calendar->getCalendarData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Due date
|
//Due date
|
||||||
$initDate = $this->getDelDelegateDate();
|
$initDate = $this->getDelDelegateDate();
|
||||||
$timeZone = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($initDate);
|
$timeZone = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($initDate);
|
||||||
$dueDate = $calendar->dashCalculateDate($timeZone, $aData["TAS_DURATION"], $aData["TAS_TIMEUNIT"], $arrayCalendarData);
|
$dueDate = $calendar->dashCalculateDate($timeZone, $aData["TAS_DURATION"], $aData["TAS_TIMEUNIT"], $calendarData);
|
||||||
|
|
||||||
$dueDate = \ProcessMaker\Util\DateTime::convertDataToUtc($dueDate);
|
$dueDate = \ProcessMaker\Util\DateTime::convertDataToUtc($dueDate);
|
||||||
return $dueDate;
|
return $dueDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calculateRiskDate($dueDate, $risk)
|
/**
|
||||||
|
* Calculate the risk date
|
||||||
|
*
|
||||||
|
* @param array $nextTask
|
||||||
|
* @param double $risk
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function calculateRiskDate($nextTask, $risk)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$data = array();
|
$data = [];
|
||||||
if (isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
if (isset($nextTask['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $nextTask['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
||||||
$data['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
|
$data['TAS_DURATION'] = $nextTask['NEXT_TASK']['TAS_DURATION'];
|
||||||
$data['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
|
$data['TAS_TIMEUNIT'] = $nextTask['NEXT_TASK']['TAS_TIMEUNIT'];
|
||||||
} else {
|
} else {
|
||||||
$task = TaskPeer::retrieveByPK($this->getTasUid());
|
$task = TaskPeer::retrieveByPK($this->getTasUid());
|
||||||
$data['TAS_DURATION'] = $task->getTasDuration();
|
$data['TAS_DURATION'] = $task->getTasDuration();
|
||||||
@@ -506,19 +545,21 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
|
|
||||||
$riskTime = $data['TAS_DURATION'] - ($data['TAS_DURATION'] * $risk);
|
$riskTime = $data['TAS_DURATION'] - ($data['TAS_DURATION'] * $risk);
|
||||||
|
|
||||||
//Calendar - Use the dates class to calculate dates
|
// Calendar - Use the dates class to calculate dates
|
||||||
$calendar = new Calendar();
|
$calendar = new Calendar();
|
||||||
|
$calendarData = [];
|
||||||
$arrayCalendarData = array();
|
if (empty($calendar->pmCalendarUid)) {
|
||||||
|
|
||||||
if ($calendar->pmCalendarUid == "") {
|
|
||||||
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
|
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
|
||||||
|
$calendarData = $calendar->getCalendarData();
|
||||||
$arrayCalendarData = $calendar->getCalendarData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Risk date
|
// Risk date
|
||||||
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $riskTime, $data['TAS_TIMEUNIT'], $arrayCalendarData);
|
$riskDate = $calendar->dashCalculateDate(
|
||||||
|
$this->getDelDelegateDate(),
|
||||||
|
$riskTime,
|
||||||
|
$data['TAS_TIMEUNIT'],
|
||||||
|
$calendarData
|
||||||
|
);
|
||||||
|
|
||||||
return $riskDate;
|
return $riskDate;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -526,12 +567,6 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDiffDate($date1, $date2)
|
|
||||||
{
|
|
||||||
return ($date1 - $date2) / (24 * 60 * 60); //days
|
|
||||||
return ($date1 - $date2) / 3600;
|
|
||||||
}
|
|
||||||
|
|
||||||
//usually this function is called when routing in the flow, so by default cron =0
|
//usually this function is called when routing in the flow, so by default cron =0
|
||||||
public function calculateDuration($cron = 0)
|
public function calculateDuration($cron = 0)
|
||||||
{
|
{
|
||||||
@@ -799,8 +834,10 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function get the current user related to the specific case and index
|
* This function get the current user related to the specific case and index
|
||||||
|
*
|
||||||
* @param string $appUid, Uid related to the case
|
* @param string $appUid, Uid related to the case
|
||||||
* @param integer $index, Index to review
|
* @param integer $index, Index to review
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getCurrentUsers($appUid, $index)
|
public static function getCurrentUsers($appUid, $index)
|
||||||
@@ -820,7 +857,8 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
/**
|
/**
|
||||||
* Verify if the current case is already routed.
|
* Verify if the current case is already routed.
|
||||||
*
|
*
|
||||||
* @param string $AppUid the uid of the application
|
* @param string $appUid the uid of the application
|
||||||
|
*
|
||||||
* @return array $Fields the fields
|
* @return array $Fields the fields
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -841,18 +879,6 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRisk()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$risk = 0.2;
|
|
||||||
|
|
||||||
//Return
|
|
||||||
return $risk;
|
|
||||||
} catch (Exception $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all task before Join Threads
|
* Get all task before Join Threads
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -381,36 +381,39 @@ class Delegation extends Model
|
|||||||
* Scope a query to get only the date on time
|
* Scope a query to get only the date on time
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param string $now
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function scopeOnTime($query)
|
public function scopeOnTime($query, $now)
|
||||||
{
|
{
|
||||||
return $query->whereRaw('TIMEDIFF(DEL_RISK_DATE, NOW()) > 0');
|
return $query->where('DEL_RISK_DATE', '>', $now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope a query to get only the date at risk
|
* Scope a query to get only the date at risk
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param string $now
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function scopeAtRisk($query)
|
public function scopeAtRisk($query, $now)
|
||||||
{
|
{
|
||||||
return $query->whereRaw('TIMEDIFF(DEL_RISK_DATE, NOW()) < 0 AND TIMEDIFF(DEL_TASK_DUE_DATE, NOW()) > 0');
|
return $query->where('DEL_RISK_DATE', '>=', $now)->where('DEL_TASK_DUE_DATE', '>=', $now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope a query to get only the date overdue
|
* Scope a query to get only the date overdue
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param string $now
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function scopeOverdue($query)
|
public function scopeOverdue($query, $now)
|
||||||
{
|
{
|
||||||
return $query->whereRaw('TIMEDIFF(DEL_TASK_DUE_DATE, NOW()) < 0');
|
return $query->where('DEL_TASK_DUE_DATE', '>', $now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user