[icinga-checkins] icinga.org: icinga-web/master: * Makefile tab and seperator fix

git at icinga.org git at icinga.org
Mon Jan 30 17:41:24 CET 2012


Module: icinga-web
Branch: master
Commit: 5ddd01dd294a23a0f0ca3bce554b46da971c61f0
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=5ddd01dd294a23a0f0ca3bce554b46da971c61f0

Author: Marius Hein <marius.hein at netways.de>
Date:   Mon Jan 30 17:40:47 2012 +0100

* Makefile tab and seperator fix
* Fixing deleting custom cronks (fixes #2155)

---

 Makefile.in                                        |   68 +++++++++++---------
 .../models/Provider/CronksDataModel.class.php      |   26 ++++----
 2 files changed, 51 insertions(+), 43 deletions(-)

diff --git a/Makefile.in b/Makefile.in
old mode 100755
new mode 100644
index 03c3469..166ab4d
--- a/Makefile.in
+++ b/Makefile.in
@@ -86,6 +86,7 @@ none:
 	
 	@printf "\nDevelopment targets:\n"
 	@printf "\t%-22s - %s\n" "devel-inplace-config" "Prepare src tree for running inplace"
+	@printf "\t%-22s - %s\n" "devel-reconfigure" "Clean and reconfigure source"
 	@printf "\t%-22s - %s\n" "test" "Running tests"
 	@printf "\t%-22s - %s\n" "test-cs" "Running codestyle tests"
 	@printf "\n\n"
@@ -109,39 +110,39 @@ distclean:
 	.build/ \
 	
 	rm -f \
-        Makefile \
-        lib/Makefile \
+	Makefile \
+	lib/Makefile \
 	lib/icingaScheduler/config.php \
-        pub/Makefile \
-        etc/Makefile \
-        bin/Makefile \
-        doc/Makefile \
-        app/Makefile \
+	pub/Makefile \
+	etc/Makefile \
+	bin/Makefile \
+	doc/Makefile \
+	app/Makefile \
 	app/config.php \
-        app/config/databases.xml \
-        app/config/icinga.xml \
-        app/config/logging.xml \
-        app/config/settings.xml \
-        app/config/translation.xml \
+	app/config/databases.xml \
+	app/config/icinga.xml \
+	app/config/logging.xml \
+	app/config/settings.xml \
+	app/config/translation.xml \
 	app/config/factories.xml \
-        app/modules/Api/config/module.xml \
-    	app/modules/Api/config/access.xml \
-        app/modules/AppKit/config/module.xml \
-        app/modules/AppKit/config/auth.xml
+	app/modules/Api/config/module.xml \
+	app/modules/Api/config/access.xml \
+	app/modules/AppKit/config/module.xml \
+	app/modules/AppKit/config/auth.xml \
 	app/modules/Cronks/config/module.xml \
 	app/modules/Reporting/config/module.xml \
 	app/modules/Web/config/module.xml \
-        etc/build.properties \
-        tests/phpunit/test.properties \
-        etc/apache2/icinga-web.conf \
-    	etc/scheduler/icingaCron \
-        bin/clearcache.sh \
-        pub/.htaccess \
-        pub/soap/.htaccess \
-        etc/conf.d/access.xml \
-        etc/conf.d/databases.xml \
-        etc/conf.d/Makefile \
-        etc/conf.d/sla.xml \
+	etc/build.properties \
+	tests/phpunit/test.properties \
+	etc/apache2/icinga-web.conf \
+	etc/scheduler/icingaCron \
+	bin/clearcache.sh \
+	pub/.htaccess \
+	pub/soap/.htaccess \
+	etc/conf.d/access.xml \
+	etc/conf.d/databases.xml \
+	etc/conf.d/Makefile \
+	etc/conf.d/sla.xml
 	
 remove-temp-files:
 	bin/rmtmp-files.sh
@@ -176,13 +177,20 @@ test-cs: test-precede
 		$(SRC_DIR)/app
 
 devel-inplace-config:
-	- at mkdir $(SRC_DIR)/app/cache $(SRC_DIR)/app/cache/config 2> /dev/null
-	@chown $(WEB_USER).$(WEB_GROUP) \
+	mkdir -p \
+	$(SRC_DIR)/app/cache/config \
+	$(SRC_DIR)/log
+	chown $(WEB_USER).$(WEB_GROUP) \
 		$(SRC_DIR)/app/cache \
 		$(SRC_DIR)/app/cache/config \
-		$web_log_folder@
+		$(LOGDIR)
 	@printf "Done.\n"
 
+devel-reconfigure:
+	@EXEC=`head config.log  | grep "$$ configure" | sed -e 's/\s\+\$$\s\+//g'`; \
+	make distclean; \
+	sh $$EXEC
+
 install-javascript:
 	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/pub/js
 	ln -sf $(DESTDIR)$(prefix)/lib/ext3 $(DESTDIR)$(prefix)/pub/js/ext3
diff --git a/app/modules/Cronks/models/Provider/CronksDataModel.class.php b/app/modules/Cronks/models/Provider/CronksDataModel.class.php
index 54edbd6..d8d412a 100644
--- a/app/modules/Cronks/models/Provider/CronksDataModel.class.php
+++ b/app/modules/Cronks/models/Provider/CronksDataModel.class.php
@@ -561,7 +561,7 @@ class Cronks_Provider_CronksDataModel extends CronksBaseModel implements AgaviIS
         $q = AppKitDoctrineUtil::createQuery()
              ->select('c.*')
              ->from('Cronk c')
-             ->where('c.cronk_uid=? and c.cronk_name=?', array($cronkid, $cronkname));
+             ->where('c.cronk_uid=?', array($cronkid));
 
         if ($own==true) {
             $q->andWhere('c.cronk_user_id=?', array($this->user->user_id));
@@ -571,24 +571,24 @@ class Cronks_Provider_CronksDataModel extends CronksBaseModel implements AgaviIS
 
         if ($cronk instanceof Cronk && $cronk->cronk_id > 0) {
             AppKitDoctrineUtil::getConnection()->beginTransaction();
-            $cronk->CronkCategoryCronk->delete();
-            $cronk->CronkPrincipalCronk->delete();
-            $cronk->save();
-            AppKitDoctrineUtil::getConnection()->commit();
             
-            // bad but helps doctrine to work
-            // with oracle ;-)
-            try {
-                $cronk->CronkPrincipalCronk->delete();
-            } catch (Exception $e) {
-                // BYPASS
-            }
+            $params = array($cronk->cronk_id);
+            
+            AppKitDoctrineUtil::createQuery()->delete('CronkCategoryCronk c')
+            ->andWhere('c.ccc_cronk_id=?')
+            ->execute($params);
+            
+            AppKitDoctrineUtil::createQuery()->delete('CronkPrincipalCronk c')
+            ->andWhere('c.cpc_cronk_id=?')
+            ->execute($params);
+            
+            AppKitDoctrineUtil::getConnection()->commit();
             
             $cronk->delete();
 
             return true;
         } else {
-            throw new AppKitModelException('Cronk not found: '. $cronkid);
+            throw new AppKitModelException('Could not delete cronk: '. $cronkid);
         }
     }
 





More information about the icinga-checkins mailing list