=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2015-03-19 10:18:00 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2015-03-19 10:50:45 +0000 @@ -1,4 +1,6 @@ +/* global dhis2, angular, i18n_ajax_login_failed, _ */ + dhis2.util.namespace('dhis2.ec'); // whether current user has any organisation units @@ -32,6 +34,16 @@ objectStores: ['programs', 'programStages', 'geoJsons', 'optionSets', 'events', 'programValidations', 'ouLevels'] }); +(function($) { + $.safeEach = function(arr, fn) + { + if (arr) + { + $.each(arr, fn); + } + }; +})(jQuery); + /** * Page init. The order of events is: * === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js 2015-03-19 10:18:00 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js 2015-03-19 10:50:45 +0000 @@ -29,6 +29,16 @@ objectStores: ['programs', 'programStages', 'trackedEntities', 'trackedEntityForms', 'attributes', 'relationshipTypes', 'optionSets', 'programValidations', 'ouLevels'] }); +(function($) { + $.safeEach = function(arr, fn) + { + if (arr) + { + $.each(arr, fn); + } + }; +})(jQuery); + /** * Page init. The order of events is: *