{% import '@OroUI/macros.html.twig' as ui %} {% import '@OroEmail/macros.html.twig' as email %} {% import '@OroEntityConfig/macros.html.twig' as entityConfig %} {% import '@OroChannel/macros.html.twig' as channel %} {% import '@OroSales/macros.html.twig' as sales %} {% import '@OroTag/macros.html.twig' as Tag %} {% import _self as salesLeadInfo %} {%- macro getSocialUrl(type, value) -%} {%- if value|slice(0, 5) == 'http:' or value|slice(0, 6) == 'https:' -%} {{- value -}} {%- else -%} {{- oro_social_url(type, value) -}} {%- endif -%} {%- endmacro -%}
{{ ui.renderProperty('oro.sales.lead.first_name.label'|trans, entity.firstName) }} {{ ui.renderProperty('oro.sales.lead.last_name.label'|trans, entity.lastName) }} {% if entity['dataChannel'] is defined %} {{ channel.renderChannelProperty(entity, 'oro.sales.lead.data_channel.label') }} {% endif %} {{ ui.renderHtmlProperty( 'oro.sales.lead.contact.label'|trans, ui.entityViewLink(entity.contact, entity.contact ? entity.contact|oro_format_name : '', 'oro_contact_view') ) }} {{ ui.renderProperty('oro.sales.lead.job_title.label'|trans, entity.jobTitle) }} {% set opportunityResourceEnabled = feature_resource_enabled('Oro\\Bundle\\SalesBundle\\Entity\\Opportunity', 'entities') %} {%- set opportunitiesData -%} {%- if opportunityResourceEnabled and entity.opportunities.count -%} {% set opportunityViewGranted = is_granted('oro_sales_opportunity_view') %} {%- for opportunity in entity.opportunities -%} {%- if opportunityViewGranted -%} {{ ui.renderEntityViewLabel(opportunity, 'name', 'oro.sales.oportunity.entity_label') }} {%- else -%} {{ ui.renderEntityViewLabel(opportunity, 'name') }} {%- endif -%} {% if not loop.last %}, {% endif %} {%- endfor -%} {%- endif -%} {%- endset -%} {{ sales.render_customer_info(entity) }} {{ ui.renderProperty('oro.sales.lead.company_name.label'|trans, entity.companyName) }} {{ ui.renderProperty('oro.sales.lead.industry.label'|trans, entity.industry) }} {{ ui.renderProperty('oro.sales.lead.number_of_employees.label'|trans, entity.numberOfEmployees) }} {{ ui.renderProperty('oro.sales.lead.source.label'|trans, entity.source) }} {{ entityConfig.renderDynamicFields(entity) }} {{ ui.renderHtmlProperty('oro.tag.entity_plural_label'|trans, Tag.renderView(entity)) }}
{%- set socialData -%} {%- if entity.twitter or entity.linkedIn -%} {%- endif -%} {%- endset -%}
{{ ui.renderHtmlProperty('oro.sales.lead.emails.label'|trans, sales.renderCollectionWithPrimaryElement(entity.emails, true, entity)) }} {{ ui.renderHtmlProperty('oro.sales.lead.phones.label'|trans, sales.renderCollectionWithPrimaryElement(entity.phones, false, entity)) }} {%- if entity.website -%} {%- set website = entity.website|strip_dangerous_protocols -%} {%- endif -%} {{ ui.renderHtmlProperty('oro.sales.lead.website.label'|trans, website is defined ? ui.renderUrl(website, website, 'no-hash') : null) }} {{ ui.renderCollapsibleHtmlProperty('oro.sales.lead.notes.label'|trans, entity.notes|oro_html_strip_tags, entity, 'notes') }} {{ ui.renderHtmlProperty('oro.contact.social.label'|trans, socialData) }} {% if opportunityResourceEnabled %} {{ ui.renderHtmlProperty('oro.sales.opportunity.entity_label'|trans, opportunitiesData) }} {% endif %}