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 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; 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/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 diff --git a/schema/change-the-collation.php b/schema/change-the-collation.php new file mode 100644 index 0000000..4216a16 --- /dev/null +++ b/schema/change-the-collation.php @@ -0,0 +1,49 @@ + 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({