From dabc96d07a30da750072fa773387841e5fcb88b7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 30 May 2016 16:22:41 +0200 Subject: [PATCH] GeoLocation in addressbook: - Fix a conflict of %s as placeholder with et2 %s placeholder - Fix pre-defined urls according to new placeholders - Add some translations --- addressbook/inc/class.addressbook_hooks.inc.php | 6 +++--- addressbook/js/app.js | 14 +++++++------- addressbook/lang/egw_de.lang | 5 ++++- addressbook/lang/egw_en.lang | 7 +++++-- addressbook/templates/default/config.xet | 2 +- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 714cbb568b..be7ab79301 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -544,9 +544,9 @@ class addressbook_hooks } // geolocation pre-defined maps $geoLocation = array( - array('value' => 'https://maps.here.com/directions/drive{{%sr=/%sr}}%s0,%t0,%z0,%c0{{%d=/%d}}%s1,%t1,%z1+%c1', 'label' => 'Here Maps'), - array('value' => 'http://maps.google.com/{{%sr=?saddr=%sr}}%s0+%t0+%z0+%c0{{%d=&daddr=%d}}%s1+%t1+%z1+%c1', 'label' => 'Google Maps'), - array('value' => 'https://www.bing.com/maps/{{%sr=?rtp=adr.%sr}}%s0+%t0+%z0+%c0{{%d=~adr.%d}}%s1+%t1+%z1+%c1', 'label' => 'Bing Maps') + array('value' => 'https://maps.here.com/directions/drive{{%rs=/%rs}}%r0,%t0,%z0,%c0{{%d=/%d}}%r1,%t1,%z1+%c1', 'label' => 'Here Maps'), + array('value' => 'http://maps.google.com/{{%rs=?saddr=%rs}}%r0+%t0+%z0+%c0{{%d=&daddr=%d}}%r1+%t1+%z1+%c1', 'label' => 'Google Maps'), + array('value' => 'https://www.bing.com/maps/{{%rs=?rtp=adr.%rs}}%r0+%t0+%z0+%c0{{%d=~adr.%d}}%r1+%t1+%z1+%c1', 'label' => 'Bing Maps') ); $ret = array( 'sel_options' => array( diff --git a/addressbook/js/app.js b/addressbook/js/app.js index cc4c95040c..dbdbeeaee0 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -951,7 +951,7 @@ app.classes.addressbook = AppJS.extend( return false; } var content = egw.dataGetUIDdata(_selected[0].id); - + // Selected, but data not found if(!content || typeof content.data === 'undefined') return false; @@ -1001,25 +1001,25 @@ app.classes.addressbook = AppJS.extend( var addrs = [ [ // source address - {id:'s0',val:_src_type === 'browser'?_src_data.latitude:_src_data['adr_'+_src_type+'_street']}, + {id:'r0',val:_src_type === 'browser'?_src_data.latitude:_src_data['adr_'+_src_type+'_street']}, {id:'t0',val:_src_type === 'browser'?_src_data.longitude:_src_data['adr_'+_src_type+'_locality']}, {id:'c0',val:_src_type === 'browser'?'':_src_data['adr_'+_src_type+'_countrycode']}, {id:'z0',val:_src_type === 'browser'?'':_src_data['adr_'+_src_type+'_postalcode']} ], [ // destination address - {id:'s1',val:_dest_data['adr_'+dest_type+'_street']}, + {id:'r1',val:_dest_data['adr_'+dest_type+'_street']}, {id:'t1',val:_dest_data['adr_'+dest_type+'_locality']}, {id:'c1',val:_dest_data['adr_'+dest_type+'_countrycode']}, {id:'z1',val:_dest_data['adr_'+dest_type+'_postalcode']} ] ]; - var src_param = url.match(/{{%sr=.*%sr}}/ig); + var src_param = url.match(/{{%rs=.*%rs}}/ig); if (src_param[0]) { - src_param = src_param[0].replace(/{{%sr=/,''); - src_param = src_param.replace(/%sr}}/,''); - url = url.replace(/{{%sr=.*%sr}}/, src_param) + src_param = src_param[0].replace(/{{%rs=/,''); + src_param = src_param.replace(/%rs}}/,''); + url = url.replace(/{{%rs=.*%rs}}/, src_param) } var d_param = url.match(/{{%d=.*%d}}/ig); diff --git a/addressbook/lang/egw_de.lang b/addressbook/lang/egw_de.lang index 81db67d4d4..ac30564594 100644 --- a/addressbook/lang/egw_de.lang +++ b/addressbook/lang/egw_de.lang @@ -109,6 +109,7 @@ check all addressbook de Alle auswählen choose an icon for this contact type admin de Wählen Sie ein Icon für diesen Kontakt Typ choose charset addressbook de Zeichensatz auswählen choose owner of imported data addressbook de Wählen Sie den Besitzer der importierten Daten +choose pre-defined map source or use custom url (use %r = street, %t = city, %c = country, %z = zipcode) admin de Wählen Sie einen vordefinierten Kartenanbieter aus oder geben Sie eine Url an mit folgenden Platzhaltern: %r = Strasse, %t = Stadt, %c = Land, %z = Postleitzahl chosse an etemplate for this contact type admin de Wählen Sie ein eTemplate für diesen Kontakt Typ city common de Stadt city (private) addressbook de Stadt (Privat) @@ -257,6 +258,7 @@ general admin de Allgemein general fields: addressbook de Allgemeine Felder: general settings addressbook de Allgemeine Einstellungen geo addressbook de GEO +geolocation integration admin de Integration Routenplanung global categories addressbook de Globale Kategorien grant addressbook access common de Berechtigungen group %1 addressbook de Gruppe %1 @@ -405,6 +407,7 @@ role addressbook de Beruf room addressbook de Raum search letter addressbook de Suche nach Buchstaben select a portrait format jpeg photo. it will be resized to 60 pixel width. addressbook de Wählen Sie ein hochformatiges jpeg Foto. Es wird 60 Pixel breit skaliert. +select a source address to be used in geolocation routing system addressbook de Legen Sie fest, wie der Startpunkt für die Routenplanung gesetzt wird. select a view addressbook de Eine Ansicht auswählen select addressbook type addressbook de Typ des Adressbuchs auswählen select all addressbook de Alles auswählen @@ -528,4 +531,4 @@ you need to select some entries first addressbook de Sie müssen zuerst Daten au your new public key has been stored in accounts addressbook. addressbook de Ihr neuer öffentlicher Schlüssen wurde im Benutzerkonten Adressbuch gespeichert. zip code common de PLZ zip code (private) addressbook de PLZ (Privat) -zip_note addressbook de

Notiz:Die Datei kann ein zip Archiv sein, bestehend aus .csv, .vcf oder .ldif Dateien. Sie dürfen die Dateitypen pro Import nicht mischen! +zip_note addressbook de

Notiz:Die Datei kann ein zip Archiv sein, bestehend aus .csv, .vcf oder .ldif Dateien. Sie dürfen die Dateitypen pro Import nicht mischen! \ No newline at end of file diff --git a/addressbook/lang/egw_en.lang b/addressbook/lang/egw_en.lang index 9c209b428e..95158ce7f1 100644 --- a/addressbook/lang/egw_en.lang +++ b/addressbook/lang/egw_en.lang @@ -110,6 +110,7 @@ check all addressbook en Check all choose an icon for this contact type admin en Choose an icon for this contact type choose charset addressbook en Choose charset choose owner of imported data addressbook en Choose owner of imported data +choose pre-defined map source or use custom url (use %r = street, %t = city, %c = country, %z = zipcode) admin en Choose pre-defined map source or use custom URL (use %r = street, %t = city, %c = country, %z = zipcode) chosse an etemplate for this contact type admin en Chose an eTemplate for this contact type city common en City city (private) addressbook en City (private) @@ -258,6 +259,7 @@ general admin en General general fields: addressbook en General fields: general settings addressbook en General settings geo addressbook en GEO +geolocation integration admin en GeoLocation integration global categories addressbook en Global categories grant addressbook access common en Grant address book access group %1 addressbook en Group %1 @@ -406,6 +408,7 @@ role addressbook en Occupation room addressbook en Room search letter addressbook en Search letter select a portrait format jpeg photo. it will be resized to 60 pixel width. addressbook en Select a portrait format jpeg photo. It will be re-sized to 60 pixel width. +select a source address to be used in geolocation routing system addressbook en Select a source address to be used in GeoLocation routing system select a view addressbook en Select a view select addressbook type addressbook en Select address book type select all addressbook en Select all @@ -480,8 +483,8 @@ upload or delete the photo addressbook en Upload or delete the photo url (business) addressbook en url (business) url (private) addressbook en url (private) url to link telephone numbers to (use %1 = number to call, %u = account name, %t = account phone) admin en URL to link telephone numbers to. Use %1 = number to call, %u = account name, %t = account phone. -use addressbooks "own sorting" attribute addressbook en use addressbooks "own sorting" attribute use a category tree? addressbook en Use a tree for selecting categories +use addressbooks "own sorting" attribute addressbook en use addressbooks "own sorting" attribute use an extra tab for private custom fields? admin en Use an extra tab for private custom fields use country list addressbook en Use country list use setup for a full account-migration admin en Use setup for a full account migration @@ -530,4 +533,4 @@ you need to select some entries first addressbook en You need to select some ent your new public key has been stored in accounts addressbook. addressbook en Your new public key has been stored in accounts addressbook. zip code common en ZIP code zip code (private) addressbook en ZIP code (private) -zip_note addressbook en

Note: The file may be a zip file collection of .csv, .vcf, or .ldif files. Do not mix file types per import. +zip_note addressbook en

Note: The file may be a zip file collection of .csv, .vcf, or .ldif files. Do not mix file types per import. \ No newline at end of file diff --git a/addressbook/templates/default/config.xet b/addressbook/templates/default/config.xet index 215112ace0..c518e9f19f 100644 --- a/addressbook/templates/default/config.xet +++ b/addressbook/templates/default/config.xet @@ -24,7 +24,7 @@ - +