App-Dochazka-WWW

 view release on metacpan or  search on metacpan

share/js/dochazka-www/caches.js  view on Meta::CPAN

            "#e6beff",
            "#aa6e28",
            "#fffac8",
            "#800000",
            "#aaffc3",
            "#808000",
            "#ffd8b1",
            "#000080",
        ],

        backgroundColorStashed = null,
        currentEmployeeStashed = null,
        currentEmplPrivStashed = null,

        activityCache = [],
        activityByAID = {},
        activityByCode = {},

        profileCache = [],
        profileByEID = {},
        profileByNick = {},

share/js/dochazka-www/caches.js  view on Meta::CPAN

        scheduleCache = [],
        scheduleBySID = {},
        scheduleByScode = {},

        endTheMasquerade = function () {
            currentUser('flag1', 0); // turn off masquerade flag
            // console.log('flag1 === ', currentUser('flag1'));
            currentUser('obj', currentEmployeeStashed);
            currentEmployeeStashed = null;
            appLib.fillUserBox();
            $('body').css("background-color", backgroundColorStashed);
            coreLib.displayResult('Masquerade is finished');
            $('input[name="sel"]').val('');
        },

        getActivityByAID = function (aid) {
            if (activityCache.length > 0) {
                return activityByAID[aid];
            }
            console.log('CRITICAL ERROR: activity cache not populated');
            return null;

share/js/dochazka-www/caches.js  view on Meta::CPAN

            }
            if (priv !== 'admin') {
                if (obj.supervisor !== cu.eid) {
                    coreLib.displayError(obj.nick + " is not your supervisee");
                    return null;
                }
            }

            // let the masquerade begin
            currentEmployeeStashed = $.extend({}, cu);
            backgroundColorStashed = $('body').css("background-color");
            currentUser('obj', obj);
            currentUser('flag1', 1); // turn on masquerade flag
            populate.bootstrap([
                populateFullEmployeeProfileCache,
                populateScheduleBySID,
            ]);
            appLib.fillUserBox(); // reset userbox
            $('body').css("background-color", "#669933");
            stack.unwindToType('dmenu'); // return to most recent dmenu
        },

        populateActivityCache = function (populateArray) {
            var ao, rest, sc, fc, populateContinue;
            console.log("Entering populateActivityCache()");
            populateContinue = populate.shift(populateArray);
            if (coreLib.isArray(activityCache) && activityCache.length > 0) {
                console.log("populateActivityCache(): noop, cache already populated");
                console.log("Activity Cache contents", activityCache);



( run in 2.718 seconds using v1.01-cache-2.11-cpan-d8267643d1d )