X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.display_address.php;h=32cf19c036124fecd4777bbdb4afd7849cd5cf25;hb=f6e35ff3fefafe908e1675690340ab93265192a0;hp=2e60262afb8a75866c4a6f9dc62769ddc82775a7;hpb=9e1816c7666767755abbc24f6a0df290efff81b6;p=platal.git
diff --git a/plugins/function.display_address.php b/plugins/function.display_address.php
index 2e60262..32cf19c 100644
--- a/plugins/function.display_address.php
+++ b/plugins/function.display_address.php
@@ -38,14 +38,12 @@ function display_address_isIdentity($idt, $value, $test_reverse = true)
function smarty_function_display_address($param, &$smarty)
{
- require_once('geoloc.inc.php');
- $txtad = get_address_text($param['adr']);
- if (!$txtad &&
- !$param['adr']['tels'] && !count($param['adr']['tels']) &&
- !$param['adr']['tel'] &&
- !$param['adr']['fax'] &&
- !$param['adr']['mobile']) return "";
-
+ require_once('geocoding.inc.php');
+ $adr = $param['adr'];
+ $txtad = $adr->text;
+ if (!$txtad && !$adr->phones() && !count($adr->phones())) {
+ return "";
+ }
$lines = explode("\n", $txtad);
$idt = array_shift($lines);
@@ -61,29 +59,37 @@ function smarty_function_display_address($param, &$smarty)
$map = "";
+ $comment = "";
+ if ($adr->comment != "")
+ {
+ $commentHtml = str_replace(array('&', '"'), array('&', '"'), $adr->comment);
+ $commentJs = str_replace(array('\\', '\''), array('\\\\', '\\\''), $commentHtml);
+ $comment = "
";
+ }
if ($restore) {
array_unshift($lines, $idt);
}
if ($param['titre'])
{
if ($param['titre_div'])
- $txthtml .= "