/* This file is part of Ext JS 4 Copyright (c) 2011 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. */ Ext.onReady(function() { if(Ext.Updater) { Ext.Updater.defaults.indicatorText = '
Идет загрузка...
'; } if(Ext.view.View){ Ext.view.View.prototype.emptyText = ""; } if(Ext.grid.Panel){ Ext.grid.Panel.prototype.ddText = "{0} выбранных строк"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Закрыть эту вкладку"; } if(Ext.form.field.Base){ Ext.form.field.Base.prototype.invalidText = "Значение в этом поле неверное"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Загрузка..."; } if(Ext.Date){ Ext.Date.monthNames = [ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" ]; Ext.Date.shortMonthNames = [ "Янв", "Февр", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сент", "Окт", "Нояб", "Дек" ]; Ext.Date.getShortMonthName = function(month) { return Ext.Date.shortMonthNames[month]; }; Ext.Date.monthNumbers = { 'Янв': 0, 'Фев': 1, 'Мар': 2, 'Апр': 3, 'Май': 4, 'Июн': 5, 'Июл': 6, 'Авг': 7, 'Сен': 8, 'Окт': 9, 'Ноя': 10, 'Дек': 11 }; Ext.Date.getMonthNumber = function(name) { return Ext.Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Ext.Date.dayNames = [ "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" ]; Ext.Date.getShortDayName = function(day) { return Ext.Date.dayNames[day].substring(0, 3); }; } if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Отмена", yes : "Да", no : "Нет" }; } if(Ext.util.Format){ Ext.apply(Ext.util.Format, { thousandSeparator: '.', decimalSeparator: ',', currencySign: '\u0440\u0443\u0431', // Russian Ruble dateFormat: 'd.m.Y' }); } if(Ext.picker.Date){ Ext.apply(Ext.picker.Date.prototype, { todayText : "Сегодня", minText : "Эта дата раньше минимальной даты", maxText : "Эта дата позже максимальной даты", disabledDaysText : "", disabledDatesText : "", monthNames : Ext.Date.monthNames, dayNames : Ext.Date.dayNames, nextText : 'Следующий месяц (Control+Вправо)', prevText : 'Предыдущий месяц (Control+Влево)', monthYearText : 'Выбор месяца (Control+Вверх/Вниз для выбора года)', todayTip : "{0} (Пробел)", format : "d.m.y", startDay : 1 }); } if(Ext.picker.Month) { Ext.apply(Ext.picker.Month.prototype, { okText : " OK ", cancelText : "Отмена" }); } if(Ext.toolbar.Paging){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Страница", afterPageText : "из {0}", firstText : "Первая страница", prevText : "Предыдущая страница", nextText : "Следующая страница", lastText : "Последняя страница", refreshText : "Обновить", displayMsg : "Отображаются записи с {0} по {1}, всего {2}", emptyMsg : 'Нет данных для отображения' }); } if(Ext.form.field.Text){ Ext.apply(Ext.form.field.Text.prototype, { minLengthText : "Минимальная длина этого поля {0}", maxLengthText : "Максимальная длина этого поля {0}", blankText : "Это поле обязательно для заполнения", regexText : "", emptyText : null }); } if(Ext.form.field.Number){ Ext.apply(Ext.form.field.Number.prototype, { minText : "Значение этого поля не может быть меньше {0}", maxText : "Значение этого поля не может быть больше {0}", nanText : "{0} не является числом" }); } if(Ext.form.field.Date){ Ext.apply(Ext.form.field.Date.prototype, { disabledDaysText : "Не доступно", disabledDatesText : "Не доступно", minText : "Дата в этом поле должна быть позде {0}", maxText : "Дата в этом поле должна быть раньше {0}", invalidText : "{0} не является правильной датой - дата должна быть указана в формате {1}", format : "d.m.y", altFormats : "d.m.y|d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d" }); } if(Ext.form.field.ComboBox){ Ext.apply(Ext.form.field.ComboBox.prototype, { loadingText : "Загрузка...", valueNotFoundText : undefined }); } if(Ext.form.field.VTypes){ Ext.apply(Ext.form.field.VTypes, { emailText : 'Это поле должно содержать адрес электронной почты в формате "user@example.com"', urlText : 'Это поле должно содержать URL в формате "http:/'+'/www.example.com"', alphaText : 'Это поле должно содержать только латинские буквы и символ подчеркивания "_"', alphanumText : 'Это поле должно содержать только латинские буквы, цифры и символ подчеркивания "_"' }); } if(Ext.form.field.HtmlEditor){ Ext.apply(Ext.form.field.HtmlEditor.prototype, { createLinkText : 'Пожалуйста введите адрес:', buttonTips : { bold : { title: 'Полужирный (Ctrl+B)', text: 'Применение полужирного начертания к выделенному тексту.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, italic : { title: 'Курсив (Ctrl+I)', text: 'Применение курсивного начертания к выделенному тексту.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, underline : { title: 'Подчёркнутый (Ctrl+U)', text: 'Подчёркивание выделенного текста.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, increasefontsize : { title: 'Увеличить размер', text: 'Увеличение размера шрифта.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, decreasefontsize : { title: 'Уменьшить размер', text: 'Уменьшение размера шрифта.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, backcolor : { title: 'Заливка', text: 'Изменение цвета фона для выделенного текста или абзаца.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, forecolor : { title: 'Цвет текста', text: 'Измение цвета текста.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, justifyleft : { title: 'Выровнять текст по левому краю', text: 'Выровнивание текста по левому краю.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, justifycenter : { title: 'По центру', text: 'Выровнивание текста по центру.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, justifyright : { title: 'Выровнять текст по правому краю', text: 'Выровнивание текста по правому краю.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, insertunorderedlist : { title: 'Маркеры', text: 'Начать маркированный список.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, insertorderedlist : { title: 'Нумерация', text: 'Начать нумернованный список.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, createlink : { title: 'Вставить гиперссылку', text: 'Создание ссылки из выделенного текста.', cls: Ext.baseCSSPrefix + 'html-editor-tip' }, sourceedit : { title: 'Исходный код', text: 'Переключиться на исходный код.', cls: Ext.baseCSSPrefix + 'html-editor-tip' } } }); } if(Ext.form.Basic){ Ext.form.Basic.prototype.waitTitle = "Пожалуйста подождите..."; } if(Ext.grid.header.Container){ Ext.apply(Ext.grid.header.Container.prototype, { sortAscText : "Сортировать по возрастанию", sortDescText : "Сортировать по убыванию", lockText : "Закрепить столбец", unlockText : "Снять закрепление столбца", columnsText : "Столбцы" }); } if(Ext.grid.GroupingFeature){ Ext.apply(Ext.grid.GroupingFeature.prototype, { emptyGroupText : '(Пусто)', groupByText : 'Группировать по этому полю', showGroupsText : 'Отображать по группам' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Название", valueText : "Значение", dateFormat : "d.m.Y" }); } if(Ext.SplitLayoutRegion){ Ext.apply(Ext.SplitLayoutRegion.prototype, { splitTip : "Тяните для изменения размера.", collapsibleSplitTip : "Тяните для изменения размера. Двойной щелчок спрячет панель." }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Тяните для изменения размера.", collapsibleSplitTip : "Тяните для изменения размера. Двойной щелчок спрячет панель." }); } }); Ext.onReady(function(){ Ext.QuickTips.init(); var citiesStore = Ext.create('Ext.data.Store', { autoLoad: true, fields: ['id','name','cityid','region','regionid'], proxy: { type: 'ajax', url : '/msshoppers/getregcities', reader: { type: 'json', totalProperty:'rows', root: 'cities' } }, storeId: 'citiesStore' }); citiesStore.addListener('load',function(store,records,rslt,operation,eOpts){ if(!rslt) { Ext.Msg.show({ title:'Системное сообщение', msg:'Ошибка загрузки данных. Проверьте соединение с сетью Интернет.', buttons:Ext.Msg.OK }); } }); var regionsStore = Ext.create('Ext.data.Store', { autoLoad: true, fields: ['id','name','regionid'], proxy: { type: 'ajax', url : '/msshoppers/getregregions', reader: { type: 'json', totalProperty:'results', root: 'rows' } }, storeId: 'regionsStore' }); regionsStore.addListener('load',function(store,records,rslt,operation,eOpts){ if(!rslt) { Ext.Msg.show({ title:'Системное сообщение', msg:'Ошибка загрузки данных. Проверьте соединение с сетью Интернет.', buttons:Ext.Msg.OK }); } }); regionsStore.load(); citiesStore.load(); var profileForm = Ext.create('Ext.form.Panel', { id:'profileForm', labelWidth:200, labelAlign:'right', frame:true, autoScroll: false, bodyStyle:'padding:5px 5px 0', items:[ { xtype: 'fieldset', title: 'Общая информация', collapsible:'true', anchor: '100%', items:[ { xtype: 'container', anchor: '100%', layout:'column', items:[ { xtype: 'container', columnWidth:.5, layout: 'anchor', anchor: '100%', items: [ { xtype:'textfield', id:'lastname', fieldLabel:'Фамилия', labelSeparator:':', name:'data[Msshopper][lastname]', allowBlank:false, emptyText:'Ваша фамилия (по паспорту)', width: 350 }, { xtype:'textfield', id:'msshoppername', fieldLabel:'Имя', labelSeparator:':', name:'data[Msshopper][name]', emptyText:'Ваше имя (по паспорту)', allowBlank:false, width: 350 }, { xtype:'textfield', id:'fathername', fieldLabel:'Отчество', labelSeparator:':', name:'data[Msshopper][fathername]', emptyText:'Ваше отчество (по паспорту)', allowBlank:false, width: 350 }, { xtype:'datefield', id:'birthdate', fieldLabel:'Дата рождения', labelSeparator:':', name:'data[Msshopper][birthdate]', width: 350, format: 'Y-m-d' }, { xtype:'textfield', id:'privat', fieldLabel:'Карта ПриватБанка', labelSeparator:':', name:'data[Msshopper][privat]', width: 250, format: 'Y-m-d' } ] }, { xtype: 'container', columnWidth:.5, layout: 'anchor', anchor: '100%', items: [ { xtype:'combo', id:'gender', fieldLabel:'Пол', labelSeparator:':', allowBlank:false, name:'data[Msshopper][gender]', width: 350, mode: 'local', editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['male','Мужской'],['female','Женский']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'textfield', id:'msshopperemail', fieldLabel:'Email', labelSeparator:':', name:'data[Msshopper][email]', emptyText: 'Будет вашим логином в системе', allowBlank:false, width: 350 }, { xtype:'textfield', id:'password', fieldLabel:'Пароль', inputType:'password', labelSeparator:':', name:'data[Msshopper][password]', allowBlank:false, password:true, emptyText:'Пароль для входа в личный кабинет', disabled: false, width: 350 }, { xtype: 'filefield', id: 'photofile', emptyText: 'Выберите изображение (необязательно)', fieldLabel: 'Фотография', name: 'file', buttonText: '', buttonConfig: { iconCls: 'image_add' }, width: 350 } ] } ] } ] }, { xtype: 'fieldset', title: 'Контактная информация', collapsible:'true', anchor: '100%', items:[ { xtype: 'container', anchor: '100%', layout:'column', items:[ { xtype: 'container', columnWidth:.5, layout: 'anchor', anchor: '100%', items: [ { xtype:'combo', id:'region_id', hiddenName:'region_id', fieldLabel:'Регион', name:'data[Place][region_id]', allowBlank:false, editable: false, queryMode:'local', width: 350, store: regionsStore, displayField: 'name', triggerAction: 'all', valueField:'regionid', listeners:{ 'select':function(combo,record) { if(record[0]) { Ext.getCmp('city_id').clearValue(); citiesStore.clearFilter(); citiesStore.filter("region",record[0].data.name); } else { Ext.getCmp('city_id').clearValue(); } } } }, { xtype:'combo', id:'city_id', hiddenName:'city_id', fieldLabel:'Город', name:'data[Msshopper][city_id]', labelSeparator:':', allowBlank:true, width: 350, store: citiesStore, queryMode:'local', displayField: 'name', editable: false, valueField:'cityid', triggerAction: 'all' }, { xtype:'textfield', id:'acity', fieldLabel:'Другой город', labelSeparator:':', name:'data[Place][acity]', allowBlank:true, width: 350 }, { xtype:'textarea', id:'address', fieldLabel:'Домашний адрес', labelSeparator:':', name:'data[Msshopper][address]', allowBlank:true, width: 350, height: 60, grow: true } ] }, { xtype: 'container', columnWidth:.5, layout: 'anchor', anchor: '100%', items: [ { xtype:'textfield', id:'telmob', fieldLabel:'Мобильный телефон', labelSeparator:':', name:'data[Msshopper][telmob]', allowBlank:false, width: 350 }, { xtype:'textfield', id:'telmob1', fieldLabel:'Дополнительный моб. телефон', labelSeparator:':', name:'data[Msshopper][telmob1]', allowBlank:true, width: 350 }, { xtype:'textfield', id:'telhome', fieldLabel:'Домашний телефон', labelSeparator:':', name:'data[Msshopper][telhome]', allowBlank:true, width: 350 } ] } ] } ] }, { xtype: 'fieldset', title: 'Дополнительная информация', collapsible:'true', anchor: '100%', items:[ { xtype: 'container', anchor: '100%', layout:'column', items:[ { xtype: 'container', columnWidth:.5, layout: 'anchor', anchor: '100%', items: [ { xtype:'combo', id:'domesticpos', fieldLabel:'Семейное положение', labelSeparator:':', allowBlank:false, name:'data[Msshopper][domesticpos]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['single','Не женат (не замужем)'],['married','Женат (замужем)'],['divorced','Разведен (разведена)']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'combo', id:'incomelevel', fieldLabel:'Уровень месячного дохода', labelSeparator:':', allowBlank:false, name:'data[Msshopper][incomelevel]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['1','до 2500 грн.'],['2','от 2500 до 5000 грн.'],['3','от 5000 до 10000 грн.'],['4','от 10000 до 15000 грн.'],['4','свыше 15000 грн.']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'combo', id:'dl', fieldLabel:'Наличие прав', labelSeparator:':', allowBlank:false, name:'data[Msshopper][dl]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['1','Нет'],['2','Есть']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'combo', id:'car', fieldLabel:'Наличие автомобиля', labelSeparator:':', allowBlank:false, name:'data[Msshopper][car]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['1','Нет'],['2','Есть']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'textfield', id:'auto', fieldLabel:'Марка автомобиля', labelSeparator:':', name:'data[Msshopper][auto]', allowBlank:true, width: 350 } ] }, { xtype: 'container', columnWidth:.5, layout: 'anchor', anchor: '100%', items: [ { xtype:'combo', id:'internet', fieldLabel:'Доступ в интернет', labelSeparator:':', allowBlank:false, name:'data[Msshopper][internet]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['no','Нет'],['cafe','Интернет кафе/знакомые'],['work','На работе'],['home','Дома/постоянный']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'combo', id:'dictaphone', fieldLabel:'Наличие диктофона', labelSeparator:':', allowBlank:false, name:'data[Msshopper][dictaphone]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['no','Нет'],['mobile','На мобильном'],['mp3','Цифровой']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'combo', id:'camera', fieldLabel:'Наличие фотоаппарата', labelSeparator:':', allowBlank:false, name:'data[Msshopper][camera]', mode:'local', width: 350, editable: false, triggerAction: 'all', store:new Ext.data.SimpleStore({ fields:['key','name'], data:[['no','Нет'],['ordinary','Обычный'],['digital','Цифровой']] }), displayField:'name', valueField:'key', hiddenValue:'key' }, { xtype:'textarea', id:'dop', fieldLabel:'Дополнительно', labelSeparator:':', name:'data[Msshopper][dop]', allowBlank:true, width: 350, emptyText:'Дополнительная информация о себе (ICQ, Skype, другие контакты, пожелания и т.д.)', grow: true } ] } ] } ] }, { xtype: 'fieldset', title: 'Последнее (текущее место работы)', collapsible:'true', items:[ { xtype:'textfield', id:'companyname', fieldLabel:'Название компании', labelSeparator:':', name:'data[Msshopper][companyname]', allowBlank:true, width: 350 }, { xtype:'textfield', id:'position', fieldLabel:'Должность', labelSeparator:':', name:'data[Msshopper][position]', allowBlank:true, width: 500 }, { xtype:'textarea', id:'duties', fieldLabel:'Обязанности', labelSeparator:':', name:'data[Msshopper][duties]', allowBlank:true, width: 500, height: 100, grow: true } ] }, { xtype: 'fieldset', title: 'Почему Вы хотите стать Тайным покупателем?', collapsible:'true', anchor: '100%', items:[ { xtype:'label', html:'Некоторые варианты: «Получение дополнительного дохода», «Выявить недостатки обслуживания в различных организациях», «Из любопытства», «Внести свой вклад в общее повышение уровня сервиса», «Интересна тема контроля и оценки персонала, т.к это связано с моей профессиональной деятельностью»

' }, { xtype:'textarea', id:'why', fieldLabel:'', labelSeparator:':', name:'data[Msshopper][why]', allowBlank:false, width: 500, height: 100, emptyText: 'Напишите аргументировано. Объем комментариев - не менее 3-4 предложений', grow: true } ] }, { xtype: 'fieldset', title: 'Опишите компанию/магазин/офис, в которой, по вашему мнению, высокий уровень сервиса (обязательно аргументируйте)', collapsible:'true', anchor: '100%', items:[ { xtype:'textarea', id:'descr', fieldLabel:'', labelSeparator:':', name:'data[Msshopper][descr]', allowBlank:true, width: 500, height: 100, emptyText: 'Напишите аргументировано Ваше мнение об обслуживании (что понравилось, не понравилось)', grow: true } ] }, { xtype: 'checkboxfield', name: 'accept', fieldLabel: 'Terms of Use', hideLabel: true, style: 'margin-top:15px', boxLabel: 'Я согласен (согласна) получать на мой e-mail уведомления компании о новых вакансиях, назначении заданий, оплате услуг и т.д.', listeners: { change:function(fld,nv,ov){ if(nv) { Ext.getCmp("regButton").enable(); } else { Ext.getCmp("regButton").disable(); } } } } ] }); var profilewindow = new Ext.Window({ id:'profilewindow', title: 'Изменение профиля', width: 890, height:560, minWidth: 890, minHeight: 560, plain:false, closable:true, autoScroll: true, modal: true, items:[profileForm], buttons:[ { text:'Регистрация', id:'regButton', disabled:true, tooltip:'Регистрация в системе', handler:function(){ if(profileForm.getForm().isValid()){ var regflag = true; if (!Ext.getCmp('city_id').getValue()) { if ((!Ext.getCmp('region_id').getValue())||(!Ext.getCmp('acity').getValue())) { Ext.Msg.show({ title:'Системное сообщение', msg:'Не указан город. Выберите город из списка или укажите другой город с указанием региона.', icon:Ext.Msg.INFO, buttons:Ext.Msg.OK, width: 450, scope:this }); regflag = false; } else { regflag = true; } } if (regflag) { profileForm.getForm().submit({ waitTitle: 'Пожалуйста подождите', waitMsg:'Загрузка данных', url:'/msshoppers/register', timeout:30, success:function(form,action){ Ext.getCmp('profilewindow').close(); Ext.Msg.show({ title:'Системное сообщение', msg:action.result.msg, icon:Ext.Msg.INFO, buttons:Ext.Msg.OK, width: 450, scope:this, fn:function(response) { self.location='/msshoppers'; } }); }, failure:function(form,action){ switch (action.failureType) { case Ext.form.Action.CONNECT_FAILURE: Ext.Msg.alert('Системное сообщение', 'Ошибка загрузки данных. Проверьте соединение с сетью Интернет.'); break; default: if (action.result.msg){ Ext.Msg.alert('Системное сообщение',action.result.msg); } else { Ext.Msg.alert('Системное сообщение','Ошибка загрузки данных. Проверьте соединение с сетью Интернет.'); } break; } } }); } } else { Ext.MessageBox.alert('Ошибка', 'Заполните все необходимые поля'); } } } ] }); profilewindow.show(); });