##// END OF EJS Templates
* Added time zone support: users can select their time zone on their account view....
Jean-Philippe Lang -
r904:deb182337d14
parent child
Show More
@@ -0,0 +1,9
1 class AddUserPreferencesTimeZone < ActiveRecord::Migration
2 def self.up
3 add_column :user_preferences, :time_zone, :string
4 end
5
6 def self.down
7 remove_column :user_preferences, :time_zone
8 end
9 end
@@ -79,9 +79,15 module ApplicationHelper
79 79 def format_time(time, include_date = true)
80 80 return nil unless time
81 81 time = time.to_time if time.is_a?(String)
82 zone = User.current.time_zone
83 if time.utc?
84 local = zone ? zone.adjust(time) : time.getlocal
85 else
86 local = zone ? zone.adjust(time.getutc) : time
87 end
82 88 @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
83 89 @time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format)
84 include_date ? time.strftime("#{@date_format} #{@time_format}") : time.strftime(@time_format)
90 include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format)
85 91 end
86 92
87 93 def authoring(created, author)
@@ -150,7 +150,7 class Project < ActiveRecord::Base
150 150 end
151 151
152 152 def <=>(project)
153 name <=> project.name
153 name.downcase <=> project.name.downcase
154 154 end
155 155
156 156 def allows_to?(action)
@@ -130,6 +130,10 class User < ActiveRecord::Base
130 130 self.preference ||= UserPreference.new(:user => self)
131 131 end
132 132
133 def time_zone
134 self.pref.time_zone.nil? ? nil : TimeZone[self.pref.time_zone]
135 end
136
133 137 # Return user's RSS key (a 40 chars long string), used to access feeds
134 138 def rss_key
135 139 token = self.rss_token || Token.create(:user => self, :action => 'feeds')
@@ -231,6 +235,10 class AnonymousUser < User
231 235 false
232 236 end
233 237
238 def time_zone
239 nil
240 end
241
234 242 # Anonymous user has no RSS key
235 243 def rss_key
236 244 nil
@@ -14,6 +14,7
14 14 <p><%= f.select :language, lang_options_for_select %></p>
15 15
16 16 <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %>
17 <p><%= pref_fields.select :time_zone, TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
17 18 <p><%= pref_fields.check_box :hide_mail %></p>
18 19 <% end %>
19 20 </div>
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -169,6 +169,7 field_assignable: Issues can be assigned to this role
169 169 field_redirect_existing_links: Redirect existing links
170 170 field_estimated_hours: Estimated time
171 171 field_column_names: Columns
172 field_time_zone: Time zone
172 173
173 174 setting_app_title: Application title
174 175 setting_app_subtitle: Application subtitle
@@ -547,3 +547,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
547 547 label_registration_automatic_activation: automatic account activation
548 548 label_registration_manual_activation: manual account activation
549 549 notice_account_pending: "Your account was created and is now pending administrator approval."
550 field_time_zone: Time zone
@@ -169,6 +169,7 field_assignable: Demandes assignables à ce rôle
169 169 field_redirect_existing_links: Rediriger les liens existants
170 170 field_estimated_hours: Temps estimé
171 171 field_column_names: Colonnes
172 field_time_zone: Fuseau horaire
172 173
173 174 setting_app_title: Titre de l'application
174 175 setting_app_subtitle: Sous-titre de l'application
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -545,3 +545,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
545 545 label_registration_automatic_activation: automatic account activation
546 546 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -545,3 +545,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
545 545 label_registration_automatic_activation: automatic account activation
546 546 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 field_time_zone: Time zone
@@ -102,12 +102,12 field_value: Wartość
102 102 field_category: Kategoria
103 103 field_title: Tytuł
104 104 field_project: Projekt
105 field_issue: Zgłoszenie
105 field_issue: Zagadnienie
106 106 field_status: Status
107 107 field_notes: Notatki
108 field_is_closed: Zgłoszenie zamknięte
108 field_is_closed: Zagadnienie zamknięte
109 109 field_is_default: Domyślny status
110 field_tracker: Typ zgłoszenia
110 field_tracker: Typ zagadnienia
111 111 field_subject: Temat
112 112 field_due_date: Data oddania
113 113 field_assigned_to: Przydzielony do
@@ -117,9 +117,9 field_user: Użytkownik
117 117 field_role: Rola
118 118 field_homepage: Strona www
119 119 field_is_public: Publiczny
120 field_parent: Subprojekt
121 field_is_in_chlog: Zgłoszenia pokazane w zapisie zmian
122 field_is_in_roadmap: Zgłoszenia pokazane na mapie
120 field_parent: Podprojekt
121 field_is_in_chlog: Zagadnienie pokazywane w zapisie zmian
122 field_is_in_roadmap: Zagadnienie pokazywane na mapie
123 123 field_login: Login
124 124 field_mail_notification: Powiadomienia Email
125 125 field_admin: Administrator
@@ -152,8 +152,8 field_hours: Godzin
152 152 field_activity: Aktywność
153 153 field_spent_on: Data
154 154 field_identifier: Identifikator
155 field_is_filter: Używane jako filter
156 field_issue_to_id: Powiązane zgłoszenie
155 field_is_filter: Atrybut filtrowania
156 field_issue_to_id: Powiązania zagadnienia
157 157 field_delay: Opóźnienie
158 158
159 159 setting_app_title: Tytuł aplikacji
@@ -163,7 +163,7 setting_default_language: Domyślny język
163 163 setting_login_required: Identyfikacja wymagana
164 164 setting_self_registration: Własna rejestracja umożliwiona
165 165 setting_attachment_max_size: Maks. rozm. załącznika
166 setting_issues_export_limit: Limit eksportu zgłosz
166 setting_issues_export_limit: Limit eksportu zagadni
167 167 setting_mail_from: Adres email wysyłki
168 168 setting_host_name: Nazwa hosta
169 169 setting_text_formatting: Formatowanie tekstu
@@ -184,10 +184,10 label_project_new: Nowy projekt
184 184 label_project_plural: Projekty
185 185 label_project_all: Wszystkie projekty
186 186 label_project_latest: Ostatnie projekty
187 label_issue: Zgłoszenie
188 label_issue_new: Nowe zgłoszenie
189 label_issue_plural: Zgłoszenia
190 label_issue_view_all: Zobacz wszystkie zgłoszenia
187 label_issue: Zagadnienie
188 label_issue_new: Nowe zagadnienie
189 label_issue_plural: Zagadnienia
190 label_issue_view_all: Zobacz wszystkie zagadnienia
191 191 label_document: Dokument
192 192 label_document_new: Nowy dokument
193 193 label_document_plural: Dokumenty
@@ -198,15 +198,15 label_role_and_permissions: Role i Uprawnienia
198 198 label_member: Uczestnik
199 199 label_member_new: Nowy uczestnik
200 200 label_member_plural: Uczestnicy
201 label_tracker: Typ zgłoszenia
202 label_tracker_plural: Typy zgłosz
203 label_tracker_new: Nowy typ zgłoszenia
201 label_tracker: Typ zagadnienia
202 label_tracker_plural: Typy zagadni
203 label_tracker_new: Nowy typ zagadnienia
204 204 label_workflow: Przepływ
205 label_issue_status: Status zgłoszenia
206 label_issue_status_plural: Statusy zgłosz
205 label_issue_status: Status zagadnienia
206 label_issue_status_plural: Statusy zagadni
207 207 label_issue_status_new: Nowy status
208 label_issue_category: Kategoria zgłoszenia
209 label_issue_category_plural: Kategorie zgłosz
208 label_issue_category: Kategoria zagadnienia
209 label_issue_category_plural: Kategorie zagadni
210 210 label_issue_category_new: Nowa kategoria
211 211 label_custom_field: Dowolne pole
212 212 label_custom_field_plural: Dowolne pola
@@ -226,8 +226,8 label_administration: Administracja
226 226 label_login: Login
227 227 label_logout: Wylogowanie
228 228 label_help: Pomoc
229 label_reported_issues: Zaraportowane zgłoszenia
230 label_assigned_to_me_issues: Zgłoszenia przypisane do mnie
229 label_reported_issues: Wprowadzone zagadnienia
230 label_assigned_to_me_issues: Zagadnienia przypisane do mnie
231 231 label_last_login: Ostatnie połączenie
232 232 label_last_updates: Ostatnia zmieniana
233 233 label_last_updates_plural: %d ostatnie zmiany
@@ -244,8 +244,8 label_subproject_plural: Podprojekty
244 244 label_min_max_length: Min - Maks długość
245 245 label_list: Lista
246 246 label_date: Data
247 label_integer: L. pojedyńcza
248 label_boolean: Wart. logiczna
247 label_integer: Liczba całkowita
248 label_boolean: Wartość logiczna
249 249 label_string: Tekst
250 250 label_text: Długi tekst
251 251 label_attribute: Atrybut
@@ -333,7 +333,7 label_deleted: usunięte
333 333 label_latest_revision: Ostatnia zmiana
334 334 label_latest_revision_plural: Ostatnie zmiany
335 335 label_view_revisions: Pokaż zmiany
336 label_max_size: Kamsymalny rozmiar
336 label_max_size: Maksymalny rozmiar
337 337 label_on: 'włączone'
338 338 label_sort_highest: Przesuń na górę
339 339 label_sort_higher: Do góry
@@ -341,7 +341,7 label_sort_lower: Do dołu
341 341 label_sort_lowest: Przesuń na dół
342 342 label_roadmap: Mapa
343 343 label_roadmap_due_in: W czasie
344 label_roadmap_no_issues: Brak zgłoszeń do tej wersji
344 label_roadmap_no_issues: Brak zagadnień do tej wersji
345 345 label_search: Szukaj
346 346 label_result_plural: Rezultatów
347 347 label_all_words: Wszystkie słowa
@@ -356,7 +356,7 label_current_version: Obecna wersja
356 356 label_preview: Podgląd
357 357 label_feed_plural: Ilość RSS
358 358 label_changes_details: Szczegóły wszystkich zmian
359 label_issue_tracking: Śledzenie zgłosz
359 label_issue_tracking: Śledzenie zagadni
360 360 label_spent_time: Spędzony czas
361 361 label_f_hour: %.2f godzina
362 362 label_f_hour_plural: %.2f godzin
@@ -371,8 +371,8 label_diff_side_by_side: obok siebie
371 371 label_options: Opcje
372 372 label_copy_workflow_from: Kopiuj przepływ z
373 373 label_permissions_report: Raport uprawnień
374 label_watched_issues: Obserwowane zgłoszenia
375 label_related_issues: Powiązane zgłoszenia
374 label_watched_issues: Obserwowane zagadnienia
375 label_related_issues: Powiązane zagadnienia
376 376 label_applied_status: Stosowany status
377 377 label_loading: Ładowanie...
378 378 label_relation_new: Nowe powiązanie
@@ -446,7 +446,7 text_select_mail_notifications: Zaznacz czynności przy których użytkownik pow
446 446 text_regexp_info: np. ^[A-Z0-9]+$
447 447 text_min_max_length_info: 0 oznacza brak restrykcji
448 448 text_project_destroy_confirmation: Jesteś pewien, że chcesz usunąć ten projekt i wszyskie powiązane dane?
449 text_workflow_edit: Zaznacz rolę i typ zgłoszenia do edycji przepływu
449 text_workflow_edit: Zaznacz rolę i typ zagadnienia do edycji przepływu
450 450 text_are_you_sure: Jesteś pewien ?
451 451 text_journal_changed: zmienione %s do %s
452 452 text_journal_set_to: ustawione na %s
@@ -457,14 +457,14 text_tip_task_begin_end_day: zadanie zaczynające i kończące się dzisiaj
457 457 text_project_identifier_info: 'Małe litery (a-z), liczby i myślniki dozwolone.<br />Raz zapisany, identyfikator nie może być zmieniony.'
458 458 text_caracters_maximum: %d znaków maksymalnie.
459 459 text_length_between: Długość pomiędzy %d i %d znaków.
460 text_tracker_no_workflow: Brak przepływu zefiniowanego dla tego typu zgłoszenia
460 text_tracker_no_workflow: Brak przepływu zefiniowanego dla tego typu zagadnienia
461 461 text_unallowed_characters: Niedozwolone znaki
462 462 text_comma_separated: Wielokrotne wartości dozwolone (rozdzielone przecinkami).
463 text_issues_ref_in_commit_messages: Zgłoszenia odnoszące i ustalające we wrzutkach CVS
463 text_issues_ref_in_commit_messages: Zagadnienia odnoszące i ustalające we wrzutkach CVS
464 464
465 465 default_role_manager: Kierownik
466 466 default_role_developper: Programista
467 default_role_reporter: Raportujący
467 default_role_reporter: Wprowadzajacy
468 468 default_tracker_bug: Błąd
469 469 default_tracker_feature: Cecha
470 470 default_tracker_support: Wsparcie
@@ -484,25 +484,25 default_priority_immediate: Natyczmiastowy
484 484 default_activity_design: Projektowanie
485 485 default_activity_development: Rozwój
486 486
487 enumeration_issue_priorities: Priorytety zgłosz
487 enumeration_issue_priorities: Priorytety zagadni
488 488 enumeration_doc_categories: Kategorie dokumentów
489 489 enumeration_activities: Działania (śledzenie czasu)
490 490 button_rename: Zmień nazwę
491 text_issue_category_destroy_question: Zgłoszenia (%d) są przypisane do tej kategorii. Co chcesz uczynić?
491 text_issue_category_destroy_question: Zagadnienia (%d) są przypisane do tej kategorii. Co chcesz uczynić?
492 492 label_feeds_access_key_created_on: Klucz dostępu RSS stworzony %s dni temu
493 setting_cross_project_issue_relations: Zezwól na powiązania zgłoszeń między projektami
493 setting_cross_project_issue_relations: Zezwól na powiązania zagadnień między projektami
494 494 label_roadmap_overdue: %s spóźnienia
495 495 label_module_plural: Moduły
496 496 label_this_week: ten tydzień
497 497 label_jump_to_a_project: Skocz do projektu...
498 field_assignable: Zgłoszenia mogą być przypisane do tej roli
498 field_assignable: Zagadnienia mogą być przypisane do tej roli
499 499 label_sort_by: Sortuj po %s
500 text_issue_updated: Zgłoszenie %s zostało zaktualizowane.
500 text_issue_updated: Zagadnienie %s zostało zaktualizowane.
501 501 notice_feeds_access_key_reseted: Twój klucz dostępu RSS został zrestetowany.
502 502 field_redirect_existing_links: Przekierowanie istniejących odnośników
503 text_issue_category_reassign_to: Przywróć zgłoszenia do tej kategorii
503 text_issue_category_reassign_to: Przydziel zagadnienie do tej kategorii
504 504 notice_email_sent: Email został wysłany do %s
505 text_issue_added: Zgłoszenie %s zostało zaraportowane.
505 text_issue_added: Zagadnienie %s zostało wprowadzone.
506 506 text_wiki_destroy_confirmation: Jesteś pewien, że chcesz usunąć to wiki i całą jego zawartość ?
507 507 notice_email_error: Wystąpił błąd w trakcie wysyłania maila (%s)
508 508 label_updated_time: Zaktualizowane %s temu
@@ -518,29 +518,30 label_default_columns: Domyślne kolumny
518 518 setting_issue_list_default_columns: Domyślne kolumny wiświetlane na liście zagadnień
519 519 setting_repositories_encodings: Kodowanie repozytoriów
520 520 notice_no_issue_selected: "Nie wybrano zagadnienia! Zaznacz zagadnienie, które chcesz edytować."
521 label_bulk_edit_selected_issues: Bulk edit selected issues
521 label_bulk_edit_selected_issues: Zbiorowa edycja zagadnień
522 522 label_no_change_option: (Bez zmian)
523 523 notice_failed_to_save_issues: "Błąd podczas zapisu zagadnień %d z %d zaznaczonych: %s."
524 524 label_theme: Temat
525 525 label_default: Domyślne
526 526 label_search_titles_only: Przeszukuj tylko tytuły
527 label_nobody: nobody
528 button_change_password: Change password
529 text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)."
530 label_user_mail_option_selected: "For any event on the selected projects only..."
531 label_user_mail_option_all: "For any event on all my projects"
532 label_user_mail_option_none: "Only for things I watch or I'm involved in"
533 setting_emails_footer: Emails footer
534 label_float: Float
535 button_copy: Copy
527 label_nobody: nikt
528 button_change_password: Zmień hasło
529 text_user_mail_option: "W przypadku niezaznaczonych projektów, będziesz otrzymywał powiadomienia tylko na temat zagadnien, które obserwujesz, lub w których bierzesz udział (np. jesteś autorem lub adresatem)."
530 label_user_mail_option_selected: "Tylko dla każdego zdarzenia w wybranych projektach..."
531 label_user_mail_option_all: "Dla każdego zdarzenia w każdym moim projekcie"
532 label_user_mail_option_none: "Tylko to co obserwuje lub w czym biorę udział"
533 setting_emails_footer: Stopka e-mail
534 label_float: Liczba rzeczywista
535 button_copy: Kopia
536 536 mail_body_account_information_external: Możesz użyć twojego "%s" konta do zalogowania do Redmine.
537 537 mail_body_account_information: Twoje konto w Redmine
538 setting_protocol: Protocol
539 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
540 setting_time_format: Time format
541 label_registration_activation_by_email: account activation by email
542 mail_subject_account_activation_request: Redmine account activation request
543 mail_body_account_activation_request: 'A new user (%s) has registered. His account his pending your approval:'
544 label_registration_automatic_activation: automatic account activation
545 label_registration_manual_activation: manual account activation
546 notice_account_pending: "Your account was created and is now pending administrator approval."
538 setting_protocol: Protokoł
539 label_user_mail_no_self_notified: "Nie chcę powiadomień o zmianach, które sam wprowadzam."
540 setting_time_format: Format czasu
541 label_registration_activation_by_email: aktywacja konta przez e-mail
542 mail_subject_account_activation_request: Zapytanie aktywacyjne konta Redmine
543 mail_body_account_activation_request: 'Zarejestrowano nowego użytkownika: (%s). Konto oczekuje na twoje zatwierdzenie:'
544 label_registration_automatic_activation: automatyczna aktywacja kont
545 label_registration_manual_activation: manualna aktywacja kont
546 notice_account_pending: "Twoje konto zostało utworzone i oczekuje na zatwierdzenie administratora."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -544,3 +544,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
544 544 label_registration_automatic_activation: automatic account activation
545 545 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 field_time_zone: Time zone
@@ -545,3 +545,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
545 545 label_registration_automatic_activation: automatic account activation
546 546 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 field_time_zone: Time zone
@@ -545,3 +545,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
545 545 label_registration_automatic_activation: automatic account activation
546 546 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 field_time_zone: Time zone
@@ -547,3 +547,4 mail_body_account_activation_request: 'A new user (%s) has registered. His accou
547 547 label_registration_automatic_activation: automatic account activation
548 548 label_registration_manual_activation: manual account activation
549 549 notice_account_pending: "Your account was created and is now pending administrator approval."
550 field_time_zone: Time zone
General Comments 0
You need to be logged in to leave comments. Login now