AntonLV 8 лет назад
Родитель
Сommit
a27ed6d340

+ 2 - 1
inc/js/classes/BxDolGrid.js

@@ -408,7 +408,8 @@ BxDolGrid.prototype._bindActions = function (isSkipSearchInput) {
         var callbackSearch = function (sTerm) {
             clearTimeout($this._iSearchTimeoutId);
             $this._iSearchTimeoutId = setTimeout(function () {
-                glGrids[$this._sObject].setFilter(sTerm, true);
+            	if(glGrids[$this._sObject])
+            		glGrids[$this._sObject].setFilter(sTerm, true);
             }, 500);
         };
         

+ 1 - 1
modules/boonex/notifications/install/sql/enable.sql

@@ -28,7 +28,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 -- MENU: Notifications
 SET @iMIOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' AND `order` < 9999);
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-('sys_account_notifications', @sName, 'notifications-notifications', '_bx_ntfs_menu_item_title_system_notifications', '_bx_ntfs_menu_item_title_notifications', 'page.php?i=notifications-view', '', '', 'bell col-green3', 'a:2:{s:6:"module";s:16:"bx_notifications";s:6:"method";s:28:"get_unread_notifications_num";}', '', 2147483646, 1, 0, @iMIOrder + 1);
+('sys_account_notifications', @sName, 'notifications-notifications', '_bx_ntfs_menu_item_title_system_notifications', '_bx_ntfs_menu_item_title_notifications', 'page.php?i=notifications-view', '', '', 'bell col-green3', 'a:2:{s:6:"module";s:16:"bx_notifications";s:6:"method";s:28:"get_unread_notifications_num";}', '', 2147483646, 1, 1, @iMIOrder + 1);
 
 
 -- SETTINGS

+ 2 - 0
studio/classes/BxDolStudioNavigationQuery.php

@@ -260,11 +260,13 @@ class BxDolStudioNavigationQuery extends BxDolDb
                 `tmi`.`onclick` AS `onclick`,
                 `tmi`.`target` AS `target`,
                 `tmi`.`icon` AS `icon`,
+                `tmi`.`addon` AS `addon`,
                 `tmi`.`submenu_object` AS `submenu_object`,
                 `tmi`.`submenu_popup` AS `submenu_popup`,
                 `tmi`.`visible_for_levels` AS `visible_for_levels`,
                 `tmi`.`active` AS `active`,
                 `tmi`.`copyable` AS `copyable`,
+                `tmi`.`editable` AS `editable`,
                 `tmi`.`order` AS `order`" . $sSelectClause . "
             FROM `sys_menu_items` AS `tmi` " . $sJoinClause . "
             WHERE 1 " . $sWhereClause . " " . $sGroupClause . " " . $sOrderClause . " " . $sLimitClause;

+ 14 - 1
studio/js/navigation_import.js

@@ -31,7 +31,8 @@ BxDolStudioNavigationImport.prototype.onChangeFilter = function() {
 
 	clearTimeout($this._iSearchTimeoutId);
     $this._iSearchTimeoutId = setTimeout(function () {
-    	glGrids[$this.sObjNameGrid].setFilter(sValueSet + $this.sParamsDivider + sValueModule + $this.sParamsDivider + sValueSearch, true);
+    	if(glGrids[$this.sObjNameGrid])
+    		glGrids[$this.sObjNameGrid].setFilter(sValueSet + $this.sParamsDivider + sValueModule + $this.sParamsDivider + sValueSearch, true);
     }, 500);
 };
 
@@ -41,4 +42,16 @@ BxDolStudioNavigationImport.prototype.onImport = function(oData) {
 	});
 	glGrids.sys_studio_nav_items.processJson({grid: oData.parent_grid, blink: oData.parent_blink}, 'import', false);
 };
+
+BxDolStudioNavigationImport.prototype.done = function(oData) {
+	var $this = this;
+
+	$('.bx-popup-applied:visible').dolPopupHide({
+		removeOnClose: true, 
+		onHide: function() {
+			if(glGrids[$this.sObjNameGrid] != undefined)
+				glGrids[$this.sObjNameGrid] = null;
+		}
+	})
+};
 /** @} */

+ 27 - 5
studio/template/scripts/BxBaseStudioNavigationImport.php

@@ -28,6 +28,8 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
             exit;
         }
 
+        $oLanguagesUtils = BxDolStudioLanguagesUtils::getInstance();
+
         $aIdsAffected = array ();
         foreach($aIds as $iId) {
             $aItem = array();
@@ -47,13 +49,28 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
                 $oStorage->afterUploadCleanup($mixedIcon, 0);
             }
 
-            $iIdImported = (int)$aItem['id'];
-            $sTitleKey = $aItem['title'];
+            $sPostfix = time();
 
+            $iIdImported = (int)$aItem['id'];
             unset($aItem['id']);
+            
             $aItem['set_name'] = $this->sSet;
             $aItem['module'] = BX_DOL_STUDIO_MODULE_CUSTOM;
-            $aItem['title'] .= '_' . time();
+
+            $sKeyTitleSystem = '';
+            if(!empty($aItem['title_system'])) {
+                $sKeyTitleSystem = $aItem['title_system'];
+
+                $aItem['title_system'] .= '_' . $sPostfix;
+            }
+
+            $sKeyTitle = '';
+            if(!empty($aItem['title'])) {
+                $sKeyTitle = $aItem['title'];
+
+                $aItem['title'] .= '_' . $sPostfix;
+            }
+
             $aItem['icon'] = $mixedIcon != 0 ? $mixedIcon : '';
             $aItem['active'] = 1;
             $aItem['order'] = $this->oDb->getItemOrderMax($this->sSet) + 1;
@@ -61,7 +78,11 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
             if(($iIdAdded = (int)$this->oDb->addItem($aItem)) == 0)
                 continue;
 
-            BxDolStudioLanguagesUtils::getInstance()->addLanguageString($aItem['title'], _t($sTitleKey));
+            if(!empty($sKeyTitleSystem))
+                $oLanguagesUtils->addLanguageString($aItem['title_system'], _t($sKeyTitleSystem));
+
+            if(!empty($sKeyTitle))
+                $oLanguagesUtils->addLanguageString($aItem['title'], _t($sKeyTitle));
 
             $aIdsImported[] = $iIdImported;
             $aIdsAdded[] = $iIdAdded;
@@ -71,6 +92,7 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
         $aResult = array('msg' => _t('_adm_nav_err_items_import'));
         if($iAffected) {
             $oGrid = BxDolGrid::getObjectInstance('sys_studio_nav_items');
+            $oGrid->resetQueryParams();
             if($oGrid !== false)
                 $aResult = array(
                     'parent_grid' => $oGrid->getCode(false),
@@ -111,7 +133,7 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
 
     protected function _getActionDone ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
-        $a['attr']['onclick'] = "$('.bx-popup-applied:visible').dolPopupHide()";
+        $a['attr']['onclick'] = "javascript: " . $this->getJsObject() . ".done();";
         return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
     }