diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.coffee index 522026c97..01ee6f760 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.coffee @@ -366,15 +366,17 @@ class App.ControllerForm extends App.Controller return item else placeholderObjects = {} - if @model.className && @params && !_.isEmpty(attribute.linktemplate) && !_.isEmpty(@params[attribute.name]) + if @model.className && @params && ( attribute.type is 'url' || !_.isEmpty(attribute.linktemplate) ) && !_.isEmpty(@params[attribute.name]) placeholderObjects = { attribute: attribute, session: App.Session.get(), config: App.Config.all() } placeholderObjects[@model.className.toLowerCase()] = @params + fullItem = $( App.view('generic/attribute')( attribute: attribute, item: '', bookmarkable: @bookmarkable placeholderObjects: placeholderObjects + className: @model.className ) ) fullItem.find('.controls').prepend(item) diff --git a/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee b/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee index 149c78caf..63a49d9b0 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee @@ -210,6 +210,15 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi item.find('.js-inputMaxlength').html(inputMaxlength.form) item.find('.js-inputLinkTemplate').html(inputLinkTemplate.form) + item.find("select[name='data_option::type']").on('change', (e) -> + value = $(e.target).val() + if value is 'url' + item.find('.js-inputLinkTemplate').hide() + else + item.find('.js-inputLinkTemplate').show() + ) + item.find("select[name='data_option::type']").trigger('change') + @datetime: (item, localParams, params) -> configureAttributes = [ { name: 'data_option::future', display: 'Allow future', tag: 'boolean', null: false, default: true }, diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee index c06e1fb38..1a0f401ef 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee @@ -22,7 +22,7 @@ class Edit extends App.ObserverController @permissionCheck('admin') || ticket.currentView() is 'agent' new App.ControllerForm( elReplace: @el - model: { configure_attributes: @formMeta.configure_attributes || App.Ticket.configure_attributes } + model: { className: 'Ticket', configure_attributes: @formMeta.configure_attributes || App.Ticket.configure_attributes } screen: 'edit' handlersConfig: handlers filter: @formMeta.filter diff --git a/app/assets/javascripts/app/views/generic/attribute.jst.eco b/app/assets/javascripts/app/views/generic/attribute.jst.eco index d039fec18..9cbfa468b 100644 --- a/app/assets/javascripts/app/views/generic/attribute.jst.eco +++ b/app/assets/javascripts/app/views/generic/attribute.jst.eco @@ -20,9 +20,9 @@
<% if @attribute.help: %><%- @T(@attribute.help) %><% end %><%- @attribute.helpLink %>
<% end %> -