Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
24538a4a
Commit
24538a4a
authored
Nov 28, 2011
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#735] Log time form on issue update should only be displayed with log_time permission
Based on a patch by Jean-Philippe Lang.
parent
59dc1034
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
_edit.rhtml
app/views/issues/_edit.rhtml
+2
-2
issues_controller_test.rb
test/functional/issues_controller_test.rb
+16
-0
No files found.
app/views/issues/_edit.rhtml
View file @
24538a4a
...
...
@@ -15,7 +15,7 @@
<%=
render
:partial
=>
(
@edit_allowed
?
'form'
:
'form_update'
),
:locals
=>
{
:f
=>
f
}
%>
</fieldset>
<%
end
%>
<%
if
authorize_for
(
'timelog'
,
'edit'
)
%>
<%
if
User
.
current
.
allowed_to?
(
:log_time
,
@project
)
%>
<fieldset
class=
"tabular"
><legend>
<%=
l
(
:button_log_time
)
%>
</legend>
<%
fields_for
:time_entry
,
@time_entry
,
{
:builder
=>
TabularFormBuilder
,
:lang
=>
current_language
}
do
|
time_entry
|
%>
<div
class=
"splitcontentleft"
>
...
...
@@ -26,7 +26,7 @@
</div>
<p>
<%=
time_entry
.
text_field
:comments
,
:size
=>
60
%>
</p>
<%
@time_entry
.
custom_field_values
.
each
do
|
value
|
%>
<p>
<%=
custom_field_tag_with_label
:time_entry
,
value
%>
</p>
<p>
<%=
custom_field_tag_with_label
:time_entry
,
value
%>
</p>
<%
end
%>
<%
end
%>
</fieldset>
...
...
test/functional/issues_controller_test.rb
View file @
24538a4a
...
...
@@ -781,6 +781,22 @@ class IssuesControllerTest < ActionController::TestCase
assert_tag
:input
,
:attributes
=>
{
:name
=>
'time_entry[comments]'
,
:value
=>
'test_get_edit_with_params'
}
end
def
test_get_edit_should_display_the_time_entry_form_with_log_time_permission
@request
.
session
[
:user_id
]
=
2
Role
.
find_by_name
(
'Manager'
).
update_attribute
:permissions
,
[
:view_issues
,
:edit_issues
,
:log_time
]
get
:edit
,
:id
=>
1
assert_tag
'input'
,
:attributes
=>
{
:name
=>
'time_entry[hours]'
}
end
def
test_get_edit_should_not_display_the_time_entry_form_without_log_time_permission
@request
.
session
[
:user_id
]
=
2
Role
.
find_by_name
(
'Manager'
).
remove_permission!
:log_time
get
:edit
,
:id
=>
1
assert_no_tag
'input'
,
:attributes
=>
{
:name
=>
'time_entry[hours]'
}
end
def
test_update_edit_form
@request
.
session
[
:user_id
]
=
2
xhr
:post
,
:new
,
:project_id
=>
1
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment