{# deprecated use getLabel instead #} {% macro getContactLabel(object, options) %} {% import _self as contactSelf %} {% if object is not empty %} {% if object|instanceof('AppBundle\\Entity\\Contact\\ContactProfessional') or object|instanceof('AppBundle\\Entity\\Contact\\ContactGroup') or object.discr == constant('AppBundle\\Entity\\Contact\\Contact::CONTACT_DISCR_PROFESSIONAL') or object.discr == constant('AppBundle\\Entity\\Contact\\Contact::CONTACT_DISCR_GROUP') %} {% if options.corporate is defined and options.corporate == true %} {% set value = contactSelf.getCorporateName(object, options) %} {% else %} {% set value = contactSelf.getCommonName(object, options) %} {% endif %} {% else %} {% set value = contactSelf.getFirstname(object, options) ~ contactSelf.getLastname(object, options) %} {% endif %} {% endif %} {{ value }} {% endmacro %} {% macro getLabel(object, options) %} {% import _self as contactSelf %} {% set value = '' %} {% if object is not empty %} {% if object.discr in [constant('AppBundle\\Entity\\Contact\\Contact::CONTACT_DISCR_INDIVIDUAL'), constant('AppBundle\\Entity\\Contact\\ContactQuick\\ContactQuickBase::CONTACT_DISCR_INDIVIDUAL')] %} {# individual contact #} {% if options.civility is defined and options.civility == true %} {% set value = object.civility|trans({}, 'CommonTrans') ~ ' ' %} {% endif %} {% set value = value ~ object.firstName ~ ' ' ~ object.lastName %} {% else %} {# pro contact #} {% if options.corporate is defined and options.corporate == true %} {% set value = contactSelf.getCorporateName(object, options) %} {% else %} {% set value = contactSelf.getCommonName(object, options) %} {% endif %} {% endif %} {% endif %} {{ value }} {% endmacro %} {% macro getContactAndCoContactLabel(options) %} {% import _self as contactSelf %} {% set options = {}|merge(options|default({})) %} {% set customer = options.customer is defined ? options.customer : '' %} {% set coCustomer = options.coCustomer is defined ? options.coCustomer : '' %} {{ contactSelf.getLabel(customer, options) }} {% if coCustomer.discr is not empty %} {% if options.isSpouse is defined and options.isSpouse == true %} {{ 'and'|trans({}, 'DocumentTrans' ) }} {% else %} {{ 'or'|trans({}, 'DocumentTrans' ) }} {% endif %} {{ contactSelf.getLabel(coCustomer, options) }} {% endif %} {% endmacro %} {% macro getCorporateName(object, options) %} {% set value = object.corporateNameContact is defined ? object.corporateNameContact : '' %} {{ value }} {% endmacro %} {% macro getCommonName(object, options) %} {% set value = object.commonName is defined ? object.commonName : '' %} {{ value }} {% endmacro %} {% macro getFirstname(object, options) %} {% set value = object.firstname is defined ? object.firstname : '' %} {{ value }} {% endmacro %} {% macro getLastname(object, options) %} {% set value = object.lastname is defined ? object.lastname : '' %} {{ value }} {% endmacro %} {% macro getCellPhoneNumber(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'previousValue': 'Port : '}|merge(options|default({})) %} {% set value = object.cellPhoneNumber is defined ? object.cellPhoneNumber : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getPhoneNumber(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'previousValue': 'Tél : '}|merge(options|default({})) %} {% set value = object.phoneNumber is defined ? object.phoneNumber : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getEmail(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'previousValue': 'Email : '}|merge(options|default({})) %} {% set value = object.email is defined ? object.email : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getIdentityCardNumber(object, options) %} {% if object|instanceof('AppBundle\\Entity\\Contact\\ContactIndividual') %} {% if object.driver is not null %} {% set driver = object.driver %} {% set value = driver.identityCardNumber is defined ? driver.identityCardNumber : '' %} {{ value }} {% endif %} {% endif %} {% endmacro %} {% macro getBirthDate(object, options) %} {% if (object|instanceof('AppBundle\\Entity\\Contact\\ContactIndividual')) %} {% if object.driver is not null %} {% set driver = object.driver %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set value = driver.birthDate is defined ? driver.birthDate : '' %} {% set value = globalF.formatDate(value, options) %} {{ value }} {% endif %} {% endif %} {% endmacro %} {% macro getSiret(object, options) %} {% if not (object|instanceof('AppBundle\\Entity\\Contact\\ContactIndividual')) %} {% if object.siret is not null %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'previousValue': 'SIRET : '}|merge(options|default({})) %} {% set value = object.siret is defined ? object.siret : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endif %} {% endif %} {% endmacro %}