Parcourir la source

TableAjax remove edit link form ID field

Piotr Labudda il y a 11 ans
Parent
commit
dd7f44a85a
2 fichiers modifiés avec 7 ajouts et 6 suppressions
  1. 1 1
      SE/VERSION
  2. 6 5
      SE/se-lib/TableAjax.php

+ 1 - 1
SE/VERSION

@@ -1 +1 @@
-3.10.7
+3.10.8

+ 6 - 5
SE/se-lib/TableAjax.php

@@ -981,18 +981,21 @@ class TableAjax extends ViewAjax {
 					}
 
 					//create cells
+					var primaryKeyField = '';
 					for (var i = 0; i < colsSorted.length; i++) {
 						var key = colsSorted[i];
 						var val = props[key];
 						if (!_data.cols[key]) return;
 						if (_data.cols[key].unique) row.data('unique', val);
 
-						var cellID = _uniqueCol || 'ID';
-						cellID = (cellID in props)? props[cellID] : null;
+						primaryKeyField = _uniqueCol || 'ID';
+						cellID = (primaryKeyField in props)? props[primaryKeyField] : null;
 
 						if (!_data.cols[key].hidden) {
 							var cell = $('<td></td>').appendTo(row);
-							cell.on('dblclick', {id:cellID, col:key}, priv.rowDblClicked);
+							if (key !== primaryKeyField) {
+								cell.on('dblclick', {id:cellID, col:key}, priv.rowDblClicked);
+							}
 							var cellCnt = $('<span></span>').appendTo(cell);
 							if (i == 1) cell.addClass('stickyCol2');
 							cell.data('column', key);
@@ -5004,8 +5007,6 @@ jQuery(document).ready(function(){
 			$ind++;
 			$columnConfig = (object)array('index'=>$ind);
 			if ($col == 'ID') {
-				// /SE/se-dev/index.php?MENU_INIT=USERS2_MARKETING_EDIT&ARG1=EDIT&ARG1_VAL=31105
-				$columnConfig->format = '<a href="#EDIT/{0}">{0}</a>';
 				$columnConfig->unique = true;
 			}
 			else if (in_array($col, array('A_STATUS','A_STATUS_CURRENT','A_SERVICES_STATUS_CURRENT'))) {