AntonLV 10 лет назад
Родитель
Сommit
817bc2b65f

+ 3 - 3
modules/boonex/albums/updates/9.0.1_9.0.2/install/installer.php

@@ -20,17 +20,17 @@ class BxAlbumsUpdater extends BxDolStudioUpdater
 			if(!$this->oDb->isFieldExists('bx_albums_files2albums', 'favorites'))
 	        		$this->oDb->query("ALTER TABLE `bx_albums_files2albums` ADD `favorites` int(11) NOT NULL default '0' AFTER `votes`");
 
-			if ($this->isIndexExists('bx_albums_files2albums', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_albums_files2albums', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_albums_files2albums` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_albums_files2albums` ADD FULLTEXT `search_fields` (`title`)");
 
-			if ($this->isIndexExists('bx_albums_cmts', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_albums_cmts', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_albums_cmts` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_albums_cmts` ADD FULLTEXT `search_fields` (`cmt_text`)");
 
-			if ($this->isIndexExists('bx_albums_cmts_media', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_albums_cmts_media', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_albums_cmts_media` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_albums_cmts_media` ADD FULLTEXT `search_fields` (`cmt_text`)");

+ 1 - 1
modules/boonex/convos/updates/9.0.1_9.0.2/install/installer.php

@@ -17,7 +17,7 @@ class BxCnvUpdater extends BxDolStudioUpdater
     		if(!$this->oDb->isFieldExists('bx_convos_conversations', 'allow_edit'))
         		$this->oDb->query("ALTER TABLE `bx_convos_conversations` ADD `allow_edit` tinyint(4) NOT NULL DEFAULT '0' AFTER `text`");
 
-			if ($this->isIndexExists('bx_convos_cmts', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_convos_cmts', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_convos_cmts` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_convos_cmts` ADD FULLTEXT `search_fields` (`cmt_text`)");

+ 2 - 2
modules/boonex/events/updates/9.0.0_9.0.1/install/installer.php

@@ -17,10 +17,10 @@ class BxEventsUpdater extends BxDolStudioUpdater
     		if(!$this->oDb->isFieldExists('bx_events_data', 'favorites'))
         		$this->oDb->query("ALTER TABLE `bx_events_data` ADD `favorites` int(11) NOT NULL default '0' AFTER `votes`");
 
-			if ($this->isIndexExists('bx_events_data', 'event_name'))
+			if ($this->oDb->isIndexExists('bx_events_data', 'event_name'))
 				$this->oDb->query("ALTER TABLE `bx_events_data` DROP INDEX `event_name`");
 
-			if ($this->isIndexExists('bx_events_data', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_events_data', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_events_data` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_events_data` ADD FULLTEXT KEY `search_fields` (`event_name`, `event_desc`)");

+ 23 - 2
modules/boonex/forum/updates/9.0.0_9.0.1/install/installer.php

@@ -23,12 +23,33 @@ class BxForumUpdater extends BxDolStudioUpdater
     		if(!$this->oDb->isFieldExists('bx_forum_discussions', 'favorites'))
         		$this->oDb->query("bx_forum_discussions` ADD `favorites` int(11) NOT NULL default '0' AFTER `votes`");
 
-			if ($this->isIndexExists('bx_forum_cmts', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_forum_cmts', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_forum_cmts` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_forum_cmts` ADD FULLTEXT KEY `search_fields` (`cmt_text`)");
 		}
 
-    	return parent::actionExecuteSql($sOperation);
+    	$mixedResult = parent::actionExecuteSql($sOperation);
+
+        if($sOperation == 'install' && $mixedResult === BX_DOL_STUDIO_INSTALLER_SUCCESS) {
+			$sLangCategory = $this->oDb->getOne("SELECT `lang_category` FROM `sys_modules` WHERE `uri`=:uri LIMIT 1", array(
+				'uri' => $this->_aConfig['module_uri']
+			));
+
+			if(strcmp($sLangCategory, $this->_aConfig['language_category']) !== 0) {
+    			$this->oDb->query("UPDATE `sys_localization_categories` SET `Name`=:name_new WHERE `name`=:name_old", array(
+    				'name_new' => $this->_aConfig['language_category'],
+    				'name_old' => $sLangCategory,
+    			));
+
+    			$this->oDb->query("UPDATE `sys_modules` SET `title`=:title, `lang_category`=:lang_category WHERE `uri`=:uri", array(
+    				'uri' => $this->_aConfig['module_uri'],
+    				'title' => $this->_aConfig['title'],
+    				'lang_category' => $this->_aConfig['language_category']
+    			));
+			}
+		}
+    	
+    	return $mixedResult;
     }
 }

+ 2 - 2
modules/boonex/groups/updates/9.0.1_9.0.2/install/installer.php

@@ -17,10 +17,10 @@ class BxGroupsUpdater extends BxDolStudioUpdater
     		if(!$this->oDb->isFieldExists('bx_groups_data', 'favorites'))
         		$this->oDb->query("ALTER TABLE `bx_groups_data` ADD `favorites` int(11) NOT NULL default '0' AFTER `votes`");
 
-			if ($this->isIndexExists('bx_groups_data', 'group_name'))
+			if ($this->oDb->isIndexExists('bx_groups_data', 'group_name'))
 				$this->oDb->query("ALTER TABLE `bx_groups_data` DROP INDEX `group_name`");
 
-			if ($this->isIndexExists('bx_groups_data', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_groups_data', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_groups_data` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_groups_data` ADD FULLTEXT KEY `search_fields` (`group_name`, `group_desc`)");

+ 1 - 1
modules/boonex/market/updates/9.0.2_9.0.3/install/installer.php

@@ -17,7 +17,7 @@ class BxMarketUpdater extends BxDolStudioUpdater
     		if(!$this->oDb->isFieldExists('bx_market_products', 'favorites'))
         		$this->oDb->query("ALTER TABLE `bx_market_products` ADD `favorites` int(11) NOT NULL default '0' AFTER `votes`");
 
-			if ($this->isIndexExists('bx_market_cmts', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_market_cmts', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_market_cmts` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_market_cmts` ADD FULLTEXT KEY `search_fields` (`cmt_text`)");

+ 1 - 1
modules/boonex/posts/updates/9.0.1_9.0.2/install/installer.php

@@ -17,7 +17,7 @@ class BxPostsUpdater extends BxDolStudioUpdater
     		if(!$this->oDb->isFieldExists('bx_posts_posts', 'favorites'))
         		$this->oDb->query("ALTER TABLE `bx_posts_posts` ADD `favorites` int(11) NOT NULL default '0' AFTER `votes`");
 
-			if ($this->isIndexExists('bx_posts_cmts', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_posts_cmts', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_posts_cmts` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_posts_cmts` ADD FULLTEXT KEY `search_fields` (`cmt_text`)");

+ 2 - 2
modules/boonex/timeline/updates/9.0.1_9.0.2/install/installer.php

@@ -14,12 +14,12 @@ class BxTimelineUpdater extends BxDolStudioUpdater
 	public function actionExecuteSql($sOperation)
     {
     	if($sOperation == 'install') {
-			if ($this->isIndexExists('bx_timeline_events', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_timeline_events', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_timeline_events` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_timeline_events` ADD FULLTEXT KEY `search_fields` (`description`)");
 
-			if ($this->isIndexExists('bx_timeline_comments', 'search_fields'))
+			if ($this->oDb->isIndexExists('bx_timeline_comments', 'search_fields'))
 				$this->oDb->query("ALTER TABLE `bx_timeline_comments` DROP INDEX `search_fields`");
 
 			$this->oDb->query("ALTER TABLE `bx_timeline_comments` ADD FULLTEXT KEY `search_fields` (`cmt_text`)");