diff --git a/js/hoverControl.js b/js/hoverControl.js new file mode 100644 index 00000000..d625d956 --- /dev/null +++ b/js/hoverControl.js @@ -0,0 +1,248 @@ +/* Indicia, the OPAL Online Recording Toolkit. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/gpl.html. + */ + +/** + * Class: OpenLayers.Control.HoverFeature + * Gets data for features under the mouse cursor: runs an ajax request + * and inseerts the returning data into a popup + * + * Inherits from: + * - + */ +OpenLayers.Control.HoverFeature = OpenLayers.Class(OpenLayers.Control, { + + /** + * APIProperty: clickTolerance + * {Integer} Tolerance for the filter query in pixels. This has the + * same effect as the tolerance parameter on WMS GetFeatureInfo + * requests. Will be ignored for box selections. Applies only if + * or is true. Default is 5. Note that this not + * only affects requests on click, but also on hover. + */ + clickTolerance: 5, + + /** + * Property: handlers + * {Object} Object with references to multiple + * instances. + */ + handlers: null, + + /** + * APIProperty: events + * {} Events instance for listeners and triggering + * control specific events. + * + * Register a listener for a particular event with the following syntax: + * (code) + * control.events.register(type, obj, listener); + * (end) + */ + + /** + * Constructor: OpenLayers.Control.HoverFeature + * Create a new control for fetching remote features. + * + * Parameters: + * options - {Object} A configuration object + */ + initialize: function(options) { + options.handlerOptions = options.handlerOptions || {}; + + OpenLayers.Control.prototype.initialize.apply(this, [options]); + + this.handlers = {}; + + this.handlers.hover = new OpenLayers.Handler.Hover( + this, {'move': this.cancelHover, 'pause': this.selectHover}, + OpenLayers.Util.extend(this.handlerOptions.hover, { + 'pixelTolerance': 4 + }) + ); + }, + + /** + * Method: activate + * Activates the control. + * + * Returns: + * {Boolean} The control was effectively activated. + */ + activate: function () { + if (!this.active) { + for(var i in this.handlers) { + this.handlers[i].activate(); + } + } + return OpenLayers.Control.prototype.activate.apply( + this, arguments + ); + }, + + /** + * Method: deactivate + * Deactivates the control. + * + * Returns: + * {Boolean} The control was effectively deactivated. + */ + deactivate: function () { + if (this.active) { + for(var i in this.handlers) { + this.handlers[i].deactivate(); + } + } + return OpenLayers.Control.prototype.deactivate.apply( + this, arguments + ); + }, + + /** + * Method: selectHover + * Callback from the handlers.hover set up when selection is on + * + * Parameters: + * evt - {Object} event object with an xy property + */ + pixelToBounds: function(pixel) { + var llPx = pixel.add(-this.clickTolerance/2, this.clickTolerance/2); + var urPx = pixel.add(this.clickTolerance/2, -this.clickTolerance/2); + var ll = this.map.getLonLatFromPixel(llPx); + var ur = this.map.getLonLatFromPixel(urPx); + return new OpenLayers.Bounds(ll.lon, ll.lat, ur.lon, ur.lat); + }, + + /** + * Method: selectHover + * Callback from the handlers.hover set up when selection is on + * + * Parameters: + * evt - {Object} event object with an xy property + */ + selectHover: function(evt) { + + var bounds = this.pixelToBounds(evt.xy); + + for (var i=0; i', + keepVagueDates = typeof records[0].date === 'undefined'; + if(records.length <= 1) { + // use normal for (in) to get object properties + for(var attr in records[0]) { + // skip vague date component columns if we have a standard date + if (keepVagueDates || attr.substr(0, 5)!=='date_') { + html += '' + attr.charAt(0).toUpperCase() + attr.slice(1) + '' + '' + records[0][attr] + ''; + } + }; + } else { + html += ''; + for(var attr in records[0]) { + // skip vague date component columns if we have a standard date + if (keepVagueDates || attr.substr(0, 5)!=='date_') { + html += '' + attr.charAt(0).toUpperCase() + attr.slice(1) + ''; + } + }; + html += ''; + for(var i = 0; i < records.length && i < 8; i++) { /// force a maximum of 8, otherwise there is havoc on the map + html += ''; + for(var attr in records[0]) { + if (keepVagueDates || attr.substr(0, 5)!=='date_') { + html += '' + records[i][attr] + ''; + } + }; + html += ''; + } + html += ''; + } + html += ''; + return html; + }, + + /** + * Method: cancelHover + * Callback from the handlers.hover set up when selection is on + */ + cancelHover: function() { + + }, + + /** + * Method: setMap + * Set the map property for the control. + * + * Parameters: + * map - {} + */ + setMap: function(map) { + for(var i in this.handlers) { + this.handlers[i].setMap(map); + } + OpenLayers.Control.prototype.setMap.apply(this, arguments); + }, + + CLASS_NAME: "OpenLayers.Control.HoverFeature" +}); diff --git a/js/jquery.indiciaMapPanel.js b/js/jquery.indiciaMapPanel.js index bd5f6e6c..e47b95cb 100644 --- a/js/jquery.indiciaMapPanel.js +++ b/js/jquery.indiciaMapPanel.js @@ -44,6 +44,7 @@ mapClickForSpatialRefHooks = []; var lastClickedLatLonZoom = {}; var destroyAllFeatures; + /** * Class: indiciaMapPanel * JavaScript & OpenLayers based map implementation class for Indicia data entry forms. @@ -1204,11 +1205,15 @@ var destroyAllFeatures; clickableWMSLayerNames = clickableWMSLayerNames.join(','); // Create a control that can handle both WMS and vector layer clicks. var infoCtrl = new OpenLayers.Control({ + hoverControl: null, displayClass: align + 'olControlSelectFeature', title: div.settings.reportGroup===null ? '' : div.settings.hintQueryDataPointsTool, lastclick: {}, allowBox: clickableVectorLayers.length>0 && div.settings.allowBox===true, deactivate: function() { + if(this.hoverControl !== null) { + this.hoverControl.deactivate(); + } // Disable the click buffer tolerance control. $('#click-buffer').hide(); //If the map is setup to use popups, then we need to switch off popups when moving to use a different tool icon @@ -1268,6 +1273,9 @@ var destroyAllFeatures; scope: this }); } + if(clickableVectorLayers.length>0 && this.hoverControl !== null) { + this.hoverControl.activate(); + } OpenLayers.Control.prototype.activate.call(this); }, // handler for the click or bounding box action @@ -1362,6 +1370,14 @@ var destroyAllFeatures; }); + if (clickableVectorLayers.length>0 && div.settings.hoverShowsDetails === true) { + // If there are clickable layers and hover is enabled, we add a hidden control to handle the hover events + // It is not possible to have a single select control that does both. The select control itself + // interferes with select status of feature, even if in hover mode, so use our own custom control. + infoCtrl.hoverControl = new OpenLayers.Control.HoverFeature( + {'layers': clickableVectorLayers}); + } + return infoCtrl; } else { return null; @@ -2466,6 +2482,9 @@ var destroyAllFeatures; toolbar.addControls([nav]); toolbar.addControls(toolbarControls); div.map.addControl(toolbar); + if (clickInfoCtrl !== null && clickInfoCtrl.hoverControl !== null) { + div.map.addControl(clickInfoCtrl.hoverControl); + } if (click) { click.activate(); } @@ -2481,6 +2500,9 @@ var destroyAllFeatures; } if (clickInfoCtrl !== null) { div.map.addControl(clickInfoCtrl); + if (clickInfoCtrl.hoverControl !== null) { + div.map.addControl(clickInfoCtrl.hoverControl); + } clickInfoCtrl.activate(); } } @@ -2542,6 +2564,7 @@ jQuery.fn.indiciaMapPanel.defaults = { indiciaWMSLayers: {}, indiciaWFSLayers : {}, layers: [], + hoverShowsDetails: false, clickableLayers: [], clickableLayersOutputMode: 'popup', // options are popup, div or customFunction clickableLayersOutputFn: format_selected_features, diff --git a/js/jquery.reportgrid.js b/js/jquery.reportgrid.js index 7626fd1e..0e726908 100644 --- a/js/jquery.reportgrid.js +++ b/js/jquery.reportgrid.js @@ -136,7 +136,7 @@ } function getActions (div, row, actions, queryParams) { - var result=''; + var result = ''; var onclick; var href; var content; @@ -151,9 +151,9 @@ if (typeof action.visibility_field === 'undefined' || thisrow[action.visibility_field] !== 'f') { if (typeof action.javascript !== 'undefined') { rowCopy = thisrow; - $.each(rowCopy, function (idx) { - if (rowCopy[idx] !== null) { - rowCopy[idx] = rowCopy[idx].replace(/'/g,"\\'"); + $.each(rowCopy, function replaceInField(field) { + if (typeof rowCopy[field] === 'string') { + rowCopy[field] = rowCopy[field].replace(/'/g, "\\'"); } }); onclick = ' onclick="' + mergeParamsIntoTemplate(div, rowCopy, action.javascript) + '"'; @@ -227,7 +227,7 @@ } function simplePager (pager, div, hasMore) { - var pagerContent=''; + var pagerContent = ''; if (div.settings.offset !== 0) { pagerContent += 'previous '; } else { @@ -268,7 +268,7 @@ for (page = Math.max(1, div.settings.offset/div.settings.itemsPerPage - 4); page <= Math.min(div.settings.offset/div.settings.itemsPerPage + 6, Math.ceil(div.settings.recordCount / div.settings.itemsPerPage)); page += 1) { - if (page === div.settings.offset/div.settings.itemsPerPage+1) { + if (page === div.settings.offset / div.settings.itemsPerPage + 1) { pagelist += '' + page + ' '; } else { pagelist += '' + page + ' '; @@ -276,7 +276,7 @@ } pagerContent = pagerContent.replace('{pagelist}', pagelist); if (div.settings.recordCount === 0) { - pagerContent=pagerContent.replace('{showing}', div.settings.noRecords); + pagerContent = pagerContent.replace('{showing}', div.settings.noRecords); } else { showing = showing.replace('{1}', div.settings.offset + 1); showing = showing.replace('{2}', div.settings.offset + div.settings.currentPageCount); @@ -315,7 +315,9 @@ div.loading = true; div.settings.offset -= div.settings.itemsPerPage; // Min offset is zero. - if (div.settings.offset < 0) { div.settings.offset = 0; } + if (div.settings.offset < 0) { + div.settings.offset = 0; + } load(div, false); }); @@ -348,7 +350,7 @@ // recreate the pagination footer function updatePager (div, hasMore) { - var pager=$(div).find('.pager'); + var pager = $(div).find('.pager'); pager.empty(); if (typeof div.settings.recordCount === 'undefined') { simplePager(pager, div, hasMore); @@ -362,7 +364,8 @@ * Returns the query parameter, which filters the output based on the filters and filtercol/filtervalue. */ function getQueryParam (div) { - var query={}, needQuery = false; + var query = {}; + var needQuery = false; if (div.settings.filterCol !== null && div.settings.filterValue !== null) { query.like = {}; query.like[div.settings.filterCol] = div.settings.filterValue; @@ -396,13 +399,13 @@ * the user has made on the popup filter page. * Returns an array containing the rows to keep. */ - function applyPopupFilterExclusionsToRows(rows,div) { - indiciaData.popupFilterRemovedRowsCount=0; - indiciaData.allReportGridRecords=[]; + function applyPopupFilterExclusionsToRows(rows, div) { var rowsToDisplay = []; var keepRow; // Keep a count of each row we have worked on starting from 1. var rowCount = 1; + indiciaData.popupFilterRemovedRowsCount = 0; + indiciaData.allReportGridRecords = []; $.each(rows, function(rowIdx, theRow) { // To start assume we are keeping the data keepRow = true; @@ -621,7 +624,7 @@ // execute callback it there is one if (div.settings.callback !== '') { - window[div.settings.callback](); + window[div.settings.callback](div); } if (typeof callback !== 'undefined') { callback(); @@ -1312,7 +1315,7 @@ // execute callback it there is one if (div.settings.callback !== '') { - window[div.settings.callback](); + window[div.settings.callback](div); } }); diff --git a/js/reportFilters.js b/js/reportFilters.js index d4326f63..da6a6a87 100644 --- a/js/reportFilters.js +++ b/js/reportFilters.js @@ -190,10 +190,39 @@ jQuery(document).ready(function ($) { if (filterDef.marine_flag && indiciaData.filter.def.marine_flag !== 'all') { r.push($('#marine_flag').find('option[value=' + filterDef.marine_flag + ']').text()); } + if (typeof filterDef.confidential !== 'undefined') { + switch (filterDef.confidential) { + case 't': + r.push(indiciaData.lang.reportFilters.OnlyConfidentialRecords); + break; + case 'all': + r.push(indiciaData.lang.reportFilters.AllConfidentialRecords); + break; + default: + r.push(indiciaData.lang.reportFilters.NoConfidentialRecords); + } + } + if (typeof filterDef.release_status !== 'undefined') { + switch (filterDef.release_status) { + case 'A': + r.push(indiciaData.lang.reportFilters.includeUnreleasedRecords); + break; + default: + r.push(indiciaData.lang.reportFilters.excludeUnreleasedRecords); + } + } + if (typeof filterDef.taxa_taxon_list_attribute_term_descriptions !== 'undefined') { + $.each(filterDef.taxa_taxon_list_attribute_term_descriptions, function getAttrDescription(label, terms) { + r.push(label + ' ' + Object.values(terms).join(', ')); + }); + } return r.join('
'); }, applyFormToDefinition: function () { - // don't send unnecessary stuff + var ttlAttrTermIds = []; + var ttlAttrTermDescriptions = {}; + var i = 0; + // Don't send unnecessary stuff like input values from sub_list controls. delete indiciaData.filter.def['taxon_group_list:search']; delete indiciaData.filter.def['taxon_group_list:search:q']; delete indiciaData.filter.def['higher_taxa_taxon_list_list:search']; @@ -202,6 +231,11 @@ jQuery(document).ready(function ($) { delete indiciaData.filter.def['taxa_taxon_list_list:search:searchterm']; delete indiciaData.filter.def['taxon_designation_list:search']; delete indiciaData.filter.def['taxon_designation_list:search:title']; + while (typeof indiciaData.filter.def['taxa_taxon_list_attribute_termlist_term_ids:' + i + ':search'] !== 'undefined') { + delete indiciaData.filter.def['taxa_taxon_list_attribute_termlist_term_ids:' + i + ':search']; + delete indiciaData.filter.def['taxa_taxon_list_attribute_termlist_term_ids:' + i + ':search:term']; + } + // reset the list of group names and species indiciaData.filter.def.taxon_group_names = {}; indiciaData.filter.def.higher_taxa_taxon_list_names = {}; @@ -244,17 +278,31 @@ jQuery(document).ready(function ($) { if (typeof indiciaData.filter.def.taxon_rank_sort_order_combined !== 'undefined') { indiciaData.filter.def.taxon_rank_sort_order = indiciaData.filter.def.taxon_rank_sort_order_combined.split(':')[0]; } + $.each($('ul[id^="taxa_taxon_list_attribute_termlist_term_ids\\:"]'), function () { + var groupIdx = this.id.replace(/^taxa_taxon_list_attribute_termlist_term_ids:/, '').replace(/:sublist$/, ''); + var groupTerms = {}; + $.each($(this).find('li'), function() { + ttlAttrTermIds.push($(this).find('input[name$="\\[\\]"]').val()); + groupTerms[$(this).find('input[name$="\\[\\]"]').val()] = $(this).text().trim(); + }); + if ($(this).find('li').length > 0) { + ttlAttrTermDescriptions[indiciaData.taxaTaxonListAttributeLabels[groupIdx]] = groupTerms; + } + }); + indiciaData.filter.def.taxa_taxon_list_attribute_ids = indiciaData.taxaTaxonListAttributeIds.join(','); + indiciaData.filter.def.taxa_taxon_list_attribute_termlist_term_ids = ttlAttrTermIds.join(','); + indiciaData.filter.def.taxa_taxon_list_attribute_term_descriptions = ttlAttrTermDescriptions; }, loadForm: function (context) { - var firstTab = 0, disabled = []; + var firstTab = 'species-group-tab'; + var disabled = []; // got a families or species level context. So may as well disable the less specific tabs as they won't be useful. if (context && context.higher_taxa_taxon_list_list) { - firstTab = 1; + firstTab = 'species-tab'; disabled = [0]; $('#families-tab').find('.context-instruct').show(); - } - else if (context && context.taxa_taxon_list_list) { - firstTab = 2; + } else if (context && context.taxa_taxon_list_list) { + firstTab = 'designations-tab'; disabled = [0, 1]; $('#species-tab').find('.context-instruct').show(); } @@ -269,10 +317,22 @@ jQuery(document).ready(function ($) { $('#marine_flag').removeAttr('disabled'); $('#flags-tab .context-instruct').hide(); } + if (context && context.confidential && context.confidential !== 'all') { + $('#confidential').attr('disabled', 'disabled'); + $('#confidential').find('option[value=' + context.confidential + ']').attr('selected', 'selected'); + $('#flags-tab .context-instruct').show(); + } + if (context && context.release_status && context.release_status !== 'A') { + $('#release_status').attr('disabled', 'disabled'); + $('#release_status').find('option[value=' + context.release_status + ']').attr('selected', 'selected'); + $('#flags-tab .context-instruct').show(); + } $('#what-tabs').tabs('option', 'disabled', disabled); indiciaFns.activeTab($('#what-tabs'), firstTab); if (context && context.taxon_group_list) { - $('input#taxon_group_list\\:search\\:q').setExtraParams({'idlist': context.taxon_group_list}); + $('input#taxon_group_list\\:search\\:q').setExtraParams({ + idlist: context.taxon_group_list + }); $('#species-group-tab .context-instruct').show(); } else if ($('input#taxon_group_list\\:search\\:q').length > 0) { @@ -307,8 +367,23 @@ jQuery(document).ready(function ($) { ''); }); } - if (typeof hook_reportfilter_loadForm != 'undefined') + // need to load the sub list control for each linked taxa_taxon_list_attribute. + if (typeof indiciaData.filter.def.taxa_taxon_list_attribute_term_descriptions !== 'undefined' && + typeof indiciaData.taxaTaxonListAttributeLabels !== 'undefined') { + $.each(indiciaData.taxaTaxonListAttributeLabels, function (idx, label) { + var sublist = $('#taxa_taxon_list_attribute_termlist_term_ids\\:' + idx + '\\:sublist'); + sublist.children().remove(); + if (typeof indiciaData.filter.def.taxa_taxon_list_attribute_term_descriptions[label] !== 'undefined') { + $.each(indiciaData.filter.def.taxa_taxon_list_attribute_term_descriptions[label], function (termlistTermId, term) { + sublist.append('
  • ' + term + + '
  • '); + }); + } + }); + } + if (typeof hook_reportfilter_loadForm !== 'undefined') { hook_reportfilter_loadForm('what'); + } } }, when: { @@ -439,7 +514,7 @@ jQuery(document).ready(function ($) { ids.push($(this).find('input[name="location_list[]"]').val()); names.push($(this).text().trim()); }); - if ($.inArray(parseInt($('#site-type').val()), indiciaData.indexedLocationTypeIds) !== -1) { + if ($.inArray(parseInt($('#site-type').val(), 10), indiciaData.indexedLocationTypeIds) !== -1) { indiciaData.filter.def.indexed_location_list = ids.join(','); } else { indiciaData.filter.def.location_list = ids.join(','); @@ -486,6 +561,8 @@ jQuery(document).ready(function ($) { $('#filter-map-container').css('height', $(window).height() - 380); }, loadForm: function (context) { + var locationsToLoad; + var siteType; // legacy if (indiciaData.filter.def.location_id && !indiciaData.filter.def.location_list) { indiciaData.filter.def.location_list = indiciaData.filter.def.location_id; @@ -502,8 +579,8 @@ jQuery(document).ready(function ($) { $("#site-type option[value='loc:" + indiciaData.filter.def.indexed_location_list + "']").length > 0) { $('#site-type').val('loc:' + indiciaData.filter.def.indexed_location_list); } else if (indiciaData.filter.def.indexed_location_list || indiciaData.filter.def.location_list) { - var locationsToLoad = indiciaData.filter.def.indexed_location_list ? - indiciaData.filter.def.indexed_location_list : indiciaData.filter.def.location_list, siteType; + locationsToLoad = indiciaData.filter.def.indexed_location_list ? + indiciaData.filter.def.indexed_location_list : indiciaData.filter.def.location_list; if (indiciaData.filter.def['site-type']) { siteType = indiciaData.filter.def['site-type']; } else { @@ -576,7 +653,7 @@ jQuery(document).ready(function ($) { who: { getDescription: function () { if (indiciaData.filter.def.my_records) { - return indiciaData.lang.MyRecords; + return indiciaData.lang.reportFilters.MyRecords; } else { return ''; } @@ -627,21 +704,21 @@ jQuery(document).ready(function ($) { r.push($('#quality-filter option[value=' + indiciaData.filter.def.quality.replace('!', '\\!') + ']').html()); } if (indiciaData.filter.def.autochecks === 'F') { - r.push(indiciaData.lang.AutochecksFailed); + r.push(indiciaData.lang.reportFilters.AutochecksFailed); } else if (indiciaData.filter.def.autochecks === 'P') { - r.push(indiciaData.lang.AutochecksPassed); + r.push(indiciaData.lang.reportFilters.AutochecksPassed); } if (indiciaData.filter.def.identification_difficulty) { op = typeof indiciaData.filter.def.identification_difficulty_op === 'undefined' ? '=' : indiciaData.filter.def.identification_difficulty_op.replace(/[<=>]/g, '\\$&'); - r.push(indiciaData.lang.IdentificationDifficulty + ' ' + + r.push(indiciaData.lang.reportFilters.IdentificationDifficulty + ' ' + $('#identification_difficulty_op').find("option[value='" + op + "']").html() + ' ' + indiciaData.filter.def.identification_difficulty); } if (indiciaData.filter.def.has_photos && indiciaData.filter.def.has_photos === '1') { - r.push(indiciaData.lang.HasPhotos); + r.push(indiciaData.lang.reportFilters.HasPhotos); } else if (indiciaData.filter.def.has_photos && indiciaData.filter.def.has_photos === '0') { - r.push(indiciaData.lang.HasNoPhotos); + r.push(indiciaData.lang.reportFilters.HasNoPhotos); } return r.join('
    '); }, @@ -1085,7 +1162,7 @@ jQuery(document).ready(function ($) { // clear any sublists $('.ind-sub-list li').remove(); updateFilterDescriptions(); - $('#filter-build').html(indiciaData.lang.CreateAFilter); + $('#filter-build').html(indiciaData.lang.reportFilters.CreateAFilter); $('#filter-reset').addClass('disabled'); $('#filter-delete').addClass('disabled'); $('#filter-apply').addClass('disabled'); @@ -1132,7 +1209,7 @@ jQuery(document).ready(function ($) { } }); updateFilterDescriptions(); - $('#filter-build').html(indiciaData.lang.ModifyFilter); + $('#filter-build').html(indiciaData.lang.reportFilters.ModifyFilter); $('#standard-params .header span.changed').hide(); // can't delete a filter you didn't create. if (data[0].created_by_id === indiciaData.user_id) { @@ -1145,7 +1222,7 @@ jQuery(document).ready(function ($) { loadFilter = function (id, getParams) { var def; filterOverride = getParams; - if ($('#standard-params .header span.changed:visible').length===0 || confirm(indiciaData.lang.ConfirmFilterChangedLoad)) { + if ($('#standard-params .header span.changed:visible').length===0 || confirm(indiciaData.lang.reportFilters.ConfirmFilterChangedLoad)) { def = false; switch (id) { case 'my-records': @@ -1374,7 +1451,7 @@ jQuery(document).ready(function ($) { if ($(e.currentTarget).hasClass('disabled')) { return; } - if (confirm(indiciaData.lang.ConfirmFilterDelete.replace('{title}', indiciaData.filter.title))) { + if (confirm(indiciaData.lang.reportFilters.ConfirmFilterDelete.replace('{title}', indiciaData.filter.title))) { filter = { id: indiciaData.filter.id, website_id: indiciaData.website_id, @@ -1385,7 +1462,7 @@ jQuery(document).ready(function ($) { filter, function (data) { if (typeof data.error === 'undefined') { - alert(indiciaData.lang.FilterDeleted); + alert(indiciaData.lang.reportFilters.FilterDeleted); $('#select-filter').val(''); $('#select-filter').find('option[value="' + indiciaData.filter.id + '"]').remove(); resetFilter(); @@ -1529,7 +1606,7 @@ jQuery(document).ready(function ($) { function (data) { var handled; if (typeof data.error === 'undefined') { - alert(indiciaData.lang.FilterSaved); + alert(indiciaData.lang.reportFilters.FilterSaved); indiciaData.filter.id = data.outer_id; indiciaData.filter.title = $('#filter\\:title').val(); indiciaData.filter.filters_user_id = data.struct.children[0].id; @@ -1549,7 +1626,7 @@ jQuery(document).ready(function ($) { if (typeof data.errors !== 'undefined') { $.each(data.errors, function (key, msg) { if (msg.indexOf('duplicate') > -1) { - if (confirm(indiciaData.lang.FilterExistsOverwrite)) { + if (confirm(indiciaData.lang.reportFilters.FilterExistsOverwrite)) { // need to load the existing filter to get it's ID, then resave $.getJSON(indiciaData.read.url + 'index.php/services/data/filter?created_by_id=' + indiciaData.user_id + '&title=' + encodeURIComponent($('#filter\\:title').val()) + '&sharing=' + @@ -1569,7 +1646,7 @@ jQuery(document).ready(function ($) { } } saving = false; - $('#filter-build').html(indiciaData.lang.ModifyFilter); + $('#filter-build').html(indiciaData.lang.reportFilters.ModifyFilter); $('#filter-reset').removeClass('disabled'); }, 'json'