From 05fe8f39c1f2fd01a9cdb3cd8c975c14162f9dbc Mon Sep 17 00:00:00 2001 From: Faber Vergara Date: Wed, 12 Oct 2016 20:01:22 -0500 Subject: [PATCH 01/12] change the collation file added --- schema/change-the-collation.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 schema/change-the-collation.php diff --git a/schema/change-the-collation.php b/schema/change-the-collation.php new file mode 100644 index 0000000..ba2536b --- /dev/null +++ b/schema/change-the-collation.php @@ -0,0 +1,31 @@ + Date: Wed, 12 Oct 2016 20:04:43 -0500 Subject: [PATCH 02/12] default values added --- schema/change-the-collation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/change-the-collation.php b/schema/change-the-collation.php index ba2536b..c3c33db 100644 --- a/schema/change-the-collation.php +++ b/schema/change-the-collation.php @@ -1,9 +1,9 @@ Date: Wed, 12 Oct 2016 20:06:12 -0500 Subject: [PATCH 03/12] comments fixed --- schema/change-the-collation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/change-the-collation.php b/schema/change-the-collation.php index c3c33db..bfacd5c 100644 --- a/schema/change-the-collation.php +++ b/schema/change-the-collation.php @@ -1,5 +1,5 @@ Date: Wed, 12 Oct 2016 20:12:20 -0500 Subject: [PATCH 04/12] code cleaned --- schema/change-the-collation.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/schema/change-the-collation.php b/schema/change-the-collation.php index bfacd5c..c6cf9bc 100644 --- a/schema/change-the-collation.php +++ b/schema/change-the-collation.php @@ -1,21 +1,26 @@ Date: Tue, 11 Oct 2016 16:06:42 -0500 Subject: [PATCH 05/12] fixed ambiguous field name in on clause task #173 --- mod/analysis/searchSql.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/analysis/searchSql.php b/mod/analysis/searchSql.php index 5dff983..76614d2 100644 --- a/mod/analysis/searchSql.php +++ b/mod/analysis/searchSql.php @@ -23,7 +23,7 @@ public function sqlForJsonQuery($json) { //var_dump('searchQuery',$queryArray); $this->generateSqlArray(); - $sql = $this->getSql(); + $sql = $this->getSql(); return $sql; } @@ -554,8 +554,8 @@ public function getFieldAlias($formField, $type = 'query', $entityType = null, $ $entity = $formField["map"]["entity"]; $field = $formField["map"]["field"]; - - if (is_location_field($entity,$field)){ + + if (is_location_field($entity,$field)){ return "concat($entity.{$field}_longitude,',',$entity.{$field}_latitude) AS $entity"."_"."$field"; } @@ -577,10 +577,10 @@ public function createResult($entity, $field, $type) { $entityArray = $this->getEntityArray($entity); $selectField = $this->getFieldAlias($entityArray[$field], $type, $entity); - //var_dump('selectField' , $entityArray[$field]); + //var_dump('selectField' , $entityArray[$field]); if (($selectField == null || $selectField == '' )) { - error_log(var_export($field,true)); - } + error_log(var_export($field,true)); + } if (!($selectField == null || $selectField == '' )) { $this->sqlArray['select'][$selectField] = $selectField; @@ -641,7 +641,7 @@ public function managementJoin($entity) { } } if ($join) { - $this->sqlArray['join'][] = array('table' => 'management', 'jointype' => 'LEFT', 'field1' => 'entity_id', 'field2' => get_primary_key($entity), 'as' => $as, 'condition' => " AND entity_type ='$entity' "); + $this->sqlArray['join'][] = array('table' => 'management', 'jointype' => 'LEFT', 'field1' => $as.'.entity_id', 'field2' => get_primary_key($entity), 'as' => $as, 'condition' => " AND $as.entity_type ='$entity' "); } } From 20dbf53ab6c3d00d3a74261c4d22dde24fc58870 Mon Sep 17 00:00:00 2001 From: Faber Vergara Date: Thu, 10 Nov 2016 09:34:32 -0500 Subject: [PATCH 06/12] send settings as parameters --- schema/change-the-collation.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/schema/change-the-collation.php b/schema/change-the-collation.php index c6cf9bc..4216a16 100644 --- a/schema/change-the-collation.php +++ b/schema/change-the-collation.php @@ -1,10 +1,17 @@ Date: Thu, 1 Dec 2016 07:33:04 -0500 Subject: [PATCH 07/12] field name fixed --- inc/lib_form.inc | 64 ++++++------- www/res/openlayers/map.js | 189 +++++++++++++++++++------------------- 2 files changed, 127 insertions(+), 126 deletions(-) diff --git a/inc/lib_form.inc b/inc/lib_form.inc index 52d059e..3c98301 100755 --- a/inc/lib_form.inc +++ b/inc/lib_form.inc @@ -8,10 +8,10 @@ * LICENSE: This source file is subject to LGPL license * that is available through the world-wide-web at the following URI: * http://www.gnu.org/copyleft/lesser.html - * + * * * @package moduleAPI - * @subpackage form + * @subpackage form * @author Chamindra de Silva (chamindra@opensource.lk> * @author Janaka Wickramasinghe * @author Ravindra De Silva @@ -223,11 +223,11 @@ function shn_form_text($label, $name, $extra_opts) { if (get_magic_quotes_gpc()) $value = stripslashes($value); if ($extra_opts['no_label'] !== true && isset($label)) { - ?> + ?> + ?>
value="" tabindex="" /> - + onchange="" name="" id="" tabindex="" > @@ -799,7 +799,7 @@ function _shn_form_mt_tree($label, $name, $extra_opts, $multiple = false) { } } ?> - $("#").on("change", function(event) { + $("#").on("change", function(event) { var visibility_fields = ; val = $(this).val() values = val; @@ -807,7 +807,7 @@ function _shn_form_mt_tree($label, $name, $extra_opts, $multiple = false) { values = new Array(val); } for(val2 in visibility_fields){ - + if($.inArray(val2,values)<0){ for(i in visibility_fields[val2]){ $("#"+visibility_fields[val2][i]+"_group").show(); @@ -816,7 +816,7 @@ function _shn_form_mt_tree($label, $name, $extra_opts, $multiple = false) { } for(j in values){ val = values[j] - + if(visibility_fields.hasOwnProperty(val)){ for(i in visibility_fields[val]){ $("#"+visibility_fields[val][i]+"_group").hide(); @@ -1004,11 +1004,11 @@ function shn_form_related_victim($label, $name, $extra_opts) { if (get_magic_quotes_gpc()) $value = stripslashes($value); if ($extra_opts['no_label'] !== true && isset($label)) { - ?> + ?> + ?>
@@ -1073,9 +1073,9 @@ function shn_form_related_event($label, $name, $extra_opts) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } - ?> - -
+ ?> + +
@@ -1150,11 +1150,11 @@ function shn_form_password($label, $name, $extra_opts) { $text_options .= " class='$class'"; if ($extra_opts['no_label'] !== true && isset($label)) { - ?> + ?> + ?>
/> + ?> - +
- - + +

-
+

@@ -1321,7 +1321,7 @@ function shn_form_address($label, $name, $extra_opts) { - + @@ -1376,7 +1376,7 @@ function shn_form_address($label, $name, $extra_opts) { } unset($_POST['person_address']); } - ?> + ?>
@@ -1401,7 +1401,7 @@ function shn_form_address($label, $name, $extra_opts) { - + @@ -1438,7 +1438,7 @@ function shn_form_location($label, $name, $extra_opts) { - +
@@ -1451,7 +1451,7 @@ function shn_form_location($label, $name, $extra_opts) {
- +
diff --git a/www/res/openlayers/map.js b/www/res/openlayers/map.js index fcde83f..fddb0bc 100644 --- a/www/res/openlayers/map.js +++ b/www/res/openlayers/map.js @@ -9,18 +9,18 @@ var highlightCtrl; var selectCtrl; var selectedFeatures = []; function initEditMap(settings){ - + var defaultSettings = { mapContainer:"mapContainer", editContainer:"editContainer", fieldName:"location" - + }; - settings = jQuery.extend(defaultSettings, settings); - + settings = jQuery.extend(defaultSettings, settings); + var options = { units: "dd", - numZoomLevels: 18, + numZoomLevels: 18, controls:[], theme: false, projection: proj_900913, @@ -31,32 +31,32 @@ function initEditMap(settings){ maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34), maxResolution: 156543.0339 }; - + // Now initialise the map map = new OpenLayers.Map(settings.mapContainer, options); maps[settings.fieldName] = map; - - var google_satellite = new OpenLayers.Layer.Google("Google Maps Satellite", { + + var google_satellite = new OpenLayers.Layer.Google("Google Maps Satellite", { type: google.maps.MapTypeId.SATELLITE, animationEnabled: true, sphericalMercator: true, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) }); - var google_hybrid = new OpenLayers.Layer.Google("Google Maps Hybrid", { + var google_hybrid = new OpenLayers.Layer.Google("Google Maps Hybrid", { type: google.maps.MapTypeId.HYBRID, animationEnabled: true, sphericalMercator: true, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) }); - var google_normal = new OpenLayers.Layer.Google("Google Maps Normal", { + var google_normal = new OpenLayers.Layer.Google("Google Maps Normal", { animationEnabled: true, sphericalMercator: true, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) }); - var google_physical = new OpenLayers.Layer.Google("Google Maps Physical", { + var google_physical = new OpenLayers.Layer.Google("Google Maps Physical", { type: google.maps.MapTypeId.TERRAIN, animationEnabled: true, sphericalMercator: true, @@ -70,7 +70,7 @@ function initEditMap(settings){ maps[settings.fieldName].addControl(new OpenLayers.Control.ScaleLine()); maps[settings.fieldName].addControl(new OpenLayers.Control.Scale('mapScale')); maps[settings.fieldName].addControl(new OpenLayers.Control.LayerSwitcher()); - + // Vector/Drawing Layer Styles style1 = new OpenLayers.Style({ pointRadius: "8", @@ -108,13 +108,13 @@ function initEditMap(settings){ strokeWidth: 2.5, graphicZIndex: 1 }); - + var vlayerStyles = new OpenLayers.StyleMap({ "default": style1, "select": style2, "temporary": style3 }); - + vlayer = new OpenLayers.Layer.Vector( "Editable", { styleMap: vlayerStyles, rendererOptions: { @@ -123,7 +123,7 @@ function initEditMap(settings){ }); vlayers[settings.fieldName] = vlayer; maps[settings.fieldName].addLayer(vlayers[settings.fieldName]); - + var endDragfname = settings.fieldName+"_endDrag" var code = "" //code += "function "+endDragfname+"(feature, pixel) {"; @@ -131,14 +131,14 @@ function initEditMap(settings){ code +=" f.state = OpenLayers.State.UPDATE;"; code +="}"; code +="refreshFeatures(\""+settings.fieldName+"\");"; - + code +="var latitude = parseFloat(jQuery('input[name=\""+settings.fieldName+"_latitude\"]').val());" code +="var longitude = parseFloat(jQuery('input[name=\""+settings.fieldName+"_longitude\"]').val());" - + code +="reverseGeocode(latitude, longitude,\""+settings.fieldName+"\");" //code +="}"; var endDragf = new Function(code); - + // Drag Control var drag = new OpenLayers.Control.DragFeature(vlayers[settings.fieldName], { onStart: startDrag, @@ -146,7 +146,7 @@ function initEditMap(settings){ onComplete: endDragf }); maps[settings.fieldName].addControl(drag); - + // Vector Layer Events vlayers[settings.fieldName].events.on({ beforefeaturesadded: function(event) { @@ -155,7 +155,7 @@ function initEditMap(settings){ // vlayer.removeFeatures(vlayer.features); // } //} - + // Disable this to add multiple points // vlayer.removeFeatures(vlayer.features); }, @@ -169,7 +169,7 @@ function initEditMap(settings){ refreshFeatures(event,settings.fieldName); } }); - + // Vector Layer Highlight Features highlightCtrl = new OpenLayers.Control.SelectFeature(vlayers[settings.fieldName], { hover: true, @@ -177,9 +177,9 @@ function initEditMap(settings){ renderIntent: "temporary" }); selectCtrl = new OpenLayers.Control.SelectFeature(vlayers[settings.fieldName], { - clickout: true, + clickout: true, toggle: false, - multiple: false, + multiple: false, hover: false, renderIntent: "select", onSelect: addSelected, @@ -187,35 +187,35 @@ function initEditMap(settings){ }); maps[settings.fieldName].addControl(highlightCtrl); maps[settings.fieldName].addControl(selectCtrl); - - + + // Insert Saved Geometries wkt = new OpenLayers.Format.WKT(); - + if(settings.geometries){ for(i in settings.geometries){ wktFeature = wkt.read(settings.geometries[i]); wktFeature.geometry.transform(proj_4326,proj_900913); vlayers[settings.fieldName].addFeatures(wktFeature); - } + } }else{ // Default Point point = new OpenLayers.Geometry.Point(settings.longitude, settings.latitude); OpenLayers.Projection.transform(point, proj_4326, maps[settings.fieldName].getProjectionObject()); var origFeature = new OpenLayers.Feature.Vector(point); vlayers[settings.fieldName].addFeatures(origFeature); - - } - + + } + // Create a lat/lon object var startPoint = new OpenLayers.LonLat(settings.longitude, settings.latitude); startPoint.transform(proj_4326, maps[settings.fieldName].getProjectionObject()); - + // Display the map centered on a latitude and longitude (Google zoom levels) maps[settings.fieldName].setCenter(startPoint, 8); - - + + // Create the Editing Toolbar var container = document.getElementById(settings.editContainer); var panel = new OpenLayers.Control.EditingToolbar( @@ -228,7 +228,7 @@ function initEditMap(settings){ drag.activate(); highlightCtrl.activate(); selectCtrl.activate(); - + jQuery('.'+settings.fieldName+'_locationButtonsLast').on('click', function () { if (vlayers[settings.fieldName].features.length > 0) { x = vlayers[settings.fieldName].features.length - 1; @@ -239,7 +239,7 @@ function initEditMap(settings){ selectCtrl.activate(); return false; }); - + // Delete Selected Features jQuery('.'+settings.fieldName+'_locationButtonsDelete').on('click', function () { for(var y=0; y < selectedFeatures.length; y++) { @@ -250,7 +250,7 @@ function initEditMap(settings){ selectCtrl.activate(); return false; }); - + // Clear Map jQuery('.'+settings.fieldName+'_locationButtonsClear').on('click', function () { vlayers[settings.fieldName].removeFeatures(vlayers[settings.fieldName].features); @@ -267,8 +267,8 @@ function initEditMap(settings){ selectCtrl.activate(); return false; }); - - + + // GeoCode jQuery('.'+settings.fieldName+'_buttonFind').on('click', function () { geoCode(settings.fieldName); @@ -280,7 +280,7 @@ function initEditMap(settings){ return false; } }); - + // Event on Latitude/Longitude Typing Change jQuery('#'+settings.fieldName+'_latitude, #'+settings.fieldName+'_longitude').bind("focusout keyup", function() { var newlat = jQuery('input[name="'+settings.fieldName+'_latitude"]').val(); @@ -290,13 +290,13 @@ function initEditMap(settings){ // Clear the map first vlayers[settings.fieldName].removeFeatures(vlayers[settings.fieldName].features); jQuery('input[name="'+settings.fieldName+'_geometry[]"]').remove(); - + point = new OpenLayers.Geometry.Point(newlon, newlat); OpenLayers.Projection.transform(point, proj_4326,proj_900913); - + f = new OpenLayers.Feature.Vector(point); vlayers[settings.fieldName].addFeatures(f); - + // create a new lat/lon object myPoint = new OpenLayers.LonLat(newlon, newlat); myPoint.transform(proj_4326, maps[settings.fieldName].getProjectionObject()); @@ -313,19 +313,19 @@ function initEditMap(settings){ } function initViewMap(settings){ - + var defaultSettings = { mapContainer:"mapContainer", editContainer:"editContainer", fieldName:"location" - + }; - settings = jQuery.extend(defaultSettings, settings); - - + settings = jQuery.extend(defaultSettings, settings); + + var options = { units: "dd", - numZoomLevels: 18, + numZoomLevels: 18, controls:[], theme: false, projection: proj_900913, @@ -336,31 +336,31 @@ function initViewMap(settings){ maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34), maxResolution: 156543.0339 }; - + // Now initialise the map map = new OpenLayers.Map(settings.mapContainer, options); maps[settings.fieldName] = map - var google_satellite = new OpenLayers.Layer.Google("Google Maps Satellite", { + var google_satellite = new OpenLayers.Layer.Google("Google Maps Satellite", { type: google.maps.MapTypeId.SATELLITE, animationEnabled: true, sphericalMercator: true, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) }); - var google_hybrid = new OpenLayers.Layer.Google("Google Maps Hybrid", { + var google_hybrid = new OpenLayers.Layer.Google("Google Maps Hybrid", { type: google.maps.MapTypeId.HYBRID, animationEnabled: true, sphericalMercator: true, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) }); - var google_normal = new OpenLayers.Layer.Google("Google Maps Normal", { + var google_normal = new OpenLayers.Layer.Google("Google Maps Normal", { animationEnabled: true, sphericalMercator: true, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) }); - var google_physical = new OpenLayers.Layer.Google("Google Maps Physical", { + var google_physical = new OpenLayers.Layer.Google("Google Maps Physical", { type: google.maps.MapTypeId.TERRAIN, animationEnabled: true, sphericalMercator: true, @@ -374,7 +374,7 @@ function initViewMap(settings){ maps[settings.fieldName].addControl(new OpenLayers.Control.ScaleLine()); maps[settings.fieldName].addControl(new OpenLayers.Control.Scale('mapScale')); maps[settings.fieldName].addControl(new OpenLayers.Control.LayerSwitcher()); - + // Vector/Drawing Layer Styles style1 = new OpenLayers.Style({ pointRadius: "8", @@ -412,13 +412,13 @@ function initViewMap(settings){ strokeWidth: 2.5, graphicZIndex: 1 }); - + var vlayerStyles = new OpenLayers.StyleMap({ "default": style1, "select": style2, "temporary": style3 }); - + vlayer = new OpenLayers.Layer.Vector( "Editable", { styleMap: vlayerStyles, rendererOptions: { @@ -427,11 +427,11 @@ function initViewMap(settings){ }); vlayers[settings.fieldName] = vlayer maps[settings.fieldName].addLayer(vlayers[settings.fieldName]); - - - - - + + + + + // Insert Saved Geometries wkt = new OpenLayers.Format.WKT(); if(settings.geometries){ @@ -439,27 +439,27 @@ function initViewMap(settings){ wktFeature = wkt.read(settings.geometries[i]); wktFeature.geometry.transform(proj_4326,proj_900913); vlayers[settings.fieldName].addFeatures(wktFeature); - } + } }else{ // Default Point point = new OpenLayers.Geometry.Point(settings.longitude, settings.latitude); OpenLayers.Projection.transform(point, proj_4326, maps[settings.fieldName].getProjectionObject()); var origFeature = new OpenLayers.Feature.Vector(point); vlayers[settings.fieldName].addFeatures(origFeature); - - } - + + } + // Create a lat/lon object var startPoint = new OpenLayers.LonLat(settings.longitude, settings.latitude); startPoint.transform(proj_4326, maps[settings.fieldName].getProjectionObject()); - + // Display the map centered on a latitude and longitude (Google zoom levels) maps[settings.fieldName].setCenter(startPoint, 8); - + // Create the Editing Toolbar //var container = document.getElementById(settings.editContainer); //refreshFeatures(settings.fieldName); - + } function geoCode(fieldName) @@ -474,28 +474,29 @@ function geoCode(fieldName) // Clear the map first vlayers[fieldName].removeFeatures(vlayers[fieldName].features); jQuery('input[name="'+fieldName+'_geometry[]"]').remove(); - + point = new OpenLayers.Geometry.Point(data.longitude, data.latitude); OpenLayers.Projection.transform(point, proj_4326,proj_900913); - + f = new OpenLayers.Feature.Vector(point); vlayers[fieldName].addFeatures(f); - + // create a new lat/lon object myPoint = new OpenLayers.LonLat(data.longitude, data.latitude); myPoint.transform(proj_4326, maps[fieldName].getProjectionObject()); // display the map centered on a latitude and longitude maps[fieldName].panTo(myPoint); - + // Update form values - jQuery("#"+fieldName+"_country_name").val(data.country); + console.log('data', data); jQuery('input[name="'+fieldName+'_latitude"]').val(data.latitude); jQuery('input[name="'+fieldName+'_longitude"]').val(data.longitude); - jQuery("#"+fieldName+"_location_name").val(data.location_name); + jQuery('input[name="'+fieldName+"_country_name").val(data.country == '' ? '-' : data.country); + jQuery('input[name="'+fieldName+"_location_name").val(data.location_name == '' ? '-' : data.location_name); } else { // Alert message to be displayed - var alertMessage = address + " not found!\n\n***************************\n" + + var alertMessage = address + " not found!\n\n***************************\n" + "Enter more details like city, town, country\nor find a city or town " + "close by and zoom in\nto find your precise location"; @@ -505,7 +506,7 @@ function geoCode(fieldName) }, "json"); return false; } - + /* Keep track of the selected features */ function addSelected(feature) { selectedFeatures.push(feature); @@ -566,7 +567,7 @@ function clearSelected(feature) { //jQuery('#geometry_color').ColorPickerHide(); } - + /* Feature starting to move */ function startDrag(feature, pixel) { lastPixel = pixel; @@ -590,15 +591,15 @@ function doDrag(feature, pixel) { f.state = OpenLayers.State.UPDATE; } refreshFeatures(fieldName); - + // Fetching Lat Lon Values var latitude = parseFloat(jQuery('input[name="latitude"]').val()); var longitude = parseFloat(jQuery('input[name="longitude"]').val()); - + // Looking up country name using reverse geocoding reverseGeocode(latitude, longitude); }*/ - + function refreshFeatures(event,fieldName) { var geoCollection = new OpenLayers.Geometry.Collection; jQuery('input[name="'+fieldName+'_geometry[]"]').remove(); @@ -638,12 +639,12 @@ function refreshFeatures(event,fieldName) { strokewidth = vlayers[fieldName].features[i].strokewidth; } geometryAttributes = JSON.stringify({ - geometry: geometry, - label: label, + geometry: geometry, + label: label, comment: comment, - lat: lat, - lon: lon, - color: color, + lat: lat, + lon: lon, + color: color, strokewidth: strokewidth }); jQuery('form').append(jQuery('').attr('name',fieldName+'_geometry[]').attr('type','hidden').attr('value',geometryAttributes)); @@ -655,17 +656,17 @@ function refreshFeatures(event,fieldName) { jQuery('input[name="'+fieldName+'_latitude"]').val(centroid.y); jQuery('input[name="'+fieldName+'_longitude"]').val(centroid.x); } - - + + function incidentZoom(event) { jQuery("#incident_zoom").val(maps[settings.fieldName].getZoom()); } - + function updateFeature(feature, color, strokeWidth){ - + // Create a symbolizer from exiting stylemap var symbolizer = feature.layer.styleMap.createSymbolizer(feature); - + // Color available? if (color) { symbolizer['fillColor'] = "#"+color; @@ -678,7 +679,7 @@ function updateFeature(feature, color, strokeWidth){ symbolizer['fillOpacity'] = "0.7"; } } - + // Stroke available? if (parseFloat(strokeWidth)) { symbolizer['strokeWidth'] = parseFloat(strokeWidth); @@ -687,16 +688,16 @@ function updateFeature(feature, color, strokeWidth){ } else { symbolizer['strokeWidth'] = "2.5"; } - + // Set the unique style to the feature feature.style = symbolizer; // Redraw the feature with its new style feature.layer.drawFeature(feature); } - + // Reverse GeoCoder -function reverseGeocode(latitude, longitude,fieldName) { +function reverseGeocode(latitude, longitude,fieldName) { var latlng = new google.maps.LatLng(latitude, longitude); var geocoder = new google.maps.Geocoder(); geocoder.geocode({ From 48a5d22973e7a1e6efd79bcc4107a2a33dbd73a9 Mon Sep 17 00:00:00 2001 From: Andres Vergara Date: Mon, 5 Dec 2016 09:19:41 -0500 Subject: [PATCH 08/12] remove coma at the end --- www/res/locale/ar.json | 2 +- www/res/locale/en.json | 2 +- www/res/locale/es.json | 3 ++- www/res/locale/et.json | 2 +- www/res/locale/fr.json | 2 +- www/res/locale/ge.json | 2 +- www/res/locale/hu.json | 2 +- www/res/locale/ind.json | 2 +- www/res/locale/it.json | 2 +- www/res/locale/km.json | 2 +- www/res/locale/ru.json | 2 +- www/res/locale/sr.json | 2 +- www/res/locale/tr.json | 2 +- 13 files changed, 14 insertions(+), 13 deletions(-) diff --git a/www/res/locale/ar.json b/www/res/locale/ar.json index d7d14da..c111437 100644 --- a/www/res/locale/ar.json +++ b/www/res/locale/ar.json @@ -61,5 +61,5 @@ "Map": "خارطة", "Charts": "رسم بياني", "Results": "النتائج", -"Filters": "مرشح ـ فلتر", +"Filters": "مرشح ـ فلتر" } diff --git a/www/res/locale/en.json b/www/res/locale/en.json index 05a3e31..cf4de80 100644 --- a/www/res/locale/en.json +++ b/www/res/locale/en.json @@ -61,5 +61,5 @@ "Map": "Map", "Charts": "Charts", "Results": "Results", -"Filters": "Filters", +"Filters": "Filters" } diff --git a/www/res/locale/es.json b/www/res/locale/es.json index 1ea0f0e..d6272ae 100644 --- a/www/res/locale/es.json +++ b/www/res/locale/es.json @@ -44,6 +44,7 @@ "REMOVE_CLARIFY": "Eliminar Explicar", "REMOVE_CONDITION": "Eliminar Condición", "REMOVE_SELECTION": "Eliminar Selección", +"SELECT": "Seleccionar", "SELECT_ENTITY": "Seleccionar una entidad", "SELECT_FIELD": "Seleccionar un campo", "SELECT_TREE_OPTION": "Seleccionar Opción árbol", @@ -61,5 +62,5 @@ "Map": "Mapa", "Charts": "Gráficos", "Results": "Resultados", -"Filters": "Filtros", +"Filters": "Filtros" } diff --git a/www/res/locale/et.json b/www/res/locale/et.json index ee81330..bbc3092 100644 --- a/www/res/locale/et.json +++ b/www/res/locale/et.json @@ -61,5 +61,5 @@ "Map": "Kaart", "Charts": "Graafikud", "Results": "Tulemused", -"Filters": "Filtrid", +"Filters": "Filtrid" } diff --git a/www/res/locale/fr.json b/www/res/locale/fr.json index 23c3df9..10a71a9 100644 --- a/www/res/locale/fr.json +++ b/www/res/locale/fr.json @@ -61,5 +61,5 @@ "Map": "Carte", "Charts": "Graphiques", "Results": "Résultats", -"Filters": "Filtres", +"Filters": "Filtres" } diff --git a/www/res/locale/ge.json b/www/res/locale/ge.json index 5e9a6cd..f2aceb9 100644 --- a/www/res/locale/ge.json +++ b/www/res/locale/ge.json @@ -61,5 +61,5 @@ "Map": "რუკა", "Charts": "სქემები", "Results": "შედეგების დანომვრა", -"Filters": "ფილტრები", +"Filters": "ფილტრები" } diff --git a/www/res/locale/hu.json b/www/res/locale/hu.json index 373105c..9bc95c3 100644 --- a/www/res/locale/hu.json +++ b/www/res/locale/hu.json @@ -61,5 +61,5 @@ "Map": "Térkép", "Charts": "Diagramok", "Results": "Eredmények", -"Filters": "Szűrők", +"Filters": "Szűrők" } diff --git a/www/res/locale/ind.json b/www/res/locale/ind.json index 6dbb13b..2aa525a 100644 --- a/www/res/locale/ind.json +++ b/www/res/locale/ind.json @@ -61,5 +61,5 @@ "Map": "Peta", "Charts": "Grafik", "Results": "Hasil", -"Filters": "Penyaring", +"Filters": "Penyaring" } diff --git a/www/res/locale/it.json b/www/res/locale/it.json index dc65162..3cbd02d 100644 --- a/www/res/locale/it.json +++ b/www/res/locale/it.json @@ -61,5 +61,5 @@ "Map": "Mappa", "Charts": "Grafici", "Results": "Risultati", -"Filters": "Filtri", +"Filters": "Filtri" } diff --git a/www/res/locale/km.json b/www/res/locale/km.json index 371a1e3..ed64751 100644 --- a/www/res/locale/km.json +++ b/www/res/locale/km.json @@ -61,5 +61,5 @@ "Map": "Map", "Charts": "Charts", "Results": "Results", -"Filters": "Filters", +"Filters": "Filters" } diff --git a/www/res/locale/ru.json b/www/res/locale/ru.json index 35691b5..fdecb18 100644 --- a/www/res/locale/ru.json +++ b/www/res/locale/ru.json @@ -61,5 +61,5 @@ "Map": "Карта", "Charts": "Графики", "Results": "Результаты", -"Filters": "Фильтры", +"Filters": "Фильтры" } diff --git a/www/res/locale/sr.json b/www/res/locale/sr.json index b117748..85f8614 100644 --- a/www/res/locale/sr.json +++ b/www/res/locale/sr.json @@ -61,5 +61,5 @@ "Map": "Mape", "Charts": "Grafikoni", "Results": "Rezultati", -"Filters": "Filteri", +"Filters": "Filteri" } diff --git a/www/res/locale/tr.json b/www/res/locale/tr.json index 7a24138..13a0d4d 100644 --- a/www/res/locale/tr.json +++ b/www/res/locale/tr.json @@ -61,5 +61,5 @@ "Map": "Harita", "Charts": "Grafikler", "Results": "Sonuçlar", -"Filters": "Filtreler", +"Filters": "Filtreler" } From c255da9bdd5a5769f38410d8786e1e975a68800c Mon Sep 17 00:00:00 2001 From: Andres Vergara Date: Tue, 14 Feb 2017 09:51:33 -0500 Subject: [PATCH 09/12] change Delete method by DeleteFromRecordNumber --- mod/docu/docuModule.class.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mod/docu/docuModule.class.php b/mod/docu/docuModule.class.php index 7d917cb..7e01bc7 100644 --- a/mod/docu/docuModule.class.php +++ b/mod/docu/docuModule.class.php @@ -80,10 +80,10 @@ function __construct() { public function createArgumentEncoder() { $whiteList = Array( 'request_page', 'rpp', 'doc_id', 'title', - 'datecreated', 'datesubmitted', 'type', 'format', + 'datecreated', 'datesubmitted', 'type', 'format', 'filter', 'sort', 'sortorder' ); - + $this->argumentEncoder = new ArgumentEncoder($whiteList); } @@ -132,7 +132,7 @@ public function act_browse() { $this->result_pager = Browse::getExecuteSql($sqlStatement); $this->result_pager->setArgumentEncoder($this->argumentEncoder); - + $this->columnValues = $this->result_pager->get_page_data(); $this->columnValues = set_links_in_recordset($this->columnValues, 'supporting_docs_meta'); @@ -194,7 +194,7 @@ public function act_view_document() { $this->supporting_docs_meta = new SupportingDocsMeta(); $this->supporting_docs_meta->LoadfromRecordNumber($_GET['doc_id']); $this->supporting_docs_meta->LoadRelationships(); - + $this->supporting_docs = new SupportingDocs(); $this->supporting_docs->LoadfromRecordNumber($_GET['doc_id']); @@ -204,8 +204,8 @@ public function act_view_document() { } /** - * act_edit_document Action to edit document details - * + * act_edit_document Action to edit document details + * * @access public * @return void */ @@ -231,14 +231,14 @@ public function act_edit_document() { $this->supporting_docs->Save(); shnMessageQueue::addInformation(_t('THE_OLD_FILE_ATTACHMENT_WAS_UPDATED_WITH_THE_NEW_FILE_ATTACHMENT_')); } else if (isset($_POST['no'])) { - + } else if ($this->supporting_docs->uri != null && $uri != '') { $this->fileExist = true; $_SESSION['uri'] = $uri; $_SESSION['type'] = $type; return; } else if ($this->supporting_docs->uri != null && $uri == '') { - + } else { $this->supporting_docs->uri = $uri; $this->supporting_docs->Save(); @@ -262,7 +262,7 @@ public function act_delete_document() { set_redirect_header('docu', 'view_document', null); } if (isset($_POST['delete'])) { - $this->supporting_docs_meta->Delete(); + $this->supporting_docs_meta->DeleteFromRecordNumber($this->supporting_docs_meta->doc_id); unlink($this->supporting_docs->uri); $this->supporting_docs->Delete(); @@ -275,8 +275,8 @@ public function act_delete_document() { } /** - * act_link - * + * act_link + * * @access public * @return void */ @@ -290,8 +290,8 @@ public function act_link() { } /** - * act_audit - * + * act_audit + * * @access public * @return void */ @@ -316,7 +316,7 @@ public function act_download() { $supporting_docs_meta = new SupportingDocsMeta(); $supporting_docs_meta->LoadfromRecordNumber($_GET['doc_id']); $supporting_docs_meta->LoadRelationships(); - + $supporting_docs = new SupportingDocs(); $supporting_docs->LoadfromRecordNumber($_GET['doc_id']); //set headers From 9b60b21b930d387a1c54cddea0680ebeee14c0d8 Mon Sep 17 00:00:00 2001 From: Andres Vergara Date: Tue, 14 Feb 2017 10:03:12 -0500 Subject: [PATCH 10/12] ignore git oedemo's own folders --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e10925a..866ffe5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /media/* /media/filemanager/* /conf/sysconf.php -/www/images/uploads \ No newline at end of file +/www/images/uploads +/usr +/etc \ No newline at end of file From c05d55e30a44341cf561c21445b58479ee37286a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Habinshuti?= Date: Fri, 3 Mar 2017 21:53:57 +0000 Subject: [PATCH 11/12] Add url property to SupportingDocMeta --- data/SupportingDocsMeta.php | 1 + 1 file changed, 1 insertion(+) diff --git a/data/SupportingDocsMeta.php b/data/SupportingDocsMeta.php index 6f22e12..ecbfcca 100644 --- a/data/SupportingDocsMeta.php +++ b/data/SupportingDocsMeta.php @@ -41,6 +41,7 @@ class SupportingDocsMeta extends DomainEntity{ public $type; public $language; public $subject; +public $url; From f0008b6bf253b4dc436548dcf8c1ec1b25e415b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Habinshuti?= Date: Fri, 3 Mar 2017 22:00:17 +0000 Subject: [PATCH 12/12] Add document url field to database schema --- schema/mysql-dbcreate.sql | 1 + schema/mysql-dbpopulate-datadict.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/schema/mysql-dbcreate.sql b/schema/mysql-dbcreate.sql index 11adc52..ef51968 100755 --- a/schema/mysql-dbcreate.sql +++ b/schema/mysql-dbcreate.sql @@ -1274,6 +1274,7 @@ CREATE TABLE IF NOT EXISTS supporting_docs_meta( type varchar(14), language varchar(64), subject varchar(64), + url varchar(255), PRIMARY KEY (doc_id), FOREIGN KEY (doc_id) REFERENCES supporting_docs(doc_id) ON DELETE CASCADE diff --git a/schema/mysql-dbpopulate-datadict.sql b/schema/mysql-dbpopulate-datadict.sql index 1e34347..e05a9dc 100755 --- a/schema/mysql-dbpopulate-datadict.sql +++ b/schema/mysql-dbpopulate-datadict.sql @@ -323,6 +323,7 @@ INSERT INTO `data_dict` (`field_number`, `field_label`, `field_type`, `datatype` ('9008', 'Language', 'text', NULL, '9008', '0', 'n', 'n', 'language', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'supporting_docs_meta', NULL, 'n', 'y', 'y', 'y', 'y', 'y', 'y', '', 'y', '', 'n', 'y', 'n'), ('9009', 'Choose File Upload', 'upload', NULL, '9009', '0', 'n', 'n', 'choose_file_upload', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'supporting_docs_meta', NULL, 'n', 'y', 'y', 'y', 'y', 'N', 'N', 'n', 'n', '', 'n', 'n', 'n'), ('9010', 'Format', 'hidden', NULL, '9010', '0', 'n', 'n', 'format', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'supporting_docs_meta', NULL, 'n', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', '', 'n', 'y', 'n'), +('9011', 'URL', 'text', NULL, '9011', '0', 'n', 'n', 'url', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'supporting_docs_meta', NULL, 'n', 'y', 'y', 'y', 'y', 'y', 'y', '', 'y', '', 'n', 'y', 'n'), ('911_1', 'Date of Birth Type', 'mt_select', NULL, '911_1', '48', 'N', 'n', 'date_of_birth_type', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'person', NULL, 'n', 'y', 'y', '', 'y', 'n', 'n', '', 'y', '', 'n', 'y', 'n'), ('928_1', 'Date Deceased Type', 'mt_select', NULL, '928_1', '48', 'N', 'n', 'date_deceased_type', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'person', NULL, 'n', 'y', 'y', '', 'y', 'n', 'n', '', 'y', '', 'n', 'y', 'n');