commit 697833f072070cad339176482ca9df5d1c7095ba Author: Philipp Hahn Date: Mon Nov 19 11:20:08 2012 +0100 Bug #29269: Fix execution of disabled menu entries Filter out disabled actions from the context sub-menues as well. diff --git a/branches/ucs-3.1/ucs/management/univention-management-console-frontend/Makefile b/branches/ucs-3.1/ucs/management/univention-management-console-frontend/Makefile index 727006f..5eb3c94 100644 --- a/branches/ucs-3.1/ucs/management/univention-management-console-frontend/Makefile +++ b/branches/ucs-3.1/ucs/management/univention-management-console-frontend/Makefile @@ -39,8 +39,7 @@ tmpDir:=$(CURDIR)/tmp themesDir:=$(tmpDir)/dijit/themes jsFiles:=$(shell find umc -name "*.js") -.PHONY: build build-dev build-common install clean jslint i18n umc/package.json $(tmpDir)/umc/login.html $(buildDir)/index.html $(buildDir)/debug.html - +.PHONY: build build: build-common $(tmpDir) $(buildDir)/js/dojo/dojo.js.uncompressed.js $(themesDir)/umc # the automatically generated module umc/widgets contains a require to all umc widgets @@ -51,8 +50,8 @@ umc/widgets.js: done; \ echo "define([$${deplist%, }], function() { })" > $@ -umc/package.json: - sed 's/%VERSION%/$(version)/' package.json > $@ +umc/package.json: package.json + sed 's/%VERSION%/$(version)/' $< > $@ # temp directory $(tmpDir): @@ -63,6 +62,7 @@ $(tmpDir): cp -rfs "$(CURDIR)/umc" $@ # convert .po to .json files +.PHONY: i18n i18n: /usr/bin/dh-umc-translate -p univention-management-console-frontend -l en -l de -o umc $(jsFiles) @@ -70,16 +70,16 @@ $(buildDir): mkdir -p $@ # rule for the main dojo build process -$(buildDir)/js/dojo/dojo.js.uncompressed.js: $(jsFiles) $(buildDir) - /usr/share/univention-dojo/util/buildscripts/build.sh profile=build_profile.js version="$(version)" +$(buildDir)/js/dojo/dojo.js.uncompressed.js: build_profile.js $(jsFiles) $(buildDir) + /usr/share/univention-dojo/util/buildscripts/build.sh profile=$< version="$(version)" # index page -$(buildDir)/index.html: $(buildDir) index.html - sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%//; s/%VERSION%/$(version)/;' index.html > $@ +$(buildDir)/index.html: index.html $(buildDir) + sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%//; s/%VERSION%/$(version)/;' $< > $@ # index page for debug mode -$(buildDir)/debug.html: $(buildDir) index.html - sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%/.uncompressed.js/; s/%VERSION%/$(version)/;' index.html > $@ +$(buildDir)/debug.html: index.html $(buildDir) + sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%/.uncompressed.js/; s/%VERSION%/$(version)/;' $< > $@ # login page $(tmpDir)/umc/login.html: login.html @@ -120,6 +120,7 @@ $(themesDir)/umc/icons: $(themesDir)/umc done; \ done +.PHONY: build-dev build-dev: build-common @# symlink javascript code [ -e $(buildDir)/js ] || ln -s $(tmpDir) $(buildDir)/js @@ -128,6 +129,7 @@ build-dev: build-common cp -frs /usr/share/univention-management-console-frontend/js/umc/modules/* $(tmpDir)/umc/modules cp -frs /usr/share/univention-management-console-frontend/js/dijit/themes/umc/icons/* $(themesDir)/umc/icons/ +.PHONY: build-common build-common: i18n umc/widgets.js umc/package.json $(themesDir)/umc $(themesDir)/umc/icons $(tmpDir)/umc/login.html $(buildDir) $(buildDir)/index.html $(buildDir)/debug.html @# symlink to javascript dir with timestamp rm -f "$(buildDir)/js_"* @@ -142,11 +144,12 @@ build-common: i18n umc/widgets.js umc/package.json $(themesDir)/umc $(themesDir) @# create empty branding localisation files to not cause 404 errors touch "$(tmpDir)/umc/i18n/en/branding.json" "$(tmpDir)/umc/i18n/de/branding.json" +.PHONY: install install: build @# copy all files from the build directory .. exclude file of the tmp directory mkdir -p "$(DESTDIR)$(pkgDir)" rsync -rpl --exclude ".svn" "$(buildDir)/" "$(DESTDIR)$(pkgDir)" +.PHONY: clean clean: rm -rf $(tmpDir) $(buildDir) umc.xml umc/widgets.js umc/{en,de}.json umc/package.json - diff --git a/branches/ucs-3.1/ucs/management/univention-management-console-frontend/debian/changelog b/branches/ucs-3.1/ucs/management/univention-management-console-frontend/debian/changelog index 00c7f75..991695b 100644 --- a/branches/ucs-3.1/ucs/management/univention-management-console-frontend/debian/changelog +++ b/branches/ucs-3.1/ucs/management/univention-management-console-frontend/debian/changelog @@ -1,3 +1,9 @@ +univention-management-console-frontend (2.0.164-1) unstable; urgency=low + + * Fix execution of disabled menu entries (Bug #29269) + + -- Philipp Hahn Mon, 19 Nov 2012 11:16:48 +0100 + univention-management-console-frontend (2.0.163-1) unstable; urgency=low * Dont set HTML annoying title attributes on widgets (Bug #28551) diff --git a/branches/ucs-3.1/ucs/management/univention-management-console-frontend/umc/widgets/Grid.js b/branches/ucs-3.1/ucs/management/univention-management-console-frontend/umc/widgets/Grid.js index f43a1b5..c47b978 100644 --- a/branches/ucs-3.1/ucs/management/univention-management-console-frontend/umc/widgets/Grid.js +++ b/branches/ucs-3.1/ucs/management/univention-management-console-frontend/umc/widgets/Grid.js @@ -274,7 +274,10 @@ define([ iconClass: iiconClass, onMouseUp: lang.hitch(this, function() { if (iaction.callback) { - iaction.callback([this._contextItemID], [this._contextItem]); + var isExecutable = typeof iaction.canExecute == "function" ? iaction.canExecute(this._contextItem) : true; + if (isExecutable) { + iaction.callback([this._contextItemID], [this._contextItem]); + } } }), _action: iaction