Piotr Labudda 11 лет назад
Родитель
Сommit
507be13ab9
1 измененных файлов с 18 добавлено и 17 удалено
  1. 18 17
      SE/se-lib/ProcesMenu.php

+ 18 - 17
SE/se-lib/ProcesMenu.php

@@ -442,7 +442,8 @@ class ProcesMenu {
 											<script>
 jQuery(document).ready(function() {
 	if ('procesy5.php' === window.location.pathname.substr(-12)
-			&& (pos = window.location.search.search('&filtr_id=')) > 0
+			&& window.location.search.search('task=CRM_LISTA_ZASOBOW') > 0
+			&& window.location.search.search('&filtr_id=') > 0
 		 ) {
 		jQuery('#ProcesMenuZasobFltrAdd').on('click', function(e) {
 			var frm = jQuery(this).get(0).form;
@@ -453,22 +454,22 @@ jQuery(document).ready(function() {
 			} else {
 				return;
 			}
-			if ('procesy5.php' === window.location.pathname.substr(-12)) {
-				var pos = 0, fltrIds = '';
-				if ((pos = window.location.search.search('&filtr_id=')) > 0) {
-					pos += 10;
-					console.log('pos:', pos);
-					fltrIds = window.location.search.substr(pos);
-					if ((pos = fltrIds.search('&')) > 0) {
-						fltrIds = fltrIds.substr(0, pos);
-					}
-					if (fltrIds) {
-						fltrIds = decodeURIComponent(fltrIds);
-						fltrIds += ',' + fltrId;
-						if (fldNode.selectize) {
-							fldNode.selectize.addOption({id: fltrIds, name: fltrIds});
-							fldNode.selectize.setValue(fltrIds, true);
-						}
+			var pos = 0, fltrIds = '';
+			if ('procesy5.php' === window.location.pathname.substr(-12)
+					&& window.location.search.search('task=CRM_LISTA_ZASOBOW') > 0
+					&& (pos = window.location.search.search('&filtr_id=')) > 0
+				 ) {
+				pos += 10;
+				fltrIds = window.location.search.substr(pos);
+				if ((pos = fltrIds.search('&')) > 0) {
+					fltrIds = fltrIds.substr(0, pos);
+				}
+				if (fltrIds) {
+					fltrIds = decodeURIComponent(fltrIds);
+					fltrIds += ',' + fltrId;
+					if (fldNode.selectize) {
+						fldNode.selectize.addOption({id: fltrIds, name: fltrIds});
+						fldNode.selectize.setValue(fltrIds, true);
 					}
 				}
 			}