Revision 1297:0a574315af3e .svn/pristine/dd

View differences:

.svn/pristine/dd/dd3fda21557e42e76ff4e7d0ea0177f132ffdf18.svn-base
1
/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
/* Written by Andrew Stromnov (stromnov@gmail.com). */
3
jQuery(function($){
4
	$.datepicker.regional['ru'] = {
5
		closeText: 'Закрыть',
6
		prevText: '<Пред',
7
		nextText: 'След>',
8
		currentText: 'Сегодня',
9
		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
10
		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
11
		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
12
		'Июл','Авг','Сен','Окт','Ноя','Дек'],
13
		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
14
		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
15
		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
16
		weekHeader: 'Нед',
17
		dateFormat: 'dd.mm.yy',
18
		firstDay: 1,
19
		isRTL: false,
20
		showMonthAfterYear: false,
21
		yearSuffix: ''};
22
	$.datepicker.setDefaults($.datepicker.regional['ru']);
23
});
.svn/pristine/dd/dd561db5ef5432d6bf441ad281f7e7b0c0b4f902.svn-base
1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
3
#
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU General Public License
6
# as published by the Free Software Foundation; either version 2
7
# of the License, or (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17

  
18
require File.expand_path('../../../test_helper', __FILE__)
19

  
20
class ApiTest::TrackersTest < ActionController::IntegrationTest
21
  fixtures :trackers
22

  
23
  def setup
24
    Setting.rest_api_enabled = '1'
25
  end
26

  
27
  context "/trackers" do
28
    context "GET" do
29

  
30
      should "return trackers" do
31
        get '/trackers.xml'
32

  
33
        assert_response :success
34
        assert_equal 'application/xml', @response.content_type
35
        assert_tag :tag => 'trackers',
36
          :attributes => {:type => 'array'},
37
          :child => {
38
            :tag => 'tracker',
39
            :child => {
40
              :tag => 'id',
41
              :content => '2',
42
              :sibling => {
43
                :tag => 'name',
44
                :content => 'Feature request'
45
              }
46
            }
47
          }
48
      end
49
    end
50
  end
51
end
.svn/pristine/dd/dd876b89c5fe4070fb794829baa9cc92b9f7ef13.svn-base
1
# encoding: utf-8
2
#
3
# Redmine - project management software
4
# Copyright (C) 2006-2012  Jean-Philippe Lang
5
#
6
# This program is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU General Public License
8
# as published by the Free Software Foundation; either version 2
9
# of the License, or (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19

  
20
module EnumerationsHelper
21
end
.svn/pristine/dd/ddb1e7765908d6669ef044e05cf9c200a2438849.svn-base
1
require File.expand_path('../../test_helper', __FILE__)
2

  
3
class ContextMenusControllerTest < ActionController::TestCase
4
  fixtures :projects,
5
           :trackers,
6
           :projects_trackers,
7
           :roles,
8
           :member_roles,
9
           :members,
10
           :enabled_modules,
11
           :workflows,
12
           :journals, :journal_details,
13
           :versions,
14
           :issues, :issue_statuses, :issue_categories,
15
           :users,
16
           :enumerations,
17
           :time_entries
18

  
19
  def test_context_menu_one_issue
20
    @request.session[:user_id] = 2
21
    get :issues, :ids => [1]
22
    assert_response :success
23
    assert_template 'context_menu'
24
    assert_tag :tag => 'a', :content => 'Edit',
25
                            :attributes => { :href => '/issues/1/edit',
26
                                             :class => 'icon-edit' }
27
    assert_tag :tag => 'a', :content => 'Closed',
28
                            :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bstatus_id%5D=5',
29
                                             :class => '' }
30
    assert_tag :tag => 'a', :content => 'Immediate',
31
                            :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bpriority_id%5D=8',
32
                                             :class => '' }
33
    assert_no_tag :tag => 'a', :content => 'Inactive Priority'
34
    # Versions
35
    assert_tag :tag => 'a', :content => '2.0',
36
                            :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=3',
37
                                             :class => '' }
38
    assert_tag :tag => 'a', :content => 'eCookbook Subproject 1 - 2.0',
39
                            :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=4',
40
                                             :class => '' }
41

  
42
    assert_tag :tag => 'a', :content => 'Dave Lopper',
43
                            :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bassigned_to_id%5D=3',
44
                                             :class => '' }
45
    assert_tag :tag => 'a', :content => 'Copy',
46
                            :attributes => { :href => '/projects/ecookbook/issues/1/copy',
47
                                             :class => 'icon-copy' }
48
    assert_no_tag :tag => 'a', :content => 'Move'
49
    assert_tag :tag => 'a', :content => 'Delete',
50
                            :attributes => { :href => '/issues?ids%5B%5D=1',
51
                                             :class => 'icon-del' }
52
  end
53

  
54
  def test_context_menu_one_issue_by_anonymous
55
    get :issues, :ids => [1]
56
    assert_response :success
57
    assert_template 'context_menu'
58
    assert_tag :tag => 'a', :content => 'Delete',
59
                            :attributes => { :href => '#',
60
                                             :class => 'icon-del disabled' }
61
  end
62

  
63
  def test_context_menu_multiple_issues_of_same_project
64
    @request.session[:user_id] = 2
65
    get :issues, :ids => [1, 2]
66
    assert_response :success
67
    assert_template 'context_menu'
68
    assert_not_nil assigns(:issues)
69
    assert_equal [1, 2], assigns(:issues).map(&:id).sort
70

  
71
    ids = assigns(:issues).map(&:id).sort.map {|i| "ids%5B%5D=#{i}"}.join('&amp;')
72
    assert_tag :tag => 'a', :content => 'Edit',
73
                            :attributes => { :href => "/issues/bulk_edit?#{ids}",
74
                                             :class => 'icon-edit' }
75
    assert_tag :tag => 'a', :content => 'Closed',
76
                            :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bstatus_id%5D=5",
77
                                             :class => '' }
78
    assert_tag :tag => 'a', :content => 'Immediate',
79
                            :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bpriority_id%5D=8",
80
                                             :class => '' }
81
    assert_tag :tag => 'a', :content => 'Dave Lopper',
82
                            :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bassigned_to_id%5D=3",
83
                                             :class => '' }
84
    assert_tag :tag => 'a', :content => 'Copy',
85
                            :attributes => { :href => "/issues/bulk_edit?copy=1&amp;#{ids}",
86
                                             :class => 'icon-copy' }
87
    assert_no_tag :tag => 'a', :content => 'Move'
88
    assert_tag :tag => 'a', :content => 'Delete',
89
                            :attributes => { :href => "/issues?#{ids}",
90
                                             :class => 'icon-del' }
91
  end
92

  
93
  def test_context_menu_multiple_issues_of_different_projects
94
    @request.session[:user_id] = 2
95
    get :issues, :ids => [1, 2, 6]
96
    assert_response :success
97
    assert_template 'context_menu'
98
    assert_not_nil assigns(:issues)
99
    assert_equal [1, 2, 6], assigns(:issues).map(&:id).sort
100

  
101
    ids = assigns(:issues).map(&:id).sort.map {|i| "ids%5B%5D=#{i}"}.join('&amp;')
102
    assert_tag :tag => 'a', :content => 'Edit',
103
                            :attributes => { :href => "/issues/bulk_edit?#{ids}",
104
                                             :class => 'icon-edit' }
105
    assert_tag :tag => 'a', :content => 'Closed',
106
                            :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bstatus_id%5D=5",
107
                                             :class => '' }
108
    assert_tag :tag => 'a', :content => 'Immediate',
109
                            :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bpriority_id%5D=8",
110
                                             :class => '' }
111
    assert_tag :tag => 'a', :content => 'John Smith',
112
                            :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bassigned_to_id%5D=2",
113
                                             :class => '' }
114
    assert_tag :tag => 'a', :content => 'Delete',
115
                            :attributes => { :href => "/issues?#{ids}",
116
                                             :class => 'icon-del' }
117
  end
118

  
119
  def test_context_menu_should_include_list_custom_fields
120
    field = IssueCustomField.create!(:name => 'List', :field_format => 'list',
121
      :possible_values => ['Foo', 'Bar'], :is_for_all => true, :tracker_ids => [1, 2, 3])
122
    @request.session[:user_id] = 2
123
    get :issues, :ids => [1]
124

  
125
    assert_tag 'a',
126
      :content => 'List',
127
      :attributes => {:href => '#'},
128
      :sibling => {:tag => 'ul', :children => {:count => 3}}
129

  
130
    assert_tag 'a',
131
      :content => 'Foo',
132
      :attributes => {:href => "/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bcustom_field_values%5D%5B#{field.id}%5D=Foo"}
133
    assert_tag 'a',
134
      :content => 'none',
135
      :attributes => {:href => "/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bcustom_field_values%5D%5B#{field.id}%5D=__none__"}
136
  end
137

  
138
  def test_context_menu_should_not_include_null_value_for_required_custom_fields
139
    field = IssueCustomField.create!(:name => 'List', :is_required => true, :field_format => 'list',
140
      :possible_values => ['Foo', 'Bar'], :is_for_all => true, :tracker_ids => [1, 2, 3])
141
    @request.session[:user_id] = 2
142
    get :issues, :ids => [1, 2]
143

  
144
    assert_tag 'a',
145
      :content => 'List',
146
      :attributes => {:href => '#'},
147
      :sibling => {:tag => 'ul', :children => {:count => 2}}
148
  end
149

  
150
  def test_context_menu_on_single_issue_should_select_current_custom_field_value
151
    field = IssueCustomField.create!(:name => 'List', :field_format => 'list',
152
      :possible_values => ['Foo', 'Bar'], :is_for_all => true, :tracker_ids => [1, 2, 3])
153
    issue = Issue.find(1)
154
    issue.custom_field_values = {field.id => 'Bar'}
155
    issue.save!
156
    @request.session[:user_id] = 2
157
    get :issues, :ids => [1]
158

  
159
    assert_tag 'a',
160
      :content => 'List',
161
      :attributes => {:href => '#'},
162
      :sibling => {:tag => 'ul', :children => {:count => 3}}
163
    assert_tag 'a',
164
      :content => 'Bar',
165
      :attributes => {:class => /icon-checked/}
166
  end
167

  
168
  def test_context_menu_should_include_bool_custom_fields
169
    field = IssueCustomField.create!(:name => 'Bool', :field_format => 'bool',
170
      :is_for_all => true, :tracker_ids => [1, 2, 3])
171
    @request.session[:user_id] = 2
172
    get :issues, :ids => [1]
173

  
174
    assert_tag 'a',
175
      :content => 'Bool',
176
      :attributes => {:href => '#'},
177
      :sibling => {:tag => 'ul', :children => {:count => 3}}
178

  
179
    assert_tag 'a',
180
      :content => 'Yes',
181
      :attributes => {:href => "/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bcustom_field_values%5D%5B#{field.id}%5D=1"}
182
  end
183

  
184
  def test_context_menu_should_include_user_custom_fields
185
    field = IssueCustomField.create!(:name => 'User', :field_format => 'user',
186
      :is_for_all => true, :tracker_ids => [1, 2, 3])
187
    @request.session[:user_id] = 2
188
    get :issues, :ids => [1]
189

  
190
    assert_tag 'a',
191
      :content => 'User',
192
      :attributes => {:href => '#'},
193
      :sibling => {:tag => 'ul', :children => {:count => Project.find(1).members.count + 1}}
194

  
195
    assert_tag 'a',
196
      :content => 'John Smith',
197
      :attributes => {:href => "/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bcustom_field_values%5D%5B#{field.id}%5D=2"}
198
  end
199

  
200
  def test_context_menu_should_include_version_custom_fields
201
    field = IssueCustomField.create!(:name => 'Version', :field_format => 'version', :is_for_all => true, :tracker_ids => [1, 2, 3])
202
    @request.session[:user_id] = 2
203
    get :issues, :ids => [1]
204

  
205
    assert_tag 'a',
206
      :content => 'Version',
207
      :attributes => {:href => '#'},
208
      :sibling => {:tag => 'ul', :children => {:count => Project.find(1).shared_versions.count + 1}}
209

  
210
    assert_tag 'a',
211
      :content => '2.0',
212
      :attributes => {:href => "/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bcustom_field_values%5D%5B#{field.id}%5D=3"}
213
  end
214

  
215
  def test_context_menu_by_assignable_user_should_include_assigned_to_me_link
216
    @request.session[:user_id] = 2
217
    get :issues, :ids => [1]
218
    assert_response :success
219
    assert_template 'context_menu'
220

  
221
    assert_tag :tag => 'a', :content => / me /,
222
                            :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bassigned_to_id%5D=2',
223
                                             :class => '' }
224
  end
225

  
226
  def test_context_menu_should_propose_shared_versions_for_issues_from_different_projects
227
    @request.session[:user_id] = 2
228
    version = Version.create!(:name => 'Shared', :sharing => 'system', :project_id => 1)
229

  
230
    get :issues, :ids => [1, 4]
231
    assert_response :success
232
    assert_template 'context_menu'
233

  
234
    assert_include version, assigns(:versions)
235
    assert_tag :tag => 'a', :content => 'eCookbook - Shared'
236
  end
237

  
238
  def test_context_menu_issue_visibility
239
    get :issues, :ids => [1, 4]
240
    assert_response :success
241
    assert_template 'context_menu'
242
    assert_equal [1], assigns(:issues).collect(&:id)
243
  end
244
  
245
  def test_time_entries_context_menu
246
    @request.session[:user_id] = 2
247
    get :time_entries, :ids => [1, 2]
248
    assert_response :success
249
    assert_template 'time_entries'
250
    assert_tag 'a', :content => 'Edit'
251
    assert_no_tag 'a', :content => 'Edit', :attributes => {:class => /disabled/}
252
  end
253
  
254
  def test_time_entries_context_menu_without_edit_permission
255
    @request.session[:user_id] = 2
256
    Role.find_by_name('Manager').remove_permission! :edit_time_entries
257
    
258
    get :time_entries, :ids => [1, 2]
259
    assert_response :success
260
    assert_template 'time_entries'
261
    assert_tag 'a', :content => 'Edit', :attributes => {:class => /disabled/}
262
  end
263
end
.svn/pristine/dd/ddeddca3bdda0963ba87aabdfae2d9aadf1fb7d7.svn-base
1
= Redmine
2

  
3
Redmine is a flexible project management web application written using Ruby on Rails framework.
4

  
5
More details can be found at http://www.redmine.org
6

  
7
= License
8

  
9
Copyright (C) 2006-2012  Jean-Philippe Lang
10

  
11
This program is free software; you can redistribute it and/or
12
modify it under the terms of the GNU General Public License
13
as published by the Free Software Foundation; either version 2
14
of the License, or (at your option) any later version.
15

  
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
GNU General Public License for more details.
20

  
21
You should have received a copy of the GNU General Public License
22
along with this program; if not, write to the Free Software
23
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24

  
25
Icons credits:
26

  
27
* Mark James (Silk Icons) licensed under a Creative Commons Attribution 2.5 License.
28
* Yusuke Kamiyamane (Fugue Icons) licensed under a Creative Commons Attribution 3.0 License.

Also available in: Unified diff