Guide to upgrade to 1.2.0 - Oracle ยป patch-redmine_1.2.0_Oracle.diff
| app/models/time_entry.rb (revisi?n: 2706) | ||
|---|---|---|
|
end
|
||
|
TimeEntry.maximum(:spent_on, :include => :project, :conditions => finder_conditions.conditions)
|
||
|
end
|
||
|
if ActiveRecord::Base.connection.adapter_name == 'OracleEnhanced'
|
||
|
set_date_columns :spent_on, :created_on, :updated_on
|
||
|
end
|
||
|
end
|
||
| app/models/version.rb (revisi?n: 2706) | ||
|---|---|---|
|
if completed_pourcent == 100
|
||
|
return false
|
||
|
elsif due_date && start_date
|
||
|
done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor
|
||
|
done_date = start_date.to_date + ((due_date.to_date - start_date.to_date+1)* completed_pourcent/100).floor
|
||
|
return done_date <= Date.today
|
||
|
else
|
||
|
false # No issues so it's not late
|
||
| app/models/project.rb (revisi?n: 2706) | ||
|---|---|---|
|
# The earliest start date of a project, based on it's issues and versions
|
||
|
def start_date
|
||
|
[
|
||
|
issues.minimum('start_date'),
|
||
|
(issues.minimum('start_date')).to_date,
|
||
|
shared_versions.collect(&:effective_date),
|
||
|
shared_versions.collect(&:start_date)
|
||
|
].flatten.compact.min
|
||
| ... | ... | |
|
# The latest due date of an issue or version
|
||
|
def due_date
|
||
|
[
|
||
|
issues.maximum('due_date'),
|
||
|
(issues.maximum('due_date')).to_date,
|
||
|
shared_versions.collect(&:effective_date),
|
||
|
shared_versions.collect {|v| v.fixed_issues.maximum('due_date')}
|
||
|
shared_versions.collect {|v| (v.fixed_issues.maximum('due_date')).to_date}
|
||
|
].flatten.compact.max
|
||
|
end
|
||
|
|
||
| db/migrate/20100129193402_change_users_mail_notification_to_string.rb (revisi?n: 2706) | ||
|---|---|---|
|
class ChangeUsersMailNotificationToString < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
rename_column :users, :mail_notification, :mail_notification_bool
|
||
|
add_column :users, :mail_notification, :string, :default => '', :null => false
|
||
|
User.update_all("mail_notification = 'all'", "mail_notification_bool = #{connection.quoted_true}")
|
||
|
User.update_all("mail_notification = 'selected'", "EXISTS (SELECT 1 FROM #{Member.table_name} WHERE #{Member.table_name}.mail_notification = #{connection.quoted_true} AND #{Member.table_name}.user_id = #{User.table_name}.id)")
|
||
|
User.update_all("mail_notification = 'only_my_events'", "mail_notification NOT IN ('all', 'selected')")
|
||
|
remove_column :users, :mail_notification_bool
|
||
|
end
|
||
|
|
||
|
def self.down
|
||
|
rename_column :users, :mail_notification, :mail_notification_char
|
||
|
add_column :users, :mail_notification, :boolean, :default => true, :null => false
|
||
|
User.update_all("mail_notification = #{connection.quoted_false}", "mail_notification_char <> 'all'")
|
||
|
remove_column :users, :mail_notification_char
|
||
|
end
|
||
|
end
|
||
|
class ChangeUsersMailNotificationToString < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
rename_column :users, :mail_notification, :mail_notification_bool
|
||
|
add_column :users, :mail_notification, :string, :default => '', :null => true
|
||
|
User.update_all("mail_notification = 'all'", "mail_notification_bool = #{connection.quoted_true}")
|
||
|
User.update_all("mail_notification = 'selected'", "EXISTS (SELECT 1 FROM #{Member.table_name} WHERE #{Member.table_name}.mail_notification = #{connection.quoted_true} AND #{Member.table_name}.user_id = #{User.table_name}.id)")
|
||
|
User.update_all("mail_notification = 'only_my_events'", "mail_notification NOT IN ('all', 'selected')")
|
||
|
remove_column :users, :mail_notification_bool
|
||
|
end
|
||
|
def self.down
|
||
|
rename_column :users, :mail_notification, :mail_notification_char
|
||
|
add_column :users, :mail_notification, :boolean, :default => true, :null => true
|
||
|
User.update_all("mail_notification = #{connection.quoted_false}", "mail_notification_char <> 'all'")
|
||
|
remove_column :users, :mail_notification_char
|
||
|
end
|
||
|
end
|
||
| db/migrate/20110227125750_change_journal_details_values_to_text.rb (revisi?n: 2706) | ||
|---|---|---|
|
class ChangeJournalDetailsValuesToText < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
change_column :journal_details, :old_value, :text
|
||
|
change_column :journal_details, :value, :text
|
||
|
end
|
||
|
|
||
|
def self.down
|
||
|
change_column :journal_details, :old_value, :string
|
||
|
change_column :journal_details, :value, :string
|
||
|
end
|
||
|
end
|
||
|
class ChangeJournalDetailsValuesToText < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
#change_column :journal_details, :old_value, :text
|
||
|
#change_column :journal_details, :value, :text
|
||
|
end
|
||
|
def self.down
|
||
|
change_column :journal_details, :old_value, :string
|
||
|
change_column :journal_details, :value, :string
|
||
|
end
|
||
|
end
|
||
| config/initializers/oracle_enhanced.rb (revisi?n: 2706) | ||
|---|---|---|
|
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_dates_by_column_name=true
|
||
|
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.instance_eval do
|
||
|
self.string_to_date_format="%d/%m/%Y"
|
||
|
self.string_to_time_format="%d/%m/%Y %H:%M:%S"
|
||
|
end
|
||
| lib/redmine/codeset_util.rb (revisi?n: 2706) | ||
|---|---|---|
|
begin
|
||
|
txtar += ic.iconv(str)
|
||
|
rescue Iconv::IllegalSequence
|
||
|
txtar += $!.success
|
||
|
str = '?' + $!.failed[1,$!.failed.length]
|
||
|
txtar += ($!.success).to_s
|
||
|
str = '?' + (($!.failed).to_s[1,($!.failed).to_s.length]).to_s
|
||
|
retry
|
||
|
rescue
|
||
|
txtar += $!.success
|
||
| lib/redmine/helpers/gantt.rb (revisi?n: 2706) | ||
|---|---|---|
|
end
|
||
|
|
||
|
@date_from = Date.civil(@year_from, @month_from, 1)
|
||
|
@date_to = (@date_from >> @months) - 1
|
||
|
@date_to = ((@date_from >> @months) - 1).to_date
|
||
|
|
||
|
@subjects = ''
|
||
|
@lines = ''
|
||
| ... | ... | |
|
# Generates a gantt image
|
||
|
# Only defined if RMagick is avalaible
|
||
|
def to_image(format='PNG')
|
||
|
date_to = (@date_from >> @months)-1
|
||
|
date_to = ((@date_from >> @months)-1).to_date
|
||
|
show_weeks = @zoom > 1
|
||
|
show_days = @zoom > 2
|
||
|
|
||