diff --git a/src/Plugin/Block/TYPProfileShareBlock.php b/src/Plugin/Block/TYPProfileShareBlock.php --- a/src/Plugin/Block/TYPProfileShareBlock.php +++ b/src/Plugin/Block/TYPProfileShareBlock.php @@ -1,1 +1,1 @@ -getRequestUri(); $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $s = explode("/",$url); $bid = end($s); $this->data = \Drupal::service("typ.search")->getProfile($bid ,AUTO); $this->result = \Drupal::service('typ.unvservice')->loadListing($this->data['customerid'],NULL); $type = $this->result['address'][$this->data['headingcode']][$this->data['addressid']]['customertype']; $telno = '';$fax = '';$workinghours = ''; if (!empty($this->data['telno'])) { foreach ($this->data['telno'] as $t) { $telno .= TYPProfileController::FormatPhoneNumber($t); } } if (!empty($this->data['fax'])) { foreach ($this->data['fax'] as $t) { $fax .= TYPProfileController::FormatPhoneNumber($t); } } if (!empty($this->data['workinghours'])) { $workinghours .= $this->formatWorkingHour($this->data['workinghours']); } $body_email = format_string('
'.t('Address').' | '.$this->data['fulladdr'].' |
'.t('Tel').' | '.$telno.' |
'.t('Fax').' | '.$fax.' |
'.t('Email').' | '.$this->data['email'].' |
'.t('Website').' | '.$this->data['website'].' |
'.t('Work-Time').' | '.$workinghours.' |
'.t('Link').' | '.$fullurl.' |
'.t('Address').' | '.$this->data['fulladdr'].' |
'.t('Tel').' | '.$telno.' |
'.t('Fax').' | '.$fax.' |
'.t('Email').' | '.$this->data['email'].' |
'.t('Website').' | '.$this->data['website'].' |
'.t('Work-Time').' | '.$workinghours.' |
'.t('Link').' | '.$fullurl.' |
{% trans %} Address {% endtrans %}: | +{{ [profile.addr,profile.soi,profile.road,profile.subdistrictname,profile.districtname,profile.cityname,profile.postcode]|join(' ') }} | +|
{% trans %} Tel {% endtrans %} | +{% trans %} Tel {% endtrans %}: |
{% if not profile.telno %}
{% else %}
{% if type == 'FL' %}
{{ profile._format.telno.0 }} {% else %} {% for key, tel in profile._format.telno %} {% if loop.last != key+1 %}{{ tel }}{{ " ," }} {% else %}{{ tel }}{% endif %} {% endfor %} {% endif %} {% endif %} |
{% trans %} Fax {% endtrans %} | +{% trans %} Fax {% endtrans %}: |
{% if not profile.fax %}
{% else %}
{% if type == 'FL' %}
{{ profile._format.fax.0 }} {% else %} {% for key, fax in profile._format.fax %} {% if loop.last != key+1 %}{{ fax }}{{ " ," }} {% else %}{{ fax }}{% endif %} {% endfor %} {% endif %} {% endif %} |
{% trans %} Email {% endtrans %} | +{% trans %} Email {% endtrans %}: |
{% if not profile.email %}
{% else %}
{% if type == 'FL' %}
{% set email = profile.email|split(',') %}
{% for key , mail in email %}
{% if loop.last != key+1 %}{{ mail }} , {% else %}{{ mail }} {% endif %} {% endfor %} {% else %} {% set email = profile.email|split(',') %} {% for key , mail in email %} {% if loop.last != key+1 %}{{ mail }} , {% else %}{{ mail }} {% endif %} {% endfor %} {% endif %} {% endif %} |
{% trans %} Website {% endtrans %} | +{% trans %} Website {% endtrans %}: |
{% if not profile.website %}
{% else %}
{% set website = profile.website|split(',') %}
{% for key , web in website %}
{% if loop.last != key+1 %}{{ web }} , {% else %}{{ web }} {% endif %} {% endfor %} {% endif %} |
{% trans %} Work-Time {% endtrans %} | +{% trans %} Work-Time {% endtrans %}: |
{% if not profile.workinghours %}
{% else %}
{{ profile._format.workinghours }} {% endif %} |
":" ","
":" "}) }} {% endif %} {% endif %}