- added new filter option for "frigate wormholes" to route search module, closed #460

This commit is contained in:
Exodus4D
2017-04-12 17:59:44 +02:00
parent f8b3da4e9b
commit 231a13b697
4 changed files with 41 additions and 2 deletions

View File

@@ -118,6 +118,7 @@ class Route extends Controller\AccessController {
$whereQuery = "";
$includeScopes = [];
$includeTypes = [];
$excludeTypes = [];
$includeEOL = true;
if( $filterData['stargates'] === true){
@@ -147,6 +148,10 @@ class Route extends Controller\AccessController {
$includeTypes[] = 'wh_critical';
}
if( $filterData['wormholesFrigate'] !== true ){
$excludeTypes[] = 'frigate';
}
if( $filterData['wormholesEOL'] === false ){
$includeEOL = false;
}
@@ -157,6 +162,10 @@ class Route extends Controller\AccessController {
if( !empty($includeScopes) ){
$whereQuery .= " `connection`.`scope` IN ('" . implode("', '", $includeScopes) . "') AND ";
if( !empty($excludeTypes) ){
$whereQuery .= " `connection`.`type` NOT REGEXP '" . implode("|", $excludeTypes) . "' AND ";
}
if( !empty($includeTypes) ){
$whereQuery .= " `connection`.`type` REGEXP '" . implode("|", $includeTypes) . "' AND ";
}
@@ -561,6 +570,7 @@ class Route extends Controller\AccessController {
'wormholes' => (bool) $routeData['wormholes'],
'wormholesReduced' => (bool) $routeData['wormholesReduced'],
'wormholesCritical' => (bool) $routeData['wormholesCritical'],
'wormholesFrigate' => (bool) $routeData['wormholesFrigate'],
'wormholesEOL' => (bool) $routeData['wormholesEOL'],
'safer' => (bool) $routeData['safer']
];

View File

@@ -183,6 +183,7 @@ define([
wormholes: (rowData.hasOwnProperty('wormholes')) ? rowData.wormholes | 0 : 1,
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
wormholesFrigate: (rowData.hasOwnProperty('wormholesFrigate')) ? rowData.wormholesFrigate | 0 : 1,
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1,
safer: (rowData.hasOwnProperty('safer')) ? rowData.safer.value | 0 : 0
};
@@ -273,6 +274,7 @@ define([
wormholes: routeDialogData.hasOwnProperty('wormholes') ? parseInt( routeDialogData.wormholes ) : 0,
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt( routeDialogData.wormholesReduced ) : 0,
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt( routeDialogData.wormholesCritical ) : 0,
wormholesFrigate: routeDialogData.hasOwnProperty('wormholesFrigate') ? parseInt( routeDialogData.wormholesFrigate ) : 0,
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt( routeDialogData.wormholesEOL ) : 0
}]
};
@@ -480,12 +482,14 @@ define([
let wormholeCheckbox = routeDialog.find('input[type="checkbox"][name="wormholes"]');
let wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
let wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
let wormholeFrigateCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesFrigate"]');
let wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
// store current "checked" state for each box ---------------------------------------------
let storeCheckboxStatus = function(){
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
wormholeFrigateCheckbox.data('selectState', wormholeFrigateCheckbox.prop('checked'));
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
};
@@ -495,10 +499,12 @@ define([
if( $(this).is(':checked') ){
wormholeReducedCheckbox.prop('disabled', false);
wormholeCriticalCheckbox.prop('disabled', false);
wormholeFrigateCheckbox.prop('disabled', false);
wormholeEolCheckbox.prop('disabled', false);
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
wormholeFrigateCheckbox.prop('checked', wormholeFrigateCheckbox.data('selectState'));
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
}else{
storeCheckboxStatus();
@@ -507,6 +513,8 @@ define([
wormholeReducedCheckbox.prop('disabled', true);
wormholeCriticalCheckbox.prop('checked', false);
wormholeCriticalCheckbox.prop('disabled', true);
wormholeFrigateCheckbox.prop('checked', false);
wormholeFrigateCheckbox.prop('disabled', true);
wormholeEolCheckbox.prop('checked', false);
wormholeEolCheckbox.prop('disabled', true);
}
@@ -580,6 +588,7 @@ define([
wormholes: routeData.wormholes,
wormholesReduced: routeData.wormholesReduced,
wormholesCritical: routeData.wormholesCritical,
wormholesFrigate: routeData.wormholesFrigate,
wormholesEOL: routeData.wormholesEOL,
safer: {
value: routeData.safer,

View File

@@ -183,6 +183,7 @@ define([
wormholes: (rowData.hasOwnProperty('wormholes')) ? rowData.wormholes | 0 : 1,
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
wormholesFrigate: (rowData.hasOwnProperty('wormholesFrigate')) ? rowData.wormholesFrigate | 0 : 1,
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1,
safer: (rowData.hasOwnProperty('safer')) ? rowData.safer.value | 0 : 0
};
@@ -273,6 +274,7 @@ define([
wormholes: routeDialogData.hasOwnProperty('wormholes') ? parseInt( routeDialogData.wormholes ) : 0,
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt( routeDialogData.wormholesReduced ) : 0,
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt( routeDialogData.wormholesCritical ) : 0,
wormholesFrigate: routeDialogData.hasOwnProperty('wormholesFrigate') ? parseInt( routeDialogData.wormholesFrigate ) : 0,
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt( routeDialogData.wormholesEOL ) : 0
}]
};
@@ -480,12 +482,14 @@ define([
let wormholeCheckbox = routeDialog.find('input[type="checkbox"][name="wormholes"]');
let wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
let wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
let wormholeFrigateCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesFrigate"]');
let wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
// store current "checked" state for each box ---------------------------------------------
let storeCheckboxStatus = function(){
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
wormholeFrigateCheckbox.data('selectState', wormholeFrigateCheckbox.prop('checked'));
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
};
@@ -495,10 +499,12 @@ define([
if( $(this).is(':checked') ){
wormholeReducedCheckbox.prop('disabled', false);
wormholeCriticalCheckbox.prop('disabled', false);
wormholeFrigateCheckbox.prop('disabled', false);
wormholeEolCheckbox.prop('disabled', false);
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
wormholeFrigateCheckbox.prop('checked', wormholeFrigateCheckbox.data('selectState'));
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
}else{
storeCheckboxStatus();
@@ -507,6 +513,8 @@ define([
wormholeReducedCheckbox.prop('disabled', true);
wormholeCriticalCheckbox.prop('checked', false);
wormholeCriticalCheckbox.prop('disabled', true);
wormholeFrigateCheckbox.prop('checked', false);
wormholeFrigateCheckbox.prop('disabled', true);
wormholeEolCheckbox.prop('checked', false);
wormholeEolCheckbox.prop('disabled', true);
}
@@ -580,6 +588,7 @@ define([
wormholes: routeData.wormholes,
wormholesReduced: routeData.wormholesReduced,
wormholesCritical: routeData.wormholesCritical,
wormholesFrigate: routeData.wormholesFrigate,
wormholesEOL: routeData.wormholesEOL,
safer: {
value: routeData.safer,

View File

@@ -60,7 +60,7 @@
<option value="{{id}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/mapSelectOptions}}
</select>
<span class="help-block with-errors">Set maps from search</span>
<span class="help-block with-errors">Set maps for search</span>
</div>
</div>
</div>
@@ -105,7 +105,18 @@
</div>
</div>
<div class="col-sm-4 col-sm-offset-8">
<div class="col-sm-4 col-sm-offset-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 col-xs-6 checkbox checkbox checkbox-circle" title="include frigate connections">
<input id="form_wormholes_frigate" name="wormholesFrigate" value="1" type="checkbox" checked>
<label for="form_wormholes_frigate">Frigate</label>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 col-xs-6 checkbox checkbox-danger checkbox-circle" title="include EOL connections">