require_parameters :id
@filter = MeasureFilter.find(params[:id])
- access_denied unless @filter.owner?(current_user)
+ access_denied unless has_role?(:admin)
@filter.name=params[:name]
@filter.description=params[:description]
@filter.shared=(params[:shared]=='true')
+ @filter.user = User.find_by_login(params[:owner])
if @filter.save
render :text => @filter.id.to_s, :status => 200
else
<label for="description"><%= h message('description') -%></label>
<input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h @filter.description -%>"/>
</div>
+ <div class="modal-field">
+ <label for="owner"><%= h message('owner') -%></label>
+ <%= user_select_tag('owner', :html_id => 'select-filter-owner', :selected_user => @filter.user) -%>
+ </div>
<div class="modal-field">
<label for="shared"><%= h message('measure_filter.shared_with_all_users') -%></label>
<input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if @filter.shared -%>/>
</td>
<td class="thin nowrap right">
<a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
- <% if filter.system? && has_role?(:admin) %>
+ <% if has_role?(:admin) %>
<a id="edit_system_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>