Fixes #3214 - link_template for ticket no longer shows a button after update to 3.5.
This commit is contained in:
parent
835787ee69
commit
45f56b0d7c
5 changed files with 25 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
</h2>
|
||||
<p class="help-text"><% if @attribute.help: %><%- @T(@attribute.help) %><% end %><%- @attribute.helpLink %></p>
|
||||
<% end %>
|
||||
<div class="controls <% if !_.isEmpty(@attribute.linktemplate) && !_.isEmpty(@placeholderObjects): %>controls--button<% end %>">
|
||||
<% if !_.isEmpty(@attribute.linktemplate) && !_.isEmpty(@placeholderObjects): %>
|
||||
<a href="<%- @replacePlaceholder(@attribute.linktemplate, @placeholderObjects, true) %>" class="controls-button" target="_blank" rel="nofollow">
|
||||
<div class="controls <% if ( @attribute.type is 'url' || !_.isEmpty(@attribute.linktemplate) ) && !_.isEmpty(@placeholderObjects): %>controls-button<% end %>">
|
||||
<% if ( @attribute.type is 'url' || !_.isEmpty(@attribute.linktemplate) ) && !_.isEmpty(@placeholderObjects): %>
|
||||
<a href="<% if @attribute.type is 'url': %><%= @placeholderObjects[@className.toLowerCase()][@attribute.name] %><% else: %><%- @replacePlaceholder(@attribute.linktemplate, @placeholderObjects, true) %><% end %>" class="controls-button" target="_blank" rel="nofollow">
|
||||
<span class="controls-button-inner"><%- @Icon('external') %></span>
|
||||
</a>
|
||||
<% end %>
|
||||
|
|
|
@ -2014,6 +2014,10 @@ input[type=url] {
|
|||
min-width: 400px;
|
||||
}
|
||||
|
||||
.sidebar-content input[type=url] {
|
||||
min-width: inherit;
|
||||
}
|
||||
|
||||
.user-select.form-control {
|
||||
padding-right: 35px;
|
||||
min-width: 300px;
|
||||
|
|
Loading…
Reference in a new issue