cit-analysis-menu.ctrl.js 1.38 KB
Newer Older
Ken you's avatar
Ken you committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
citModule.controller('citAnalysisMenuController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q',
	'SweetAlert', 'vatSessionService', 'citSessionService',
    function ($scope, $rootScope, $log, $translate, $timeout, $q, SweetAlert, vatSessionService, citSessionService) {
        'use strict';
        $log.debug('citAnalysisMenuController.ctor()...');

        $scope.menus = [
            { name: '.analyzeReport', text: $translate.instant('ModelAnalysis'), icon: 'glyphicon glyphicon-flag', show: true },
            { name: '.organizeDashboard', text: $translate.instant('Dashboard'), icon: 'glyphicon glyphicon-stats', show: true }
        ];
        citSessionService.querySummayDashboardModel = {
            organizationID: vatSessionService.project.organizationID,
            year: (new Date()).getFullYear(),
            month: 13
        };

        citSessionService.dashboardSingelOrganizationId = vatSessionService.project.organizationID;

        var analyzeMenuEvent = function (obj) {
            if (obj.menu.text === $translate.instant('Dashboard')) {
                citSessionService.urlFromAnalyze = true;
                return true;
            }
        };

        (function initialize() {
            $log.debug('citAnalysisMenuController.initialize()...');
            $scope.analyzeMenuEvent = analyzeMenuEvent;
        })();
    }
]);