Merged in dashboards2 (pull request #2370)
KPIs Inbox, queue time modifications
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -839,6 +839,7 @@ class calendar extends CalendarDefinition
|
|||||||
$finDate = date('Y-m-d H:i:s');
|
$finDate = date('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((strtotime($finDate)) <= (strtotime($iniDate))) {
|
if ((strtotime($finDate)) <= (strtotime($iniDate))) {
|
||||||
return 0.00;
|
return 0.00;
|
||||||
}
|
}
|
||||||
@@ -847,6 +848,10 @@ class calendar extends CalendarDefinition
|
|||||||
|
|
||||||
$finDate = $this->dashGetIniDate($finDate, $calendarData);
|
$finDate = $this->dashGetIniDate($finDate, $calendarData);
|
||||||
$newDate = $iniDate;
|
$newDate = $iniDate;
|
||||||
|
|
||||||
|
$timeIniDate = strtotime($iniDate);
|
||||||
|
$timeFinDate = strtotime($finDate);
|
||||||
|
|
||||||
while ($timeIniDate < $timeFinDate) {
|
while ($timeIniDate < $timeFinDate) {
|
||||||
$newDate = $this->dashGetIniDate($newDate, $calendarData);
|
$newDate = $this->dashGetIniDate($newDate, $calendarData);
|
||||||
|
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ class indicatorsCalculator
|
|||||||
private $userGroupReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "PRO_UID");
|
private $userGroupReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "PRO_UID");
|
||||||
private $processCategoryReportingMetadata = array("tableName" => "PRO_REPORTING", "keyField" => "PRO_UID");
|
private $processCategoryReportingMetadata = array("tableName" => "PRO_REPORTING", "keyField" => "PRO_UID");
|
||||||
|
|
||||||
private $peiCostFormula = " SUM(case when TOTAL_TIME_BY_TASK >0 then (TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - TOTAL_TIME_BY_TASK) * USER_HOUR_COST else 0 end)";
|
private $peiCostFormula = " SUM(case when (TOTAL_TIME_BY_TASK + TOTAL_QUEUE_TIME_BY_TASK) > 0 then (TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - (TOTAL_TIME_BY_TASK * USER_HOUR_COST + TOTAL_QUEUE_TIME_BY_TASK * PRO_COST)) else 0 end)";
|
||||||
private $peiFormula = "SUM(TOTAL_CASES_OUT*CONFIGURED_TASK_TIME) / SUM(SDV_TIME * TOTAL_CASES_OUT + TOTAL_TIME_BY_TASK)";
|
private $peiFormula = "SUM(TOTAL_CASES_OUT*CONFIGURED_TASK_TIME) / SUM(SDV_TIME * TOTAL_CASES_OUT + (TOTAL_TIME_BY_TASK + TOTAL_QUEUE_TIME_BY_TASK))";
|
||||||
|
|
||||||
private $ueiCostFormula = " SUM(case when TOTAL_TIME_BY_TASK >0 then (TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - TOTAL_TIME_BY_TASK) * USER_HOUR_COST else 0 end)";
|
private $ueiCostFormula = " SUM(case when (TOTAL_TIME_BY_TASK + TOTAL_QUEUE_TIME_BY_TASK) > 0 then (TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - (TOTAL_TIME_BY_TASK * USER_HOUR_COST + TOTAL_QUEUE_TIME_BY_TASK * PRO_COST)) else 0 end)";
|
||||||
private $ueiFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME) / SUM(TOTAL_TIME_BY_TASK)";
|
private $ueiFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME) / SUM((TOTAL_TIME_BY_TASK + TOTAL_QUEUE_TIME_BY_TASK))";
|
||||||
|
|
||||||
public function getSkewOfDataDistribution($table, $field) {
|
public function getSkewOfDataDistribution($table, $field) {
|
||||||
/*$sqlString = "SET @median = (SELECT x.$field from $table x, $table y
|
/*$sqlString = "SET @median = (SELECT x.$field from $table x, $table y
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ class Dashboard extends BaseDashboard
|
|||||||
$msg = 'Update ';
|
$msg = 'Update ';
|
||||||
$dashboard = DashboardPeer::retrieveByPK($data['DAS_UID']);
|
$dashboard = DashboardPeer::retrieveByPK($data['DAS_UID']);
|
||||||
}
|
}
|
||||||
|
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && isset($data['USR_UID']) && $data['USR_UID'] != '') {
|
||||||
|
$this->setUser($data['USR_UID']);
|
||||||
|
}
|
||||||
|
|
||||||
G::LoadSystem('inputfilter');
|
G::LoadSystem('inputfilter');
|
||||||
$filter = new InputFilter();
|
$filter = new InputFilter();
|
||||||
@@ -74,7 +77,7 @@ class Dashboard extends BaseDashboard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function remove($dasUid)
|
public function remove($dasUid, $userLogged = '')
|
||||||
{
|
{
|
||||||
$connection = Propel::getConnection(DashboardPeer::DATABASE_NAME);
|
$connection = Propel::getConnection(DashboardPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
@@ -89,6 +92,10 @@ class Dashboard extends BaseDashboard
|
|||||||
$criteria->add(DashboardIndicatorPeer::DAS_UID, $dasUid);
|
$criteria->add(DashboardIndicatorPeer::DAS_UID, $dasUid);
|
||||||
DashboardIndicatorPeer::doDelete($criteria);
|
DashboardIndicatorPeer::doDelete($criteria);
|
||||||
|
|
||||||
|
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && $userLogged != '') {
|
||||||
|
$this->setUser($userLogged);
|
||||||
|
}
|
||||||
|
|
||||||
$dashboard = DashboardPeer::retrieveByPK($dasUid);
|
$dashboard = DashboardPeer::retrieveByPK($dasUid);
|
||||||
if (!is_null($dashboard)) {
|
if (!is_null($dashboard)) {
|
||||||
$connection->begin();
|
$connection->begin();
|
||||||
@@ -96,7 +103,7 @@ class Dashboard extends BaseDashboard
|
|||||||
$result = $dashboard->delete();
|
$result = $dashboard->delete();
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
|
|
||||||
G::auditLog("Deletedashboard", "Dashboard Name: ". $dashboardData['DAS_TITLE']." Dashboard ID: (".$dasUid.") ");
|
G::auditLog("Delete", "Dashboard Name: ". $dashboardData['DAS_TITLE']." Dashboard ID: (".$dasUid.") ");
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
|
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
|
||||||
@@ -106,5 +113,12 @@ class Dashboard extends BaseDashboard
|
|||||||
throw $error;
|
throw $error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUser($usrId) {
|
||||||
|
$user = new Users ();
|
||||||
|
$user = $user->loadDetails($usrId);
|
||||||
|
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
|
||||||
|
$_SESSION['USR_FULLNAME'] = $user['USR_FULLNAME'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ class DashboardDasInd extends BaseDashboardDasInd
|
|||||||
$result = $dashboardDasInd->save();
|
$result = $dashboardDasInd->save();
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
|
|
||||||
|
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && isset($data['USR_UID']) && $data['USR_UID'] != '') {
|
||||||
|
$this->setUser($data['USR_UID']);
|
||||||
|
}
|
||||||
G::auditLog("Create", "Dashboard Owner: ". $data['OWNER_UID']." Dashboard ID: (".$dashboardDasInd->getDasUid().") ");
|
G::auditLog("Create", "Dashboard Owner: ". $data['OWNER_UID']." Dashboard ID: (".$dashboardDasInd->getDasUid().") ");
|
||||||
return $dashboardDasInd;
|
return $dashboardDasInd;
|
||||||
} else {
|
} else {
|
||||||
@@ -87,7 +90,7 @@ class DashboardDasInd extends BaseDashboardDasInd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function remove($dasUid, $owner)
|
public function remove($dasUid, $owner, $userLogged='')
|
||||||
{
|
{
|
||||||
$connection = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
$connection = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
@@ -97,7 +100,10 @@ class DashboardDasInd extends BaseDashboardDasInd
|
|||||||
$result = $dashboardDasInd->delete();
|
$result = $dashboardDasInd->delete();
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
|
|
||||||
G::auditLog("DeletedashboardIndicator", "Dashboard ID: ". $dasUid ." Dashboard owner ID: (".$owner.") ");
|
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && $userLogged != '') {
|
||||||
|
$this->setUser($userLogged);
|
||||||
|
}
|
||||||
|
G::auditLog("Delete", "Dashboard ID: ". $dasUid ." Dashboard owner ID: (".$owner.") ");
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
|
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
|
||||||
@@ -143,5 +149,12 @@ class DashboardDasInd extends BaseDashboardDasInd
|
|||||||
throw $error;
|
throw $error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUser($usrId) {
|
||||||
|
$user = new Users ();
|
||||||
|
$user = $user->loadDetails($usrId);
|
||||||
|
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
|
||||||
|
$_SESSION['USR_FULLNAME'] = $user['USR_FULLNAME'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,9 @@ class DashboardIndicator extends BaseDashboardIndicator
|
|||||||
$result = $dashboardIndicator->save();
|
$result = $dashboardIndicator->save();
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
|
|
||||||
|
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && isset($data['USR_UID']) && $data['USR_UID'] != '') {
|
||||||
|
$this->setUser($data['USR_UID']);
|
||||||
|
}
|
||||||
G::auditLog($msg, "Dashboard Indicator Name: ".$dashboardIndicator->getDasIndTitle()." Dashboard indicator ID: (".$dashboardIndicator->getDasIndUid() .") ");
|
G::auditLog($msg, "Dashboard Indicator Name: ".$dashboardIndicator->getDasIndTitle()." Dashboard indicator ID: (".$dashboardIndicator->getDasIndUid() .") ");
|
||||||
return $dashboardIndicator->getDasIndUid();
|
return $dashboardIndicator->getDasIndUid();
|
||||||
} else {
|
} else {
|
||||||
@@ -175,7 +178,7 @@ class DashboardIndicator extends BaseDashboardIndicator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function remove($dasIndUid)
|
public function remove($dasIndUid, $userLogged ='')
|
||||||
{
|
{
|
||||||
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
@@ -186,7 +189,10 @@ class DashboardIndicator extends BaseDashboardIndicator
|
|||||||
$result = $dashboardIndicator->delete();
|
$result = $dashboardIndicator->delete();
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
|
|
||||||
G::auditLog("DeletedashboardIndicator", "Dashboard Indicator Name: ". $dashboardIndicatorData['DAS_IND_TITLE']." Dashboard Instance ID: (".$dasIndUid.") ");
|
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && $userLogged != '') {
|
||||||
|
$this->setUser($userLogged);
|
||||||
|
}
|
||||||
|
G::auditLog("Delete", "Dashboard Indicator Name: ". $dashboardIndicatorData['DAS_IND_TITLE']." Dashboard Instance ID: (".$dasIndUid.") ");
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('Error trying to delete: The row "' . $dasIndUid. '" does not exist.');
|
throw new Exception('Error trying to delete: The row "' . $dasIndUid. '" does not exist.');
|
||||||
@@ -196,5 +202,12 @@ class DashboardIndicator extends BaseDashboardIndicator
|
|||||||
throw $error;
|
throw $error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUser($usrId) {
|
||||||
|
$user = new Users ();
|
||||||
|
$user = $user->loadDetails($usrId);
|
||||||
|
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
|
||||||
|
$_SESSION['USR_FULLNAME'] = $user['USR_FULLNAME'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ ViewDashboardHelper.prototype.fillSelectWithOptions = function ($select, options
|
|||||||
|
|
||||||
ViewDashboardHelper.prototype.setVisibility = function ($element, isVisible) {
|
ViewDashboardHelper.prototype.setVisibility = function ($element, isVisible) {
|
||||||
$element.css('visibility', (isVisible ? 'visible' : 'hidden'));
|
$element.css('visibility', (isVisible ? 'visible' : 'hidden'));
|
||||||
|
$element.css('display', (isVisible ? 'inline' : 'none'));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewDashboardHelper.prototype.truncateString = function (string, len) {
|
ViewDashboardHelper.prototype.truncateString = function (string, len) {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
var ViewDashboardModel = function (oauthToken, server, workspace) {
|
var ViewDashboardModel = function (oauthToken, server, workspace, moneySymbol) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.workspace = workspace;
|
this.workspace = workspace;
|
||||||
this.baseUrl = "/api/1.0/" + workspace + "/";
|
this.baseUrl = "/api/1.0/" + workspace + "/";
|
||||||
//this.baseUrl = "http://127.0.0.1:8080/api/1.0/workflow/";
|
//this.baseUrl = "http://127.0.0.1:8080/api/1.0/workflow/";
|
||||||
this.oauthToken = oauthToken;
|
this.oauthToken = oauthToken;
|
||||||
this.helper = new ViewDashboardHelper();
|
this.helper = new ViewDashboardHelper();
|
||||||
|
this.moneySymbol = moneySymbol;
|
||||||
};
|
};
|
||||||
|
|
||||||
ViewDashboardModel.prototype.userDashboards = function(userId) {
|
ViewDashboardModel.prototype.userDashboards = function(userId) {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
var ViewDashboardPresenter = function (model) {
|
var ViewDashboardPresenter = function (model) {
|
||||||
this.helper = new ViewDashboardHelper();
|
this.helper = new ViewDashboardHelper();
|
||||||
this.helper.assert(model != null, "A model must be passed for the presenter work.")
|
this.helper.assert(model != null, "A model must be passed for the presenter work.")
|
||||||
@@ -40,7 +38,6 @@ ViewDashboardPresenter.prototype.userDashboardsViewModel = function(data) {
|
|||||||
if (!hasFavorite && returnList.length > 0 ) {
|
if (!hasFavorite && returnList.length > 0 ) {
|
||||||
returnList[0].isFavorite = 1;
|
returnList[0].isFavorite = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnList;
|
return returnList;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -263,6 +260,8 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) {
|
|||||||
"inefficiencyCost" : "value"
|
"inefficiencyCost" : "value"
|
||||||
};
|
};
|
||||||
var newObject = that.helper.merge(originalObject, {}, map);
|
var newObject = that.helper.merge(originalObject, {}, map);
|
||||||
|
//the values do not come with a minus and moneny symbol, so we add them
|
||||||
|
newObject.valuePrefix = that.model.moneySymbol + " -";
|
||||||
graphData.push(newObject);
|
graphData.push(newObject);
|
||||||
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
||||||
//rounded to 1 decimal
|
//rounded to 1 decimal
|
||||||
@@ -294,6 +293,7 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) {
|
|||||||
"deviationTime" : "dispersion"
|
"deviationTime" : "dispersion"
|
||||||
};
|
};
|
||||||
var newObject = that.helper.merge(originalObject, {}, map);
|
var newObject = that.helper.merge(originalObject, {}, map);
|
||||||
|
newObject.valuePrefix = that.model.moneySymbol + " -";
|
||||||
graphData.push(newObject);
|
graphData.push(newObject);
|
||||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost * 10)/10;
|
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost * 10)/10;
|
||||||
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
||||||
@@ -429,6 +429,7 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelPei = function(modelD
|
|||||||
"deviationTime" : "dispersion"
|
"deviationTime" : "dispersion"
|
||||||
};
|
};
|
||||||
var newObject = that.helper.merge(originalObject, {}, map);
|
var newObject = that.helper.merge(originalObject, {}, map);
|
||||||
|
newObject.valuePrefix = that.model.moneySymbol + " -";
|
||||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost * 10) / 10;
|
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost * 10) / 10;
|
||||||
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
||||||
originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime);
|
originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime);
|
||||||
@@ -456,6 +457,7 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelUei = function(modelD
|
|||||||
"deviationTime" : "dispersion"
|
"deviationTime" : "dispersion"
|
||||||
};
|
};
|
||||||
var newObject = that.helper.merge(originalObject, {}, map);
|
var newObject = that.helper.merge(originalObject, {}, map);
|
||||||
|
newObject.valuePrefix = that.model.moneySymbol + " -";
|
||||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost * 10) / 10;
|
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost * 10) / 10;
|
||||||
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
originalObject.efficiencyIndexToShow = that.roundedIndicatorValue(originalObject.efficiencyIndex);
|
||||||
originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime);
|
originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime);
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ WidgetBuilder.prototype.setColorForInefficiency = function ($widget, indicatorDa
|
|||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
helper = new ViewDashboardHelper();
|
helper = new ViewDashboardHelper();
|
||||||
var ws = urlProxy.split('/');
|
var ws = urlProxy.split('/');
|
||||||
model = new ViewDashboardModel(token, urlProxy, ws[3]);
|
model = new ViewDashboardModel(token, urlProxy, ws[3], moneyUnit);
|
||||||
presenter = new ViewDashboardPresenter(model);
|
presenter = new ViewDashboardPresenter(model);
|
||||||
|
|
||||||
window.loadedIndicators = []; //updated in das-title-selector.click->fillIndicatorWidgets, ready->fillIndicatorWidgets
|
window.loadedIndicators = []; //updated in das-title-selector.click->fillIndicatorWidgets, ready->fillIndicatorWidgets
|
||||||
@@ -467,7 +467,7 @@ var setActiveDashboard = function () {
|
|||||||
if (dashboard == null) {
|
if (dashboard == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$('#titleH4').text(dashboard.title);
|
$('#titleH4').html(dashboard.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
var initialDraw = function () {
|
var initialDraw = function () {
|
||||||
@@ -476,9 +476,6 @@ var initialDraw = function () {
|
|||||||
.then(function(dashboardsVM) {
|
.then(function(dashboardsVM) {
|
||||||
fillDashboardsList(dashboardsVM);
|
fillDashboardsList(dashboardsVM);
|
||||||
if (window.currentDashboardId == null) {return;}
|
if (window.currentDashboardId == null) {return;}
|
||||||
|
|
||||||
console.log(tsPresenter);
|
|
||||||
console.log(window.currentDashboardId);
|
|
||||||
tsPresenter.initializePresenter(window.currentDashboardId)
|
tsPresenter.initializePresenter(window.currentDashboardId)
|
||||||
.done(function (data){
|
.done(function (data){
|
||||||
bindTimeSeriesLists(tsPresenter);
|
bindTimeSeriesLists(tsPresenter);
|
||||||
@@ -564,7 +561,7 @@ var defaultEndDate = function () {
|
|||||||
var fillDashboardsList = function (presenterData) {
|
var fillDashboardsList = function (presenterData) {
|
||||||
if (presenterData == null || presenterData.length == 0) {
|
if (presenterData == null || presenterData.length == 0) {
|
||||||
$('#dashboardMessage').text(G_STRING['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE']);
|
$('#dashboardMessage').text(G_STRING['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE']);
|
||||||
$('#titleH4').text(G_STRING['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE']);
|
$('#titleH4').html(G_STRING['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE']);
|
||||||
$('#compareIndicators').hide();
|
$('#compareIndicators').hide();
|
||||||
}
|
}
|
||||||
_.templateSettings.variable = "dashboard";
|
_.templateSettings.variable = "dashboard";
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ SELECT
|
|||||||
ACV.USR_UID,
|
ACV.USR_UID,
|
||||||
ACV.TAS_UID,
|
ACV.TAS_UID,
|
||||||
ACV.PRO_UID,
|
ACV.PRO_UID,
|
||||||
DATE_FORMAT(ACV.DEL_INIT_DATE, '%m') AS `MONTH`,
|
DATE_FORMAT(ACV.DEL_DELEGATE_DATE, '%m') AS `MONTH`,
|
||||||
DATE_FORMAT(ACV.DEL_INIT_DATE, '%Y') AS `YEAR`,
|
DATE_FORMAT(ACV.DEL_DELEGATE_DATE, '%Y') AS `YEAR`,
|
||||||
SUM(ACV.DEL_QUEUE_DURATION*24) AS TOTAL_QUEUE_TIME_BY_TASK,
|
SUM(ACV.DEL_QUEUE_DURATION*24) AS TOTAL_QUEUE_TIME_BY_TASK,
|
||||||
SUM(ACV.DEL_DURATION*24) AS TOT_TIME_BY_TASK,
|
SUM(ACV.DEL_DURATION*24) AS TOT_TIME_BY_TASK,
|
||||||
COUNT(ACV.DEL_INIT_DATE) AS TOT_CASES_IN,
|
COUNT(ACV.DEL_DELEGATE_DATE) AS TOT_CASES_IN,
|
||||||
COUNT(ACV.DEL_FINISH_DATE) AS TOT_CASES_OUT,
|
COUNT(ACV.DEL_FINISH_DATE) AS TOT_CASES_OUT,
|
||||||
NULL,
|
NULL,
|
||||||
AVG(DEL_DURATION*24) AS `AVG_TIME`,
|
AVG(DEL_DURATION*24) AS `AVG_TIME`,
|
||||||
@@ -47,9 +47,9 @@ SELECT
|
|||||||
FROM
|
FROM
|
||||||
APP_CACHE_VIEW AS ACV
|
APP_CACHE_VIEW AS ACV
|
||||||
WHERE
|
WHERE
|
||||||
(ACV.DEL_INIT_DATE BETWEEN CAST(@INIT_DATE AS DATETIME) AND CAST(@FINISH_DATE AS DATETIME))
|
(ACV.DEL_DELEGATE_DATE BETWEEN CAST(@INIT_DATE AS DATETIME) AND CAST(@FINISH_DATE AS DATETIME))
|
||||||
AND ACV.DEL_INIT_DATE IS NOT NULL
|
AND ACV.DEL_DELEGATE_DATE IS NOT NULL
|
||||||
GROUP BY ACV.USR_UID , ACV.TAS_UID, DATE_FORMAT( ACV.DEL_INIT_DATE, '%m' ) , DATE_FORMAT( ACV.DEL_INIT_DATE, '%Y' ) ;
|
GROUP BY ACV.USR_UID , ACV.TAS_UID, DATE_FORMAT( ACV.DEL_DELEGATE_DATE, '%m' ) , DATE_FORMAT( ACV.DEL_DELEGATE_DATE, '%Y' ) ;
|
||||||
|
|
||||||
DELETE USR_REPORTING
|
DELETE USR_REPORTING
|
||||||
FROM USR_REPORTING
|
FROM USR_REPORTING
|
||||||
|
|||||||
@@ -294,15 +294,16 @@ class Dashboard {
|
|||||||
* Delete Dashboard
|
* Delete Dashboard
|
||||||
*
|
*
|
||||||
* @param string $das_uid Unique id
|
* @param string $das_uid Unique id
|
||||||
|
* @param string $usr_uid
|
||||||
*
|
*
|
||||||
* return void
|
* return void
|
||||||
*
|
*
|
||||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||||
*/
|
*/
|
||||||
public function deletedashboard($das_uid)
|
public function deletedashboard($das_uid, $usr_uid)
|
||||||
{
|
{
|
||||||
$dashboard = new \Dashboard();
|
$dashboard = new \Dashboard();
|
||||||
$response = $dashboard->remove($das_uid);
|
$response = $dashboard->remove($das_uid, $usr_uid);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,16 +327,17 @@ class Dashboard {
|
|||||||
* Delete Dashboard owner
|
* Delete Dashboard owner
|
||||||
*
|
*
|
||||||
* @param string $das_uid
|
* @param string $das_uid
|
||||||
* @param string $owner_uid
|
* @param string $owner_uid
|
||||||
|
* * @param string $usr_uid
|
||||||
*
|
*
|
||||||
* return void
|
* return void
|
||||||
*
|
*
|
||||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||||
*/
|
*/
|
||||||
public function deleteDashboardOwner($das_uid, $owner_uid)
|
public function deleteDashboardOwner($das_uid, $owner_uid, $usr_uid)
|
||||||
{
|
{
|
||||||
$dashboard = new \DashboardDasInd();
|
$dashboard = new \DashboardDasInd();
|
||||||
$response = $dashboard->remove($das_uid, $owner_uid);
|
$response = $dashboard->remove($das_uid, $owner_uid, $usr_uid);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,15 +361,16 @@ class Dashboard {
|
|||||||
* Delete Indicator
|
* Delete Indicator
|
||||||
*
|
*
|
||||||
* @param string $das_ind_uid Unique id
|
* @param string $das_ind_uid Unique id
|
||||||
|
* @param string $usr_uid
|
||||||
*
|
*
|
||||||
* return void
|
* return void
|
||||||
*
|
*
|
||||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||||
*/
|
*/
|
||||||
public function delete($das_ind_uid)
|
public function delete($das_ind_uid, $usr_uid)
|
||||||
{
|
{
|
||||||
$dashboard = new \DashboardIndicator();
|
$dashboard = new \DashboardIndicator();
|
||||||
$response = $dashboard->remove($das_ind_uid);
|
$response = $dashboard->remove($das_ind_uid, $usr_uid);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
|
$request_data['USR_UID'] = $this->getUserId();
|
||||||
$response = $dashboard->createDashboard($request_data);
|
$response = $dashboard->createDashboard($request_data);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -260,6 +261,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
|
$request_data['USR_UID'] = $this->getUserId();
|
||||||
$response = $dashboard->createDashboard($request_data);
|
$response = $dashboard->createDashboard($request_data);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -279,7 +281,8 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
$response = $dashboard->deletedashboard($das_uid);
|
$request_data['USR_UID'] = $this->getUserId();
|
||||||
|
$response = $dashboard->deletedashboard($das_uid, $this->getUserId());
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
@@ -300,6 +303,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
|
$request_data['USR_UID'] = $this->getUserId();
|
||||||
$response = $dashboard->createOwner($request_data);
|
$response = $dashboard->createOwner($request_data);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -320,7 +324,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
$response = $dashboard->deleteDashboardOwner($das_uid, $owner_uid);
|
$response = $dashboard->deleteDashboardOwner($das_uid, $owner_uid, $this->getUserId());
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
@@ -341,6 +345,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
|
$request_data['USR_UID'] = $this->getUserId();
|
||||||
$response = $dashboard->createIndicator($request_data);
|
$response = $dashboard->createIndicator($request_data);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -363,6 +368,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
|
$request_data['USR_UID'] = $this->getUserId();
|
||||||
$response = $dashboard->createIndicator($request_data);
|
$response = $dashboard->createIndicator($request_data);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -382,7 +388,7 @@ class Dashboard extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||||
$response = $dashboard->delete($ind_uid);
|
$response = $dashboard->delete($ind_uid, $this->getUserId());
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
|
|||||||
@@ -54,11 +54,11 @@
|
|||||||
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">
|
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">
|
||||||
<div class="panel-heading" >
|
<div class="panel-heading" >
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-3" data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_IND_VALUE"}>
|
<div class="col-xs-3" data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_IND_VALUE'}">
|
||||||
<div class="huge ind-value-selector"><%- indicator.value %></div>
|
<div class="huge ind-value-selector"><%- indicator.value %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-9 text-right"><i class="ind-symbol-selector fa fa-arrow-up fa-3x" data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_SYMBOL_SELECTOR"}></i>
|
<div class="col-xs-9 text-right"><i class="ind-symbol-selector fa fa-arrow-up fa-3x" data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_SYMBOL_SELECTOR'}"></i>
|
||||||
<div class="small ind-comparative-selector" data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_IND_COMPARE"}>
|
<div class="small ind-comparative-selector" data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_IND_COMPARE'}">
|
||||||
<%- indicator.comparative %> <%- indicator.percentComparative %>
|
<%- indicator.comparative %> <%- indicator.percentComparative %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
data-indicator-id="<%- indicator.id %>"
|
data-indicator-id="<%- indicator.id %>"
|
||||||
data-indicator-type="<%- indicator.type %>"
|
data-indicator-type="<%- indicator.type %>"
|
||||||
data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2"
|
data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2"
|
||||||
data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_INBOX_STATUS"}>
|
data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_INBOX_STATUS'}">
|
||||||
<div class="ind-container-selector panel grid-stack-item-content panel-status" style="min-width:200px;">
|
<div class="ind-container-selector panel grid-stack-item-content panel-status" style="min-width:200px;">
|
||||||
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">
|
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">
|
||||||
<div class="panel-heading status-indicator-low"
|
<div class="panel-heading status-indicator-low"
|
||||||
@@ -159,10 +159,10 @@
|
|||||||
|
|
||||||
<div class="text-center huge">
|
<div class="text-center huge">
|
||||||
<div class="col-xs-3 vcenter">
|
<div class="col-xs-3 vcenter">
|
||||||
<div class="blue" data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_IND_EFFICIENCY"}><%- indicator.efficiencyIndexToShow %></div>
|
<div class="blue" data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_IND_EFFICIENCY'}"><%- indicator.efficiencyIndexToShow %></div>
|
||||||
<div class="small grey sind-index-selector ellipsis"></div>
|
<div class="small grey sind-index-selector ellipsis"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3 vcenter" style="margin-right:40px" data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_IND_COST"}>
|
<div class="col-xs-3 vcenter" style="margin-right:40px" data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_IND_COST'}">
|
||||||
<div class="red sind-cost-number-selector">{$unitCost} <%- indicator.inefficiencyCostToShow %></div>
|
<div class="red sind-cost-number-selector">{$unitCost} <%- indicator.inefficiencyCostToShow %></div>
|
||||||
<div class="small grey sind-cost-selector ellipsis"></div>
|
<div class="small grey sind-cost-selector ellipsis"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -196,11 +196,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="text-center huge">
|
<div class="text-center huge">
|
||||||
<div class="col-xs-12 vcenter-task">
|
<div class="col-xs-12 vcenter-task">
|
||||||
<div class="col-xs-6 " data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_IND_EFFICIENCY"}>
|
<div class="col-xs-6 " data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_IND_EFFICIENCY'}">
|
||||||
<div class="blue small"><%- detailData.efficiencyIndexToShow%></div>
|
<div class="blue small"><%- detailData.efficiencyIndexToShow%></div>
|
||||||
<div class="smallB grey detail-efficiency-selector ellipsis"></div>
|
<div class="smallB grey detail-efficiency-selector ellipsis"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6" data-toggle="tooltip" data-original-title={translate label="ID_DASH_HELP_IND_COST"}>
|
<div class="col-xs-6" data-toggle="tooltip" data-original-title="{translate label='ID_DASH_HELP_IND_COST'}">
|
||||||
<div class="small detail-cost-number-selector">{$unitCost} <%- detailData.inefficiencyCostToShow%></div>
|
<div class="small detail-cost-number-selector">{$unitCost} <%- detailData.inefficiencyCostToShow%></div>
|
||||||
<div class="smallB grey detail-cost-selector ellipsis"></div>
|
<div class="smallB grey detail-cost-selector ellipsis"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user