mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-02 20:19:27 +01:00
Add default url for geolocation config
This commit is contained in:
parent
9c3ba4240a
commit
3c6d4dea15
@ -556,8 +556,10 @@ class addressbook_hooks
|
|||||||
'fileas' => $bocontacts->fileas_options(),
|
'fileas' => $bocontacts->fileas_options(),
|
||||||
'contact_repository' => $repositories,
|
'contact_repository' => $repositories,
|
||||||
'geolocation_url' => $geoLocation
|
'geolocation_url' => $geoLocation
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (empty($config['geolocation_url'])) $ret ['geolocation_url'] = $geoLocation[0]['value'];
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -941,8 +941,7 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
// multiple selection is not supported
|
// multiple selection is not supported
|
||||||
if (_selected.length>1) return false;
|
if (_selected.length>1) return false;
|
||||||
|
|
||||||
var url = egw.config('geolocation_url');
|
var url = this.getGeolocationConfig();
|
||||||
if (url) url = url[0];
|
|
||||||
|
|
||||||
// exit if no url or invalide url given
|
// exit if no url or invalide url given
|
||||||
if (!url || typeof url === 'undefined' || typeof url !== 'string')
|
if (!url || typeof url === 'undefined' || typeof url !== 'string')
|
||||||
@ -987,8 +986,7 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
geoLocationUrl: function (_dest_data, _dest_type,_src_data, _src_type)
|
geoLocationUrl: function (_dest_data, _dest_type,_src_data, _src_type)
|
||||||
{
|
{
|
||||||
var dest_type = _dest_type || 'one';
|
var dest_type = _dest_type || 'one';
|
||||||
var url = egw.config('geolocation_url');
|
var url = this.getGeolocationConfig();
|
||||||
if (url) url = url[0];
|
|
||||||
|
|
||||||
// exit if no url or invalide url given
|
// exit if no url or invalide url given
|
||||||
if (!url || typeof url === 'undefined' || typeof url !== 'string')
|
if (!url || typeof url === 'undefined' || typeof url !== 'string')
|
||||||
@ -1071,5 +1069,20 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
}).sendRequest();
|
}).sendRequest();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get geolocation_url stored in config|default url
|
||||||
|
*
|
||||||
|
* @returns {String}
|
||||||
|
*/
|
||||||
|
getGeolocationConfig: function()
|
||||||
|
{
|
||||||
|
// This default url should be identical to the first value of geolocation_url array
|
||||||
|
// defined in addressbook_hooks::config
|
||||||
|
var default_url = 'https://maps.here.com/directions/drive{{%rs=/%rs}}%r0,%t0,%z0,%c0{{%d=/%d}}%r1,%t1,%z1+%c1';
|
||||||
|
var geo_url = egw.config('geolocation_url');
|
||||||
|
if (geo_url) geo_url = geo_url[0];
|
||||||
|
return geo_url || default_url;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user