Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allows for each of the incidents proper color to be viewed when 'All …

…Categories' is selected.

This can be toggled on and off with the 'Multi' button, which is found in the filters.
  • Loading branch information...
commit ec390173047ac62250314249adc3be0a13e828ff 1 parent 69429a8
@Pewpy authored
View
28 application/controllers/json.php
@@ -59,11 +59,12 @@ public function index()
$media_type = (isset($_GET['m']) AND intval($_GET['m']) > 0)? intval($_GET['m']) : 0;
- // Get the incident and category id
+ // Get the incident, category and multi-color id
$category_id = (isset($_GET['c']) AND intval($_GET['c']) > 0)? intval($_GET['c']) : 0;
$incident_id = (isset($_GET['i']) AND intval($_GET['i']) > 0)? intval($_GET['i']) : 0;
+ $multi_color = (isset($_GET['multi'])) ? intval($_GET['multi']) : 0;
- // Get the category colour
+ // Get the category colour
if (Category_Model::is_valid_category($category_id))
{
$color = ORM::factory('category', $category_id)->category_color;
@@ -95,6 +96,29 @@ public function index()
}
}
+ //Where the proper colors are found
+ //Check if All categories is selected
+ if ( $category_id == 0 && $multi_color == 1){
+ //Create new database
+ $db2 = new Database();
+ $sql_category = "SELECT category_id FROM ".$this->table_prefix."incident_category WHERE incident_id = $marker->incident_id";
+ //Retrieve the category_id list from the database
+ $category_query = $db2->query($sql_category);
+ //Hold the category_id as a string
+ foreach ( $category_query as $item ){
+ $category_list = $item->category_id;
+ }
+
+ $sql_color = "SELECT category_color FROM ".$this->table_prefix."category WHERE id = $category_list";
+ //Retrieve the category_color
+ $color_query = $db2->query($sql_color);
+ //Hold the hex color as a string to be passed
+ foreach ( $color_query as $item2 ){
+ $color = $item2->category_color;
+ }
+
+ }
+
$json_item = "{";
$json_item .= "\"type\":\"Feature\",";
$json_item .= "\"properties\": {";
View
7 application/views/main_js.php
@@ -50,7 +50,8 @@
var selectedFeature;
var allGraphData = "";
var dailyGraphData = "";
- var gMediaType = 0
+ var gMediaType = 0;
+ var multiColor = 0;
var timeout = 1500;
var activeZoom = null;
@@ -893,7 +894,9 @@ function smartColumns()
var startTime = new Date(startTimestamp * 1000);
var endTime = new Date(endTimestamp * 1000);
gMediaType = parseFloat(this.id.replace('media_', '')) || 0;
+ var flipColor = parseInt(this.id.replace('multicolor_', '')) || 0;
currentCat = $("#currentCat").val();
+ multiColor = multiColor ^ flipColor;
// Get Current Zoom
currZoom = map.getZoom();
@@ -1065,4 +1068,4 @@ function cilisting(sqllimit,sqloffset) {
<?php
// END CHECKINS!
}
- ?>
+ ?>
View
2  media/js/timeline.js
@@ -745,7 +745,7 @@
// Build the URL for fetching the data
fetchUrl = (thisLayer && thisLayerType == 'layers')
? protocolUrl
- : protocolUrl + '?z=' + myZoom + '&' + this.markerUrlParams(startDate, endDate).join('&');
+ : protocolUrl + '?multi=' + multiColor + '&z=' + myZoom + '&' + this.markerUrlParams(startDate, endDate).join('&');
// Create the reports layer
markers = new OpenLayers.Layer.Vector(thisLayer, {
View
1  themes/default/views/main.php
@@ -181,6 +181,7 @@
<li><a id="media_1" href="#"><span><?php echo Kohana::lang('ui_main.pictures'); ?></span></a></li>
<li><a id="media_2" href="#"><span><?php echo Kohana::lang('ui_main.video'); ?></span></a></li>
<li><a id="media_0" href="#"><span><?php echo Kohana::lang('ui_main.all'); ?></span></a></li>
+ <li><a id="multicolor_1" href="#"><span>multi</span></a></li>
</ul>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.