Skip to content

Commit

Permalink
Table buttons remove clear selection, add toggle buton to enable/disa…
Browse files Browse the repository at this point in the history
…ble table for only features inside map extent

Fix for QGIS Server 3
Loading of CSS file fixed for Editing plugin
  • Loading branch information
uprel committed Jan 13, 2019
1 parent 1de956a commit 38469da
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 9 deletions.
12 changes: 12 additions & 0 deletions admin/class.Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,18 @@ public static function getEqwcVersion() {
return $version;
}

public static function getPluginVersion($name) {
$version = '0';
$dir = dirname(dirname(__FILE__)) . "/plugins/";
if (self::checkModulexist($name)) {
if (file_exists($dir . $name . '/changelog.txt')) {
$version = trim(file_get_contents($dir . $name . '/changelog.txt',null,null,null,5));
}
}
return $version;
}


public static function getClientPath() {
$root = filter_input(INPUT_SERVER,'DOCUMENT_ROOT',FILTER_SANITIZE_STRING);
if (basename($root)=='gisportal') {
Expand Down
7 changes: 7 additions & 0 deletions client/site/css/contextMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
background-image:url(../gis_icons/mActionClear.png);
}

.x-extent-icon {
background-image:url(../gis_icons/extents.png);
height:16px;
background-position:center right;
}


.x-exclamation-icon {
background-image:url(../libs/ext/resources/images/access/form/exclamation.gif);
height:16px;
Expand Down
Binary file added client/site/gis_icons/extents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/site/js/LayerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,12 @@ function loadMore() {
grid.onSubmit();
}

function switchBbox(btn,state) {
var grid = this;
grid.useBbox = state;
grid.onSubmit(true);
}

function applyWMSFilter(item) {
var idx = item.itemId.split('_')[1]-1;
var node = layerTree.getSelectionModel().getSelectedNode();
Expand Down
21 changes: 16 additions & 5 deletions client/site/js/QGISExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,10 @@ QGIS.SearchPanel = Ext.extend(Ext.Panel, {
if(this.gridLocation=='bottom') {
maskElement = Ext.getCmp('BottomPanel');
}
//moved
// Make sure it's shown and expanded
maskElement.show();
maskElement.collapsible && maskElement.expand();
//maskElement.show();
//maskElement.collapsible && maskElement.expand();

if (this.useWmsRequest) {
//alert(maskElement.id);
Expand Down Expand Up @@ -990,11 +991,21 @@ QGIS.SearchPanel = Ext.extend(Ext.Panel, {
'QUERY_LAYERS': layerId,
'FEATURE_COUNT': this.gridResults,
'INFO_FORMAT': 'text/xml',
'SRS': authid,
'FILTER': filter
'CRS': authid
//'FILTER': filter
};
if (this.useBbox) {
params.BBOX=geoExtMap.map.calculateBounds().left+","+geoExtMap.map.calculateBounds().bottom+","+geoExtMap.map.calculateBounds().right+","+geoExtMap.map.calculateBounds().top;
//qgis3 workaround
if(Eqwc.settings.qgisVersion && parseInt(Eqwc.settings.qgisVersion)>2) {
var xx = geoExtMap.map.getExtent().toGeometry();
params.FILTER_GEOM = xx.toString();
} else {
params.FILTER = filter;
params.BBOX=geoExtMap.map.calculateBounds().left+","+geoExtMap.map.calculateBounds().bottom+","+geoExtMap.map.calculateBounds().right+","+geoExtMap.map.calculateBounds().top;
}

} else {
params.FILTER = filter;
}

if (fieldsValidate) {
Expand Down
21 changes: 18 additions & 3 deletions client/site/js/WebgisInit_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,11 @@ function showSearchPanelResults(searchPanelInstance, features) {
searchPanelId = 'table_'+searchPanelInstance.queryLayer;
collapsible = false; // No collapsible in bottom
autoHeight = false;

// Make sure it's shown and expanded
targetComponent.show();
targetComponent.collapsible && targetComponent.expand();

break;
case 'popup':
if (typeof(Ext.getCmp('SearchResultsPopUp')) == 'undefined') {
Expand Down Expand Up @@ -1759,12 +1764,22 @@ function showSearchPanelResults(searchPanelInstance, features) {
}
},
{
iconCls: 'x-clear-icon',
tooltip: TR.clearSelection,
iconCls: 'x-extent-icon',
tooltip: TR.tableUseExtent,
pressed: Eqwc.settings.syncAttributeTableWithView,
//scale: 'medium',
//disabled: true,
handler: clearTableSelection
enableToggle: true,
toggleHandler: switchBbox,
scope: searchPanelInstance
},
//{
// iconCls: 'x-clear-icon',
// tooltip: TR.clearSelection,
// //scale: 'medium',
// //disabled: true,
// handler: clearTableSelection
//},
{
itemId: 'loadmore',
iconCls: 'x-exclamation-icon',
Expand Down
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ function goMobile($lang) {
if ($login_check->isValidUserProj($helpers->getMapFromUrl())) {

$edit = $helpers->checkModulexist("editing");
$editVer = $helpers->getPluginVersion("editing");
$google = $helpers->loadGoogle();

//OK open application
Expand All @@ -244,7 +245,7 @@ function goMobile($lang) {
<link rel="stylesheet" type="text/css" href="client/site/css/contextMenu.css?v=20180320"/>

<?php if ($edit) {
echo '<link rel="stylesheet" type="text/css" href="plugins/editing/theme/geosilk/geosilk.css?v=20181107"/>';
echo '<link rel="stylesheet" type="text/css" href="plugins/editing/theme/geosilk/geosilk.css?v='.$editVer.'"/>';
}?>

<script type="text/javascript" src="client_common/load.php"></script>
Expand Down

0 comments on commit 38469da

Please sign in to comment.