Merged in marcoAntonioNina/processmaker/dashboards2 (pull request #2325)
Add link home inbox
This commit is contained in:
@@ -324,6 +324,7 @@ class ListInbox extends BaseListInbox
|
|||||||
$category = isset($filters['category']) ? $filters['category'] : "";
|
$category = isset($filters['category']) ? $filters['category'] : "";
|
||||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : "";
|
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : "";
|
||||||
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : "";
|
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : "";
|
||||||
|
$filterStatus = isset($filters['filterStatus']) ? $filters['filterStatus'] : "";
|
||||||
|
|
||||||
if ($filter != '') {
|
if ($filter != '') {
|
||||||
switch ($filter) {
|
switch ($filter) {
|
||||||
@@ -379,6 +380,21 @@ class ListInbox extends BaseListInbox
|
|||||||
|
|
||||||
$criteria->add( ListInboxPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
$criteria->add( ListInboxPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($filterStatus != '') {
|
||||||
|
switch ($filterStatus) {
|
||||||
|
case 'ON_TIME':
|
||||||
|
$criteria->add( ListInboxPeer::DEL_RISK_DATE , "TIMEDIFF(". ListInboxPeer::DEL_RISK_DATE." , NOW( ) ) > 0", Criteria::CUSTOM);
|
||||||
|
break;
|
||||||
|
case 'AT_RISK':
|
||||||
|
$criteria->add( ListInboxPeer::DEL_RISK_DATE , "TIMEDIFF(". ListInboxPeer::DEL_RISK_DATE .", NOW( ) ) < 0", Criteria::CUSTOM);
|
||||||
|
$criteria->add( ListInboxPeer::DEL_DUE_DATE , "TIMEDIFF(". ListInboxPeer::DEL_DUE_DATE .", NOW( ) ) > 0", Criteria::CUSTOM);
|
||||||
|
break;
|
||||||
|
case 'OVERDUE':
|
||||||
|
$criteria->add( ListInboxPeer::DEL_DUE_DATE , "TIMEDIFF(". ListInboxPeer::DEL_DUE_DATE." , NOW( ) ) < 0", Criteria::CUSTOM);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countTotal ($usr_uid, $filters = array())
|
public function countTotal ($usr_uid, $filters = array())
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ class StrategicDashboard extends Controller
|
|||||||
$this->setView( 'strategicDashboard/viewDashboard' );
|
$this->setView( 'strategicDashboard/viewDashboard' );
|
||||||
|
|
||||||
$this->setVar('urlProxy', $this->urlProxy);
|
$this->setVar('urlProxy', $this->urlProxy);
|
||||||
|
$this->setVar('SYS_SYS', SYS_SYS);
|
||||||
$this->setVar('usrId', $this->usrId);
|
$this->setVar('usrId', $this->usrId);
|
||||||
$this->setVar('credentials', $this->clientToken);
|
$this->setVar('credentials', $this->clientToken);
|
||||||
$this->setVar('unitCost', $this->usrUnitCost);
|
$this->setVar('unitCost', $this->usrUnitCost);
|
||||||
|
|||||||
@@ -54,8 +54,9 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var bindTimeSeriesLists = function (presenter, elementsToConserve = []) {
|
var bindTimeSeriesLists = function (presenter, elementsToConserve) {
|
||||||
var conserveStates =[];
|
var conserveStates =[];
|
||||||
|
elementsToConserve =[];
|
||||||
$.each (elementsToConserve, function (i, elem){
|
$.each (elementsToConserve, function (i, elem){
|
||||||
conserveStates.push({id:elem, selValue: $('#' + elem).val()});
|
conserveStates.push({id:elem, selValue: $('#' + elem).val()});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -376,6 +376,18 @@ $(document).ready(function() {
|
|||||||
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
|
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#indicatorsGridStack').on('click','.status-indicator-low', function() {
|
||||||
|
locationCases('OVERDUE');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#indicatorsGridStack').on('click','.status-indicator-medium', function() {
|
||||||
|
locationCases('AT_RISK');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#indicatorsGridStack').on('click','.status-indicator-high', function() {
|
||||||
|
locationCases('ON_TIME');
|
||||||
|
});
|
||||||
|
|
||||||
$('body').on('click','.bread-back-selector', function() {
|
$('body').on('click','.bread-back-selector', function() {
|
||||||
var indicatorId = window.currentIndicator.id;
|
var indicatorId = window.currentIndicator.id;
|
||||||
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
|
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
|
||||||
@@ -1001,6 +1013,28 @@ var animateProgress = function (indicatorItem, widget){
|
|||||||
fpAnimationFrame(animacion);
|
fpAnimationFrame(animacion);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var createCookie = function (name, value, time) {
|
||||||
|
if (time) {
|
||||||
|
var date = new Date();
|
||||||
|
date.setTime(date.getTime()+(time*24*60*60*1000));
|
||||||
|
var expires = "; expires="+date.toUTCString();
|
||||||
|
} else {
|
||||||
|
var expires = "";
|
||||||
|
}
|
||||||
|
document.cookie = name+"="+value+expires+"; path=/sys"+workspace;
|
||||||
|
};
|
||||||
|
|
||||||
|
var locationCases = function (type) {
|
||||||
|
createCookie("dashboardListInbox", type, 1);
|
||||||
|
|
||||||
|
var currentLocation = location.href;
|
||||||
|
var position = currentLocation.lastIndexOf('/', currentLocation.lastIndexOf('/') - 1);
|
||||||
|
currentLocation = currentLocation.substring(0, position+1);
|
||||||
|
currentLocation = currentLocation + 'cases/main';
|
||||||
|
|
||||||
|
parent.location.href = currentLocation;
|
||||||
|
};
|
||||||
|
|
||||||
/*var dashboardButtonTemplate = ' <div class="btn-group pull-left"> \
|
/*var dashboardButtonTemplate = ' <div class="btn-group pull-left"> \
|
||||||
<button id="favorite" type="button" class="btn btn-success"><i class="fa fa-star fa-1x"></i></button> \
|
<button id="favorite" type="button" class="btn btn-success"><i class="fa fa-star fa-1x"></i></button> \
|
||||||
<button id="dasB" type="button" class="btn btn-success">'+ G_STRING.ID_MANAGERS_DASHBOARDS +'</button> \
|
<button id="dasB" type="button" class="btn btn-success">'+ G_STRING.ID_MANAGERS_DASHBOARDS +'</button> \
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ unset($_SESSION['APPLICATION']);
|
|||||||
//get the action from GET or POST, default is todo
|
//get the action from GET or POST, default is todo
|
||||||
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
|
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
|
||||||
|
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
$filterAction = isset( $_GET['filterAction'] ) ? $_GET['filterAction'] : (isset( $_POST['filterAction'] ) ? $_POST['filterAction'] : '');
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
//fix a previous inconsistency
|
//fix a previous inconsistency
|
||||||
$urlProxy = 'proxyCasesList';
|
$urlProxy = 'proxyCasesList';
|
||||||
if ($action == 'selfservice') {
|
if ($action == 'selfservice') {
|
||||||
@@ -179,6 +183,28 @@ $oHeadPublisher->assign( 'allUsersValues', $allUsers ); //Sending the listing of
|
|||||||
$oHeadPublisher->assign( 'solrEnabled', $solrEnabled ); //Sending the status of solar
|
$oHeadPublisher->assign( 'solrEnabled', $solrEnabled ); //Sending the status of solar
|
||||||
$oHeadPublisher->assign( 'enableEnterprise', $enableEnterprise ); //sending the page size
|
$oHeadPublisher->assign( 'enableEnterprise', $enableEnterprise ); //sending the page size
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||||
|
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') ) {
|
||||||
|
$filterStatus[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||||
|
$filterStatus[] = array('ON_TIME', G::LoadTranslation('ID_ON_TIME'));
|
||||||
|
$filterStatus[] = array('AT_RISK', G::LoadTranslation('ID_AT_RISK'));
|
||||||
|
$filterStatus[] = array('OVERDUE', G::LoadTranslation('ID_TASK_OVERDUE'));
|
||||||
|
|
||||||
|
$oHeadPublisher->assign('filterStatus', $filterStatus);
|
||||||
|
|
||||||
|
if (isset($_COOKIE['dashboardListInbox'])) {
|
||||||
|
$oHeadPublisher->assign('valueFilterStatus', $_COOKIE['dashboardListInbox']);
|
||||||
|
if (PHP_VERSION < 5.2) {
|
||||||
|
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
|
||||||
|
} else {
|
||||||
|
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
//menu permissions
|
//menu permissions
|
||||||
/*$c = new Criteria('workflow');
|
/*$c = new Criteria('workflow');
|
||||||
$c->clearSelectColumns();
|
$c->clearSelectColumns();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ try {
|
|||||||
|
|
||||||
$filters['action'] = isset( $_REQUEST["action"] ) ? $_REQUEST["action"] : "";
|
$filters['action'] = isset( $_REQUEST["action"] ) ? $_REQUEST["action"] : "";
|
||||||
$listName = isset( $_REQUEST["list"] ) ? $_REQUEST["list"] : "inbox";
|
$listName = isset( $_REQUEST["list"] ) ? $_REQUEST["list"] : "inbox";
|
||||||
|
$filters['filterStatus'] = isset( $_REQUEST["filterStatus"] ) ? $_REQUEST["filterStatus"] : "";
|
||||||
|
|
||||||
// Select list
|
// Select list
|
||||||
switch ($listName) {
|
switch ($listName) {
|
||||||
@@ -155,6 +156,7 @@ try {
|
|||||||
$filtersData['date_from'] = $filters['dateFrom'];
|
$filtersData['date_from'] = $filters['dateFrom'];
|
||||||
$filtersData['date_to'] = $filters['dateTo'];
|
$filtersData['date_to'] = $filters['dateTo'];
|
||||||
$filtersData["action"] = $filters["action"];
|
$filtersData["action"] = $filters["action"];
|
||||||
|
$filtersData["filterStatus"] = $filters['filterStatus'];
|
||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
$response['filters'] = $filtersData;
|
$response['filters'] = $filtersData;
|
||||||
|
|||||||
@@ -836,6 +836,13 @@ Ext.onReady ( function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Layout Resizing
|
//Layout Resizing
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
if (typeof valueFilterStatus != 'undefined') {
|
||||||
|
if (valueFilterStatus != '') {
|
||||||
|
storeCases.setBaseParam('filterStatus', valueFilterStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
storeCases.on('load',function(){var viewport = Ext.getCmp("viewportcases");viewport.doLayout();})
|
storeCases.on('load',function(){var viewport = Ext.getCmp("viewportcases");viewport.doLayout();})
|
||||||
|
|
||||||
// create the Data Store for processes
|
// create the Data Store for processes
|
||||||
@@ -1050,6 +1057,40 @@ Ext.onReady ( function() {
|
|||||||
iconCls: 'no-icon'
|
iconCls: 'no-icon'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
var comboFilterStatus = new Ext.form.ComboBox({
|
||||||
|
width : 180,
|
||||||
|
boxMaxWidth : 200,
|
||||||
|
editable : false,
|
||||||
|
displayField : 'NAME',
|
||||||
|
valueField : 'UID',
|
||||||
|
forceSelection : false,
|
||||||
|
emptyText : _('ID_SELECT_STATUS'),
|
||||||
|
selectOnFocus : true,
|
||||||
|
typeAhead : true,
|
||||||
|
mode : 'local',
|
||||||
|
autocomplete : true,
|
||||||
|
triggerAction : 'all',
|
||||||
|
store : new Ext.data.ArrayStore({
|
||||||
|
fields : ['UID','NAME'],
|
||||||
|
data : filterStatus
|
||||||
|
}),
|
||||||
|
listeners:{
|
||||||
|
scope: this,
|
||||||
|
'select': function() {
|
||||||
|
var filter = comboFilterStatus.value;
|
||||||
|
if ( action == 'search' ){
|
||||||
|
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
||||||
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
||||||
|
}
|
||||||
|
storeCases.setBaseParam('filterStatus', filter);
|
||||||
|
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
iconCls: 'no-icon'
|
||||||
|
});
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
var btnSelectAll = new Ext.Button ({
|
var btnSelectAll = new Ext.Button ({
|
||||||
text: _('CHECK_ALL'),
|
text: _('CHECK_ALL'),
|
||||||
// text: 'Check All',
|
// text: 'Check All',
|
||||||
@@ -1664,6 +1705,8 @@ Ext.onReady ( function() {
|
|||||||
'-',
|
'-',
|
||||||
btnAll,
|
btnAll,
|
||||||
'->', // begin using the right-justified button container
|
'->', // begin using the right-justified button container
|
||||||
|
_('ID_OVERDUE'),
|
||||||
|
comboFilterStatus,
|
||||||
_("ID_CATEGORY"),
|
_("ID_CATEGORY"),
|
||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
@@ -2002,7 +2045,7 @@ Ext.onReady ( function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var gridForm = new Ext.FormPanel({
|
var gridForm = new Ext.FormPanel({
|
||||||
id: 'reassign-form',
|
id: 'reassign-form',
|
||||||
frame: true,
|
frame: true,
|
||||||
labelAlign: 'left',
|
labelAlign: 'left',
|
||||||
@@ -2267,12 +2310,17 @@ var gridForm = new Ext.FormPanel({
|
|||||||
comboCategory.setValue("");
|
comboCategory.setValue("");
|
||||||
comboProcess.setValue("");
|
comboProcess.setValue("");
|
||||||
comboStatus.setValue("");
|
comboStatus.setValue("");
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
if (typeof valueFilterStatus != 'undefined') {
|
||||||
|
comboFilterStatus.setValue(valueFilterStatus);
|
||||||
|
}
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
if(typeof(comboUser) != 'undefined'){
|
if(typeof(comboUser) != 'undefined'){
|
||||||
comboUser.setValue("");
|
comboUser.setValue("");
|
||||||
}
|
}
|
||||||
comboAllUsers.setValue("CURRENT_USER");
|
comboAllUsers.setValue("CURRENT_USER");
|
||||||
|
|
||||||
function reassign(){
|
function reassign(){
|
||||||
storeReassignCases.removeAll();
|
storeReassignCases.removeAll();
|
||||||
var rows = grid.getSelectionModel().getSelections();
|
var rows = grid.getSelectionModel().getSelections();
|
||||||
storeReassignCases.rejectChanges();
|
storeReassignCases.rejectChanges();
|
||||||
@@ -2345,18 +2393,18 @@ function reassign(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function inArray(arr, obj) {
|
function inArray(arr, obj) {
|
||||||
for(var i=0; i<arr.length; i++) {
|
for(var i=0; i<arr.length; i++) {
|
||||||
if (arr[i] == obj) return true;
|
if (arr[i] == obj) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add the additional 'advanced' VTypes -- [Begin]
|
// Add the additional 'advanced' VTypes -- [Begin]
|
||||||
Ext.apply(Ext.form.VTypes, {
|
Ext.apply(Ext.form.VTypes, {
|
||||||
daterange : function(val, field) {
|
daterange : function(val, field) {
|
||||||
var date = field.parseDate(val);
|
var date = field.parseDate(val);
|
||||||
|
|
||||||
@@ -2381,7 +2429,7 @@ Ext.apply(Ext.form.VTypes, {
|
|||||||
*/
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Add the additional 'advanced' VTypes -- [End]
|
// Add the additional 'advanced' VTypes -- [End]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<script type="text/javascript" src="/js/pmchart/pmCharts.js"></script>
|
<script type="text/javascript" src="/js/pmchart/pmCharts.js"></script>
|
||||||
<script type="text/javascript" >
|
<script type="text/javascript" >
|
||||||
var urlProxy = '{$urlProxy}';
|
var urlProxy = '{$urlProxy}';
|
||||||
|
var workspace = '{$SYS_SYS}';
|
||||||
var pageUserId = '{$usrId}';
|
var pageUserId = '{$usrId}';
|
||||||
var token = '{$credentials.access_token}';
|
var token = '{$credentials.access_token}';
|
||||||
var moneyUnit = '{$unitCost}';
|
var moneyUnit = '{$unitCost}';
|
||||||
|
|||||||
Reference in New Issue
Block a user