Merge remote-tracking branch 'upstream/dashboards2' into dashboards2

This commit is contained in:
Marco Antonio Nina Mena
2015-05-29 14:39:21 -04:00
6 changed files with 352 additions and 462 deletions

View File

@@ -550,14 +550,6 @@ class indicatorsCalculator
$response = array();
$result = $this->statusIndicatorGeneral($usrUid);
$list = new \ListInbox();
$filters = array();
$filters['sort'] = "LIST_INBOX.APP_UPDATE_DATE";
$filters['dir'] = "ASC";
$filters['action'] = "to_do";
$filters['paged'] = 0;
$response['data'] = $list->loadList($usrUid, $filters);
$response['overdue'] = 0;
$response['atRisk'] = 0;
$response['onTime'] = 0;

View File

@@ -197,7 +197,6 @@ class StrategicDashboard extends Controller
$translation['ID_TIME_HOURS'] = G::LoadTranslation( 'ID_TIME_HOURS');
$translation['ID_GROUPS'] = G::LoadTranslation( 'ID_GROUPS');
$translation['ID_COSTS'] = G::LoadTranslation( 'ID_COSTS');
$translation['ID_PROCESS'] = G::LoadTranslation( 'ID_PROCESS');
$translation['ID_TASK'] = G::LoadTranslation( 'ID_TASK');
$translation['ID_USER'] = G::LoadTranslation( 'ID_USER');
$translation['ID_YEAR'] = G::LoadTranslation( 'ID_YEAR');

View File

@@ -108,10 +108,6 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) {
: newObject.percentComparative;
newObject.value = that.roundedIndicatorValue(newObject.value);
//we don't use the database values to avoid rounding differences
newObject.oldValue = newObject.value - newObject.comparative
newObject.favorite = 0;
that.setStatusButtonWidthsAndDisplayValues(newObject);

View File

@@ -27,18 +27,18 @@ WidgetBuilder.prototype.buildSpecialIndicatorButton = function (indicator) {
if(indicator.comparative < 0){
$retval.find(".ind-container-selector").removeClass("panel-green").addClass("panel-red");
$retval.find(".ind-symbol-selector").removeClass("fa-arrow-up").addClass("fa-arrow-down");
$retval.find(".ind-symbol-selector").removeClass("fa-chevron-up").addClass("fa-chevron-down");
}
if(indicator.comparative > 0){
$retval.find(".ind-container-selector").removeClass("panel-red").addClass("panel-green");
$retval.find(".ind-symbol-selector").removeClass("fa-arrow-down").addClass("fa-arrow-up");
$retval.find(".ind-symbol-selector").removeClass("fa-chevron-down").addClass("fa-chevron-up");
}
if(indicator.comparative == 0){
$retval.find(".ind-symbol-selector").removeClass("fa-arrow-up");
$retval.find(".ind-symbol-selector").removeClass("fa-arrow-down");
$retval.find(".ind-symbol-selector").addClass("fa-arrows-h");
$retval.find(".ind-symbol-selector").removeClass("fa-chevron-up");
$retval.find(".ind-symbol-selector").removeClass("fa-chevron-down");
$retval.find(".ind-symbol-selector").addClass("fa-circle-o");
$retval.find(".ind-container-selector").removeClass("panel-red").addClass("panel-green");
}
return $retval;
@@ -88,23 +88,15 @@ WidgetBuilder.prototype.buildSpecialIndicatorFirstViewDetail = function (oneItem
//detailData = {indicatorId, uid, name, averateTime...}
if (oneItemDetail == null){throw new Error("oneItemDetail is null ");}
if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);}
if (window.currentIndicator.type != '1050' && !oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);}
if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);}
_.templateSettings.variable = "detailData";
var template = _.template ($("script.specialIndicatorDetail").html());
if (window.currentIndicator.type == '1050') {
template = _.template ($("script.statusInboxDetail").html());
}
var $retval = $(template(oneItemDetail));
$retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX);
$retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST);
if (window.currentIndicator.type == '1050') {
$retval.find(".detail-pro-title").text(G_STRING.ID_PROCESS);
$retval.find(".detail-tas-title").text(G_STRING.ID_TASK);
}
this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail);
return $retval;
_.templateSettings.variable = "detailData";
var template = _.template ($("script.specialIndicatorDetail").html());
var $retval = $(template(oneItemDetail));
$retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX);
$retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST);
this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail);
return $retval;
}
WidgetBuilder.prototype.buildStatusIndicatorFirstView = function (indicatorData) {
@@ -382,7 +374,6 @@ $(document).ready(function() {
$('#indicatorsGridStack').on('click','.ind-button-selector', function() {
var indicatorId = $(this).data('indicator-id');
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
});
$('body').on('click','.bread-back-selector', function() {
@@ -451,15 +442,8 @@ var selectDefaultMonthAndYear = function () {
compareDate.setMonth(compareDate.getMonth() - 1);
var compareMonth = compareDate.getMonth() + 1;
var compareYear = compareDate.getFullYear();
$('#monthInit').val(compareMonth);
$('#yearInit').val(compareYear);
var today = new Date();
var todayMonth = today.getMonth();
var todayYear = today.getFullYear();
$('#month').val(todayMonth + 1);
$('#year').val(todayYear);
$('#month').val(compareMonth);
$('#year').val(compareYear);
}
var setActiveDashboard = function () {
@@ -538,18 +522,15 @@ var defaultInitDate = function() {
var date = new Date();
var dateMonth = date.getMonth();
var dateYear = date.getFullYear();
var retval = $('#yearInit').val() + '-' + $('#monthInit').val() + '-' + '01';
return retval;
var initDate = $('#year').val() + '-' + $('#month').val() + '-' + '01';
return initDate;
}
var defaultEndDate = function () {
/*var date = new Date();
var date = new Date();
var dateMonth = date.getMonth();
var dateYear = date.getFullYear();
return dateYear + "-" + (dateMonth + 1) + "-30";*/
var retval = $('#year').val() + '-' + $('#month').val() + '-' + '01';
return retval;
return dateYear + "-" + (dateMonth + 1) + "-30";
}
var fillDashboardsList = function (presenterData) {
@@ -628,8 +609,7 @@ var fillStatusIndicatorFirstView = function (presenterData) {
var graph3 = new PieChart(presenterData.graph3Data, graphParams3, null, null);
graph3.drawChart();
var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id);
this.fillSpecialIndicatorFirstViewDetail(presenter.orderDataList(presenterData.data, selectedOrderOfDetailList()));
var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id)
setIndicatorActiveMarker();
}
@@ -704,7 +684,7 @@ var fillSpecialIndicatorFirstView = function(presenterData) {
}
};
var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id);
var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id)
if (indicatorPrincipalData.type == "1010") {
var graph = new Pie3DChart(presenterData.dataToDraw, peiParams, null, null);
@@ -731,7 +711,7 @@ var fillSpecialIndicatorFirstViewDetail = function (list) {
var gridDetail = $('#relatedDetailGridStack').data('gridstack');
gridDetail.remove_all();
window.currentDetailList = list;
window.currentDetailList = list;
window.currentDetailFunction = fillSpecialIndicatorFirstViewDetail;
$.each(list, function(index, dataItem) {
@@ -743,20 +723,13 @@ var fillSpecialIndicatorFirstViewDetail = function (list) {
}
gridDetail.add_widget($widget, x, 15, 6, 2, true);
});
var label = '';
switch (window.currentIndicator.type) {
case '1010':
label = G_STRING['ID_RELATED_PROCESS'];
break;
case '1030':
label = G_STRING['ID_RELATED_GROUPS'];
break;
case '1050':
label = G_STRING['ID_RELATED_TASKS'];
break;
}
$('#relatedLabel').find('h3').text(label);
hideScrollIfAllDivsAreVisible();
if (window.currentIndicator.type == "1010") {
$('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_PROCESS']);
}
if (window.currentIndicator.type == "1030") {
$('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_GROUPS']);
}
hideScrollIfAllDivsAreVisible();
}
var fillSpecialIndicatorSecondView = function(presenterData) {
@@ -971,7 +944,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) {
setIndicatorActiveMarker();
}
/*var animateProgress = function (indicatorItem, widget){
var animateProgress = function (indicatorItem, widget){
var getRequestAnimationFrame = function () {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
@@ -1015,7 +988,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) {
}
fpAnimationFrame(animacion);
};*/
};
/*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> \

View File

@@ -545,10 +545,6 @@ table.dataTable thead .sorting:after {
margin: 11px 17px 0 0;
}
.dashboard-right {
margin: 5px;
}
.dashboard-right h5{
margin: 20px 12px 0 0;
}