Revision 912:5e80956cc792 .svn/pristine/0a
| .svn/pristine/0a/0a08b8bce6631efd08e47030eee4cad9d864deab.svn-base | ||
|---|---|---|
| 1 |
class AddHideMailPref < ActiveRecord::Migration |
|
| 2 |
def self.up |
|
| 3 |
add_column :user_preferences, :hide_mail, :boolean, :default => false |
|
| 4 |
end |
|
| 5 |
|
|
| 6 |
def self.down |
|
| 7 |
remove_column :user_preferences, :hide_mail |
|
| 8 |
end |
|
| 9 |
end |
|
| .svn/pristine/0a/0a0af350ccda1e24c957ac2e637711c7c13afce3.svn-base | ||
|---|---|---|
| 1 |
class AddSearchPermission < ActiveRecord::Migration |
|
| 2 |
# model removed |
|
| 3 |
class Permission < ActiveRecord::Base; end |
|
| 4 |
|
|
| 5 |
def self.up |
|
| 6 |
Permission.create :controller => "projects", :action => "search", :description => "label_search", :sort => 130, :is_public => true, :mail_option => 0, :mail_enabled => 0 |
|
| 7 |
end |
|
| 8 |
|
|
| 9 |
def self.down |
|
| 10 |
Permission.find_by_controller_and_action('projects', 'search').destroy
|
|
| 11 |
end |
|
| 12 |
end |
|
| .svn/pristine/0a/0a2012ccc071b135723fea48195cee80c8c91dc5.svn-base | ||
|---|---|---|
| 1 |
class RemoveEnumerationsOpt < ActiveRecord::Migration |
|
| 2 |
def self.up |
|
| 3 |
remove_column :enumerations, :opt |
|
| 4 |
end |
|
| 5 |
|
|
| 6 |
def self.down |
|
| 7 |
add_column :enumerations, :opt, :string, :limit => 4, :default => '', :null => false |
|
| 8 |
Enumeration.update_all("opt = 'IPRI'", "type = 'IssuePriority'")
|
|
| 9 |
Enumeration.update_all("opt = 'DCAT'", "type = 'DocumentCategory'")
|
|
| 10 |
Enumeration.update_all("opt = 'ACTI'", "type = 'TimeEntryActivity'")
|
|
| 11 |
end |
|
| 12 |
end |
|
| .svn/pristine/0a/0a371b310545389947180083feb53371bb868f67.svn-base | ||
|---|---|---|
| 1 |
module CodeRay |
|
| 2 |
module Encoders |
|
| 3 |
|
|
| 4 |
map \ |
|
| 5 |
:loc => :lines_of_code, |
|
| 6 |
:plain => :text, |
|
| 7 |
:plaintext => :text, |
|
| 8 |
:remove_comments => :comment_filter, |
|
| 9 |
:stats => :statistic, |
|
| 10 |
:term => :terminal, |
|
| 11 |
:tty => :terminal, |
|
| 12 |
:yml => :yaml |
|
| 13 |
|
|
| 14 |
# No default because Tokens#nonsense should raise NoMethodError. |
|
| 15 |
|
|
| 16 |
end |
|
| 17 |
end |
|
| .svn/pristine/0a/0a62a3ae28a4f2df93a63c650d603c29ff087559.svn-base | ||
|---|---|---|
| 1 |
<% form_tag({:action => 'edit', :tab => 'mail_handler'}) do %>
|
|
| 2 |
|
|
| 3 |
<div class="box tabular settings"> |
|
| 4 |
<p> |
|
| 5 |
<%= setting_text_area :mail_handler_body_delimiters, :rows => 5 %> |
|
| 6 |
<br /><em><%= l(:text_line_separated) %></em> |
|
| 7 |
</p> |
|
| 8 |
</div> |
|
| 9 |
|
|
| 10 |
<div class="box tabular settings"> |
|
| 11 |
<p><%= setting_check_box :mail_handler_api_enabled, |
|
| 12 |
:onclick => "if (this.checked) { Form.Element.enable('settings_mail_handler_api_key'); } else { Form.Element.disable('settings_mail_handler_api_key'); }"%></p>
|
|
| 13 |
|
|
| 14 |
<p><%= setting_text_field :mail_handler_api_key, :size => 30, |
|
| 15 |
:id => 'settings_mail_handler_api_key', |
|
| 16 |
:disabled => !Setting.mail_handler_api_enabled? %> |
|
| 17 |
<%= link_to_function l(:label_generate_key), "if ($('settings_mail_handler_api_key').disabled == false) { $('settings_mail_handler_api_key').value = randomKey(20) }" %>
|
|
| 18 |
</p> |
|
| 19 |
</div> |
|
| 20 |
|
|
| 21 |
<%= submit_tag l(:button_save) %> |
|
| 22 |
|
|
| 23 |
<% end %> |
|
| .svn/pristine/0a/0a7b1df77f27f5a19675ef17aa746a136c7168e4.svn-base | ||
|---|---|---|
| 1 |
// translated by Dzintars Bergs (dzintars.bergs@gmail.com) |
|
| 2 |
jsToolBar.strings = {};
|
|
| 3 |
jsToolBar.strings['Strong'] = 'Treknraksts'; |
|
| 4 |
jsToolBar.strings['Italic'] = 'Slīpraksts'; |
|
| 5 |
jsToolBar.strings['Underline'] = 'Pasvītrojums'; |
|
| 6 |
jsToolBar.strings['Deleted'] = 'Dzēsts'; |
|
| 7 |
jsToolBar.strings['Code'] = 'Iekļauts kods'; |
|
| 8 |
jsToolBar.strings['Heading 1'] = 'Virsraksts 1'; |
|
| 9 |
jsToolBar.strings['Heading 2'] = 'Virsraksts 2'; |
|
| 10 |
jsToolBar.strings['Heading 3'] = 'Virsraksts 3'; |
|
| 11 |
jsToolBar.strings['Unordered list'] = 'Nesakārtots saraksts'; |
|
| 12 |
jsToolBar.strings['Ordered list'] = 'Sakārtots saraksts'; |
|
| 13 |
jsToolBar.strings['Quote'] = 'Citēt'; |
|
| 14 |
jsToolBar.strings['Unquote'] = 'Noņemt citātu'; |
|
| 15 |
jsToolBar.strings['Preformatted text'] = 'Iepriekš formatēts teksts'; |
|
| 16 |
jsToolBar.strings['Wiki link'] = 'Saite uz Wiki lapu'; |
|
| 17 |
jsToolBar.strings['Image'] = 'Attēls'; |
|
| .svn/pristine/0a/0a884b128ca03268f26234e1c96b240bce5a6e1b.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2011 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 EnumerationsControllerTest < ActionController::TestCase |
|
| 21 |
fixtures :enumerations, :issues, :users |
|
| 22 |
|
|
| 23 |
def setup |
|
| 24 |
@request.session[:user_id] = 1 # admin |
|
| 25 |
end |
|
| 26 |
|
|
| 27 |
def test_index |
|
| 28 |
get :index |
|
| 29 |
assert_response :success |
|
| 30 |
assert_template 'index' |
|
| 31 |
end |
|
| 32 |
|
|
| 33 |
def test_new |
|
| 34 |
get :new, :type => 'IssuePriority' |
|
| 35 |
assert_response :success |
|
| 36 |
assert_template 'new' |
|
| 37 |
assert_kind_of IssuePriority, assigns(:enumeration) |
|
| 38 |
end |
|
| 39 |
|
|
| 40 |
def test_create |
|
| 41 |
assert_difference 'IssuePriority.count' do |
|
| 42 |
post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'}
|
|
| 43 |
end |
|
| 44 |
assert_redirected_to '/enumerations?type=IssuePriority' |
|
| 45 |
e = IssuePriority.first(:order => 'id DESC') |
|
| 46 |
assert_equal 'Lowest', e.name |
|
| 47 |
end |
|
| 48 |
|
|
| 49 |
def test_create_with_failure |
|
| 50 |
assert_no_difference 'IssuePriority.count' do |
|
| 51 |
post :create, :enumeration => {:type => 'IssuePriority', :name => ''}
|
|
| 52 |
end |
|
| 53 |
assert_response :success |
|
| 54 |
assert_template 'new' |
|
| 55 |
end |
|
| 56 |
|
|
| 57 |
def test_edit |
|
| 58 |
get :edit, :id => 6 |
|
| 59 |
assert_response :success |
|
| 60 |
assert_template 'edit' |
|
| 61 |
end |
|
| 62 |
|
|
| 63 |
def test_update |
|
| 64 |
assert_no_difference 'IssuePriority.count' do |
|
| 65 |
post :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => 'New name'}
|
|
| 66 |
end |
|
| 67 |
assert_redirected_to '/enumerations?type=IssuePriority' |
|
| 68 |
e = IssuePriority.find(6) |
|
| 69 |
assert_equal 'New name', e.name |
|
| 70 |
end |
|
| 71 |
|
|
| 72 |
def test_update_with_failure |
|
| 73 |
assert_no_difference 'IssuePriority.count' do |
|
| 74 |
post :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => ''}
|
|
| 75 |
end |
|
| 76 |
assert_response :success |
|
| 77 |
assert_template 'edit' |
|
| 78 |
end |
|
| 79 |
|
|
| 80 |
def test_destroy_enumeration_not_in_use |
|
| 81 |
post :destroy, :id => 7 |
|
| 82 |
assert_redirected_to :controller => 'enumerations', :action => 'index' |
|
| 83 |
assert_nil Enumeration.find_by_id(7) |
|
| 84 |
end |
|
| 85 |
|
|
| 86 |
def test_destroy_enumeration_in_use |
|
| 87 |
post :destroy, :id => 4 |
|
| 88 |
assert_response :success |
|
| 89 |
assert_template 'destroy' |
|
| 90 |
assert_not_nil Enumeration.find_by_id(4) |
|
| 91 |
end |
|
| 92 |
|
|
| 93 |
def test_destroy_enumeration_in_use_with_reassignment |
|
| 94 |
issue = Issue.find(:first, :conditions => {:priority_id => 4})
|
|
| 95 |
post :destroy, :id => 4, :reassign_to_id => 6 |
|
| 96 |
assert_redirected_to :controller => 'enumerations', :action => 'index' |
|
| 97 |
assert_nil Enumeration.find_by_id(4) |
|
| 98 |
# check that the issue was reassign |
|
| 99 |
assert_equal 6, issue.reload.priority_id |
|
| 100 |
end |
|
| 101 |
end |
|
| .svn/pristine/0a/0ade634c1e3a74f500a2549a2decba896fa1c7ee.svn-base | ||
|---|---|---|
| 1 |
Copyright (c) 2005 Rick Olson |
|
| 2 |
|
|
| 3 |
Permission is hereby granted, free of charge, to any person obtaining |
|
| 4 |
a copy of this software and associated documentation files (the |
|
| 5 |
"Software"), to deal in the Software without restriction, including |
|
| 6 |
without limitation the rights to use, copy, modify, merge, publish, |
|
| 7 |
distribute, sublicense, and/or sell copies of the Software, and to |
|
| 8 |
permit persons to whom the Software is furnished to do so, subject to |
|
| 9 |
the following conditions: |
|
| 10 |
|
|
| 11 |
The above copyright notice and this permission notice shall be |
|
| 12 |
included in all copies or substantial portions of the Software. |
|
| 13 |
|
|
| 14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
| 15 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
| 16 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
| 17 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|
| 18 |
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|
| 19 |
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
| 20 |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
Also available in: Unified diff