Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
24538a4a
Commit
24538a4a
authored
13 years ago
by
Holger Just
Browse files
Options
Downloads
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
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/views/issues/_edit.rhtml
+2
-2
2 additions, 2 deletions
app/views/issues/_edit.rhtml
test/functional/issues_controller_test.rb
+16
-0
16 additions, 0 deletions
test/functional/issues_controller_test.rb
with
18 additions
and
2 deletions
app/views/issues/_edit.rhtml
+
2
−
2
View file @
24538a4a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<%=
render
:partial
=>
(
@edit_allowed
?
'form'
:
'form_update'
),
:locals
=>
{
:f
=>
f
}
%>
<%=
render
:partial
=>
(
@edit_allowed
?
'form'
:
'form_update'
),
:locals
=>
{
:f
=>
f
}
%>
</fieldset>
</fieldset>
<%
end
%>
<%
end
%>
<%
if
authorize_for
(
'timelog'
,
'edit'
)
%>
<%
if
User
.
current
.
allowed_to?
(
:log_time
,
@project
)
%>
<fieldset
class=
"tabular"
><legend>
<%=
l
(
:button_log_time
)
%>
</legend>
<fieldset
class=
"tabular"
><legend>
<%=
l
(
:button_log_time
)
%>
</legend>
<%
fields_for
:time_entry
,
@time_entry
,
{
:builder
=>
TabularFormBuilder
,
:lang
=>
current_language
}
do
|
time_entry
|
%>
<%
fields_for
:time_entry
,
@time_entry
,
{
:builder
=>
TabularFormBuilder
,
:lang
=>
current_language
}
do
|
time_entry
|
%>
<div
class=
"splitcontentleft"
>
<div
class=
"splitcontentleft"
>
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</div>
</div>
<p>
<%=
time_entry
.
text_field
:comments
,
:size
=>
60
%>
</p>
<p>
<%=
time_entry
.
text_field
:comments
,
:size
=>
60
%>
</p>
<%
@time_entry
.
custom_field_values
.
each
do
|
value
|
%>
<%
@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
%>
<%
end
%>
<%
end
%>
</fieldset>
</fieldset>
...
...
This diff is collapsed.
Click to expand it.
test/functional/issues_controller_test.rb
+
16
−
0
View file @
24538a4a
...
@@ -781,6 +781,22 @@ class IssuesControllerTest < ActionController::TestCase
...
@@ -781,6 +781,22 @@ class IssuesControllerTest < ActionController::TestCase
assert_tag
:input
,
:attributes
=>
{
:name
=>
'time_entry[comments]'
,
:value
=>
'test_get_edit_with_params'
}
assert_tag
:input
,
:attributes
=>
{
:name
=>
'time_entry[comments]'
,
:value
=>
'test_get_edit_with_params'
}
end
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
def
test_update_edit_form
@request
.
session
[
:user_id
]
=
2
@request
.
session
[
:user_id
]
=
2
xhr
:post
,
:new
,
:project_id
=>
1
,
xhr
:post
,
:new
,
:project_id
=>
1
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment