[%~ PROCESS 'i-header-bem/i-header-bem.tt2' title = iget('Создание клиента') require_js = 'js/main.js' header_extra = header_extra ; PROCESS 'l-table-form/l-table-form.tt2' + 'b-choose-country/b-choose-country.tt2' + 'b-choose-currency/b-choose-currency.tt2' + 'b-choose-country/b-choose-country.tt2' ; ~%]
[% IF FORM.mediaType %] [% END %] [% IF FORM.for_agency.defined || for_agency.defined %] [% END %] [% WRAPPER l_table_form options = { class => 'l-table-form_mode_search-client-id' }; WRAPPER l_table_form__row_separator; END; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; END; WRAPPER l_table_form__input; ~%]

[% IF ! client || login_rights.manager_control; IF FORM.for_agency; iget('Создание субклиента'); ELSE; iget('Создание клиента'); END; ELSE; iget('Поиск клиентов'); END; %]

[%~ END; WRAPPER l_table_form__help; END; END; END; IF error; SET error = iget('Неправильный формат e-mail') IF error_code == 'email'; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; END; WRAPPER l_table_form__input; ~%]

[% error | html | replace("\n", "
") %]

[%~ END; WRAPPER l_table_form__help; END; END; END; WRAPPER l_table_form__row_separator; END; END; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("Название:"); END; WRAPPER l_table_form__input; ~%] [% IF country_currency_only %] [% name | html %] [% ELSE %] [% END %] [%~ END; WRAPPER l_table_form__help; END; END; END; IF need_client_data || country_currency_only; IF no_country_select; %][% ELSE; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget('Страна:'); END; WRAPPER l_table_form__input; b_choose_country({countries => countries, country => client_country, main_countries => main_countries}); END; WRAPPER l_table_form__help; END; END; END; END; IF no_currency_select; %][% ELSE; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget('Валюта:'); END; WRAPPER l_table_form__input; # TODO при переписывании на bemhtml нужно учесть DIRECT-31299 b_choose_currency({countries_currencies => countries_currencies, currency => currency, clientMake => 1}); END; WRAPPER l_table_form__help; END; END; END; END; END; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("Телефон:"); END; WRAPPER l_table_form__input; ~%] [% IF country_currency_only %] [% phone | html %] [% ELSE %] [% END %] [%~ END; WRAPPER l_table_form__help; END; END; END; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("WEB:"); END; WRAPPER l_table_form__input; ~%] [% IF country_currency_only %] [% url | html %] [% ELSE %] [% END %] [%~ END; WRAPPER l_table_form__help; END; END; END; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("E-mail:"); END; WRAPPER l_table_form__input; ~%] [% IF country_currency_only %] [% email | html %] [% ELSE %] [% END %] [%~ END; WRAPPER l_table_form__help; END; END; END; IF (login_rights.agency_control && agency_options.allow_clients_without_wallet) || login_rights.manager_control || login_rights.super_control || login_rights.support_control || login_rights.superreader_control || login_rights.limited_support_control; SET default_with_wallet = 1; IF agency_options; SET default_with_wallet = agency_options.default_clients_with_wallet; END; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("Общий счёт включен:"); END; WRAPPER l_table_form__input; ~%] [%~ END; WRAPPER l_table_form__help; END; END; END; IF login_rights.manager_control || login_rights.super_control; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("ClientID:"); END; WRAPPER l_table_form__input; ~%] [% IF country_currency_only %] [% ClientID | html %] [% ELSE %] [% END %] [%~ END; WRAPPER l_table_form__help; END; END; END; END; IF login_rights.manager_control && ! FORM.for_agency; WRAPPER l_table_form__section; WRAPPER l_table_form__row; WRAPPER l_table_form__label; iget("Город:"); END; WRAPPER l_table_form__input; ~%] [% IF country_currency_only %] [% city | html %] [% ELSE %]
[% END %] [%~ END; WRAPPER l_table_form__help; END; END; END; END; WRAPPER l_table_form__row_separator; END; WRAPPER l_table_form__section; WRAPPER l_table_form__row options = {class => 'l-table-form__row_hlt_on'}; WRAPPER l_table_form__label; END; WRAPPER l_table_form__input; ~%] [% IF !country_currency_only && (login_rights.manager_control || login_rights.super_control) %] [% END %] [% IF login_rights.agency_control %] [% END %] [% IF country_currency_only || ! client || login_rights.manager_control %] [% END %] [%~ END; END; END; END; %]


[% IF client && client.size() > 0 %] [% iget('Найденные клиенты в биллинге') %]:
[% FOR cl = client %] [% END %]
  [% iget('Имя') %] [% iget('Client ID') %] [% iget('Признак') %] [% iget('Телефон') %] [% iget('Факс') %] WEB E-mail  
[% loop.count %] [%- IF cl.NAME %] [% cl.NAME | html %] [%- END -%] [%- IF cl.CLIENT_ID %] [% cl.CLIENT_ID %] [% ELSE %]   [%- END -%] [% IF cl.AGENCY_ID %] [% iget('субклиент') %] [% ELSIF cl.IS_AGENCY %] [% iget('агентство') %] [% ELSE %]   [% END %] [%- IF cl.PHONE %] [% cl.PHONE | html%] [% ELSE %]   [%- END -%] [%- IF cl.FAX %] [% cl.FAX | html %] [% ELSE %]   [%- END -%] [%- IF cl.URL %] [% cl.URL | html %] [% ELSE %]   [%- END -%] [%- IF cl.EMAIL %] [% cl.EMAIL | html %] [% ELSE %]   [%- END -%] [% iget('привязать') %]
[% ELSIF submit_search %] [% iget('Ничего не найдено') %]
[% END %]


[% PROCESS 'i-footer/i-footer.tt2' %]