Project

General

Profile

Actions

Feature #5282

closed

Hide custom fields elements

Added by Danny de Haan about 15 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
-
Start date:
2010-04-09
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid

Description

Hi All,

We have installed redmine for a customer of us. We now have to tweak it a little bit. What we want.

We have 4 user roles/groups e.g. Odontos, Ortholab, Ortholab zuid and Orthotec. They alle have their own customers for which they can make an issue.

I want that if a user from usergroup Ortholab is logged in, that they only see their own customers.

The problem is that i'm completely not Ruby on rails minded, so i dont't know how i can print the role_id. i've tried the following, but i'm always getting a Internal server error.

<%= Member.role_id >
<
= Member->role_id >
<
= Member=>role_id >
<
= Member::role_id >
<
= Member(:role_id) %>

I want to make it like this.

<script type="text/javascript">
jQuery.noConflict();
var labo = <%= Member.role_id %>;
var prefix;
if(labo == '4') {
prefix = '01-';
}
else if(labo == 5) {
prefix = '02-';
}
else if(labo == 6) {
prefix = '03-';
}
else if(labo == 7) {
prefix = '04-';
}

jQuery(document).ready(function(){
jQuery('#issue_custom_field_values_1').find('option').each(function(i){
if(jQuery(this).attr('value').substr(0,3) != prefix && jQuery(this).attr('value') != '') {
jQuery(this).remove();
}
});
});
&lt;/script&gt;

Does someone of you know a solution?

Actions #1

Updated by Jean-Philippe Lang about 15 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Please, no support request here.
Here we track Redmine issue, have a try in the forums.

Actions

Also available in: Atom PDF