Closed (fixed)
Project:
Smart IP
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2011 at 02:42 UTC
Updated:
24 Jun 2015 at 01:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
arpeggio commentedI'll try to work on this feature for D7 on my free time. Of course, patches are always welcome. Thank you.
Comment #2
dbourrion commentedWould be a really nice feature...
Comment #3
alex.neblett commentedHi,
Consider this a starting point. I had a couple of hours to migrate this up to D7 and take care of the obvious.
Right now, most of the module works, but views is not getting the data...
I am hoping to have some more time tomorrow to work on it and do some debugging. Of course, peer review and improvements to this starting point are welcome and appreciated.
I have a secondary motivation for making this work. I wanted to have a node with Get Directions that could navigate to the customer location from the service techs device (android tablet, ipad, etc. using smart ip) . Since I could not get both to co-exist on the same node so that I could have a fresh device geolocation (Get Directions causes navigator.geolocation.getCurrentPosition to fail with error.code = 2.), my next best option is to pass the latlon via a link in views along with the order_id to the Get Directions node.
Cheers,
Alex
Comment #4
alex.neblett commentedAll done!
Please review and commit. The issue was that Views 3 truncates names to 60 characters unlike Views 2.
Cheers,
Alex
Comment #5
Xomby commentedFatal Error: Class "openlayers_proximity_handler_filter_circle" not found in "smart_ip_views_bridge_openlayers_proximity_handler_filter_circle.inc" on Line 3.
Looks like this bridge module relies on OpenLayers Proximity, which does not have an official D7 release. I need to use this data for a proximity lookup, so...
I'm going to see about bridging this to the location module, as I think that could work out quite nicely. Will post back here if I come up with anything.
[update] I was going to roll a module that patched in the required code, but darned if I can't figure out how to hook an actual module function... but here's the skinny of getting this to work with location (I'm not actually sure if the previous bridge module is necessary or not at this point, but I kinda think not):
Assuming you're working with:
then you can USE SMART_IP WITH THE LOCATION MODULE.
There's four(4) files you need to modify in the location module.
location.views.inc
In the location_views_proximity_get_reference_location function (line 456), inside the case statement, include the following case:
location_handler_field_location_distance.inc
in the extra_options_form function (line 29), in the #options array, after 'distance_arg' I added the following element:
'smart_ip' => t("User's Latitude / Longitude from Smart IP (blank if unset)"),location_views_handler_filter_proximity.inc
in the value_form function (line 75), again in the #options array, same deal
'smart_ip' => t("User's Latitude / Longitude from Smart IP (blank if unset)"),and finally:
location_handler_sort_location_distance.inc
in another extra_options_form function (line 28), inside the #options array, add
'smart_ip' => t("User's Latitude / Longitude from Smart IP (blank if unset)"),note- your mileage may vary, as this is a rough hack that got me where I needed to be today. I welcome anyone to spruce this up or explain any hooks that could have been used to inject this functionality - or roll this into a real module - but it works for me. Also note - I'm still not sure if the previous bridge module is required for this or not, but I suspect it is not, as the smart_ip module sets the $_SESSION variables, and that's all this relies on.
[EDIT] This is a horribly WRONG way to implement it, and it doesn't "show" up the way it probably should because I just hacked it together without really understanding what or why... but it does work. please please please someone clean this up![/EDIT]
Comment #6
afidegnum commentedHi, any update about this?
I need it badly :)
Comment #7
chris.jichen commentedOn #4's code, there are incorrect smart ip API calls in the views field handler. It gave me blank value. Hence i use the standard Smart IP api function:
$smart_ip_session = smart_ip_session_get('smart_ip');
Instead of:
$_SESSION['location'];
The updated code has been attached.
Hope this will help someone.
Thanks
Comment #8
colanPatches must be provided in patch format.
Comment #9
spyderpie commentedAny update on this? I so need this to work.
Peace,
Julie
Comment #11
arpeggio commentedI have already completed this feature request.