function BusinessAddWizardUser(json_content) { BusinessAddWizard.call(this, json_content); } BusinessAddWizardUser.prototype = Object.create(BusinessAddWizard.prototype); BusinessAddWizardUser.prototype.constructor = BusinessAddWizardUser; BusinessAddWizardUser.prototype.SupportsCategoryContainers = function() { return this.IsEditing(); } BusinessAddWizardUser.prototype.Initialize = function(json_content) { if (this.IsEditing()) { $("#business-root-category-content").show(); $("#business-sub-category-content").show(); } BusinessAddWizard.prototype.Initialize.call(this, json_content); } BusinessAddWizardUser.prototype.GetDeleteBusinessURL = function() { return "/business.php?mode=delete_business&business_id=" + this.business_id } BusinessAddWizardUser.prototype.AnalyzeBusinessEditing = function(onSuccessCallback) { if (this.IsEditing()) { this.ExecuteSendProfileToServerAjaxRequest("business_analyze_should_moderate_ajax", function(serverAnswer) { console.log(serverAnswer); if (serverAnswer.send_to_moderation == "1") { UniversalModalDialog.showYesNoModalDialog("Редактирование существующей услуги", "При редактировании услуги она снова будет отправлена на модерацию. Вы точно хотите продолжить?", function() { onSuccessCallback(); } ); } else onSuccessCallback(); }); } else onSuccessCallback(); } BusinessAddWizardUser.prototype.AnalyzeBusinessCoverExisting = function(onSuccessCallback) { if (this.hasCover) onSuccessCallback(); else { UniversalModalDialog.showYesNoModalDialog("Добавление изображения", "Вы не добавили изображение, что может негативно сказаться на видимости вашей услуги. Хотите добавить изображение?", function() {}, function() { onSuccessCallback(); } ); } } BusinessAddWizardUser.prototype.InitializeInternalObjects = function() { SetSelectBoxValue("#business-country", wizardDefaultCountryID); BusinessAddWizard.prototype.InitializeInternalObjects.call(this); SetSelectBoxValue("#business-city", wizardDefaultCityID); } BusinessAddWizardUser.prototype.SendProfileToServerInternal = function(isSilentMode) { let _this = this; _this.AnalyzeBusinessCoverExisting(function() { _this.AnalyzeBusinessEditing(function() { BusinessAddWizard.prototype.SendProfileToServerInternal.call(_this, isSilentMode); }); }); }