Compare commits

...

545 Commits
2.2.4 ... 2.3.1

Author SHA1 Message Date
Jean-Philippe Lang
7a0e3f40a7 tagged version 2.3.1
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/tags/2.3.1@11759 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 15:15:05 +00:00
Jean-Philippe Lang
1a71316b37 Merged r11757 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11758 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 15:14:28 +00:00
Jean-Philippe Lang
5fa087a792 Merged r11592 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11756 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 15:12:24 +00:00
Jean-Philippe Lang
425a0fe988 Merged r11754 from trunk (#12684).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11755 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 13:14:21 +00:00
Jean-Philippe Lang
606762dcad Merged r11750 from trunk (#12650).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11751 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 12:53:10 +00:00
Jean-Philippe Lang
07dc1e34ff Merged r11748 from trunk (#13712).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11749 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 12:36:48 +00:00
Jean-Philippe Lang
1afe67bf74 Merged r11698 from trunk (#13541).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11747 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 12:17:31 +00:00
Jean-Philippe Lang
f9f4591cff Merged r11680 from trunk (#13541).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11746 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 12:16:56 +00:00
Jean-Philippe Lang
aa4fc1b58a Merged r11696 from trunk (#13618).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11745 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-05-01 12:15:49 +00:00
Toshi MARUYAMA
8c17237638 Merged r11737 and r11738 from trunk to 2.3-stable (#13823)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11739 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-21 09:00:27 +00:00
Toshi MARUYAMA
06ab582e5d Merged r11728, r11729, r11730, r11731, r11732 and r11733 from trunk to 2.3-stable (#13811)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11734 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-20 11:26:12 +00:00
Toshi MARUYAMA
af66c42d9e 2.3-stable: svn propset svn:eol-style native test fixtures (#13644)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11710 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-05 09:59:21 +00:00
Toshi MARUYAMA
655c50849d Merged r11706 and r11707 from trunk to 2.3-stable (#13644)
fix diff error in case of line_left out of range.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11709 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-05 09:56:14 +00:00
Toshi MARUYAMA
bd5b7428d8 Merged r11700 from trunk to 2.3-stable (#13678, #13674)
Lithuanian translation for 2.3-stable updated by Vasaris Vėjas.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11703 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-04 12:52:40 +00:00
Toshi MARUYAMA
4ed30a4495 Merged r11699 from trunk to 2.3-stable (#13678)
remove duplicate "text_repository_usernames_mapping" from Lithuanian translation.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11702 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-04 12:52:29 +00:00
Jean-Philippe Lang
ca39b05420 Merged r11692 from trunk (#13586).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11697 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-03 17:04:40 +00:00
Etienne Massip
e189641e8c Merged r11693 from trunk (#13630).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11695 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-04-02 17:50:39 +00:00
Toshi MARUYAMA
102dd4c11b 2.3-stable: svn:eol-style native jquery.ui.datepicker-pt.js (#13584)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11691 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-25 14:56:22 +00:00
Toshi MARUYAMA
c1d853d957 Merged r11686 from trunk to 2.3-stable (#13584)
add missing Portuguese jQuery UI date picker.

jquery.ui.datepicker-pt.js is from
https://raw.github.com/jquery/jquery-ui/49f9b849b9c5023f13/ui/i18n/jquery.ui.datepicker-pt.js

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11690 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-25 14:51:06 +00:00
Toshi MARUYAMA
225f99377a Merged r11682 and r11685 from trunk to 2.3-stable (#13579)
fix that datepicker uses Simplified Chinese in Traditional Chinese locale.

Contributed by Chage Juan.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11689 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-25 14:50:55 +00:00
Toshi MARUYAMA
d8cf4c57d3 Merged r11675 from trunk to 2.3-stable (#13552, #13551)
Dutch translations for 2.3-stable updated by Pieter Nicolai.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11679 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-22 01:04:33 +00:00
Toshi MARUYAMA
4b5fa08f66 Merged r11671, r11672 and r11674 from trunk to 2.3-stable (#13405)
Fixed commit link title escaping.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11678 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-22 01:04:22 +00:00
Toshi MARUYAMA
4380c0af73 Merged r11664 from trunk to 2.3-stable (#13531 ,#13528)
Traditional Chinese translation for 2.3-stable updated by ChunChang Lo.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11669 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-20 07:01:37 +00:00
Jean-Philippe Lang
61a32a5002 Merged r11657 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11658 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-19 19:22:59 +00:00
Jean-Philippe Lang
5745a2a2e3 Merged r11641 and r11642 from trunk (#8794).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11656 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-19 18:40:26 +00:00
Jean-Philippe Lang
f98f9b9ae1 Merged r11640 from trunk (#12968).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11655 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-19 18:37:33 +00:00
Toshi MARUYAMA
cfec2018e3 Merged r11648, r11649, r11650 from trunk to 2.3-stable.
upgrade Rails 3.2.13.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11652 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-19 08:21:46 +00:00
Toshi MARUYAMA
0083420829 Merged r11645 from trunk to 2.3-stable (#13514)
fix pt-BR "permission_set_notes_private" translation.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11646 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-19 02:55:35 +00:00
Toshi MARUYAMA
338d7ea91d Merged r11637 from trunk to 2.3-stable (#13354)
PDF: fix incompatible character encodings: UTF-8 and ASCII-8BIT.

Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11639 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-16 08:04:42 +00:00
Toshi MARUYAMA
73fb7e3427 Merged r11622 from trunk to 2.3-stable (#13475)
fix pt-BR translation.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11623 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-15 01:28:24 +00:00
Toshi MARUYAMA
edb7f2d2c5 Merged r11620 from trunk to 2.3-stable (#13463)
Russian translation updated by Kirill Bezrukov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11621 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-13 08:06:23 +00:00
Toshi MARUYAMA
594d9e9da2 Merged r11613 from trunk to 2.3-stable.
Fixing HTML in groups index view.

Contributed by Gregor Schmidt.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11619 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-13 00:32:53 +00:00
Toshi MARUYAMA
7ebc62387a Merged r11615 from trunk to 2.3-stable (#13458)
Bulgarian translation ordered by Ivan Cenov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11618 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-13 00:08:24 +00:00
Toshi MARUYAMA
3269c42cdc Merged r11614 from trunk to 2.3-stable (#13450)
Czech translation changed by Karel Pičman.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11617 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-13 00:08:13 +00:00
Toshi MARUYAMA
9436318987 Merged r11556 from trunk to 2.3-stable (#13391)
Czech translation changed by Karel Pičman.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11616 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-13 00:08:02 +00:00
Jean-Philippe Lang
94ecabbaf9 Merged r11605 from trunk (#13301).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11606 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-12 17:09:28 +00:00
Toshi MARUYAMA
063c9a2a83 Merged r11603 from trunk to 2.3-stable (#13447)
German translation changed by Filou Centrinov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11604 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-12 14:41:21 +00:00
Toshi MARUYAMA
376e8d4aa3 Merged r11599, r11600, r11601 from trunk to 2.3-stable (#13438)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11602 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-12 12:15:06 +00:00
Toshi MARUYAMA
20114bd8e0 Merged r11597 from trunk to 2.3-stable (#13437)
German translation of setting_emails_header changed by Filou Centrinov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11598 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-12 10:37:48 +00:00
Jean-Philippe Lang
cfdd85173f Merged r11526 and r11590 from trunk (#13341).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11591 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-11 18:00:39 +00:00
Toshi MARUYAMA
5de8e9f04c Merged r11588 from trunk to 2.3-stable (#13420)
Korean translation changed by Jongwook Choi.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11589 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-11 00:49:50 +00:00
Toshi MARUYAMA
79db8fd3e0 Merged r11585 from trunk to 2.3-stable (#13420)
Korean translation updated by Jongwook Choi.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11587 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-10 23:19:41 +00:00
Toshi MARUYAMA
98b7900c5c Merged r11584 from trunk to 2.3-stable (#13420)
Korean translation changed by Jongwook Choi.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11586 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-10 23:19:30 +00:00
Jean-Philippe Lang
23c28c1ef7 Merged r11582 from trunk (#13337).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11583 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-10 13:16:09 +00:00
Jean-Philippe Lang
974863e8f4 Merged r11525 from trunk (#11498).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11581 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-10 12:36:44 +00:00
Jean-Philippe Lang
58af20746b Merged r11522 from trunk (#13340).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11580 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-10 12:35:20 +00:00
Toshi MARUYAMA
efcd602444 Merged r11578 from trunk to 2.3-stable (#13414)
Bulgarian translation updated and changed by Ivan Cenov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11579 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-10 04:41:45 +00:00
Jean-Philippe Lang
20cd146e93 Backported r11494 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11577 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 11:07:55 +00:00
Jean-Philippe Lang
8a97dfdeab Merged r11507 from trunk (#13329).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11576 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 11:01:28 +00:00
Jean-Philippe Lang
b0b7f4d7d6 Merged r11506 from trunk (#13329).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11575 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 11:00:33 +00:00
Jean-Philippe Lang
53680edb2d Merged r11497 from trunk (#13329).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11574 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 10:59:22 +00:00
Jean-Philippe Lang
ddf0307718 Merged r11488 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11573 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 10:47:27 +00:00
Jean-Philippe Lang
0ab90145fe Merged r11571 from trunk (#12122).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11572 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 10:45:12 +00:00
Jean-Philippe Lang
f4def66c58 Merged r11518 from trunk (#8529).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11570 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 10:19:39 +00:00
Jean-Philippe Lang
4413e0e52e Merged r11519 and r11520 from trunk (#13335).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11569 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 10:17:26 +00:00
Jean-Philippe Lang
b2e1080007 Merged r11567 from trunk (#13272).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11568 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 10:01:42 +00:00
Jean-Philippe Lang
8245eaa9f3 Merged r11474 from trunk (#10277).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11566 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 09:17:37 +00:00
Jean-Philippe Lang
83430dacd9 Merged r11471 from trunk (#5329).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11565 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 09:15:42 +00:00
Jean-Philippe Lang
998a29cbaf Merged r11473 from trunk (#3676).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11564 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 09:14:22 +00:00
Jean-Philippe Lang
511099e9ca Merged r11521 from trunk (#3371).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11563 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 09:13:01 +00:00
Jean-Philippe Lang
a18db94c06 Merged r11472 from trunk (#3107).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11562 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-09 09:11:44 +00:00
Toshi MARUYAMA
fe3a4cdbd1 Merged r11560 from trunk to 2.3-stable (#13399)
Korean translation changed by Lucas Yang.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11561 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-08 10:08:34 +00:00
Toshi MARUYAMA
67bb69d68e Merged r11554 from trunk to 2.3-stable (#13391)
Czech translation for 2.3-stable updated by Karel Pičman.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11559 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-08 01:09:34 +00:00
Toshi MARUYAMA
639b6f5c85 Merged r11553 from trunk to 2.3-stable (#13398, #13391)
Czech translation for 2.2-stable updated by Karel Pičman.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11558 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-08 01:09:22 +00:00
Toshi MARUYAMA
b783bbf3bb 2.3-stable: svn propset svn:eol-style native to fixtures (#12641)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11552 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-07 21:07:51 +00:00
Toshi MARUYAMA
a4b6928a26 Merged r11544, r11545, r11546, r11547, r11549 from trunk to 2.3-stable (#12641)
fix that diff outputs become ??? in some non ASCII words.

Contributed by Filou Centrinov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11551 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-07 21:03:55 +00:00
Toshi MARUYAMA
0e92038047 Merged r11542 from trunk to 2.3-stable.
use %r{} instead of // at lib/redmine/unified_diff.rb.

Syntax highlight is broken in gedit 2.28.4 on CentOS 6.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11548 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-07 10:29:50 +00:00
Toshi MARUYAMA
35b17d3bdc Merged from r11537 trunk to 2.3-stable (#13350)
fix some Japanese "issue" translations.

Contributed by Go MAEDA.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11541 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-06 09:50:23 +00:00
Toshi MARUYAMA
8672114648 Merged from r11536 trunk to 2.3-stable (#13349)
Japanese translation updated by Go MAEDA.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11540 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-06 09:50:12 +00:00
Toshi MARUYAMA
699fa9ac3f Merged r11530 from trunk to 2.3-stable (#13339)
Vietnamese translation changed by Minh Thien Nguyen.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11535 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-03 12:11:11 +00:00
Toshi MARUYAMA
a5a1bd5a35 Merged r11528 and r11529 from trunk to 2.3-stable (#13343, #13339)
Vietnamese translation for 2.2-stable and 2.3-stable updated by Minh Thien Nguyen.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11534 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-03 12:11:00 +00:00
Toshi MARUYAMA
4100d3beeb Merged r11527 from trunk to 2.3-stable (#13338, #13329)
Ruby2.0: remove "warning: class variable access from toplevel" in lib/plugins/rfpdf/lib/tcpdf.rb.

Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11533 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-03 12:10:48 +00:00
Jean-Philippe Lang
58ebb87ae6 Merged r11510 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11517 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 16:22:37 +00:00
Jean-Philippe Lang
33ef9fbe29 Merged r11508 from trunk (#13301).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11516 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 16:22:02 +00:00
Jean-Philippe Lang
b0fa5e7305 Merged r11513 from trunk (#13328).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11515 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 16:20:27 +00:00
Jean-Philippe Lang
5bb2f5e211 Merged r11509 and r11512 from trunk (#13309).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11514 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 16:19:05 +00:00
Toshi MARUYAMA
2293a5d3f4 Merged r11504 from trunk to 2.3-stable (#13324)
pt-BR translation changed.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11505 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 07:08:23 +00:00
Toshi MARUYAMA
d14cd42a78 Merged r11499 from trunk to 2.3-stable (#13324)
pt-BR translation for 2.3-stable updated.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11503 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 02:34:33 +00:00
Toshi MARUYAMA
2a53538616 Merged r11498 from trunk to 2.3-stable (#13325, #13324)
pt-BR translation for 2.2-stable updated.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11501 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-03-01 01:57:52 +00:00
Toshi MARUYAMA
d1f63717dd Merged r11491 from trunk to 2.3-stable (#13310)
pt-BR "label_last_n_weeks" translation updated.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11493 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-28 08:35:41 +00:00
Toshi MARUYAMA
d22b085d1d Merged r11483 from trunk to 2.3-stable (#13281)
Russian translation updated by Kirill Bezrukov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11485 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-25 15:40:31 +00:00
Toshi MARUYAMA
15751a6931 Merged r11482 from trunk to 2.3-stable (#13280)
German translation changed by Filou Centrinov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11484 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-25 14:58:14 +00:00
Toshi MARUYAMA
052cf73dfd Merged r11476 from trunk to 2.3-stable (#13246)
German translation changed by Filou Centrinov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11481 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-25 11:44:44 +00:00
Jean-Philippe Lang
a4bee12e5a Merged r11464 from trunk (#13173).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11465 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-24 10:14:22 +00:00
Jean-Philippe Lang
92507382b4 Merged r11461, r11462 from trunk (#13251).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11463 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-24 10:06:27 +00:00
Jean-Philippe Lang
e6d63a4e0d Merged r11459 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11460 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-24 09:22:41 +00:00
Jean-Philippe Lang
346085c5fc Set stable version.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11455 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 14:30:18 +00:00
Jean-Philippe Lang
dcfc9170e6 Added 2.3-stable branch.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11454 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 14:26:18 +00:00
Jean-Philippe Lang
78997eea16 Typo.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11453 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 13:53:47 +00:00
Jean-Philippe Lang
d255e98023 Adds an helper for rendering query columns selection.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11452 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 12:14:22 +00:00
Jean-Philippe Lang
1ac8fd8c42 Adds helpers for query columns selection.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11451 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 12:04:29 +00:00
Jean-Philippe Lang
998928ecdf Set version to 2.3.0.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11450 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 11:51:56 +00:00
Jean-Philippe Lang
aca59db4cc Rename issues CSV and PDF exports.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11449 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 11:10:10 +00:00
Jean-Philippe Lang
797a9f1ea9 Refactor: #issues_to_csv and #entries_to_csv merged into QueriesHelper#query_to_csv.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11448 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 11:07:43 +00:00
Jean-Philippe Lang
9b1ebd6808 Refactor: makes issue id a regular QueryColumn.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11447 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-23 10:53:21 +00:00
Jean-Philippe Lang
d1244b31a4 Fixed that requesting a message from an invalid forum should respond with 404 (#13232).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11446 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-20 20:59:52 +00:00
Jean-Philippe Lang
2ae7ddcb24 Asserts that the watchers list is updated.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11445 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-20 20:49:01 +00:00
Jean-Philippe Lang
f88e4225c1 Removed hard-coded style in watchers list.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11444 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-20 20:46:42 +00:00
Jean-Philippe Lang
aca31973c2 Fixed that delete watcher link was broken by r11290 (#13231).
Deleting a watcher now use DELETE /watchers instead of POST /watchers/destroy.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11443 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-20 20:43:28 +00:00
Jean-Philippe Lang
f8c649320f Makes all time entry columns available in the CSV export.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11442 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-19 20:41:54 +00:00
Jean-Philippe Lang
af92686c62 Fixed that float custom fields do not use CSV decimal separator (#10364).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11441 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-19 20:01:00 +00:00
Jean-Philippe Lang
59c704dcd2 Don't use iconv with ruby1.9 (#12787).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11440 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 21:39:17 +00:00
Jean-Philippe Lang
b0de1b1908 Removed some shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11439 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 17:30:11 +00:00
Jean-Philippe Lang
58c643b420 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11438 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 17:29:31 +00:00
Jean-Philippe Lang
504116bfca Add login to /users/:id API for current user (#13155).
Patch by Jérôme Bataille.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11437 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 17:24:54 +00:00
Toshi MARUYAMA
661dd6dcf5 Portuguese translation for trunk updated by Rui Rebelo (#13206)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11434 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 13:02:37 +00:00
Toshi MARUYAMA
bf6f3bfbe1 Portuguese translation changed by Rui Rebelo (#13206)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11433 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 13:01:44 +00:00
Toshi MARUYAMA
d67ea67ded Portuguese translation for 2.2-stable updated by Rui Rebelo (#13207, #13206)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11432 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 13:01:05 +00:00
Toshi MARUYAMA
b9de6a5ee9 German "label_follows" translation changed by Daniel Felix (#13203)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11431 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 11:42:03 +00:00
Toshi MARUYAMA
73c6a619e7 Traditional Chinese translation updated and changed by ChunChang Lo (#13198)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11430 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 11:01:45 +00:00
Toshi MARUYAMA
d3bee90a35 Russian "almost_x_years" changed by Mikhail Velkin (#12645)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11429 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 11:01:19 +00:00
Toshi MARUYAMA
8bdd08fc34 German translation updated by Daniel Felix (#13202)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11428 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 11:00:51 +00:00
Toshi MARUYAMA
f76dcf33ef fix typo at app/models/user.rb (#5719)
Contributed by Tom Copeland.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11427 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-18 11:00:21 +00:00
Jean-Philippe Lang
64bbf64fb6 Optimizes the SQL query behind Principal#member_of.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11426 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 12:41:31 +00:00
Jean-Philippe Lang
d8e4a8fb32 Use #per_page instead of #items_per_page.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11425 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 11:35:42 +00:00
Jean-Philippe Lang
c17ec1643c Fixed that messages are not sorted by last reply (#12243).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11424 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 11:10:17 +00:00
Toshi MARUYAMA
dbf1fed6fb replace tabs to spaces at app/controllers/boards_controller.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11423 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:17:33 +00:00
Toshi MARUYAMA
e79b232a02 replace tabs to spaces at app/models/issue.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11422 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:17:10 +00:00
Toshi MARUYAMA
e478f3044e replace tabs to spaces at app/models/setting.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11421 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:16:46 +00:00
Toshi MARUYAMA
a39f9bcec0 replace tabs to spaces at app/helpers/application_helper.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11420 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:16:21 +00:00
Toshi MARUYAMA
e0215681b4 remove trailing tabs from app/controllers/users_controller.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11419 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:15:44 +00:00
Toshi MARUYAMA
51abe725ba remove trailing tabs from app/controllers/projects_controller.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11418 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:15:10 +00:00
Jean-Philippe Lang
b4013dc9f2 Removed the default 0 value for issues foreign keys.
It prevents useless "... where id=0" queries and ensures that *_id attributes default to nil.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11417 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:14:58 +00:00
Toshi MARUYAMA
c0a5796443 remove trailing tabs from app/controllers/admin_controller.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11416 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:14:35 +00:00
Toshi MARUYAMA
e31a8e2cb3 remove trailing tabs from app/models/project.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11415 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:14:08 +00:00
Toshi MARUYAMA
14fcac8160 remove trailing tab from app/helpers/custom_fields_helper.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11414 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:13:40 +00:00
Toshi MARUYAMA
9ac2afec04 remove trailing tab and white-spaces from app/controllers/issue_statuses_controller.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11413 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 10:13:12 +00:00
Jean-Philippe Lang
7b7427b46e Adds Issue#status_was that returns the initial issue status.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11412 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-17 09:30:17 +00:00
Jean-Philippe Lang
7a1af68178 Adds closed_on to issues API responses (#824).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11411 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 15:32:44 +00:00
Jean-Philippe Lang
9dd8988638 Make sure that fields filled before tracker change are preserved.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11410 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 15:20:36 +00:00
Toshi MARUYAMA
d01fe87a67 Russian "label_last_n_weeks" translation changed by Mikhail Velkin (#12645)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11409 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 13:04:36 +00:00
Toshi MARUYAMA
da0598a029 Russian "label_x_issues" translation changed by Mikhail Velkin (#12645)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11408 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 13:04:23 +00:00
Toshi MARUYAMA
dadad2f054 Bulgarian translation changed and updated by Ivan Cenov (#13190)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11407 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 13:04:09 +00:00
Toshi MARUYAMA
5778bdd4f7 replace tabs to spaces at app/helpers/timelog_helper.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11406 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 13:03:54 +00:00
Jean-Philippe Lang
7799788b3d Fixed that updating the issue form was broken by r4011 when user is not allowed to add issues (#13188).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11405 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 11:35:18 +00:00
Jean-Philippe Lang
1cf09a2d31 Adds field_closed_on to locales (#824).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11404 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 09:40:43 +00:00
Jean-Philippe Lang
98cd140a19 Makes closed_on available as column and filter on the issue list (#824).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11403 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 09:39:52 +00:00
Jean-Philippe Lang
a45c0dc550 Adds closed_on column that stores the time of the last closing (#824).
The value is preserved when reopening the issue.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11402 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 09:38:01 +00:00
Jean-Philippe Lang
723e21243e Don't fail if new filter is added.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11401 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-16 09:12:21 +00:00
Toshi MARUYAMA
d5f1e186f1 not use htmlentities gem in rfpdf plugin (#13138)
Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11399 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 13:24:10 +00:00
Jean-Philippe Lang
b5c2ca5666 Adds the date picker for the default value of date custom fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11398 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 10:45:34 +00:00
Jean-Philippe Lang
3277d59e5c Remove default for when changing custom field format.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11397 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 10:43:56 +00:00
Jean-Philippe Lang
32bf0f03ef Use a textarea instead of an input for the default value of long text custom fields (#13176).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11396 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 08:48:51 +00:00
Jean-Philippe Lang
9a3e4e0a51 Test broken by r11392 (#13174).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11395 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 08:32:06 +00:00
Jean-Philippe Lang
4e9fbeb851 Possibility to define the default enable trackers when creating a project (#13175).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11394 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 08:28:34 +00:00
Toshi MARUYAMA
348a1d59ef Azerbaijanian translation updated by Samir Suleymanov (#13152)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11393 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 07:52:04 +00:00
Jean-Philippe Lang
ee1d9647b8 Raised group name maximum length to 255 characters (#13174).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11392 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 07:48:37 +00:00
Toshi MARUYAMA
5891a873fb Bulgarian translation of jstoolbar-bg.js updated by Ivan Cenov (#13181)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11390 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 06:20:10 +00:00
Toshi MARUYAMA
52d15dd122 add "tmp:clear" to "ci:setup" rake task for new translation
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11389 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 06:10:40 +00:00
Toshi MARUYAMA
e550aa1b17 set svn eol native Azerbaijanian translation files (#13152)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11388 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:47:46 +00:00
Toshi MARUYAMA
22b7cc834b add jquery.ui.datepicker-az.js (#13152)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11387 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:29:49 +00:00
Toshi MARUYAMA
2cad145d5c copy jstoolbar-az.js from jstoolbar-en.js (#13152)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11386 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:29:36 +00:00
Toshi MARUYAMA
d954432284 adjust Azerbaijanian "general_lang_name" (#13152)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11385 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:29:22 +00:00
Toshi MARUYAMA
4a2206afa5 add missing i18n keys to az.yml (#13152)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11384 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:29:09 +00:00
Toshi MARUYAMA
0836b7fb9c remove "permission_manage_documents" from az.yml (#13152, #12401)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11383 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:28:54 +00:00
Toshi MARUYAMA
6557147b1d remove unused "label_modification" i18n keys from az.yml (#13152, #12645)
These keys were removed from app/views/repositories/revision.rhtml by r535
and app/views/repositories/revisions.rhtml by r381.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11382 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:28:40 +00:00
Toshi MARUYAMA
c509a64184 remove unused "label_download" i18n keys from az.yml (#13152, #12645)
These keys were removed from app/views/documents/show.rhtml by r1180.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11381 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:28:25 +00:00
Toshi MARUYAMA
0408c24ae6 remove unused "gui_validation_error" i18n keys from az.yml (#13152, #12645)
These keys were removed from app/helpers/application_helper.rb by r2493.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11380 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:28:10 +00:00
Toshi MARUYAMA
6d9b6ad749 remove unused i18n string from az.yml (#13152, #8373)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11379 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:27:49 +00:00
Toshi MARUYAMA
0dae278d73 add Azerbaijanian translation (#13152)
Contributed by Samir Suleymanov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11378 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 05:27:33 +00:00
Toshi MARUYAMA
cd0b8d9363 fix double "one" in Polish translation by Filou Centrinov (#7202)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11377 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 02:03:26 +00:00
Toshi MARUYAMA
70612342a5 Polish translation updated and changed (#7202)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11376 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-15 00:13:43 +00:00
Jean-Philippe Lang
3c3ac3c6ee Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11375 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-14 22:13:49 +00:00
Jean-Philippe Lang
812da860b3 Adds token finder methods.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11374 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-14 21:47:07 +00:00
Jean-Philippe Lang
adb4a575dc Adds SQL server example and cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11373 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-14 20:38:08 +00:00
Jean-Philippe Lang
0be82ea2c4 Refactor: use an ordered hash to store available filters and remove :order option (#13154).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11372 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-14 20:37:17 +00:00
Jean-Philippe Lang
f77edce621 Fixed thatinitialize_http_header overrides basic auth in rdm-mailhandler.rb (#13165).
Patch by Jean-Louis Fuchs.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11371 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-14 17:52:37 +00:00
Toshi MARUYAMA
afaab7d43f Italian translation changed by Luca Colombini (#7851)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11370 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-13 11:22:56 +00:00
Toshi MARUYAMA
6783497a4d fix a spelling mistake of German "label_query_plural" (#9475, #13142)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11369 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-12 22:46:44 +00:00
Jean-Philippe Lang
1faa94af8a Updates for 2.2.3 release.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11366 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-12 18:07:38 +00:00
Toshi MARUYAMA
4d078d3a17 German translation for my page changed (#12660)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11360 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-12 10:17:42 +00:00
Toshi MARUYAMA
3473152538 German "My custom queries" and "Custom queries" changed by Filou Centrinov (#9475)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11359 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-12 10:17:13 +00:00
Toshi MARUYAMA
77bc6e11ff remove trailing white-spaces from app/models/custom_field.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11354 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-12 00:51:11 +00:00
Toshi MARUYAMA
204abe392b upgrade Rails to 3.2.12
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11353 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-12 00:20:55 +00:00
Jean-Philippe Lang
dbe7d6fbfb Removed unused fixtures.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11352 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-11 20:14:26 +00:00
Jean-Philippe Lang
999e62711f Fixed that long project names in the header may overlap the main menu (#13127).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11351 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-11 18:14:00 +00:00
Jean-Philippe Lang
cd04a041fe Format all floats with 2 decimals in the issue list (#13126).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11350 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-11 18:07:45 +00:00
Jean-Philippe Lang
514f2d6c0f Fixed that custom_field_values are not reloaded on #reload (#13119).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11349 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-11 17:38:30 +00:00
Jean-Philippe Lang
eed4954f0a Submit the form after preview.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11348 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 21:28:29 +00:00
Jean-Philippe Lang
0df1b9b1a4 Removed delay.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11347 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 21:11:48 +00:00
Jean-Philippe Lang
7c22c30791 Fixed test after r11343.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11346 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 17:52:19 +00:00
Jean-Philippe Lang
a24bf65a8b Don't run Capybara tests on the CI server (#12822).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11345 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 17:09:33 +00:00
Jean-Philippe Lang
01a7c34828 Don't generate duplicate ids.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11344 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 16:41:26 +00:00
Jean-Philippe Lang
deffd81ada Use POST/DELETE to watch/unwatch an item.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11343 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 16:10:53 +00:00
Jean-Philippe Lang
75129aaa1b Clean up watchers routes declaration.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11342 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 16:05:30 +00:00
Jean-Philippe Lang
6d408b8261 Adds context menu tests and skip test_preview_issue_description that breaks the test suite.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11341 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 15:53:14 +00:00
Jean-Philippe Lang
bd52c23e7b Adds a test for creating an issue with watchers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11340 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 10:31:38 +00:00
Jean-Philippe Lang
856ef810b4 Bulk watch/unwatch issues from the context menu (#7159).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11339 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 10:31:12 +00:00
Toshi MARUYAMA
7303cc416c remove trailing white-space from app/models/board.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11338 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-10 04:04:21 +00:00
Jean-Philippe Lang
0d93b6dc3c Typo that breaks with ruby1.8.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11337 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-09 15:20:07 +00:00
Jean-Philippe Lang
0f2ee79f35 Fixed that project overview page shows trackers from subprojects with disabled issue module (#13076).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11336 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-09 13:56:11 +00:00
Jean-Philippe Lang
1fe29c8a0c Small datepicker improvements (#13098).
Patch by Daniel Felix.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11335 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-09 13:39:57 +00:00
Jean-Philippe Lang
8b205052a9 Don't wrap watcher link with span.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11334 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-07 20:13:15 +00:00
Jean-Philippe Lang
1d71bd598f Test failures from r11331 (#13075).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11333 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-07 19:58:43 +00:00
Jean-Philippe Lang
2cd749955e Fixed: error raised when copying project wiki with wiki module disabled (#13097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11332 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-07 19:24:57 +00:00
Jean-Philippe Lang
eece12ddfd Fixed: Can't clear custom field value through context menu in the issue list (#13075).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11331 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-07 18:35:51 +00:00
Jean-Philippe Lang
457c27e697 Add unique index on custom_fields_projects.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11330 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-07 18:21:18 +00:00
Jean-Philippe Lang
37a4342bcd Add unique index on custom_fields_trackers (#13059).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11329 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-07 18:20:59 +00:00
Toshi MARUYAMA
36d6caf35f German "label_in" translation changed by Filou Centrinov (#13080)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11328 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-05 04:30:05 +00:00
Toshi MARUYAMA
a375ab498f Gemfile: unpin mocha version
This is pinned by r10155 and r10167 due to CI server failure.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11327 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-04 08:33:53 +00:00
Toshi MARUYAMA
46ac549982 Traditional Chinese translation updated by ChunChang Lo (#13071)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11326 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-04 08:33:27 +00:00
Toshi MARUYAMA
04a2ca9ce7 remove "test-unit" from Gemfile
This is added by r10137 (#10320, #10818) and shoulda version was upgraded by r11324.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11325 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-04 08:05:21 +00:00
Jean-Philippe Lang
69ff805c8d Upgrade shoulda.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11324 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 15:49:02 +00:00
Jean-Philippe Lang
25e1842f5f Create all databases.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11323 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 15:46:54 +00:00
Jean-Philippe Lang
8aff70398c Dup generated attributes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11322 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 15:46:42 +00:00
Jean-Philippe Lang
4fa7f62182 Removed unused fixtures.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11321 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 14:27:19 +00:00
Jean-Philippe Lang
ff6425c0fa Removed unused fixtures.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11320 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 10:23:17 +00:00
Jean-Philippe Lang
bf36b6b0bb Removing shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11319 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 10:19:42 +00:00
Jean-Philippe Lang
0afab2fb30 Removing shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11318 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 10:02:22 +00:00
Jean-Philippe Lang
ca5c5d38d6 Removed unused fixtures.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11317 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 09:49:18 +00:00
Jean-Philippe Lang
f4f3764686 Removing shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11316 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 09:43:37 +00:00
Jean-Philippe Lang
14b50dfbab Removing shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11315 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 09:20:05 +00:00
Toshi MARUYAMA
de8033d183 comment out i18n key in plugin template (#12900)
It seems duplicate keys in plugins cause problems.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11314 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 08:46:40 +00:00
Jean-Philippe Lang
b3a2d07257 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11313 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 08:23:20 +00:00
Jean-Philippe Lang
c9c72cb198 Don't display the warning to administrators (#5605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11312 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 08:14:40 +00:00
Jean-Philippe Lang
140eb1f13b Fixed incorrect test name.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11311 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 08:03:42 +00:00
Jean-Philippe Lang
1acf1d6bf7 Adds a warning for when a user with inherited permissions disables inheritance (#5605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11310 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 08:03:25 +00:00
Toshi MARUYAMA
08664b3742 Bulgarian translation updated by Ivan Cenov (#13066)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11309 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 07:33:30 +00:00
Toshi MARUYAMA
f9927d6a4c German translation updated by Daniel Felix (#13065)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11307 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 05:44:48 +00:00
Toshi MARUYAMA
afc9e4784b pdf: fix broken new line in table (#11987)
Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11306 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-03 05:44:13 +00:00
Jean-Philippe Lang
dadf1d4fa1 CSS cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11305 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 15:10:13 +00:00
Jean-Philippe Lang
791b620b98 Removed div around fieldset on project modules.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11304 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 15:06:34 +00:00
Jean-Philippe Lang
8e08aae904 Raises project description height.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11303 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 14:55:21 +00:00
Jean-Philippe Lang
0380292eca Typo that makes the checkbox not visible (#5605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11302 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 14:46:26 +00:00
Jean-Philippe Lang
9536d04c1e Typo that triggers an error when editing a subproject (#5605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11301 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 13:18:04 +00:00
Jean-Philippe Lang
5fea79504c Don't remove watchers on permission change.
This can be far too slow (especially with membership inheritance) and notifications are not sent to watchers that are not allowed to view the item. If we still want to remove watchers that are no longer able to view the watched items, the redmine:watchers:prune task can be called periodically.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11300 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 13:03:22 +00:00
Jean-Philippe Lang
00481b78c8 Adds :field_inherit_members string to locales (#5605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11299 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 12:51:27 +00:00
Jean-Philippe Lang
0f29e265fc Optionaly inherit members from parent project (#5605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11298 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 12:50:45 +00:00
Jean-Philippe Lang
137aa1cf66 Test broken by r11296.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11297 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 09:49:26 +00:00
Jean-Philippe Lang
9e0723c11b Refactors methods for searching a user by token.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11296 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-02 08:46:58 +00:00
Jean-Philippe Lang
8b010e85e3 Add unique index on tokens.value.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11295 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-01 20:04:38 +00:00
Jean-Philippe Lang
9bf98bce26 Skip callbacks when updating last_login_on.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11294 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-02-01 18:32:12 +00:00
Jean-Philippe Lang
8585cda7b1 Use database LOWER instead of #downcase.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11293 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-31 22:45:07 +00:00
Jean-Philippe Lang
f29ced77a7 Makes autocomplete accept issue id with hash.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11292 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-31 22:43:24 +00:00
Jean-Philippe Lang
bf2613a02b Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11291 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-30 21:31:13 +00:00
Jean-Philippe Lang
a0158eff96 Add/remove issue watchers via the REST API (#6727).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11290 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-30 20:51:21 +00:00
Jean-Philippe Lang
f2fd78f7b8 Use POST instead of GET for logging out (#13022).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11289 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-30 17:34:48 +00:00
Jean-Philippe Lang
41faf7f5f5 Adds test:ui to ci:build.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11288 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-29 18:49:33 +00:00
Jean-Philippe Lang
69ac014e2e rake test aborts with ruby1.8.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11287 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-29 18:47:54 +00:00
Jean-Philippe Lang
b0f496a58d Parse database.yml with erb (#13004).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11286 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-29 18:02:20 +00:00
Jean-Philippe Lang
1e0a94de84 Fixe that filter "Assignee's group" doesn't work with group assignments (#13006).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11285 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-29 17:59:20 +00:00
Jean-Philippe Lang
5851f55eeb Let me see what was not found.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11284 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-29 17:58:10 +00:00
Jean-Philippe Lang
d215cc136c CI tasks cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11283 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-29 17:34:35 +00:00
Toshi MARUYAMA
8ec0990d94 Traditional Chinese translation updated by ChunChang Lo (#13003)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11282 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-28 08:08:47 +00:00
Jean-Philippe Lang
f928f36070 Wiki links to repositories with underscore their identifiers don't work (#12979).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11281 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 16:02:49 +00:00
Jean-Philippe Lang
10a38010fb Test failure with JRuby 1.7.2 (#12228).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11280 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 12:23:02 +00:00
Jean-Philippe Lang
b73c42f619 Test failure with JRuby 1.7.2 (#12228).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11279 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 12:03:47 +00:00
Jean-Philippe Lang
7643281510 undefined method `strip' for nil:NilClass error with JRuby 1.7.2 (#12228).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11278 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 10:50:19 +00:00
Toshi MARUYAMA
fb663210b2 Spanish login/logout translations changed by Jorge López (#12967)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11277 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 08:12:58 +00:00
Toshi MARUYAMA
b1aea7a562 Japanese translation updated by Go MAEDA (#12996)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11276 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 05:21:26 +00:00
Toshi MARUYAMA
f046a1bdd3 Bulgarian translation updated by Ivan Cenov (#12995)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11275 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 02:23:23 +00:00
Toshi MARUYAMA
b947823482 German translation updated by Daniel Felix (#12993)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11274 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-27 02:22:53 +00:00
Jean-Philippe Lang
b3a55983a3 Filling locales (#12992).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11273 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 18:38:01 +00:00
Jean-Philippe Lang
9f127793be Make JSONP support optional and disabled by default (#12992).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11272 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 18:37:09 +00:00
Jean-Philippe Lang
134b66cb29 Always notify project members about news unless they turned off all notifications (#4700).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11271 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 18:07:57 +00:00
Jean-Philippe Lang
9c1077841e Adds first Capybara tests (#12822).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11270 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 14:36:02 +00:00
Jean-Philippe Lang
08826ed0b6 Set proper EOL on SVG source files (#12971).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11269 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 09:46:51 +00:00
Toshi MARUYAMA
a2bf01cf89 Japanese translation updated by Go MAEDA (#12990)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11268 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 07:46:58 +00:00
Toshi MARUYAMA
3d7819ed82 remove trailing white-space from app/models/attachment.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11267 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-26 00:47:29 +00:00
Toshi MARUYAMA
8f2fdaccd2 Russian "setting_non_working_week_days" translation changed (#12988)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11265 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-25 23:37:34 +00:00
Toshi MARUYAMA
4b780de127 Russian translation for trunk updated (#12988)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11264 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-25 23:36:55 +00:00
Toshi MARUYAMA
54f9c5a435 Russian translation for 2.2-stable updated (#12987)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11263 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-25 23:35:52 +00:00
Toshi MARUYAMA
0e180c861f fix typo "header_heigth" in gantt view
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11262 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-24 12:17:47 +00:00
Jean-Philippe Lang
63cc617bc5 Fixed Redmine case.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11261 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-23 18:09:16 +00:00
Jean-Philippe Lang
8f00d31ec6 Accommodates fixtures for databases with case sensitive sort.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11260 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-23 18:09:03 +00:00
Jean-Philippe Lang
e53a5de918 Adds "sorted" scope to Principal and User and sort users/groups properly.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11259 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-23 17:44:28 +00:00
Jean-Philippe Lang
c7df78f3b6 Wrong redmine link after referencing an object from a different project (#12930).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11258 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-22 20:40:39 +00:00
Jean-Philippe Lang
a4c10376ce Removed default comments.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11257 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-22 18:31:25 +00:00
Jean-Philippe Lang
43503dad48 Removed unused shoulda macros.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11256 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-22 18:29:12 +00:00
Jean-Philippe Lang
9645cb83f2 ActionController::IntegrationTest is ActionDispatch::IntegrationTest.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11255 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-22 18:28:58 +00:00
Jean-Philippe Lang
5397216190 Adds missing copyright.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11254 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-22 18:27:27 +00:00
Jean-Philippe Lang
55a994cb29 Adds a subclass of ActionDispatch::IntegrationTest for API tests.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11253 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-22 18:26:04 +00:00
Jean-Philippe Lang
eb5675f4bc More specific warning.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11252 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 20:53:52 +00:00
Toshi MARUYAMA
bd070c13c5 Swedish translation changed by Nicklas Holm (#12927)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11250 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 12:36:31 +00:00
Toshi MARUYAMA
6957cd0548 Swedish translation updated by Nicklas Holm (#12927)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11249 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 12:36:17 +00:00
Toshi MARUYAMA
5f8eaf106e Bulgarian translation changed by Ivan Cenov (#12926)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11248 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 12:36:04 +00:00
Toshi MARUYAMA
b197f8a1fe Bulgarian translation for trunk updated by Ivan Cenov (#12926)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11247 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 12:35:51 +00:00
Toshi MARUYAMA
f388297c9b Bulgarian translation for 2.2-stable updated by Ivan Cenov (#12926, #12928)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11246 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 12:35:37 +00:00
Toshi MARUYAMA
e0fb076839 Spanish translation for trunk updated by Jorge López (#12922)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11244 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 10:03:18 +00:00
Toshi MARUYAMA
ebe0184b4e Spanish translation for 2.2-stable updated by Jorge López (#12922)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11243 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 10:02:49 +00:00
Toshi MARUYAMA
13875b1eae Traditional Chinese translation updated by ChunChang Lo (#12916)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11242 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-21 03:59:35 +00:00
Jean-Philippe Lang
2b32a63cee Updates for 2.2.2 release.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11239 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 18:24:14 +00:00
Jean-Philippe Lang
d6d7563a4b Input fields restricted on length should have maxlength parameter set (#12833).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11233 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 17:02:11 +00:00
Jean-Philippe Lang
f99535bba2 "Parent task is invalid" while editing child issues with restricted Issues Visibility (#12851).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11228 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 16:41:31 +00:00
Jean-Philippe Lang
d0888b2f71 Strip {{toc}} tags in pdf exports (#9842).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11227 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 16:22:20 +00:00
Jean-Philippe Lang
15f035be51 Respond with 404 when params[:ids] is missing (#12898).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11226 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 16:04:25 +00:00
Jean-Philippe Lang
6e6ce7c085 Fixed that adding a blank/invalid block to my page renders a blank page (#12838).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11225 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 15:56:46 +00:00
Jean-Philippe Lang
8b23d41cf9 Test failure.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11224 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 15:09:57 +00:00
Toshi MARUYAMA
4c3fe2f1f8 German translation updated by Daniel Felix (#12122)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11223 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 14:34:04 +00:00
Jean-Philippe Lang
5741d007f6 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11222 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:57:29 +00:00
Jean-Philippe Lang
e355a55e3c Don't use && return.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11221 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:54:42 +00:00
Jean-Philippe Lang
b07a27b028 Don't use && return.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11220 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:53:26 +00:00
Jean-Philippe Lang
92b92d6bb8 Safer find_by_ call.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11219 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:50:51 +00:00
Jean-Philippe Lang
8357426e79 Adjust warning message (#12251).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11218 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:48:06 +00:00
Jean-Philippe Lang
22f9b8846b Plugin settings div should perhaps have 'settings' CSS class (#12910).
Patch by Harry Garrood.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11217 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:05:23 +00:00
Jean-Philippe Lang
bb31402939 Fix 500 error for requests to the settings path for non-configurable plugins (#12911).
Path by Harry Garrood.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11216 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 13:03:55 +00:00
Jean-Philippe Lang
253197c598 Changed fieldset legend and make it hidden by default like on the issue list (#12122).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11215 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:55:09 +00:00
Toshi MARUYAMA
cf8182e1bc German translation updated by Daniel Felix (#12401)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11214 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:48:01 +00:00
Jean-Philippe Lang
e1b9767ef3 Fills locales (#12122).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11213 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:37:02 +00:00
Jean-Philippe Lang
fec32fd49d Style should be applied to child legend only.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11212 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:33:57 +00:00
Jean-Philippe Lang
8b91a2bb30 Removed duplicate HTML element id (#12122).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11211 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:31:17 +00:00
Jean-Philippe Lang
237f297f03 Gantt progress lines (#12122).
Patch by Toshi MARUYAMA.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11210 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:30:40 +00:00
Jean-Philippe Lang
30801ca968 Always log scm stderr and makes the log file path configurable.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11209 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 12:04:23 +00:00
Jean-Philippe Lang
9f9802bf46 Update locales for new document permissions (#12401).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11207 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 11:43:10 +00:00
Jean-Philippe Lang
48fb02e383 Split "Manage documents" permission into create, edit and delete permissions (#12401).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11206 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 11:38:20 +00:00
Jean-Philippe Lang
26016cdc08 Adds tests for Redmine::MenuManager.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11205 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-20 10:59:53 +00:00
Jean-Philippe Lang
1188789e15 Set ruby1.9 as default for the database configuration example.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11204 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-19 14:47:19 +00:00
Jean-Philippe Lang
513419debb database.yml should be configured first.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11203 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-19 14:45:39 +00:00
Jean-Philippe Lang
0450547b66 Don't abort when database.yml is not present.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11202 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-19 14:44:26 +00:00
Jean-Philippe Lang
db26041f83 Adds sqlserver configuration for the CI server.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11201 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-19 13:39:53 +00:00
Jean-Philippe Lang
1257f1960f Adds pagination to users list when adding project or group members (#9549).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11200 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-18 17:57:16 +00:00
Toshi MARUYAMA
10c96dba8b not use unnecessary instance variable at unit message test
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11199 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-18 15:46:38 +00:00
Toshi MARUYAMA
0f832e0d76 code layout clean up unit message test
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11198 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-18 15:46:22 +00:00
Jean-Philippe Lang
93e0885b64 Link to attachment should return latest attachment (#7510).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11196 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-15 21:08:27 +00:00
Jean-Philippe Lang
48c3785991 Underscores are allowed in project identifiers (#9225).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11195 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-15 19:44:21 +00:00
Jean-Philippe Lang
04ab2f2458 Bundle only the required database gems and adds sqlserver support (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11194 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-15 19:23:03 +00:00
Jean-Philippe Lang
17e8664b61 Attachment name is added in the generated link.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11193 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 23:07:26 +00:00
Jean-Philippe Lang
1cb1bc7c96 Attachment name is added in the generated link.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11192 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 22:43:26 +00:00
Jean-Philippe Lang
6326752290 Attachment name is added in the generated link.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11191 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 21:18:40 +00:00
Jean-Philippe Lang
1386c10074 Use helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11190 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 21:13:09 +00:00
Jean-Philippe Lang
2230c11baa Use named route with attachment filename for inline images.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11189 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 21:03:53 +00:00
Jean-Philippe Lang
6ce28450c0 Adds a named route for thumbnails and use route helper in #thumbnail_tag.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11188 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 20:51:49 +00:00
Jean-Philippe Lang
4ebdcf13db Add named routes for attachments and use route helpers in #link_to_attachment.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11187 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 20:44:48 +00:00
Jean-Philippe Lang
f607a7a023 Use route helper in #link_to_message.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11186 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 19:22:09 +00:00
Jean-Philippe Lang
b41b738aa4 Removed deprecated call from examples.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11185 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 19:18:52 +00:00
Jean-Philippe Lang
1da158edcf Use route helper in #link_to_project.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11184 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 19:16:29 +00:00
Jean-Philippe Lang
9a80e118b9 Add links to projects in Group projects list (#12843).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11183 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-14 17:40:51 +00:00
Toshi MARUYAMA
5ea7abcf83 Traditional Chinese translation updated by ChunChang Lo (#12831)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11182 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-13 16:10:41 +00:00
Toshi MARUYAMA
c8bef6d2d3 use "UTF-16LE" instead of "UTF-16" on Ruby 1.9.2 due to test failure (#12787)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11181 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-13 01:50:14 +00:00
Toshi MARUYAMA
c363fc47f3 fix typo of attachments controller test names
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11180 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-13 00:43:36 +00:00
Toshi MARUYAMA
58dfbde1ea fix test failures (#12787)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11179 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-13 00:43:24 +00:00
Jean-Philippe Lang
45f870cb53 Encoding::InvalidByteSequenceError may be raised even if encoding is valid (#12787).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11178 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 22:34:00 +00:00
Jean-Philippe Lang
ff53a9cfe1 Don't use Iconv with ruby1.9 (#12787).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11177 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 21:27:36 +00:00
Jean-Philippe Lang
e224d50408 Removed useless require 'iconv' (#12787).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11176 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 20:36:22 +00:00
Toshi MARUYAMA
926a7c1e50 German translation updated by Daniel Felix (#12819)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11175 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 13:26:28 +00:00
Jean-Philippe Lang
e18d0e268d Makes issue custom fields available as timelog columns (#1766).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11174 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 13:09:06 +00:00
Jean-Philippe Lang
a9e81b6b84 Filling locales (#10191).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11173 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 12:45:37 +00:00
Jean-Philippe Lang
14b09361e4 Adds issue custom fields to time entries filters (#10191).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11171 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 12:38:45 +00:00
Toshi MARUYAMA
cd9923e391 Swedish translation updated by Nicklas Holm (#12818)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11170 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 11:30:58 +00:00
Jean-Philippe Lang
e396a0eebe Copyright for 2013 (#12788).
Patch by Daniel Felix.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11169 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 09:29:31 +00:00
Jean-Philippe Lang
bf2fb5d535 Adds a message about disabling multiple values on custom field form (#12251).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11168 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 09:27:03 +00:00
Jean-Philippe Lang
5c1039a69e Ability to uncheck "Multiple values" for existing custom fields (#12251).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11167 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-12 09:12:09 +00:00
Jean-Philippe Lang
44ceb513ed Plugins cannot route wiki page sub-path (#12749).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11166 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-11 17:42:31 +00:00
Toshi MARUYAMA
3716a5c62f Swedish translation changed by Nicklas Holm (#12810, #12809)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11164 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-11 12:12:06 +00:00
Toshi MARUYAMA
92d1ac6f65 Swedish translation updated by Nicklas Holm (#12809)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11163 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-11 12:11:41 +00:00
Toshi MARUYAMA
32fe21341f Serbian translation changed by Miodrag Milic (#12806, #12800)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11161 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-11 07:02:49 +00:00
Toshi MARUYAMA
4a71be4a11 Serbian translation updated by Miodrag Milic (#12800)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11160 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-11 07:02:36 +00:00
Jean-Philippe Lang
956239fc85 Fixed: Cannot edit a wiki section which title starts with a tab (#12799).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11159 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-10 22:05:22 +00:00
Jean-Philippe Lang
18061b641f Code cleanup (#12801).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11158 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-10 21:40:04 +00:00
Jean-Philippe Lang
d0ffc0575a Fixed that viewing the history of a wiki page with attachments raises an error (#12801).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11157 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-10 21:38:11 +00:00
Jean-Philippe Lang
a103e0cd26 Changes for 2.2.1 release.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11146 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-09 13:32:39 +00:00
Toshi MARUYAMA
4c6a0535fc Upgrade to Rails 3.2.11
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11140 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-08 22:52:00 +00:00
Jean-Philippe Lang
9394d739b1 Deprecation warnings (#12774).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11139 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-08 20:18:12 +00:00
Jean-Philippe Lang
b29d74f9d5 Workaround for #12750.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11138 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-08 20:02:53 +00:00
Jean-Philippe Lang
cc47ccb1c2 Check if index exists before removing it (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11137 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 14:46:51 +00:00
Jean-Philippe Lang
98c8212d71 Don't compute version start date if due_date is nil.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11136 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 14:05:55 +00:00
Jean-Philippe Lang
8ee0b52d59 Gantt perf: fixed that Project#start_date and #due_date run way too much queries.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11135 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 14:03:49 +00:00
Jean-Philippe Lang
114537530f Removed debug messages.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11134 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 13:29:25 +00:00
Jean-Philippe Lang
fc19b180c8 Fixed that previews are broken by r10957 (#12642).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11133 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 13:26:25 +00:00
Toshi MARUYAMA
d9ec03493d More specific message for project identifier in Japanese (#9225)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11132 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 12:18:01 +00:00
Toshi MARUYAMA
7e4999ecdb Japanese "notice_account_register_done" translation updated by Takeshi Yaegashi (#12754)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11131 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 12:04:14 +00:00
Jean-Philippe Lang
20ecf57fba More specific message for project identifier (#9225).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11130 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 11:46:51 +00:00
Jean-Philippe Lang
062b003deb Generate project identifier automatically with JavaScript (#9225).
Based on Jan Schulz-Hofen's patch.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11129 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 11:41:37 +00:00
Jean-Philippe Lang
d2785d680d Test fails when run at the beginning of the day.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11128 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 09:54:24 +00:00
Toshi MARUYAMA
4bc2805c4a remove trailing white-spaces from app/models/mail_handler.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11127 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-06 09:32:42 +00:00
Jean-Philippe Lang
582dcf4b36 Fixed that macros with uppercase letters can not be called (#12744).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11126 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 23:11:35 +00:00
Jean-Philippe Lang
45c93340b7 Negative estimated hours should not be valid (#12735).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11125 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 16:34:41 +00:00
Jean-Philippe Lang
3e14c3017c Adds a custom validator for dates (#12736).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11124 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 16:09:15 +00:00
Jean-Philippe Lang
6ed7e091df Adjust test for r11120 (#3436).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11123 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 16:04:21 +00:00
Jean-Philippe Lang
7c2490c6fc Login link unexpected logs you out (#12611).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11122 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 13:53:18 +00:00
Jean-Philippe Lang
d56f916a0e Store the other issue in a variable (#10916).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11121 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 13:23:33 +00:00
Jean-Philippe Lang
f9325193be Only process issues that have relations.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11120 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 12:41:24 +00:00
Jean-Philippe Lang
59ddbf8c09 Use JSON so we don't have to parse data-rels manually (#3436).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11119 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 12:34:20 +00:00
Jean-Philippe Lang
601148c5b1 Show precedes/follows and blocks/blocked relations on the Gantt diagram (#3436).
Based on Toshi MARUYAMA's patch.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11118 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-05 12:28:34 +00:00
Jean-Philippe Lang
9adb0c61a9 Make sure that dates are stored as YYYY-MM-DD in journal details (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11117 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 15:38:52 +00:00
Jean-Philippe Lang
9a66463ff8 Prevent sqlserver adapter from breaking the sub-query (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11116 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 10:08:29 +00:00
Jean-Philippe Lang
a8083fb9a8 Pass the order option as an array to satisfy sqlserver adapter (#12713).
Unlike other adapters, the sqlserver adapter processes the order option and wipes it when using functions.
Here we can see a "ASC" inserted in the COALESCE call:

irb(main):001:0> Issue.order("coalesce(estimated_hours, 0), id").to_sql
=> "SELECT [issues].* FROM [issues] ORDER BY coalesce(estimated_hours ASC, 0) ASC, id ASC"

This does not happen when passing the order SQL fragments separately.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11115 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 10:04:25 +00:00
Jean-Philippe Lang
0337d9abc3 Use activerecord-jdbc-adapter 1.2.5.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11114 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 09:00:55 +00:00
Jean-Philippe Lang
9613a13b10 Deprecates Version#*_pourcent in favour of #*_percent (#12724).
Patch by Daniel Felix.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11113 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 08:30:25 +00:00
Jean-Philippe Lang
9c698157f4 Check permissions before the extra condition for displaying a menu item (#12721).
Patch by Daniel Ritz.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11112 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 08:21:33 +00:00
Toshi MARUYAMA
3bf6f8d7ff remove trailing white-space from app/controllers/wiki_controller.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11110 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-04 01:11:33 +00:00
Jean-Philippe Lang
d264911f14 Upgrade to Rails 3.2.10.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11109 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 22:54:33 +00:00
Jean-Philippe Lang
902d4bcf1c Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11108 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 13:59:15 +00:00
Jean-Philippe Lang
03329b5d4d Use joins instead of sub-queries (#12713).
Sub-queries in group by are not supported by SQLServer.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11107 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 13:57:27 +00:00
Jean-Philippe Lang
24ec41f7d4 A column has been specified more than once in the order by list (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11106 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 13:40:50 +00:00
Jean-Philippe Lang
503933c585 Don't do any query if id is not present.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11105 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 13:39:04 +00:00
Jean-Philippe Lang
e4f0b9a9f9 Fixed fixtures.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11104 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 13:38:22 +00:00
Jean-Philippe Lang
77f6b404fa Make sure we don't cast an empty string to numeric (#12713).
SQLServer evaluates the CAST condition even if the <> '' condition is false.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11103 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 13:33:16 +00:00
Jean-Philippe Lang
d82159bcf5 Use joins instead of sub-queries in group by/sort by when using custom fields (#12713).
Sub-queries in group by are not supported by SQLServer.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11102 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 12:28:50 +00:00
Jean-Philippe Lang
049eaeb776 Repository changesets are already sorted by committed_on DESC (#12713).
SQLServer raises an error because committed_on is specified twice in the order by list.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11101 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:40:39 +00:00
Jean-Philippe Lang
8b08c1a534 Prevents position to be specified more than once in the order by list which is not supported by SQLServer (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11100 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:37:07 +00:00
Jean-Philippe Lang
dd7d54b3a1 SQLServer: rule is a reserved keyword (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11099 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:21:45 +00:00
Jean-Philippe Lang
0135dc504a SQLServer: The size (60) given to the type 'decimal' exceeds the maximum allowed (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11098 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:21:03 +00:00
Jean-Philippe Lang
9c561f9124 SQLServer does not support changing the type of an indexed column (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11097 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:19:08 +00:00
Jean-Philippe Lang
3218b8204c Check that locale is well formed.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11096 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:12:41 +00:00
Jean-Philippe Lang
6f614c034f YAML.load_file returns a Hash with 3 keys with ruby 1.9.3p194 (2012-04-20) [i386-mingw32].
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11095 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:02:11 +00:00
Jean-Philippe Lang
5715f40b21 YAML.load_file fails with ruby 1.9.3p194 (2012-04-20) [i386-mingw32].
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11094 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-03 11:01:42 +00:00
Toshi MARUYAMA
524baaa9ca German translation restructured by Daniel Felix (#12708)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11092 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-02 16:30:58 +00:00
Toshi MARUYAMA
2ba7228b06 fix incorrect min_x_value of lib/SVG/Graph/TimeSeries.rb by r10439 (#12711, #11290)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11091 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-02 15:53:52 +00:00
Jean-Philippe Lang
64b98928c9 Typo in app/models/tracker.rb (#12707).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11090 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-02 13:02:20 +00:00
Jean-Philippe Lang
3644571d8a cannot load Java class com.mysql.jdbc.Driver error with jdbc-mysql 5.1.22.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11089 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-02 11:59:25 +00:00
Jean-Philippe Lang
01cbac3b74 Link to Wikipedia (#12691).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11088 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-02 07:50:38 +00:00
Jean-Philippe Lang
a18f6ffb37 Icon for the textile help link.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11087 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-01-02 07:47:12 +00:00
Toshi MARUYAMA
758e07cd96 replace tabs to spaces at app/views/timelog/_form.html.erb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11086 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-27 03:09:56 +00:00
Jean-Philippe Lang
11977f08a7 Tests broken with activerecord-jdbc-adapter 1.2.3.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11085 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-26 14:16:42 +00:00
Jean-Philippe Lang
c87f36d20b Log an error when trying to send an attachment that cannot be read.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11084 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-26 14:00:10 +00:00
Jean-Philippe Lang
6be315c1ff Update the issue subject when choosing an issue from the drop down menu.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11083 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-26 13:12:38 +00:00
Jean-Philippe Lang
48a51e60bc Adds an indicator to all autocomplete/search fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11082 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-26 12:01:11 +00:00
Jean-Philippe Lang
7606353ff9 Upgraded JQuery to 1.8.3 and JQuery UI to 1.9.2.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11081 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-26 11:47:51 +00:00
Jean-Philippe Lang
7b8ebb7e3f Auto-populate fields while creating a new user with LDAP (#10286).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11080 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-26 11:23:53 +00:00
Jean-Philippe Lang
eba4efc9d0 Missing labels on auth_source edit form.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11079 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-24 10:42:37 +00:00
Jean-Philippe Lang
b7d8913459 Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11078 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-23 16:10:07 +00:00
Jean-Philippe Lang
4ac43ab876 Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11077 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-23 15:55:57 +00:00
Jean-Philippe Lang
3ef7f5855e Renamed #_issues_path to #_project_issues_path.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11076 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-23 15:19:57 +00:00
Jean-Philippe Lang
e921d70e53 Moved routes helper methods to an helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11075 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-23 15:18:39 +00:00
Jean-Philippe Lang
1528c719a4 Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11074 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-23 15:12:57 +00:00
Jean-Philippe Lang
0927230a18 Adds route names for r11072.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11073 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 15:57:27 +00:00
Jean-Philippe Lang
8eea999ca6 Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11072 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 15:57:07 +00:00
Jean-Philippe Lang
ad246e81ad Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11071 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 12:24:43 +00:00
Jean-Philippe Lang
a4f989a5e0 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11070 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 10:57:01 +00:00
Jean-Philippe Lang
6c15812d96 Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11069 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 10:40:32 +00:00
Jean-Philippe Lang
bda9b98a56 Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11068 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 10:30:42 +00:00
Jean-Philippe Lang
cd437b7e1d Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11067 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 10:00:00 +00:00
Jean-Philippe Lang
3976d5e740 Use #assert_select instead of #assert_tag.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11066 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 09:35:35 +00:00
Jean-Philippe Lang
eecabc5bb0 Use #assert_select instead of #assert_tag.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11065 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-22 08:17:59 +00:00
Jean-Philippe Lang
7f74044854 "New issue" menu item should not link to copy form (#12652).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11064 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-21 21:17:21 +00:00
Jean-Philippe Lang
94d9172634 Changed revision regexp to make source: links accept a branch.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11063 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-21 20:59:35 +00:00
Jean-Philippe Lang
852b336f5e Adds CSS classes on pagination links.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11062 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-21 20:58:55 +00:00
Toshi MARUYAMA
b4aab7b375 remove trailing white-spaces from app/models/issue_relation.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11061 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-21 04:52:58 +00:00
Toshi MARUYAMA
77a974b4ee Russian "about_x_hours" and "x_hours" translation changed by Mikhail Velkin (#12645)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11060 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-20 05:17:55 +00:00
Toshi MARUYAMA
f0c227613a remove unused "label_modification" i18n keys (#12645)
These keys were removed from app/views/repositories/revision.rhtml by r535
and app/views/repositories/revisions.rhtml by r381.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11059 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-20 03:57:29 +00:00
Toshi MARUYAMA
7c194ea59a remove unused "label_download" i18n keys (#12645)
These keys were removed from app/views/documents/show.rhtml by r1180.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11058 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-20 03:56:53 +00:00
Toshi MARUYAMA
7eb53ae50f remove unused "gui_validation_error" i18n keys (#12645)
These keys were removed from app/helpers/application_helper.rb by r2493.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11057 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-20 03:55:35 +00:00
Toshi MARUYAMA
5dacff5ccc add "few" and "many" to Russian "x_hours" (#12640)
Contributed by Mikhail Velkin.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11056 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-19 15:03:38 +00:00
Toshi MARUYAMA
d42aaf2254 German "label_issues_by" changed by Daniel Felix (#12629)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11053 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-18 23:19:53 +00:00
Toshi MARUYAMA
82d4adc356 Russian "about_x_hours" translation changed by Mikhail Velkin (#12640)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11052 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-18 23:19:25 +00:00
Toshi MARUYAMA
c3cfdfadfd Russian "x_hours" translation updated by Mikhail Velkin (#12630)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11051 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-18 22:50:53 +00:00
Toshi MARUYAMA
c7fae614f0 Japanese "permission_commit_access" and "button_view" translation changed by Ian Walker (#12626)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11050 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-18 14:18:11 +00:00
Toshi MARUYAMA
16bddb9d24 replace tabs to spaces at Redmine.pm
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11049 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-18 14:17:27 +00:00
Jean-Philippe Lang
8396fff19b Changelog for 2.2.0 release.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11041 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-18 12:23:31 +00:00
Toshi MARUYAMA
9a1262846a Russian translation changed by Kirill Bezrukov (#12615, #12619)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11036 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 23:06:09 +00:00
Toshi MARUYAMA
2881a7245d Russian translation updated by Kirill Bezrukov (#12615)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11035 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 22:34:15 +00:00
Jean-Philippe Lang
352ec0e9e4 #pagination_links_each yields all links!
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11034 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 20:27:56 +00:00
Jean-Philippe Lang
1a58737004 Reset the page parameter when changing the number of items per page.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11033 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 20:20:56 +00:00
Jean-Philippe Lang
7f152d3485 Makes #per_page_links take a paginator.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11032 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 20:19:48 +00:00
Jean-Philippe Lang
56669f9b13 Split #per_page_links helper and moved test to specific test case.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11031 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 20:17:52 +00:00
Jean-Philippe Lang
ab3330a945 All spaces after links.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11030 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 19:39:32 +00:00
Jean-Philippe Lang
7143bd6d27 Makes #pagination_links_full accept a block for building custom links.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11029 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 19:38:17 +00:00
Jean-Philippe Lang
42d3ec3a59 Display 25 items.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11028 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 18:24:06 +00:00
Jean-Philippe Lang
85fb937a4e Use scoped models for pagination.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11027 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 18:23:30 +00:00
Jean-Philippe Lang
1cf379f370 Replaces the classic_pagination plugin with a simple pagination module.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11026 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 18:21:24 +00:00
Toshi MARUYAMA
dfe2b6fbe9 Dutch translation updated (#12614)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11022 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 11:49:46 +00:00
Toshi MARUYAMA
dd26ac3038 code cleanup gantt_helper.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11021 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-17 07:14:26 +00:00
Toshi MARUYAMA
44413d3db7 Norwegian translation changed by Ketil Mehl (#12605, #12608)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11015 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-16 06:37:02 +00:00
Toshi MARUYAMA
341431d44a Norwegian translation for 1.4-stable updated by Ketil Mehl (#12605)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11014 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-16 06:36:49 +00:00
Toshi MARUYAMA
1538ab894b Japanese translation updated by Go MAEDA (#12606)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11013 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-16 05:44:04 +00:00
Toshi MARUYAMA
b5820ce54f Japanese translation for 2.2-stable updated (#12607)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11012 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-16 05:43:50 +00:00
Jean-Philippe Lang
ccb886b715 Verifies that the param is a Hash.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11011 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-15 10:03:52 +00:00
Jean-Philippe Lang
39e7bab2b9 Save the selected file just in case uploading stuff fails/is not supported.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11010 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-15 10:03:34 +00:00
Toshi MARUYAMA
0d86303e3f Korean translation updated by Jongwook Choi (#12602)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10999 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-15 00:01:54 +00:00
Toshi MARUYAMA
301d7e7cb1 German translation updated by Daniel Felix (#10191)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10998 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-14 14:47:46 +00:00
Etienne Massip
bc51058a7c Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10997 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 18:43:34 +00:00
Jean-Philippe Lang
7775f86a69 Code cleanup in AuthSource controller and views.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10996 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 15:04:11 +00:00
Jean-Philippe Lang
c31f498ba6 Code cleanup: implement Plugin#to_param for generating routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10995 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 13:52:56 +00:00
Jean-Philippe Lang
c93fccc84a Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10994 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 13:43:01 +00:00
Jean-Philippe Lang
d46a0a3a4f NoMethodError: private method `now' called for DateTime:Class error in tests with ruby < 1.9.3 (#5298).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10993 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 13:18:41 +00:00
Jean-Philippe Lang
0a773bcbb3 Fixed that validation fails when receiving an email with list custom fields (#12400).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10992 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 13:14:46 +00:00
Jean-Philippe Lang
b99a6f11f3 Fixed: clicking journal edit multiple times shows multiple forms (#12568).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10991 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 12:42:10 +00:00
Jean-Philippe Lang
c99b638d61 Store attachments in subdirectories (#5298).
Existing files can be moved to their target subdirectories using rake redmine:attachments:move_to_subdirectories.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10990 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-13 12:07:19 +00:00
Toshi MARUYAMA
d0bbaef308 remove trailing white-spaces from public/javascripts/attachments.js
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10989 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-12 10:23:08 +00:00
Jean-Philippe Lang
cabfece11b Use browser language as default when registering.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10988 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-12 06:05:35 +00:00
Jean-Philippe Lang
24be0551cc Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10987 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 20:38:26 +00:00
Jean-Philippe Lang
5dd7467061 Fixed duplicate test name.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10986 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 20:14:39 +00:00
Jean-Philippe Lang
8c7b6012f5 Removed unused code.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10985 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 20:09:16 +00:00
Jean-Philippe Lang
ec7c512693 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10984 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 19:42:12 +00:00
Jean-Philippe Lang
8ab9215ea8 Use named routes in controllers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10983 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 19:39:47 +00:00
Jean-Philippe Lang
60d06d8c17 Removed temp file.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10982 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 17:51:48 +00:00
Jean-Philippe Lang
0b96094680 Use named routes in controllers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10981 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 17:51:30 +00:00
Jean-Philippe Lang
cf66561b1e Routes cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10980 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-11 17:51:20 +00:00
Jean-Philippe Lang
228414f777 Moved IssueRelations to IssueRelation::Relations.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10979 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-10 21:59:01 +00:00
Jean-Philippe Lang
42b6f8365a Moved javascript include tag to head.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10978 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-10 20:19:26 +00:00
Jean-Philippe Lang
ef25210aca Merged ajax_upload branch (#3957).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10977 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-10 20:09:41 +00:00
Etienne Massip
2304f5d42c Fixed notes preview in issue history broken and hidden by a broken test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10975 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-10 19:29:21 +00:00
Jean-Philippe Lang
aba07a860f Rescue Query::StatementInvalid in TimelogController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10973 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 21:13:26 +00:00
Jean-Philippe Lang
0ce6eb9285 Makes time entry custom fields available for display on the time entries list (#1766).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10972 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 21:03:30 +00:00
Jean-Philippe Lang
60088ed5a3 Adds filters for custom fields related to the project and user of time entries (#10191).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10971 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 19:25:03 +00:00
Jean-Philippe Lang
9dc07d4790 Adds filters for regular/custom fields to the time entries list/report (#10191).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10970 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 19:18:57 +00:00
Jean-Philippe Lang
093ecdfc73 Fixed syntax for ruby1.8.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10969 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 18:46:02 +00:00
Jean-Philippe Lang
d6ecfcf50c Rename the Member column to User on the time entries list.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10968 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 18:09:44 +00:00
Jean-Philippe Lang
f8895a7cdd Adds TimeEntryQuery for listing time entries.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10967 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 17:57:18 +00:00
Jean-Philippe Lang
10998c9bae Moved build_query_from_params helper to Query#build_from_params.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10966 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 15:11:00 +00:00
Jean-Philippe Lang
eb1829e739 Moves issue specific code to IssueQuery.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10965 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 14:44:28 +00:00
Jean-Philippe Lang
ab066317e6 Adds STI to Query model. Issue queries are now IssueQuery instances.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10964 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 14:10:49 +00:00
Jean-Philippe Lang
fb9a87f53e Use inheritable class attributes in Query model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10963 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-09 13:19:32 +00:00
Jean-Philippe Lang
8ead410f98 Removed conditions on HTTP methods.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10962 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 11:31:29 +00:00
Jean-Philippe Lang
0bd70d4680 Use \A and \z in validation regexps.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10961 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 11:06:53 +00:00
Jean-Philippe Lang
147e7a8d61 Use \A and \z in validation regexps.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10960 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 10:59:31 +00:00
Jean-Philippe Lang
4c6dfdf95f Cleanup dependencies in Project model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10959 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 10:45:34 +00:00
Jean-Philippe Lang
df0b91e238 Moved user status constants to Principal model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10958 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 10:44:42 +00:00
Jean-Philippe Lang
2ebcc6d960 Specifies HTTP methods for all routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10957 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 10:28:29 +00:00
Jean-Philippe Lang
5c407a8c40 Fixed that issues grouped by custom field is broken in PDF export (#12513).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10956 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 09:45:38 +00:00
Jean-Philippe Lang
1bcff510b1 Don't use jruby-openssl with JRuby 1.7.0 (#12228).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10955 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 09:22:46 +00:00
Jean-Philippe Lang
00d16d07de MailHandler: exit with 75 when a SystemCallError is raised (#12528).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10954 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 09:14:06 +00:00
Jean-Philippe Lang
cf69c2da21 Don't force english language for default admin account (#12485).
Contributed by Go MAEDA.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10953 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 08:53:09 +00:00
Jean-Philippe Lang
0e30724d66 Group events in the activity view (#12542).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10951 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-08 08:24:01 +00:00
Jean-Philippe Lang
7222e4012d Rewrites named scopes with ARel queries.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10950 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-07 17:59:20 +00:00
Jean-Baptiste Barth
4896d5c7e8 Use lambda form in model scopes (#12499)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10949 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-07 10:12:47 +00:00
Jean-Philippe Lang
8201761e77 Adds an option for displaying the issue description on the issue list (#3447).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10948 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-06 17:48:19 +00:00
Toshi MARUYAMA
43fb321195 Lithuanian translation updated by Egidijus Zideckas (#12514)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10946 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-06 05:11:36 +00:00
Jean-Philippe Lang
3e4b4ffd9a Redmine::Scm::Base.all should return an empty array instead of nil when no SCM was added.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10945 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-05 22:00:02 +00:00
Jean-Philippe Lang
0878be4e0c Prevents redmine/scm/base from being reloaded in dev mode (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10944 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-05 21:59:00 +00:00
Toshi MARUYAMA
d7229d8f9d remove trailing white-spaces from application.css
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10943 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-05 09:58:26 +00:00
Toshi MARUYAMA
ee7685670d remove trailing white-space from app/models/issue_category.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10941 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-04 04:22:59 +00:00
Toshi MARUYAMA
7082e1db9d Bulgarian "button_submit" translation changed by Ivan Cenov (#12494)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10940 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-04 03:36:12 +00:00
Jean-Philippe Lang
33549495c9 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10939 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 23:03:33 +00:00
Jean-Philippe Lang
5dbefbc40d Removed unused Redmine::About class.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10938 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 22:33:08 +00:00
Jean-Philippe Lang
46fe61d51e Adds tests for when showing/deleting an invalid issue.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10937 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 22:29:59 +00:00
Jean-Philippe Lang
4cc4e8bfd3 Functional tests cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10936 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 22:23:23 +00:00
Jean-Philippe Lang
349049a539 Test case cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10935 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 22:07:43 +00:00
Jean-Philippe Lang
127a2508fa Add a test for my page with all blocks.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10934 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 22:06:04 +00:00
Jean-Philippe Lang
2844e90902 Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10933 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 21:52:32 +00:00
Jean-Philippe Lang
e9018553e5 Removed unused helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10932 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 21:46:11 +00:00
Jean-Philippe Lang
ea296a109a Replaces find(:first/:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10931 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 21:30:10 +00:00
Jean-Philippe Lang
a7023dfa9b Replaces find(:first) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10930 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 20:55:04 +00:00
Jean-Philippe Lang
738cf2e187 Replaces find(:first) calls in migrations.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10929 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 18:25:57 +00:00
Jean-Philippe Lang
31c33f462d Replaces find(:first) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10928 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-03 18:21:32 +00:00
Jean-Philippe Lang
013c6fe009 Replaces find(:all) calls in acts_as_searchable.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10927 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 22:13:11 +00:00
Jean-Philippe Lang
30787e9cd2 Preserve the "from" parameter in activity links.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10926 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 21:41:03 +00:00
Jean-Philippe Lang
85b5b1c7f0 Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10925 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 21:28:19 +00:00
Jean-Philippe Lang
b4438b29d6 Replaces find(:all) calls in classic_pagination.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10924 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 21:21:28 +00:00
Jean-Philippe Lang
7a40e309e4 Restores acts_as_tree instance methods removed in r10919.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10923 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 21:20:27 +00:00
Jean-Philippe Lang
9230628953 Adds helpers for retrieving my page data.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10922 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 21:08:03 +00:00
Jean-Philippe Lang
45ea24ecad Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10921 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 20:43:16 +00:00
Jean-Philippe Lang
5cb56fd1e4 Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10920 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 20:42:58 +00:00
Jean-Philippe Lang
282a13d6ee Replaces acts_as_tree #roots class method with a scope.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10919 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 20:41:03 +00:00
Jean-Philippe Lang
abd921736b Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10918 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 20:28:37 +00:00
Jean-Philippe Lang
536747b747 Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10917 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 20:23:48 +00:00
Jean-Philippe Lang
96fca0b08f Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10916 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 19:16:32 +00:00
Jean-Philippe Lang
bd10a71217 Load RMagick before the gantt helper (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10915 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 19:15:52 +00:00
Jean-Philippe Lang
5b21efd4a4 Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10914 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 19:09:42 +00:00
Jean-Philippe Lang
1951c6a3fd Removed unused instance variable.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10913 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 19:00:00 +00:00
Jean-Philippe Lang
def118b42a Fixed dependency loading for when running in dev mode (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10912 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 18:32:29 +00:00
Jean-Philippe Lang
9507b448b2 Makes User.current thread safe (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10911 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 18:15:46 +00:00
Jean-Philippe Lang
e821020394 Make the tests pass when config.threadsafe! is enabled (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10910 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 18:07:35 +00:00
Jean-Philippe Lang
f474d1ff81 Explicitly load dependencies for when running with config.threadsafe! (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10909 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-12-02 18:06:06 +00:00
747 changed files with 17353 additions and 13600 deletions

86
Gemfile
View File

@@ -1,6 +1,6 @@
source 'http://rubygems.org'
source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem "rails", "3.2.13"
gem "jquery-rails", "~> 2.0.2"
gem "i18n", "~> 0.6.0"
gem "coderay", "~> 1.0.6"
@@ -28,43 +28,47 @@ platforms :mri, :mingw do
end
end
# Database gems
platforms :mri, :mingw do
group :postgresql do
gem "pg", ">= 0.11.0"
end
group :sqlite do
gem "sqlite3"
end
end
platforms :mri_18, :mingw_18 do
group :mysql do
gem "mysql", "~> 2.8.1"
end
end
platforms :mri_19, :mingw_19 do
group :mysql do
gem "mysql2", "~> 0.3.11"
end
end
platforms :jruby do
gem "jruby-openssl"
# jruby-openssl is bundled with JRuby 1.7.0
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
gem "activerecord-jdbc-adapter", "1.2.5"
end
group :mysql do
gem "activerecord-jdbcmysql-adapter"
end
group :postgresql do
gem "activerecord-jdbcpostgresql-adapter"
end
group :sqlite do
gem "activerecord-jdbcsqlite3-adapter"
# Include database gems for the adapters found in the database
# configuration file
require 'erb'
require 'yaml'
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
database_config = YAML::load(ERB.new(IO.read(database_file)).result)
adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
if adapters.any?
adapters.each do |adapter|
case adapter
when 'mysql2'
gem "mysql2", "~> 0.3.11", :platforms => [:mri, :mingw]
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
when 'mysql'
gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
when /postgresql/
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
when /sqlite3/
gem "sqlite3", :platforms => [:mri, :mingw]
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
when /sqlserver/
gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
else
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
end
end
else
warn("No adapter found in config/database.yml, please configure it first")
end
else
warn("Please configure your config/database.yml first")
end
group :development do
@@ -73,13 +77,9 @@ group :development do
end
group :test do
gem "shoulda", "~> 2.11"
# Shoulda does not work nice on Ruby 1.9.3 and JRuby 1.7.
# It seems to need test-unit explicitely.
platforms = [:mri_19]
platforms << :jruby if defined?(JRUBY_VERSION) && JRUBY_VERSION >= "1.7"
gem "test-unit", :platforms => platforms
gem "mocha", "0.12.3"
gem "shoulda", "~> 3.3.2"
gem "mocha", "~> 0.13.3"
gem 'capybara', '~> 2.0.0'
end
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -25,7 +25,9 @@ class AccountController < ApplicationController
# Login request and validation
def login
if request.get?
logout_user
if User.current.logged?
redirect_to home_url
end
else
authenticate_user
end
@@ -36,15 +38,20 @@ class AccountController < ApplicationController
# Log out current user and redirect to welcome page
def logout
logout_user
redirect_to home_url
if User.current.anonymous?
redirect_to home_url
elsif request.post?
logout_user
redirect_to home_url
end
# display the logout form
end
# Lets user choose a new password
def lost_password
redirect_to(home_url) && return unless Setting.lost_password?
(redirect_to(home_url); return) unless Setting.lost_password?
if params[:token]
@token = Token.find_by_action_and_value("recovery", params[:token].to_s)
@token = Token.find_token("recovery", params[:token].to_s)
if @token.nil? || @token.expired?
redirect_to home_url
return
@@ -92,10 +99,10 @@ class AccountController < ApplicationController
# User self-registration
def register
redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration]
(redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration]
if request.get?
session[:auth_source_registration] = nil
@user = User.new(:language => Setting.default_language)
@user = User.new(:language => current_language.to_s)
else
user_params = params[:user] || {}
@user = User.new
@@ -110,7 +117,7 @@ class AccountController < ApplicationController
session[:auth_source_registration] = nil
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)
redirect_to :controller => 'my', :action => 'account'
redirect_to my_account_path
end
else
@user.login = params[:user][:login]
@@ -132,11 +139,11 @@ class AccountController < ApplicationController
# Token based account activation
def activate
redirect_to(home_url) && return unless Setting.self_registration? && params[:token]
token = Token.find_by_action_and_value('register', params[:token])
redirect_to(home_url) && return unless token and !token.expired?
(redirect_to(home_url); return) unless Setting.self_registration? && params[:token].present?
token = Token.find_token('register', params[:token].to_s)
(redirect_to(home_url); return) unless token and !token.expired?
user = token.user
redirect_to(home_url) && return unless user.registered?
(redirect_to(home_url); return) unless user.registered?
user.activate
if user.save
token.destroy
@@ -169,12 +176,14 @@ class AccountController < ApplicationController
end
def open_id_authenticate(openid_url)
authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url, :method => :post) do |result, identity_url, registration|
back_url = signin_url(:autologin => params[:autologin])
authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => back_url, :method => :post) do |result, identity_url, registration|
if result.successful?
user = User.find_or_initialize_by_identity_url(identity_url)
if user.new_record?
# Self-registration off
redirect_to(home_url) && return unless Setting.self_registration?
(redirect_to(home_url); return) unless Setting.self_registration?
# Create on the fly
user.login = registration['nickname'] unless registration['nickname'].nil?
@@ -218,12 +227,11 @@ class AccountController < ApplicationController
set_autologin_cookie(user)
end
call_hook(:controller_account_success_authentication_after, {:user => user })
redirect_back_or_default :controller => 'my', :action => 'page'
redirect_back_or_default my_page_path
end
def set_autologin_cookie(user)
token = Token.create(:user => user, :action => 'autologin')
cookie_name = Redmine::Configuration['autologin_cookie_name'] || 'autologin'
cookie_options = {
:value => token.value,
:expires => 1.year.from_now,
@@ -231,7 +239,7 @@ class AccountController < ApplicationController
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
:httponly => true
}
cookies[cookie_name] = cookie_options
cookies[autologin_cookie_name] = cookie_options
end
# Onthefly creation failed, display the registration form to fill/fix attributes
@@ -270,7 +278,7 @@ class AccountController < ApplicationController
if user.save
self.logged_user = user
flash[:notice] = l(:notice_account_activated)
redirect_to :controller => 'my', :action => 'account'
redirect_to my_account_path
else
yield if block_given?
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -23,19 +23,18 @@ class AdminController < ApplicationController
before_filter :require_admin
helper :sort
include SortHelper
include SortHelper
def index
@no_configuration_data = Redmine::DefaultData::Loader::no_data?
end
def projects
@status = params[:status] || 1
scope = Project.status(@status)
scope = Project.status(@status).order('lft')
scope = scope.like(params[:name]) if params[:name].present?
@projects = scope.all(:order => 'lft')
@projects = scope.all
render :action => "projects", :layout => false if request.xhr?
end
@@ -55,7 +54,7 @@ class AdminController < ApplicationController
flash[:error] = l(:error_can_t_load_default_data, e.message)
end
end
redirect_to :action => 'index'
redirect_to admin_path
end
def test_email
@@ -69,7 +68,7 @@ class AdminController < ApplicationController
flash[:error] = l(:notice_email_error, e.message)
end
ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
redirect_to :controller => 'settings', :action => 'edit', :tab => 'notifications'
redirect_to settings_path(:tab => 'notifications')
end
def info

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -22,6 +22,9 @@ class Unauthorized < Exception; end
class ApplicationController < ActionController::Base
include Redmine::I18n
include Redmine::Pagination
include RoutesHelper
helper :routes
class_attribute :accept_api_auth_actions
class_attribute :accept_rss_auth_actions
@@ -32,7 +35,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
def handle_unverified_request
super
cookies.delete(:autologin)
cookies.delete(autologin_cookie_name)
end
before_filter :session_expiration, :user_setup, :check_if_login_required, :set_localization
@@ -124,10 +127,14 @@ class ApplicationController < ActionController::Base
user
end
def autologin_cookie_name
Redmine::Configuration['autologin_cookie_name'].presence || 'autologin'
end
def try_to_autologin
if cookies[:autologin] && Setting.autologin?
if cookies[autologin_cookie_name] && Setting.autologin?
# auto-login feature starts a new session
user = User.try_to_autologin(cookies[:autologin])
user = User.try_to_autologin(cookies[autologin_cookie_name])
if user
reset_session
start_user_session(user)
@@ -150,7 +157,7 @@ class ApplicationController < ActionController::Base
# Logs out current user
def logout_user
if User.current.logged?
cookies.delete :autologin
cookies.delete(autologin_cookie_name)
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
self.logged_user = nil
end
@@ -300,6 +307,16 @@ class ApplicationController < ActionController::Base
render_404
end
def find_attachments
if (attachments = params[:attachments]).present?
att = attachments.values.collect do |attachment|
Attachment.find_by_token( attachment[:token] ) if attachment[:token].present?
end
att.compact!
end
@attachments = att || []
end
# make sure that the user is a member of the project (or admin) if project is private
# used as a before_filter for actions that do not require any particular permission on the project
def check_project_privacy

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -85,15 +85,17 @@ class AttachmentsController < ApplicationController
@attachment = Attachment.new(:file => request.raw_post)
@attachment.author = User.current
@attachment.filename = params[:filename].presence || Redmine::Utils.random_hex(16)
saved = @attachment.save
if @attachment.save
respond_to do |format|
format.api { render :action => 'upload', :status => :created }
end
else
respond_to do |format|
format.api { render_validation_errors(@attachment) }
end
respond_to do |format|
format.js
format.api {
if saved
render :action => 'upload', :status => :created
else
render_validation_errors(@attachment)
end
}
end
end
@@ -101,9 +103,17 @@ class AttachmentsController < ApplicationController
if @attachment.container.respond_to?(:init_journal)
@attachment.container.init_journal(User.current)
end
# Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment)
redirect_to_referer_or project_path(@project)
if @attachment.container
# Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment)
else
@attachment.destroy
end
respond_to do |format|
format.html { redirect_to_referer_or project_path(@project) }
format.js
end
end
private
@@ -118,7 +128,12 @@ private
# Checks that the file exists and is readable
def file_readable
@attachment.readable? ? true : render_404
if @attachment.readable?
true
else
logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable."
render_404
end
end
def read_authorize

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -20,57 +20,77 @@ class AuthSourcesController < ApplicationController
menu_item :ldap_authentication
before_filter :require_admin
before_filter :find_auth_source, :only => [:edit, :update, :test_connection, :destroy]
def index
@auth_source_pages, @auth_sources = paginate AuthSource, :per_page => 10
@auth_source_pages, @auth_sources = paginate AuthSource, :per_page => 25
end
def new
klass_name = params[:type] || 'AuthSourceLdap'
@auth_source = AuthSource.new_subclass_instance(klass_name, params[:auth_source])
render_404 unless @auth_source
end
def create
@auth_source = AuthSource.new_subclass_instance(params[:type], params[:auth_source])
if @auth_source.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
redirect_to auth_sources_path
else
render :action => 'new'
end
end
def edit
@auth_source = AuthSource.find(params[:id])
end
def update
@auth_source = AuthSource.find(params[:id])
if @auth_source.update_attributes(params[:auth_source])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
redirect_to auth_sources_path
else
render :action => 'edit'
end
end
def test_connection
@auth_source = AuthSource.find(params[:id])
begin
@auth_source.test_connection
flash[:notice] = l(:notice_successful_connection)
rescue Exception => e
flash[:error] = l(:error_unable_to_connect, e.message)
end
redirect_to :action => 'index'
redirect_to auth_sources_path
end
def destroy
@auth_source = AuthSource.find(params[:id])
unless @auth_source.users.find(:first)
unless @auth_source.users.exists?
@auth_source.destroy
flash[:notice] = l(:notice_successful_delete)
end
redirect_to :action => 'index'
redirect_to auth_sources_path
end
def autocomplete_for_new_user
results = AuthSource.search(params[:term])
render :json => results.map {|result| {
'value' => result[:login],
'label' => "#{result[:login]} (#{result[:firstname]} #{result[:lastname]})",
'login' => result[:login].to_s,
'firstname' => result[:firstname].to_s,
'lastname' => result[:lastname].to_s,
'mail' => result[:mail].to_s,
'auth_source_id' => result[:auth_source_id].to_s
}}
end
private
def find_auth_source
@auth_source = AuthSource.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -23,10 +23,10 @@ class AutoCompletesController < ApplicationController
q = (params[:q] || params[:term]).to_s.strip
if q.present?
scope = (params[:scope] == "all" || @project.nil? ? Issue : @project.issues).visible
if q.match(/^\d+$/)
@issues << scope.find_by_id(q.to_i)
if q.match(/\A#?(\d+)\z/)
@issues << scope.find_by_id($1.to_i)
end
@issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%").order("#{Issue.table_name}.id DESC").limit(10).all
@issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE LOWER(?)", "%#{q}%").order("#{Issue.table_name}.id DESC").limit(10).all
@issues.compact!
end
render :layout => false

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -37,23 +37,29 @@ class BoardsController < ApplicationController
respond_to do |format|
format.html {
sort_init 'updated_on', 'desc'
sort_update 'created_on' => "#{Message.table_name}.created_on",
sort_update 'created_on' => "#{Message.table_name}.created_on",
'replies' => "#{Message.table_name}.replies_count",
'updated_on' => "#{Message.table_name}.updated_on"
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
@topic_count = @board.topics.count
@topic_pages = Paginator.new self, @topic_count, per_page_option, params['page']
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC").order(sort_clause).all(
:include => [:author, {:last_reply => :author}],
:limit => @topic_pages.items_per_page,
:offset => @topic_pages.current.offset)
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@topics = @board.topics.
reorder("#{Message.table_name}.sticky DESC").
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
preload(:author, {:last_reply => :author}).
all
@message = Message.new(:board => @board)
render :action => 'show', :layout => !request.xhr?
}
format.atom {
@messages = @board.messages.find :all, :order => 'created_on DESC',
:include => [:author, :board],
:limit => Setting.feeds_limit.to_i
@messages = @board.messages.
reorder('created_on DESC').
includes(:author, :board).
limit(Setting.feeds_limit.to_i).
all
render_feed(@messages, :title => "#{@project}: #{@board}")
}
end
@@ -94,7 +100,7 @@ class BoardsController < ApplicationController
private
def redirect_to_settings_in_projects
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'
redirect_to settings_project_path(@project, :tab => 'boards')
end
def find_board_if_available

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -32,12 +32,12 @@ class CommentsController < ApplicationController
flash[:notice] = l(:label_comment_added)
end
redirect_to :controller => 'news', :action => 'show', :id => @news
redirect_to news_path(@news)
end
def destroy
@news.comments.find(params[:comment_id]).destroy
redirect_to :controller => 'news', :action => 'show', :id => @news
redirect_to news_path(@news)
end
private

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -21,6 +21,7 @@ class ContextMenusController < ApplicationController
def issues
@issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
(render_404; return) unless @issues.present?
if (@issues.size == 1)
@issue = @issues.first
end
@@ -74,6 +75,8 @@ class ContextMenusController < ApplicationController
def time_entries
@time_entries = TimeEntry.all(
:conditions => {:id => params[:ids]}, :include => :project)
(render_404; return) unless @time_entries.present?
@projects = @time_entries.collect(&:project).compact.uniq
@project = @projects.first if @projects.size == 1
@activities = TimeEntryActivity.shared.active

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@ class CustomFieldsController < ApplicationController
before_filter :find_custom_field, :only => [:edit, :update, :destroy]
def index
@custom_fields_by_type = CustomField.find(:all).group_by {|f| f.class.name }
@custom_fields_by_type = CustomField.all.group_by {|f| f.class.name }
@tab = params[:tab] || 'IssueCustomField'
end
@@ -31,10 +31,10 @@ class CustomFieldsController < ApplicationController
end
def create
if request.post? and @custom_field.save
if @custom_field.save
flash[:notice] = l(:notice_successful_create)
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'index', :tab => @custom_field.class.name
redirect_to custom_fields_path(:tab => @custom_field.class.name)
else
render :action => 'new'
end
@@ -44,21 +44,22 @@ class CustomFieldsController < ApplicationController
end
def update
if request.put? and @custom_field.update_attributes(params[:custom_field])
if @custom_field.update_attributes(params[:custom_field])
flash[:notice] = l(:notice_successful_update)
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'index', :tab => @custom_field.class.name
redirect_to custom_fields_path(:tab => @custom_field.class.name)
else
render :action => 'edit'
end
end
def destroy
@custom_field.destroy
redirect_to :action => 'index', :tab => @custom_field.class.name
rescue
flash[:error] = l(:error_can_not_delete_custom_field)
redirect_to :action => 'index'
begin
@custom_field.destroy
rescue
flash[:error] = l(:error_can_not_delete_custom_field)
end
redirect_to custom_fields_path(:tab => @custom_field.class.name)
end
private
@@ -67,6 +68,8 @@ class CustomFieldsController < ApplicationController
@custom_field = CustomField.new_subclass_instance(params[:type], params[:custom_field])
if @custom_field.nil?
render_404
else
@custom_field.default_value = nil
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -27,7 +27,7 @@ class DocumentsController < ApplicationController
def index
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
documents = @project.documents.find :all, :include => [:attachments, :category]
documents = @project.documents.includes(:attachments, :category).all
case @sort_by
when 'date'
@grouped = documents.group_by {|d| d.updated_on.to_date }
@@ -43,7 +43,7 @@ class DocumentsController < ApplicationController
end
def show
@attachments = @document.attachments.find(:all, :order => "created_on DESC")
@attachments = @document.attachments.all
end
def new
@@ -58,7 +58,7 @@ class DocumentsController < ApplicationController
if @document.save
render_attachment_warning_if_needed(@document)
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index', :project_id => @project
redirect_to project_documents_path(@project)
else
render :action => 'new'
end
@@ -71,7 +71,7 @@ class DocumentsController < ApplicationController
@document.safe_attributes = params[:document]
if request.put? and @document.save
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @document
redirect_to document_path(@document)
else
render :action => 'edit'
end
@@ -79,7 +79,7 @@ class DocumentsController < ApplicationController
def destroy
@document.destroy if request.delete?
redirect_to :controller => 'documents', :action => 'index', :project_id => @project
redirect_to project_documents_path(@project)
end
def add_attachment
@@ -89,6 +89,6 @@ class DocumentsController < ApplicationController
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
Mailer.attachments_added(attachments[:files]).deliver
end
redirect_to :action => 'show', :id => @document
redirect_to document_path(@document)
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -46,7 +46,7 @@ class EnumerationsController < ApplicationController
def create
if request.post? && @enumeration.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
redirect_to enumerations_path
else
render :action => 'new'
end
@@ -58,7 +58,7 @@ class EnumerationsController < ApplicationController
def update
if request.put? && @enumeration.update_attributes(params[:enumeration])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
redirect_to enumerations_path
else
render :action => 'edit'
end
@@ -68,12 +68,12 @@ class EnumerationsController < ApplicationController
if !@enumeration.in_use?
# No associated objects
@enumeration.destroy
redirect_to :action => 'index'
redirect_to enumerations_path
return
elsif params[:reassign_to_id]
if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id])
@enumeration.destroy(reassign_to)
redirect_to :action => 'index'
redirect_to enumerations_path
return
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -31,8 +31,8 @@ class FilesController < ApplicationController
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
@containers = [ Project.find(@project.id, :include => :attachments, :order => sort_clause)]
@containers += @project.versions.find(:all, :include => :attachments, :order => sort_clause).sort.reverse
@containers = [ Project.includes(:attachments).reorder(sort_clause).find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder(sort_clause).all.sort.reverse
render :layout => !request.xhr?
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -84,7 +84,7 @@ class GroupsController < ApplicationController
@group.destroy
respond_to do |format|
format.html { redirect_to(groups_url) }
format.html { redirect_to(groups_path) }
format.api { render_api_ok }
end
end
@@ -93,7 +93,7 @@ class GroupsController < ApplicationController
@users = User.find_all_by_id(params[:user_id] || params[:user_ids])
@group.users << @users if request.post?
respond_to do |format|
format.html { redirect_to :controller => 'groups', :action => 'edit', :id => @group, :tab => 'users' }
format.html { redirect_to edit_group_path(@group, :tab => 'users') }
format.js
format.api { render_api_ok }
end
@@ -102,22 +102,23 @@ class GroupsController < ApplicationController
def remove_user
@group.users.delete(User.find(params[:user_id])) if request.delete?
respond_to do |format|
format.html { redirect_to :controller => 'groups', :action => 'edit', :id => @group, :tab => 'users' }
format.html { redirect_to edit_group_path(@group, :tab => 'users') }
format.js
format.api { render_api_ok }
end
end
def autocomplete_for_user
@users = User.active.not_in_group(@group).like(params[:q]).all(:limit => 100)
render :layout => false
respond_to do |format|
format.js
end
end
def edit_membership
@membership = Member.edit_membership(params[:membership_id], params[:membership], @group)
@membership.save if request.post?
respond_to do |format|
format.html { redirect_to :controller => 'groups', :action => 'edit', :id => @group, :tab => 'memberships' }
format.html { redirect_to edit_group_path(@group, :tab => 'memberships') }
format.js
end
end
@@ -125,7 +126,7 @@ class GroupsController < ApplicationController
def destroy_membership
Member.find(params[:membership_id]).destroy if request.post?
respond_to do |format|
format.html { redirect_to :controller => 'groups', :action => 'edit', :id => @group, :tab => 'memberships' }
format.html { redirect_to edit_group_path(@group, :tab => 'memberships') }
format.js
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -26,14 +26,14 @@ class IssueCategoriesController < ApplicationController
def index
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project }
format.html { redirect_to_settings_in_projects }
format.api { @categories = @project.issue_categories.all }
end
end
def show
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project }
format.html { redirect_to_settings_in_projects }
format.api
end
end
@@ -55,7 +55,7 @@ class IssueCategoriesController < ApplicationController
respond_to do |format|
format.html do
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
redirect_to_settings_in_projects
end
format.js
format.api { render :action => 'show', :status => :created, :location => issue_category_path(@category) }
@@ -78,7 +78,7 @@ class IssueCategoriesController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
redirect_to_settings_in_projects
}
format.api { render_api_ok }
end
@@ -99,7 +99,7 @@ class IssueCategoriesController < ApplicationController
end
@category.destroy(reassign_to)
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories' }
format.html { redirect_to_settings_in_projects }
format.api { render_api_ok }
end
return
@@ -107,7 +107,12 @@ class IssueCategoriesController < ApplicationController
@categories = @project.issue_categories - [@category]
end
private
private
def redirect_to_settings_in_projects
redirect_to settings_project_path(@project, :tab => 'categories')
end
# Wrap ApplicationController's find_model_object method to set
# @category instead of just @issue_category
def find_model_object

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -48,9 +48,9 @@ class IssueRelationsController < ApplicationController
saved = @relation.save
respond_to do |format|
format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue }
format.html { redirect_to issue_path(@issue) }
format.js {
@relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
@relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
}
format.api {
if saved
@@ -67,7 +67,7 @@ class IssueRelationsController < ApplicationController
@relation.destroy
respond_to do |format|
format.html { redirect_to issue_path } # TODO : does this really work since @issue is always nil? What is it useful to?
format.html { redirect_to issue_path(@relation.issue_from) }
format.js
format.api { render_api_ok }
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -25,7 +25,7 @@ class IssueStatusesController < ApplicationController
def index
respond_to do |format|
format.html {
@issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position"
@issue_status_pages, @issue_statuses = paginate IssueStatus.sorted, :per_page => 25
render :action => "index", :layout => false if request.xhr?
}
format.api {
@@ -42,7 +42,7 @@ class IssueStatusesController < ApplicationController
@issue_status = IssueStatus.new(params[:issue_status])
if request.post? && @issue_status.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
redirect_to issue_statuses_path
else
render :action => 'new'
end
@@ -56,7 +56,7 @@ class IssueStatusesController < ApplicationController
@issue_status = IssueStatus.find(params[:id])
if request.put? && @issue_status.update_attributes(params[:issue_status])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
redirect_to issue_statuses_path
else
render :action => 'edit'
end
@@ -64,11 +64,11 @@ class IssueStatusesController < ApplicationController
def destroy
IssueStatus.find(params[:id]).destroy
redirect_to :action => 'index'
redirect_to issue_statuses_path
rescue
flash[:error] = l(:error_unable_delete_issue_status)
redirect_to :action => 'index'
end
redirect_to issue_statuses_path
end
def update_issue_done_ratio
if request.post? && IssueStatus.update_issue_done_ratios
@@ -76,6 +76,6 @@ class IssueStatusesController < ApplicationController
else
flash[:error] = l(:error_issue_done_ratios_not_updated)
end
redirect_to :action => 'index'
redirect_to issue_statuses_path
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -21,11 +21,11 @@ class IssuesController < ApplicationController
before_filter :find_issue, :only => [:show, :edit, :update]
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
before_filter :find_project, :only => [:new, :create]
before_filter :find_project, :only => [:new, :create, :update_form]
before_filter :authorize, :except => [:index]
before_filter :find_optional_project, :only => [:index]
before_filter :check_for_default_issue_status, :only => [:new, :create]
before_filter :build_new_issue_from_params, :only => [:new, :create]
before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form]
accept_rss_auth :index, :show
accept_api_auth :index, :show, :create, :update, :destroy
@@ -71,8 +71,8 @@ class IssuesController < ApplicationController
end
@issue_count = @query.issue_count
@issue_pages = Paginator.new self, @issue_count, @limit, params['page']
@offset ||= @issue_pages.current.offset
@issue_pages = Paginator.new @issue_count, @limit, params['page']
@offset ||= @issue_pages.offset
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
:order => sort_clause,
:offset => @offset,
@@ -85,8 +85,8 @@ class IssuesController < ApplicationController
Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
}
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
format.csv { send_data(issues_to_csv(@issues, @project, @query, params), :type => 'text/csv; header=present', :filename => 'export.csv') }
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'export.pdf') }
format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
end
else
respond_to do |format|
@@ -132,7 +132,6 @@ class IssuesController < ApplicationController
def new
respond_to do |format|
format.html { render :action => 'new', :layout => !request.xhr? }
format.js { render :partial => 'update_form' }
end
end
@@ -145,8 +144,12 @@ class IssuesController < ApplicationController
format.html {
render_attachment_warning_if_needed(@issue)
flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
redirect_to(params[:continue] ? { :action => 'new', :project_id => @issue.project, :issue => {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} } :
{ :action => 'show', :id => @issue })
if params[:continue]
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
redirect_to new_project_issue_path(@issue.project, :issue => attrs)
else
redirect_to issue_path(@issue)
end
}
format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
end
@@ -187,7 +190,7 @@ class IssuesController < ApplicationController
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
respond_to do |format|
format.html { redirect_back_or_default({:action => 'show', :id => @issue}) }
format.html { redirect_back_or_default issue_path(@issue) }
format.api { render_api_ok }
end
else
@@ -198,6 +201,11 @@ class IssuesController < ApplicationController
end
end
# Updates the issue form when changing the project, status or tracker
# on issue creation/update
def update_form
end
# Bulk edit/copy a set of issues
def bulk_edit
@issues.sort!
@@ -270,12 +278,12 @@ class IssuesController < ApplicationController
if params[:follow]
if @issues.size == 1 && moved_issues.size == 1
redirect_to :controller => 'issues', :action => 'show', :id => moved_issues.first
redirect_to issue_path(moved_issues.first)
elsif moved_issues.map(&:project).uniq.size == 1
redirect_to :controller => 'issues', :action => 'index', :project_id => moved_issues.map(&:project).first
redirect_to project_issues_path(moved_issues.map(&:project).first)
end
else
redirect_back_or_default({:controller => 'issues', :action => 'index', :project_id => @project})
redirect_back_or_default _project_issues_path(@project)
end
end
@@ -308,7 +316,7 @@ class IssuesController < ApplicationController
end
end
respond_to do |format|
format.html { redirect_back_or_default(:action => 'index', :project_id => @project) }
format.html { redirect_back_or_default _project_issues_path(@project) }
format.api { render_api_ok }
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -80,7 +80,7 @@ class JournalsController < ApplicationController
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
respond_to do |format|
format.html { redirect_to :controller => 'issues', :action => 'show', :id => @journal.journalized_id }
format.html { redirect_to issue_path(@journal.journalized) }
format.js { render :action => 'update' }
end
else

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -26,8 +26,8 @@ class MembersController < ApplicationController
def index
@offset, @limit = api_offset_and_limit
@member_count = @project.member_principals.count
@member_pages = Paginator.new self, @member_count, @limit, params['page']
@offset ||= @member_pages.current.offset
@member_pages = Paginator.new @member_count, @limit, params['page']
@offset ||= @member_pages.offset
@members = @project.member_principals.all(
:order => "#{Member.table_name}.id",
:limit => @limit,
@@ -63,7 +63,7 @@ class MembersController < ApplicationController
end
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
format.html { redirect_to_settings_in_projects }
format.js { @members = members }
format.api {
@member = members.first
@@ -82,7 +82,7 @@ class MembersController < ApplicationController
end
saved = @member.save
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
format.html { redirect_to_settings_in_projects }
format.js
format.api {
if saved
@@ -99,7 +99,7 @@ class MembersController < ApplicationController
@member.destroy
end
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
format.html { redirect_to_settings_in_projects }
format.js
format.api {
if @member.destroyed?
@@ -112,7 +112,14 @@ class MembersController < ApplicationController
end
def autocomplete
@principals = Principal.active.not_member_of(@project).like(params[:q]).all(:limit => 100)
render :layout => false
respond_to do |format|
format.js
end
end
private
def redirect_to_settings_in_projects
redirect_to settings_project_path(@project, :tab => 'members')
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -19,6 +19,7 @@ class MessagesController < ApplicationController
menu_item :boards
default_search_scope :messages
before_filter :find_board, :only => [:new, :preview]
before_filter :find_attachments, :only => [:preview]
before_filter :find_message, :except => [:new, :preview]
before_filter :authorize, :except => [:preview, :edit, :destroy]
@@ -39,11 +40,13 @@ class MessagesController < ApplicationController
end
@reply_count = @topic.children.count
@reply_pages = Paginator.new self, @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children.find(:all, :include => [:author, :attachments, {:board => :project}],
:order => "#{Message.table_name}.created_on ASC",
:limit => @reply_pages.items_per_page,
:offset => @reply_pages.current.offset)
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on ASC").
limit(@reply_pages.per_page).
offset(@reply_pages.offset).
all
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => false if request.xhr?
@@ -115,7 +118,6 @@ class MessagesController < ApplicationController
def preview
message = @board.messages.find_by_id(params[:id])
@attachements = message.attachments if message
@text = (params[:message] || params[:reply])[:content]
@previewed = message
render :partial => 'common/preview'
@@ -123,7 +125,7 @@ class MessagesController < ApplicationController
private
def find_message
find_board
return unless find_board
@message = @board.messages.find(params[:id], :include => :parent)
@topic = @message.root
rescue ActiveRecord::RecordNotFound
@@ -135,5 +137,6 @@ private
@project = @board.project
rescue ActiveRecord::RecordNotFound
render_404
nil
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -59,7 +59,7 @@ class MyController < ApplicationController
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language
flash[:notice] = l(:notice_account_updated)
redirect_to :action => 'account'
redirect_to my_account_path
return
end
end
@@ -69,7 +69,7 @@ class MyController < ApplicationController
def destroy
@user = User.current
unless @user.own_account_deletable?
redirect_to :action => 'account'
redirect_to my_account_path
return
end
@@ -88,7 +88,7 @@ class MyController < ApplicationController
@user = User.current
unless @user.change_password_allowed?
flash[:error] = l(:notice_can_t_change_password)
redirect_to :action => 'account'
redirect_to my_account_path
return
end
if request.post?
@@ -96,7 +96,7 @@ class MyController < ApplicationController
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
if @user.save
flash[:notice] = l(:notice_account_password_updated)
redirect_to :action => 'account'
redirect_to my_account_path
end
else
flash[:error] = l(:notice_account_wrong_password)
@@ -114,7 +114,7 @@ class MyController < ApplicationController
User.current.rss_key
flash[:notice] = l(:notice_feeds_access_key_reseted)
end
redirect_to :action => 'account'
redirect_to my_account_path
end
# Create a new API key
@@ -127,7 +127,7 @@ class MyController < ApplicationController
User.current.api_key
flash[:notice] = l(:notice_api_access_key_reseted)
end
redirect_to :action => 'account'
redirect_to my_account_path
end
# User's page layout configuration
@@ -147,16 +147,17 @@ class MyController < ApplicationController
# params[:block] : id of the block to add
def add_block
block = params[:block].to_s.underscore
(render :nothing => true; return) unless block && (BLOCKS.keys.include? block)
@user = User.current
layout = @user.pref[:my_page_layout] || {}
# remove if already present in a group
%w(top left right).each {|f| (layout[f] ||= []).delete block }
# add it on top
layout['top'].unshift block
@user.pref[:my_page_layout] = layout
@user.pref.save
redirect_to :action => 'page_layout'
if block.present? && BLOCKS.key?(block)
@user = User.current
layout = @user.pref[:my_page_layout] || {}
# remove if already present in a group
%w(top left right).each {|f| (layout[f] ||= []).delete block }
# add it on top
layout['top'].unshift block
@user.pref[:my_page_layout] = layout
@user.pref.save
end
redirect_to my_page_layout_path
end
# Remove a block to user's page
@@ -169,7 +170,7 @@ class MyController < ApplicationController
%w(top left right).each {|f| (layout[f] ||= []).delete block }
@user.pref[:my_page_layout] = layout
@user.pref.save
redirect_to :action => 'page_layout'
redirect_to my_page_layout_path
end
# Change blocks order on user's page

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -40,8 +40,8 @@ class NewsController < ApplicationController
scope = @project ? @project.news.visible : News.visible
@news_count = scope.count
@news_pages = Paginator.new self, @news_count, @limit, params['page']
@offset ||= @news_pages.current.offset
@news_pages = Paginator.new @news_count, @limit, params['page']
@offset ||= @news_pages.offset
@newss = scope.all(:include => [:author, :project],
:order => "#{News.table_name}.created_on DESC",
:offset => @offset,
@@ -73,7 +73,7 @@ class NewsController < ApplicationController
if @news.save
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'news', :action => 'index', :project_id => @project
redirect_to project_news_index_path(@project)
else
render :action => 'new'
end
@@ -88,7 +88,7 @@ class NewsController < ApplicationController
if @news.save
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @news
redirect_to news_path(@news)
else
render :action => 'edit'
end
@@ -96,7 +96,7 @@ class NewsController < ApplicationController
def destroy
@news.destroy
redirect_to :action => 'index', :project_id => @project
redirect_to project_news_index_path(@project)
end
private

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -16,17 +16,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class PreviewsController < ApplicationController
before_filter :find_project
before_filter :find_project, :find_attachments
def issue
@issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
if @issue
@attachements = @issue.attachments
@description = params[:issue] && params[:issue][:description]
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
@description = nil
end
@notes = (params[:issue] ? params[:issue][:notes] : nil)
# params[:notes] is useful for preview of notes in issue history
@notes = params[:notes] || (params[:issue] ? params[:issue][:notes] : nil)
else
@description = (params[:issue] ? params[:issue][:description] : nil)
end
@@ -36,7 +36,6 @@ class PreviewsController < ApplicationController
def news
if params[:id].present? && news = News.visible.find_by_id(params[:id])
@previewed = news
@attachments = news.attachments
end
@text = (params[:news] ? params[:news][:description] : nil)
render :partial => 'common/preview'

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -29,7 +29,7 @@ class ProjectEnumerationsController < ApplicationController
flash[:notice] = l(:notice_successful_update)
end
redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project
redirect_to settings_project_path(@project, :tab => 'activities')
end
def destroy
@@ -37,7 +37,6 @@ class ProjectEnumerationsController < ApplicationController
time_entry_activity.destroy(time_entry_activity.parent)
end
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project
redirect_to settings_project_path(@project, :tab => 'activities')
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -43,6 +43,7 @@ class ProjectsController < ApplicationController
helper :repositories
include RepositoriesHelper
include ProjectsHelper
helper :members
# Lists visible projects
def index
@@ -57,25 +58,24 @@ class ProjectsController < ApplicationController
format.api {
@offset, @limit = api_offset_and_limit
@project_count = Project.visible.count
@projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => 'lft')
@projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
}
format.atom {
projects = Project.visible.find(:all, :order => 'created_on DESC',
:limit => Setting.feeds_limit.to_i)
projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
}
end
end
def new
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
end
def create
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
@@ -91,10 +91,12 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)
redirect_to(params[:continue] ?
{:controller => 'projects', :action => 'new', :project => {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}} :
{:controller => 'projects', :action => 'settings', :id => @project}
)
if params[:continue]
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
redirect_to new_project_path(attrs)
else
redirect_to settings_project_path(@project)
end
}
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
end
@@ -104,15 +106,11 @@ class ProjectsController < ApplicationController
format.api { render_validation_errors(@project) }
end
end
end
def copy
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@root_projects = Project.find(:all,
:conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}",
:order => 'name')
@source_project = Project.find(params[:id])
if request.get?
@project = Project.copy_from(@source_project)
@@ -124,13 +122,13 @@ class ProjectsController < ApplicationController
if validate_parent_id && @project.copy(@source_project, :only => params[:only])
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'projects', :action => 'settings', :id => @project
redirect_to settings_project_path(@project)
elsif !@project.new_record?
# Project was created
# But some objects were not copied due to validation failures
# (eg. issues from disabled trackers)
# TODO: inform about that
redirect_to :controller => 'projects', :action => 'settings', :id => @project
redirect_to settings_project_path(@project)
end
end
end
@@ -138,17 +136,17 @@ class ProjectsController < ApplicationController
# source_project not found
render_404
end
# Show @project
def show
if params[:jump]
# try to redirect to the requested menu item
redirect_to_project_menu_item(@project, params[:jump]) && return
# try to redirect to the requested menu item
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
return
end
@users_by_role = @project.users_by_role
@subprojects = @project.children.visible.all
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
@news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").all
@trackers = @project.rolled_up_trackers
cond = @project.project_condition(Setting.display_subprojects_issues?)
@@ -169,7 +167,7 @@ class ProjectsController < ApplicationController
end
def settings
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_custom_fields = IssueCustomField.sorted.all
@issue_category ||= IssueCategory.new
@member ||= @project.members.new
@trackers = Tracker.sorted.all
@@ -186,7 +184,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'settings', :id => @project
redirect_to settings_project_path(@project)
}
format.api { render_api_ok }
end
@@ -204,7 +202,7 @@ class ProjectsController < ApplicationController
def modules
@project.enabled_module_names = params[:enabled_module_names]
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'settings', :id => @project, :tab => 'modules'
redirect_to settings_project_path(@project, :tab => 'modules')
end
def archive
@@ -213,12 +211,12 @@ class ProjectsController < ApplicationController
flash[:error] = l(:error_can_not_archive_project)
end
end
redirect_to(url_for(:controller => 'admin', :action => 'projects', :status => params[:status]))
redirect_to admin_projects_path(:status => params[:status])
end
def unarchive
@project.unarchive if request.post? && !@project.active?
redirect_to(url_for(:controller => 'admin', :action => 'projects', :status => params[:status]))
redirect_to admin_projects_path(:status => params[:status])
end
def close
@@ -237,7 +235,7 @@ class ProjectsController < ApplicationController
if api_request? || params[:confirm]
@project_to_destroy.destroy
respond_to do |format|
format.html { redirect_to :controller => 'admin', :action => 'projects' }
format.html { redirect_to admin_projects_path }
format.api { render_api_ok }
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -32,35 +32,34 @@ class QueriesController < ApplicationController
@limit = per_page_option
end
@query_count = Query.visible.count
@query_pages = Paginator.new self, @query_count, @limit, params['page']
@queries = Query.visible.all(:limit => @limit, :offset => @offset, :order => "#{Query.table_name}.name")
@query_count = IssueQuery.visible.count
@query_pages = Paginator.new @query_count, @limit, params['page']
@queries = IssueQuery.visible.all(:limit => @limit, :offset => @offset, :order => "#{Query.table_name}.name")
respond_to do |format|
format.html { render :nothing => true }
format.api
end
end
def new
@query = Query.new
@query = IssueQuery.new
@query.user = User.current
@query.project = @project
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
build_query_from_params
@query.build_from_params(params)
end
def create
@query = Query.new(params[:query])
@query = IssueQuery.new(params[:query])
@query.user = User.current
@query.project = params[:query_is_for_all] ? nil : @project
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
build_query_from_params
@query.build_from_params(params)
@query.column_names = nil if params[:default_columns]
if @query.save
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'issues', :action => 'index', :project_id => @project, :query_id => @query
redirect_to _project_issues_path(@project, :query_id => @query)
else
render :action => 'new', :layout => !request.xhr?
end
@@ -73,12 +72,12 @@ class QueriesController < ApplicationController
@query.attributes = params[:query]
@query.project = nil if params[:query_is_for_all]
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
build_query_from_params
@query.build_from_params(params)
@query.column_names = nil if params[:default_columns]
if @query.save
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'issues', :action => 'index', :project_id => @project, :query_id => @query
redirect_to _project_issues_path(@project, :query_id => @query)
else
render :action => 'edit'
end
@@ -86,12 +85,12 @@ class QueriesController < ApplicationController
def destroy
@query.destroy
redirect_to :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1
redirect_to _project_issues_path(@project, :set_filter => 1)
end
private
def find_query
@query = Query.find(params[:id])
@query = IssueQuery.find(params[:id])
@project = @query.project
render_403 unless @query.editable_by?(User.current)
rescue ActiveRecord::RecordNotFound

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -90,6 +90,6 @@ class ReportsController < ApplicationController
private
def find_issue_statuses
@statuses = IssueStatus.find(:all, :order => 'position')
@statuses = IssueStatus.sorted.all
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -138,13 +138,14 @@ class RepositoriesController < ApplicationController
def revisions
@changeset_count = @repository.changesets.count
@changeset_pages = Paginator.new self, @changeset_count,
@changeset_pages = Paginator.new @changeset_count,
per_page_option,
params['page']
@changesets = @repository.changesets.find(:all,
:limit => @changeset_pages.items_per_page,
:offset => @changeset_pages.current.offset,
:include => [:user, :repository, :parents])
@changesets = @repository.changesets.
limit(@changeset_pages.per_page).
offset(@changeset_pages.offset).
includes(:user, :repository, :parents).
all
respond_to do |format|
format.html { render :layout => false if request.xhr? }

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -26,7 +26,7 @@ class RolesController < ApplicationController
def index
respond_to do |format|
format.html {
@role_pages, @roles = paginate :roles, :per_page => 25, :order => 'builtin, position'
@role_pages, @roles = paginate Role.sorted, :per_page => 25
render :action => "index", :layout => false if request.xhr?
}
format.api {
@@ -58,7 +58,7 @@ class RolesController < ApplicationController
@role.workflow_rules.copy(copy_from)
end
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
redirect_to roles_path
else
@roles = Role.sorted.all
render :action => 'new'
@@ -71,7 +71,7 @@ class RolesController < ApplicationController
def update
if request.put? and @role.update_attributes(params[:role])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
redirect_to roles_path
else
render :action => 'edit'
end
@@ -79,10 +79,10 @@ class RolesController < ApplicationController
def destroy
@role.destroy
redirect_to :action => 'index'
redirect_to roles_path
rescue
flash[:error] = l(:error_can_not_remove_role)
redirect_to :action => 'index'
redirect_to roles_path
end
def permissions
@@ -94,7 +94,7 @@ class RolesController < ApplicationController
role.save
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
redirect_to roles_path
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -18,9 +18,6 @@
class SearchController < ApplicationController
before_filter :find_optional_project
helper :messages
include MessagesHelper
def index
@question = params[:q] || ""
@question.strip!
@@ -43,8 +40,8 @@ class SearchController < ApplicationController
begin; offset = params[:offset].to_time if params[:offset]; rescue; end
# quick jump to an issue
if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1.to_i)
redirect_to :controller => "issues", :action => "show", :id => $1
if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
redirect_to issue_path(issue)
return
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -19,6 +19,8 @@ class SettingsController < ApplicationController
layout 'admin'
menu_item :plugins, :only => :plugin
helper :queries
before_filter :require_admin
def index
@@ -36,7 +38,7 @@ class SettingsController < ApplicationController
Setting[name] = value
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'edit', :tab => params[:tab]
redirect_to settings_path(:tab => params[:tab])
else
@options = {}
user_format = User::USER_FORMATS.collect{|key, value| [key, value[:setting_order]]}.sort{|a, b| a[1] <=> b[1]}
@@ -52,10 +54,15 @@ class SettingsController < ApplicationController
def plugin
@plugin = Redmine::Plugin.find(params[:id])
unless @plugin.configurable?
render_404
return
end
if request.post?
Setting.send "plugin_#{@plugin.id}=", params[:settings]
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'plugin', :id => @plugin.id
redirect_to plugin_settings_path(@plugin)
else
@partial = @plugin.settings[:partial]
@settings = Setting.send "plugin_#{@plugin.id}"

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -30,41 +30,34 @@ class TimelogController < ApplicationController
accept_rss_auth :index
accept_api_auth :index, :show, :create, :update, :destroy
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
helper :sort
include SortHelper
helper :issues
include TimelogHelper
helper :custom_fields
include CustomFieldsHelper
helper :queries
include QueriesHelper
def index
sort_init 'spent_on', 'desc'
sort_update 'spent_on' => ['spent_on', "#{TimeEntry.table_name}.created_on"],
'user' => 'user_id',
'activity' => 'activity_id',
'project' => "#{Project.table_name}.name",
'issue' => 'issue_id',
'hours' => 'hours'
@query = TimeEntryQuery.build_from_params(params, :project => @project, :name => '_')
scope = time_entry_scope
retrieve_date_range
scope = TimeEntry.visible.spent_between(@from, @to)
if @issue
scope = scope.on_issue(@issue)
elsif @project
scope = scope.on_project(@project, Setting.display_subprojects_issues?)
end
sort_init(@query.sort_criteria.empty? ? [['spent_on', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns)
respond_to do |format|
format.html {
# Paginate results
@entry_count = scope.count
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
@entries = scope.all(
:include => [:project, :activity, :user, {:issue => :tracker}],
:order => sort_clause,
:limit => @entry_pages.items_per_page,
:offset => @entry_pages.current.offset
:limit => @entry_pages.per_page,
:offset => @entry_pages.offset
)
@total_hours = scope.sum(:hours).to_f
@@ -94,14 +87,16 @@ class TimelogController < ApplicationController
:include => [:project, :activity, :user, {:issue => [:tracker, :assigned_to, :priority]}],
:order => sort_clause
)
send_data(entries_to_csv(@entries), :type => 'text/csv; header=present', :filename => 'timelog.csv')
send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'timelog.csv')
}
end
end
def report
retrieve_date_range
@report = Redmine::Helpers::TimeReport.new(@project, @issue, params[:criteria], params[:columns], @from, @to)
@query = TimeEntryQuery.build_from_params(params, :project => @project, :name => '_')
scope = time_entry_scope
@report = Redmine::Helpers::TimeReport.new(@project, @issue, params[:criteria], params[:columns], scope)
respond_to do |format|
format.html { render :layout => !request.xhr? }
@@ -134,16 +129,24 @@ class TimelogController < ApplicationController
flash[:notice] = l(:notice_successful_create)
if params[:continue]
if params[:project_id]
redirect_to :action => 'new', :project_id => @time_entry.project, :issue_id => @time_entry.issue,
options = {
:time_entry => {:issue_id => @time_entry.issue_id, :activity_id => @time_entry.activity_id},
:back_url => params[:back_url]
}
if @time_entry.issue
redirect_to new_project_issue_time_entry_path(@time_entry.project, @time_entry.issue, options)
else
redirect_to new_project_time_entry_path(@time_entry.project, options)
end
else
redirect_to :action => 'new',
options = {
:time_entry => {:project_id => @time_entry.project_id, :issue_id => @time_entry.issue_id, :activity_id => @time_entry.activity_id},
:back_url => params[:back_url]
}
redirect_to new_time_entry_path(options)
end
else
redirect_back_or_default :action => 'index', :project_id => @time_entry.project
redirect_back_or_default project_time_entries_path(@time_entry.project)
end
}
format.api { render :action => 'show', :status => :created, :location => time_entry_url(@time_entry) }
@@ -169,7 +172,7 @@ class TimelogController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :action => 'index', :project_id => @time_entry.project
redirect_back_or_default project_time_entries_path(@time_entry.project)
}
format.api { render_api_ok }
end
@@ -200,7 +203,7 @@ class TimelogController < ApplicationController
end
end
set_flash_from_bulk_time_entry_save(@time_entries, unsaved_time_entry_ids)
redirect_back_or_default({:controller => 'timelog', :action => 'index', :project_id => @projects.first})
redirect_back_or_default project_time_entries_path(@projects.first)
end
def destroy
@@ -219,7 +222,7 @@ class TimelogController < ApplicationController
else
flash[:error] = l(:notice_unable_delete_time_entry)
end
redirect_back_or_default(:action => 'index', :project_id => @projects.first)
redirect_back_or_default project_time_entries_path(@projects.first)
}
format.api {
if destroyed
@@ -291,51 +294,15 @@ private
end
end
# Retrieves the date range based on predefined ranges or specific from/to param dates
def retrieve_date_range
@free_period = false
@from, @to = nil, nil
if params[:period_type] == '1' || (params[:period_type].nil? && !params[:period].nil?)
case params[:period].to_s
when 'today'
@from = @to = Date.today
when 'yesterday'
@from = @to = Date.today - 1
when 'current_week'
@from = Date.today - (Date.today.cwday - 1)%7
@to = @from + 6
when 'last_week'
@from = Date.today - 7 - (Date.today.cwday - 1)%7
@to = @from + 6
when 'last_2_weeks'
@from = Date.today - 14 - (Date.today.cwday - 1)%7
@to = @from + 13
when '7_days'
@from = Date.today - 7
@to = Date.today
when 'current_month'
@from = Date.civil(Date.today.year, Date.today.month, 1)
@to = (@from >> 1) - 1
when 'last_month'
@from = Date.civil(Date.today.year, Date.today.month, 1) << 1
@to = (@from >> 1) - 1
when '30_days'
@from = Date.today - 30
@to = Date.today
when 'current_year'
@from = Date.civil(Date.today.year, 1, 1)
@to = Date.civil(Date.today.year, 12, 31)
end
elsif params[:period_type] == '2' || (params[:period_type].nil? && (!params[:from].nil? || !params[:to].nil?))
begin; @from = params[:from].to_s.to_date unless params[:from].blank?; rescue; end
begin; @to = params[:to].to_s.to_date unless params[:to].blank?; rescue; end
@free_period = true
else
# default
# Returns the TimeEntry scope for index and report actions
def time_entry_scope
scope = TimeEntry.visible.where(@query.statement)
if @issue
scope = scope.on_issue(@issue)
elsif @project
scope = scope.on_project(@project, Setting.display_subprojects_issues?)
end
@from, @to = @to, @from if @from && @to && @from > @to
scope
end
def parse_params_for_bulk_time_entry_attributes(params)

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -25,7 +25,7 @@ class TrackersController < ApplicationController
def index
respond_to do |format|
format.html {
@tracker_pages, @trackers = paginate :trackers, :per_page => 10, :order => 'position'
@tracker_pages, @trackers = paginate Tracker.sorted, :per_page => 25
render :action => "index", :layout => false if request.xhr?
}
format.api {
@@ -36,19 +36,19 @@ class TrackersController < ApplicationController
def new
@tracker ||= Tracker.new(params[:tracker])
@trackers = Tracker.find :all, :order => 'position'
@projects = Project.find(:all)
@trackers = Tracker.sorted.all
@projects = Project.all
end
def create
@tracker = Tracker.new(params[:tracker])
if request.post? and @tracker.save
if @tracker.save
# workflow copy
if !params[:copy_workflow_from].blank? && (copy_from = Tracker.find_by_id(params[:copy_workflow_from]))
@tracker.workflow_rules.copy(copy_from)
end
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
redirect_to trackers_path
return
end
new
@@ -57,14 +57,14 @@ class TrackersController < ApplicationController
def edit
@tracker ||= Tracker.find(params[:id])
@projects = Project.find(:all)
@projects = Project.all
end
def update
@tracker = Tracker.find(params[:id])
if request.put? and @tracker.update_attributes(params[:tracker])
if @tracker.update_attributes(params[:tracker])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
redirect_to trackers_path
return
end
edit
@@ -78,7 +78,7 @@ class TrackersController < ApplicationController
else
@tracker.destroy
end
redirect_to :action => 'index'
redirect_to trackers_path
end
def fields
@@ -92,7 +92,7 @@ class TrackersController < ApplicationController
end
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'fields'
redirect_to fields_trackers_path
return
end
@trackers = Tracker.sorted.all

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -45,12 +45,9 @@ class UsersController < ApplicationController
scope = scope.in_group(params[:group_id]) if params[:group_id].present?
@user_count = scope.count
@user_pages = Paginator.new self, @user_count, @limit, params['page']
@offset ||= @user_pages.current.offset
@users = scope.find :all,
:order => sort_clause,
:limit => @limit,
:offset => @offset
@user_pages = Paginator.new @user_count, @limit, params['page']
@offset ||= @user_pages.offset
@users = scope.order(sort_clause).limit(@limit).offset(@offset).all
respond_to do |format|
format.html {
@@ -58,7 +55,7 @@ class UsersController < ApplicationController
render :layout => !request.xhr?
}
format.api
end
end
end
def show
@@ -83,7 +80,7 @@ class UsersController < ApplicationController
def new
@user = User.new(:language => Setting.default_language, :mail_notification => Setting.default_notification_option)
@auth_sources = AuthSource.find(:all)
@auth_sources = AuthSource.all
end
def create
@@ -104,15 +101,16 @@ class UsersController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_user_successful_create, :id => view_context.link_to(@user.login, user_path(@user)))
redirect_to(params[:continue] ?
{:controller => 'users', :action => 'new'} :
{:controller => 'users', :action => 'edit', :id => @user}
)
if params[:continue]
redirect_to new_user_path
else
redirect_to edit_user_path(@user)
end
}
format.api { render :action => 'show', :status => :created, :location => user_url(@user) }
end
else
@auth_sources = AuthSource.find(:all)
@auth_sources = AuthSource.all
# Clear password input
@user.password = @user.password_confirmation = nil
@@ -124,7 +122,7 @@ class UsersController < ApplicationController
end
def edit
@auth_sources = AuthSource.find(:all)
@auth_sources = AuthSource.all
@membership ||= Member.new
end
@@ -159,7 +157,7 @@ class UsersController < ApplicationController
format.api { render_api_ok }
end
else
@auth_sources = AuthSource.find(:all)
@auth_sources = AuthSource.all
@membership ||= Member.new
# Clear password input
@user.password = @user.password_confirmation = nil
@@ -174,7 +172,7 @@ class UsersController < ApplicationController
def destroy
@user.destroy
respond_to do |format|
format.html { redirect_back_or_default(users_url) }
format.html { redirect_back_or_default(users_path) }
format.api { render_api_ok }
end
end
@@ -183,7 +181,7 @@ class UsersController < ApplicationController
@membership = Member.edit_membership(params[:membership_id], params[:membership], @user)
@membership.save
respond_to do |format|
format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships' }
format.html { redirect_to edit_user_path(@user, :tab => 'memberships') }
format.js
end
end
@@ -194,7 +192,7 @@ class UsersController < ApplicationController
@membership.destroy
end
respond_to do |format|
format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships' }
format.html { redirect_to edit_user_path(@user, :tab => 'memberships') }
format.js
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -31,7 +31,7 @@ class VersionsController < ApplicationController
def index
respond_to do |format|
format.html {
@trackers = @project.trackers.find(:all, :order => 'position')
@trackers = @project.trackers.sorted.all
retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?})
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id]
@@ -64,9 +64,10 @@ class VersionsController < ApplicationController
def show
respond_to do |format|
format.html {
@issues = @version.fixed_issues.visible.find(:all,
:include => [:status, :tracker, :priority],
:order => "#{Tracker.table_name}.position, #{Issue.table_name}.id")
@issues = @version.fixed_issues.visible.
includes(:status, :tracker, :priority).
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
all
}
format.api
end
@@ -95,7 +96,7 @@ class VersionsController < ApplicationController
respond_to do |format|
format.html do
flash[:notice] = l(:notice_successful_create)
redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_back_or_default settings_project_path(@project, :tab => 'versions')
end
format.js
format.api do
@@ -124,7 +125,7 @@ class VersionsController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_back_or_default settings_project_path(@project, :tab => 'versions')
}
format.api { render_api_ok }
end
@@ -141,21 +142,21 @@ class VersionsController < ApplicationController
if request.put?
@project.close_completed_versions
end
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_to settings_project_path(@project, :tab => 'versions')
end
def destroy
if @version.fixed_issues.empty?
@version.destroy
respond_to do |format|
format.html { redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project }
format.html { redirect_back_or_default settings_project_path(@project, :tab => 'versions') }
format.api { render_api_ok }
end
else
respond_to do |format|
format.html {
flash[:error] = l(:notice_unable_delete_version)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_to settings_project_path(@project, :tab => 'versions')
}
format.api { head :unprocessable_entity }
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -16,35 +16,36 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WatchersController < ApplicationController
before_filter :find_project
before_filter :require_login, :check_project_privacy, :only => [:watch, :unwatch]
before_filter :authorize, :only => [:new, :destroy]
before_filter :require_login, :find_watchables, :only => [:watch, :unwatch]
def watch
if @watched.respond_to?(:visible?) && !@watched.visible?(User.current)
render_403
else
set_watcher(User.current, true)
end
set_watcher(@watchables, User.current, true)
end
def unwatch
set_watcher(User.current, false)
set_watcher(@watchables, User.current, false)
end
before_filter :find_project, :authorize, :only => [:new, :create, :append, :destroy, :autocomplete_for_user]
accept_api_auth :create, :destroy
def new
end
def create
if params[:watcher].is_a?(Hash) && request.post?
user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]]
user_ids.each do |user_id|
Watcher.create(:watchable => @watched, :user_id => user_id)
end
user_ids = []
if params[:watcher].is_a?(Hash)
user_ids << (params[:watcher][:user_ids] || params[:watcher][:user_id])
else
user_ids << params[:user_id]
end
user_ids.flatten.compact.uniq.each do |user_id|
Watcher.create(:watchable => @watched, :user_id => user_id)
end
respond_to do |format|
format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
format.js
format.api { render_api_ok }
end
end
@@ -56,22 +57,24 @@ class WatchersController < ApplicationController
end
def destroy
@watched.set_watcher(User.find(params[:user_id]), false) if request.post?
@watched.set_watcher(User.find(params[:user_id]), false)
respond_to do |format|
format.html { redirect_to :back }
format.js
format.api { render_api_ok }
end
end
def autocomplete_for_user
@users = User.active.like(params[:q]).find(:all, :limit => 100)
@users = User.active.sorted.like(params[:q]).limit(100).all
if @watched
@users -= @watched.watcher_users
end
render :layout => false
end
private
private
def find_project
if params[:object_type] && params[:object_id]
klass = Object.const_get(params[:object_type].camelcase)
@@ -85,11 +88,22 @@ private
render_404
end
def set_watcher(user, watching)
@watched.set_watcher(user, watching)
def find_watchables
klass = Object.const_get(params[:object_type].camelcase) rescue nil
if klass && klass.respond_to?('watched_by')
@watchables = klass.find_all_by_id(Array.wrap(params[:object_id]))
raise Unauthorized if @watchables.any? {|w| w.respond_to?(:visible?) && !w.visible?}
end
render_404 unless @watchables.present?
end
def set_watcher(watchables, user, watching)
watchables.each do |watchable|
watchable.set_watcher(user, watching)
end
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_watcher', :locals => {:user => user, :watched => @watched} }
format.js { render :partial => 'set_watcher', :locals => {:user => user, :watched => watchables} }
end
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -37,6 +37,7 @@ class WikiController < ApplicationController
before_filter :find_existing_or_new_page, :only => [:show, :edit, :update]
before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy, :destroy_version]
accept_api_auth :index, :show, :update, :destroy
before_filter :find_attachments, :only => [:preview]
helper :attachments
include AttachmentsHelper
@@ -159,10 +160,10 @@ class WikiController < ApplicationController
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
respond_to do |format|
format.html { redirect_to :action => 'show', :project_id => @project, :id => @page.title }
format.html { redirect_to project_wiki_page_path(@project, @page.title) }
format.api {
if was_new_page
render :action => 'show', :status => :created, :location => url_for(:controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title)
render :action => 'show', :status => :created, :location => project_wiki_page_path(@project, @page.title)
else
render_api_ok
end
@@ -199,25 +200,26 @@ class WikiController < ApplicationController
@original_title = @page.pretty_title
if request.post? && @page.update_attributes(params[:wiki_page])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :project_id => @project, :id => @page.title
redirect_to project_wiki_page_path(@project, @page.title)
end
end
def protect
@page.update_attribute :protected, params[:protected]
redirect_to :action => 'show', :project_id => @project, :id => @page.title
redirect_to project_wiki_page_path(@project, @page.title)
end
# show page history
def history
@version_count = @page.content.versions.count
@version_pages = Paginator.new self, @version_count, per_page_option, params['page']
@version_pages = Paginator.new @version_count, per_page_option, params['page']
# don't load text
@versions = @page.content.versions.find :all,
:select => "id, author_id, comments, updated_on, version",
:order => 'version DESC',
:limit => @version_pages.items_per_page + 1,
:offset => @version_pages.current.offset
@versions = @page.content.versions.
select("id, author_id, comments, updated_on, version").
reorder('version DESC').
limit(@version_pages.per_page + 1).
offset(@version_pages.offset).
all
render :layout => false if request.xhr?
end
@@ -260,7 +262,7 @@ class WikiController < ApplicationController
end
@page.destroy
respond_to do |format|
format.html { redirect_to :action => 'index', :project_id => @project }
format.html { redirect_to project_wiki_index_path(@project) }
format.api { render_api_ok }
end
end
@@ -270,7 +272,7 @@ class WikiController < ApplicationController
@content = @page.content_for_version(params[:version])
@content.destroy
redirect_to_referer_or :action => 'history', :id => @page.title, :project_id => @project
redirect_to_referer_or history_project_wiki_page_path(@project, @page.title)
end
# Export wiki to a single pdf or html file
@@ -292,7 +294,7 @@ class WikiController < ApplicationController
# page is nil when previewing a new page
return render_403 unless page.nil? || editable?(page)
if page
@attachements = page.attachments
@attachments += page.attachments
@previewed = page.content
end
@text = params[:content][:text]
@@ -349,6 +351,6 @@ private
end
def load_pages_for_index
@pages = @wiki.pages.with_updated_on.order("#{WikiPage.table_name}.title").includes(:wiki => :project).includes(:parent).all
@pages = @wiki.pages.with_updated_on.reorder("#{WikiPage.table_name}.title").includes(:wiki => :project).includes(:parent).all
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -30,7 +30,7 @@ class WikisController < ApplicationController
def destroy
if request.post? && params[:confirm] && @project.wiki
@project.wiki.destroy
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki'
redirect_to settings_project_path(@project, :tab => 'wiki')
end
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -38,7 +38,7 @@ class WorkflowsController < ApplicationController
}
}
if @role.save
redirect_to :action => 'edit', :role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only]
redirect_to workflows_edit_path(:role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only])
return
end
end
@@ -64,7 +64,7 @@ class WorkflowsController < ApplicationController
if request.post? && @role && @tracker
WorkflowPermission.replace_permissions(@tracker, @role, params[:permissions] || {})
redirect_to :action => 'permissions', :role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only]
redirect_to workflows_permissions_path(:role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only])
return
end
@@ -106,12 +106,12 @@ class WorkflowsController < ApplicationController
if request.post?
if params[:source_tracker_id].blank? || params[:source_role_id].blank? || (@source_tracker.nil? && @source_role.nil?)
flash.now[:error] = l(:error_workflow_copy_source)
elsif @target_trackers.nil? || @target_roles.nil?
elsif @target_trackers.blank? || @target_roles.blank?
flash.now[:error] = l(:error_workflow_copy_target)
else
WorkflowRule.copy(@source_tracker, @source_role, @target_trackers, @target_roles)
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'copy', :source_tracker_id => @source_tracker, :source_role_id => @source_role
redirect_to workflows_copy_path(:source_tracker_id => @source_tracker, :source_role_id => @source_role)
end
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -0,0 +1,33 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module ActivitiesHelper
def sort_activity_events(events)
events_by_group = events.group_by(&:event_group)
sorted_events = []
events.sort {|x, y| y.event_datetime <=> x.event_datetime}.each do |event|
if group_events = events_by_group.delete(event.event_group)
group_events.sort {|x, y| y.event_datetime <=> x.event_datetime}.each_with_index do |e, i|
sorted_events << [e, i > 0]
end
end
end
sorted_events
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,6 +24,7 @@ module ApplicationHelper
include Redmine::WikiFormatting::Macros::Definitions
include Redmine::I18n
include GravatarHelper::PublicMethods
include Redmine::Pagination::Helper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
@@ -90,14 +91,10 @@ module ApplicationHelper
# * :download - Force download (default: false)
def link_to_attachment(attachment, options={})
text = options.delete(:text) || attachment.filename
action = options.delete(:download) ? 'download' : 'show'
opt_only_path = {}
opt_only_path[:only_path] = (options[:only_path] == false ? false : true)
options.delete(:only_path)
link_to(h(text),
{:controller => 'attachments', :action => action,
:id => attachment, :filename => attachment.filename}.merge(opt_only_path),
options)
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)
link_to text, url, html_options
end
# Generates a link to a SCM revision
@@ -119,13 +116,11 @@ module ApplicationHelper
# Generates a link to a message
def link_to_message(message, options={}, html_options = nil)
link_to(
h(truncate(message.subject, :length => 60)),
{ :controller => 'messages', :action => 'show',
:board_id => message.board_id,
:id => (message.parent_id || message.id),
truncate(message.subject, :length => 60),
board_message_path(message.board_id, message.parent_id || message.id, {
:r => (message.parent_id && message.id),
:anchor => (message.parent_id ? "message-#{message.id}" : nil)
}.merge(options),
}.merge(options)),
html_options
)
end
@@ -134,16 +129,29 @@ module ApplicationHelper
# Examples:
#
# link_to_project(project) # => link to the specified project overview
# link_to_project(project, :action=>'settings') # => link to project settings
# link_to_project(project, {:only_path => false}, :class => "project") # => 3rd arg adds html options
# link_to_project(project, {}, :class => "project") # => html options with default url (project overview)
#
def link_to_project(project, options={}, html_options = nil)
if project.archived?
h(project)
else
h(project.name)
elsif options.key?(:action)
ActiveSupport::Deprecation.warn "#link_to_project with :action option is deprecated and will be removed in Redmine 3.0."
url = {:controller => 'projects', :action => 'show', :id => project}.merge(options)
link_to(h(project), url, html_options)
link_to project.name, url, html_options
else
link_to project.name, project_path(project, options), html_options
end
end
# Generates a link to a project settings if active
def link_to_project_settings(project, options={}, html_options=nil)
if project.active?
link_to project.name, settings_project_path(project, options), html_options
elsif project.archived?
h(project.name)
else
link_to project.name, project_path(project, options), html_options
end
end
@@ -152,8 +160,8 @@ module ApplicationHelper
end
def thumbnail_tag(attachment)
link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)),
{:controller => 'attachments', :action => 'show', :id => attachment, :filename => attachment.filename},
link_to image_tag(thumbnail_path(attachment)),
named_attachment_path(attachment, attachment.filename),
:title => attachment.filename
end
@@ -187,7 +195,7 @@ module ApplicationHelper
def format_version_name(version)
if version.project == @project
h(version)
h(version)
else
h("#{version.project} - #{version}")
end
@@ -308,8 +316,8 @@ module ApplicationHelper
def principals_check_box_tags(name, principals)
s = ''
principals.sort.each do |principal|
s << "<label>#{ check_box_tag name, principal.id, false } #{h principal}</label>\n"
principals.each do |principal|
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal}</label>\n"
end
s.html_safe
end
@@ -335,7 +343,7 @@ module ApplicationHelper
def options_for_membership_project_select(principal, projects)
options = content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---")
options << project_tree_options_for_select(projects) do |p|
{:disabled => principal.projects.include?(p)}
{:disabled => principal.projects.to_a.include?(p)}
end
options
end
@@ -391,59 +399,6 @@ module ApplicationHelper
str.blank? ? nil : str
end
def pagination_links_full(paginator, count=nil, options={})
page_param = options.delete(:page_param) || :page
per_page_links = options.delete(:per_page_links)
url_param = params.dup
html = ''
if paginator.current.previous
# \xc2\xab(utf-8) = &#171;
html << link_to_content_update(
"\xc2\xab " + l(:label_previous),
url_param.merge(page_param => paginator.current.previous)) + ' '
end
html << (pagination_links_each(paginator, options) do |n|
link_to_content_update(n.to_s, url_param.merge(page_param => n))
end || '')
if paginator.current.next
# \xc2\xbb(utf-8) = &#187;
html << ' ' + link_to_content_update(
(l(:label_next) + " \xc2\xbb"),
url_param.merge(page_param => paginator.current.next))
end
unless count.nil?
html << " (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})"
if per_page_links != false && links = per_page_links(paginator.items_per_page, count)
html << " | #{links}"
end
end
html.html_safe
end
def per_page_links(selected=nil, item_count=nil)
values = Setting.per_page_options_array
if item_count && values.any?
if item_count > values.first
max = values.detect {|value| value >= item_count} || item_count
else
max = item_count
end
values = values.select {|value| value <= max || value == selected}
end
if values.empty? || (values.size == 1 && values.first == selected)
return nil
end
links = values.collect do |n|
n == selected ? n : link_to_content_update(n, params.merge(:per_page => n))
end
l(:label_display_per_page, links.join(', '))
end
def reorder_links(name, url, method = :post)
link_to(image_tag('2uparrow.png', :alt => l(:label_sort_highest)),
url.merge({"#{name}[move_to]" => 'highest'}),
@@ -516,7 +471,11 @@ module ApplicationHelper
end
def accesskey(s)
Redmine::AccessKeys.key_for s
@used_accesskeys ||= []
key = Redmine::AccessKeys.key_for(s)
return nil if @used_accesskeys.include?(key)
@used_accesskeys << key
key
end
# Formats text according to system settings.
@@ -597,14 +556,14 @@ module ApplicationHelper
def parse_inline_attachments(text, project, obj, attr, only_path, options)
# when using an image link, try to use an attachment, if possible
if options[:attachments] || (obj && obj.respond_to?(:attachments))
attachments = options[:attachments] || obj.attachments
attachments = options[:attachments] || []
attachments += obj.attachments if obj.respond_to?(:attachments)
if attachments.present?
text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m|
filename, ext, alt, alttext = $1.downcase, $2, $3, $4
# search for the picture in attachments
if found = Attachment.latest_attach(attachments, filename)
image_url = url_for :only_path => only_path, :controller => 'attachments',
:action => 'download', :id => found
image_url = download_named_attachment_path(found, found.filename, :only_path => only_path)
desc = found.description.to_s.gsub('"', '')
if !desc.blank? && alttext.blank?
alt = " title=\"#{desc}\" alt=\"#{desc}\""
@@ -633,9 +592,9 @@ module ApplicationHelper
esc, all, page, title = $1, $2, $3, $5
if esc.nil?
if page =~ /^([^\:]+)\:(.*)$/
link_project = Project.find_by_identifier($1) || Project.find_by_name($1)
page = $2
title ||= $1 if page.blank?
identifier, page = $1, $2
link_project = Project.find_by_identifier(identifier) || Project.find_by_name(identifier)
title ||= identifier if page.blank?
end
if link_project && link_project.wiki
@@ -703,10 +662,11 @@ module ApplicationHelper
# identifier:document:"Some document"
# identifier:version:1.0.0
# identifier:source:some/file
def parse_redmine_links(text, project, obj, attr, only_path, options)
text.gsub!(%r{([\s\(,\-\[\>]|^)(!)?(([a-z0-9\-_]+):)?(attachment|document|version|forum|news|message|project|commit|source|export)?(((#)|((([a-z0-9\-]+)\|)?(r)))((\d+)((#note)?-(\d+))?)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]][^A-Za-z0-9_/])|,|\s|\]|<|$)}) do |m|
def parse_redmine_links(text, default_project, obj, attr, only_path, options)
text.gsub!(%r{([\s\(,\-\[\>]|^)(!)?(([a-z0-9\-_]+):)?(attachment|document|version|forum|news|message|project|commit|source|export)?(((#)|((([a-z0-9\-_]+)\|)?(r)))((\d+)((#note)?-(\d+))?)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]][^A-Za-z0-9_/])|,|\s|\]|<|$)}) do |m|
leading, esc, project_prefix, project_identifier, prefix, repo_prefix, repo_identifier, sep, identifier, comment_suffix, comment_id = $1, $2, $3, $4, $5, $10, $11, $8 || $12 || $18, $14 || $19, $15, $17
link = nil
project = default_project
if project_identifier
project = Project.visible.find_by_identifier(project_identifier)
end
@@ -792,21 +752,21 @@ module ApplicationHelper
when 'commit', 'source', 'export'
if project
repository = nil
if name =~ %r{^(([a-z0-9\-]+)\|)(.+)$}
if name =~ %r{^(([a-z0-9\-_]+)\|)(.+)$}
repo_prefix, repo_identifier, name = $1, $2, $3
repository = project.repositories.detect {|repo| repo.identifier == repo_identifier}
else
repository = project.repository
end
if prefix == 'commit'
if repository && (changeset = Changeset.visible.find(:first, :conditions => ["repository_id = ? AND scmid LIKE ?", repository.id, "#{name}%"]))
if repository && (changeset = Changeset.visible.where("repository_id = ? AND scmid LIKE ?", repository.id, "#{name}%").first)
link = link_to h("#{project_prefix}#{repo_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :repository_id => repository.identifier_param, :rev => changeset.identifier},
:class => 'changeset',
:title => truncate_single_line(h(changeset.comments), :length => 100)
:title => truncate_single_line(changeset.comments, :length => 100)
end
else
if repository && User.current.allowed_to?(:browse_repository, project)
name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
name =~ %r{^[/\\]*(.*?)(@([^/\\@]+?))?(#(L\d+))?$}
path, rev, anchor = $1, $3, $5
link = link_to h("#{project_prefix}#{prefix}:#{repo_prefix}#{name}"), {:controller => 'repositories', :action => (prefix == 'export' ? 'raw' : 'entry'), :id => project, :repository_id => repository.identifier_param,
:path => to_path_param(path),
@@ -819,12 +779,11 @@ module ApplicationHelper
end
when 'attachment'
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
if attachments && attachment = attachments.detect {|a| a.filename == name }
link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
:class => 'attachment'
if attachments && attachment = Attachment.latest_attach(attachments, name)
link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
end
when 'project'
if p = Project.visible.find(:first, :conditions => ["identifier = :s OR LOWER(name) = :s", {:s => name.downcase}])
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
end
end
@@ -1077,7 +1036,7 @@ module ApplicationHelper
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
), :class => 'progress', :style => "width: #{width};").html_safe +
content_tag('p', legend, :class => 'pourcent').html_safe
content_tag('p', legend, :class => 'percent').html_safe
end
def checked_image(checked=true)
@@ -1121,7 +1080,7 @@ module ApplicationHelper
"var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
path_to_image('/images/calendar.png') +
"', showButtonPanel: true};")
"', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};")
jquery_locale = l('jquery.locale', :default => current_language.to_s)
unless jquery_locale == 'en'
tags << javascript_include_tag("i18n/jquery.ui.datepicker-#{jquery_locale}.js")
@@ -1225,7 +1184,7 @@ module ApplicationHelper
def sanitize_anchor_name(anchor)
if ''.respond_to?(:encoding) || RUBY_PLATFORM == 'java'
anchor.gsub(%r{[^\p{Word}\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
else
# TODO: remove when ruby1.8 is no longer supported
anchor.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
@@ -1234,7 +1193,7 @@ module ApplicationHelper
# Returns the javascript tags that are included in the html layout head
def javascript_heads
tags = javascript_include_tag('jquery-1.7.2-ui-1.8.21-ujs-2.0.3', 'application')
tags = javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application')
unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -36,7 +36,7 @@ module ContextMenusHelper
def bulk_update_custom_field_context_menu_link(field, text, value)
context_menu_link h(text),
{:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'custom_field_values' => {field.id => value}}, :back_url => @back},
bulk_update_issues_path(:ids => @issue_ids, :issue => {'custom_field_values' => {field.id => value}}, :back_url => @back),
:method => :post,
:selected => (@issue && @issue.custom_field_value(field) == value)
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,7 +24,7 @@ module CustomFieldsHelper
end
# Return custom field html tag corresponding to its format
def custom_field_tag(name, custom_value)
def custom_field_tag(name, custom_value)
custom_field = custom_value.custom_field
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_name << "[]" if custom_field.multiple?

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,19 +24,19 @@ module GanttHelper
when :in
if gantt.zoom < 4
link_to_content_update l(:text_zoom_in),
params.merge(gantt.params.merge(:zoom => (gantt.zoom+1))),
params.merge(gantt.params.merge(:zoom => (gantt.zoom + 1))),
:class => 'icon icon-zoom-in'
else
content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in').html_safe
content_tag(:span, l(:text_zoom_in), :class => 'icon icon-zoom-in').html_safe
end
when :out
if gantt.zoom > 1
link_to_content_update l(:text_zoom_out),
params.merge(gantt.params.merge(:zoom => (gantt.zoom-1))),
params.merge(gantt.params.merge(:zoom => (gantt.zoom - 1))),
:class => 'icon icon-zoom-out'
else
content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out').html_safe
content_tag(:span, l(:text_zoom_out), :class => 'icon icon-zoom-out').html_safe
end
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,4 +24,19 @@ module GroupsHelper
{:name => 'memberships', :partial => 'groups/memberships', :label => :label_project_plural}
]
end
def render_principals_for_new_group_users(group)
scope = User.active.sorted.not_in_group(group).like(params[:q])
principal_count = scope.count
principal_pages = Redmine::Pagination::Paginator.new principal_count, 100, params['page']
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
s = content_tag('div', principals_check_box_tags('user_ids[]', principals), :id => 'principals')
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
link_to text, autocomplete_for_user_group_path(group, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
}
s + content_tag('p', links, :class => 'pagination')
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -184,7 +184,7 @@ module IssuesHelper
def sidebar_queries
unless @sidebar_queries
@sidebar_queries = Query.visible.all(
@sidebar_queries = IssueQuery.visible.all(
:order => "#{Query.table_name}.name ASC",
# Project specific queries and global queries
:conditions => (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
@@ -347,10 +347,16 @@ module IssuesHelper
# Find the name of an associated record stored in the field attribute
def find_name_by_reflection(field, id)
unless id.present?
return nil
end
association = Issue.reflect_on_association(field.to_sym)
if association
record = association.class_name.constantize.find_by_id(id)
return record.name if record
if record
record.name.force_encoding('UTF-8') if record.name.respond_to?(:force_encoding)
return record.name
end
end
end
@@ -367,41 +373,4 @@ module IssuesHelper
end
end
end
def issues_to_csv(issues, project, query, options={})
decimal_separator = l(:general_csv_decimal_separator)
encoding = l(:general_csv_encoding)
columns = (options[:columns] == 'all' ? query.available_columns : query.columns)
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } +
(options[:description] ? [Redmine::CodesetUtil.from_utf8(l(:field_description), encoding)] : [])
# csv lines
issues.each do |issue|
col_values = columns.collect do |column|
s = if column.is_a?(QueryCustomFieldColumn)
cv = issue.custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
show_value(cv)
else
value = column.value(issue)
if value.is_a?(Date)
format_date(value)
elsif value.is_a?(Time)
format_time(value)
elsif value.is_a?(Float)
("%.2f" % value).gsub('.', decimal_separator)
else
value
end
end
s.to_s
end
csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) } +
(options[:description] ? [Redmine::CodesetUtil.from_utf8(issue.description, encoding)] : [])
end
end
export
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -18,4 +18,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module MembersHelper
def render_principals_for_new_members(project)
scope = Principal.active.sorted.not_member_of(project).like(params[:q])
principal_count = scope.count
principal_pages = Redmine::Pagination::Paginator.new principal_count, 100, params['page']
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
s = content_tag('div', principals_check_box_tags('membership[user_ids][]', principals), :id => 'principals')
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
}
s + content_tag('p', links, :class => 'pagination')
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -18,4 +18,54 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module MyHelper
def calendar_items(startdt, enddt)
Issue.visible.
where(:project_id => User.current.projects.map(&:id)).
where("(start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)", startdt, enddt, startdt, enddt).
includes(:project, :tracker, :priority, :assigned_to).
all
end
def documents_items
Document.visible.order("#{Document.table_name}.created_on DESC").limit(10).all
end
def issuesassignedtome_items
Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids)).
limit(10).
includes(:status, :project, :tracker, :priority).
order("#{IssuePriority.table_name}.position DESC, #{Issue.table_name}.updated_on DESC").
all
end
def issuesreportedbyme_items
Issue.visible.
where(:author_id => User.current.id).
limit(10).
includes(:status, :project, :tracker).
order("#{Issue.table_name}.updated_on DESC").
all
end
def issueswatched_items
Issue.visible.on_active_project.watched_by(User.current.id).recently_updated.limit(10).all
end
def news_items
News.visible.
where(:project_id => User.current.projects.map(&:id)).
limit(10).
includes(:project, :author).
order("#{News.table_name}.created_on DESC").
all
end
def timelog_items
TimeEntry.
where("#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", User.current.id, Date.today - 6, Date.today).
includes(:activity, :project, {:issue => [:tracker, :status]}).
order("#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC").
all
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,32 +24,56 @@ module QueriesHelper
def filters_options(query)
options = [[]]
sorted_options = query.available_filters.sort do |a, b|
ord = 0
if !(a[1][:order] == 20 && b[1][:order] == 20)
ord = a[1][:order] <=> b[1][:order]
else
cn = (CustomField::CUSTOM_FIELDS_NAMES.index(a[1][:field].class.name) <=>
CustomField::CUSTOM_FIELDS_NAMES.index(b[1][:field].class.name))
if cn != 0
ord = cn
else
f = (a[1][:field] <=> b[1][:field])
if f != 0
ord = f
else
# assigned_to or author
ord = (a[0] <=> b[0])
end
end
end
ord
end
options += sorted_options.map do |field, field_options|
options += query.available_filters.map do |field, field_options|
[field_options[:name], field]
end
end
def query_filters_hidden_tags(query)
tags = ''.html_safe
query.filters.each do |field, options|
tags << hidden_field_tag("f[]", field, :id => nil)
tags << hidden_field_tag("op[#{field}]", options[:operator], :id => nil)
options[:values].each do |value|
tags << hidden_field_tag("v[#{field}][]", value, :id => nil)
end
end
tags
end
def query_columns_hidden_tags(query)
tags = ''.html_safe
query.columns.each do |column|
tags << hidden_field_tag("c[]", column.name, :id => nil)
end
tags
end
def query_hidden_tags(query)
query_filters_hidden_tags(query) + query_columns_hidden_tags(query)
end
def available_block_columns_tags(query)
tags = ''.html_safe
query.available_block_columns.each do |column|
tags << content_tag('label', check_box_tag('c[]', column.name.to_s, query.has_column?(column)) + " #{column.caption}", :class => 'inline')
end
tags
end
def query_available_inline_columns_options(query)
(query.available_inline_columns - query.columns).reject(&:frozen?).collect {|column| [column.caption, column.name]}
end
def query_selected_inline_columns_options(query)
(query.inline_columns & query.available_inline_columns).reject(&:frozen?).collect {|column| [column.caption, column.name]}
end
def render_query_columns_selection(query, options={})
tag_name = (options[:name] || 'c') + '[]'
render :partial => 'queries/columns', :locals => {:query => query, :tag_name => tag_name}
end
def column_header(column)
column.sortable ? sort_header_tag(column.name.to_s, :caption => column.caption,
:default_order => column.default_order) :
@@ -70,6 +94,8 @@ module QueriesHelper
when 'String'
if column.name == :subject
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
elsif column.name == :description
issue.description? ? content_tag('div', textilizable(issue, :description), :class => "wiki") : ''
else
h(value)
end
@@ -77,14 +103,16 @@ module QueriesHelper
format_time(value)
when 'Date'
format_date(value)
when 'Fixnum', 'Float'
if column.name == :done_ratio
when 'Fixnum'
if column.name == :id
link_to value, issue_path(issue)
elsif column.name == :done_ratio
progress_bar(value, :width => '80px')
elsif column.name == :spent_hours
sprintf "%.2f", value
else
h(value.to_s)
value.to_s
end
when 'Float'
sprintf "%.2f", value
when 'User'
link_to_user value
when 'Project'
@@ -96,7 +124,7 @@ module QueriesHelper
when 'FalseClass'
l(:general_text_No)
when 'Issue'
link_to_issue(value, :subject => false)
value.visible? ? link_to_issue(value) : "##{value.id}"
when 'IssueRelation'
other = value.other_issue(issue)
content_tag('span',
@@ -107,26 +135,71 @@ module QueriesHelper
end
end
def csv_content(column, issue)
value = column.value(issue)
if value.is_a?(Array)
value.collect {|v| csv_value(column, issue, v)}.compact.join(', ')
else
csv_value(column, issue, value)
end
end
def csv_value(column, issue, value)
case value.class.name
when 'Time'
format_time(value)
when 'Date'
format_date(value)
when 'Float'
sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator))
when 'IssueRelation'
other = value.other_issue(issue)
l(value.label_for(issue)) + " ##{other.id}"
else
value.to_s
end
end
def query_to_csv(items, query, options={})
encoding = l(:general_csv_encoding)
columns = (options[:columns] == 'all' ? query.available_inline_columns : query.inline_columns)
query.available_block_columns.each do |column|
if options[column.name].present?
columns << column
end
end
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
csv << columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) }
# csv lines
items.each do |item|
csv << columns.collect {|c| Redmine::CodesetUtil.from_utf8(csv_content(c, item), encoding) }
end
end
export
end
# Retrieve query from session or build a new query
def retrieve_query
if !params[:query_id].blank?
cond = "project_id IS NULL"
cond << " OR project_id = #{@project.id}" if @project
@query = Query.find(params[:query_id], :conditions => cond)
@query = IssueQuery.find(params[:query_id], :conditions => cond)
raise ::Unauthorized unless @query.visible?
@query.project = @project
session[:query] = {:id => @query.id, :project_id => @query.project_id}
sort_clear
elsif api_request? || params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)
# Give it a name, required to be valid
@query = Query.new(:name => "_")
@query = IssueQuery.new(:name => "_")
@query.project = @project
build_query_from_params
@query.build_from_params(params)
session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
else
# retrieve from session
@query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
@query ||= Query.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
@query = IssueQuery.find_by_id(session[:query][:id]) if session[:query][:id]
@query ||= IssueQuery.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
@query.project = @project
end
end
@@ -134,10 +207,10 @@ module QueriesHelper
def retrieve_query_from_session
if session[:query]
if session[:query][:id]
@query = Query.find_by_id(session[:query][:id])
@query = IssueQuery.find_by_id(session[:query][:id])
return unless @query
else
@query = Query.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
@query = IssueQuery.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
end
if session[:query].has_key?(:project_id)
@query.project_id = session[:query][:project_id]
@@ -147,17 +220,4 @@ module QueriesHelper
@query
end
end
def build_query_from_params
if params[:fields] || params[:f]
@query.filters = {}
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v])
else
@query.available_filters.keys.each do |field|
@query.add_short_filter(field, params[field]) if params[field]
end
end
@query.group_by = params[:group_by] || (params[:query] && params[:query][:group_by])
@query.column_names = params[:c] || (params[:query] && params[:query][:column_names])
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -35,4 +35,9 @@ module ReportsHelper
a = aggregate data, criteria
a > 0 ? link_to(h(a), *args) : '-'
end
def aggregate_path(project, field, row, options={})
parameters = {:set_filter => 1, :subproject_id => '!*', field => row.id}.merge(options)
project_issues_path(row.is_a?(Project) ? row : project, parameters)
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -43,7 +43,7 @@ module RepositoriesHelper
end
def render_changeset_changes
changes = @changeset.filechanges.find(:all, :limit => 1000, :order => 'path').collect do |change|
changes = @changeset.filechanges.limit(1000).reorder('path').all.collect do |change|
case change.action
when 'A'
# Detects moved/copied files

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -0,0 +1,39 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RoutesHelper
# Returns the path to project issues or to the cross-project
# issue list if project is nil
def _project_issues_path(project, *args)
if project
project_issues_path(project, *args)
else
issues_path(*args)
end
end
def _project_calendar_path(project, *args)
project ? project_calendar_path(project, *args) : issues_calendar_path(*args)
end
def _project_gantt_path(project, *args)
project ? project_gantt_path(project, *args) : issues_gantt_path(*args)
end
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -53,7 +53,7 @@ module SettingsHelper
check_box_tag(
"settings[#{setting}][]",
value,
Setting.send(setting).include?(value),
setting_values.include?(value),
:id => nil
) + text.to_s,
:class => (options[:inline] ? 'inline' : 'block')

View File

@@ -80,12 +80,13 @@ module SortHelper
@criteria.collect {|k,o| k + (o ? '' : ':desc')}.join(',')
end
# Returns an array of SQL fragments used to sort the list
def to_sql
sql = @criteria.collect do |k,o|
if s = @available_criteria[k]
(o ? s.to_a : s.to_a.collect {|c| append_desc(c)}).join(', ')
(o ? s.to_a : s.to_a.collect {|c| append_desc(c)})
end
end.compact.join(', ')
end.flatten.compact
sql.blank? ? nil : sql
end

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -56,10 +56,10 @@ module TimelogHelper
end
def select_hours(data, criteria, value)
if value.to_s.empty?
data.select {|row| row[criteria].blank? }
if value.to_s.empty?
data.select {|row| row[criteria].blank? }
else
data.select {|row| row[criteria].to_s == value.to_s}
data.select {|row| row[criteria].to_s == value.to_s}
end
end
@@ -86,49 +86,6 @@ module TimelogHelper
value)
end
def entries_to_csv(entries)
decimal_separator = l(:general_csv_decimal_separator)
custom_fields = TimeEntryCustomField.find(:all)
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
headers = [l(:field_spent_on),
l(:field_user),
l(:field_activity),
l(:field_project),
l(:field_issue),
l(:field_tracker),
l(:field_subject),
l(:field_hours),
l(:field_comments)
]
# Export custom fields
headers += custom_fields.collect(&:name)
csv << headers.collect {|c| Redmine::CodesetUtil.from_utf8(
c.to_s,
l(:general_csv_encoding) ) }
# csv lines
entries.each do |entry|
fields = [format_date(entry.spent_on),
entry.user,
entry.activity,
entry.project,
(entry.issue ? entry.issue.id : nil),
(entry.issue ? entry.issue.tracker : nil),
(entry.issue ? entry.issue.subject : nil),
entry.hours.to_s.gsub('.', decimal_separator),
entry.comments
]
fields += custom_fields.collect {|f| show_value(entry.custom_field_values.detect {|v| v.custom_field_id == f.id}) }
csv << fields.collect {|c| Redmine::CodesetUtil.from_utf8(
c.to_s,
l(:general_csv_encoding) ) }
end
end
export
end
def format_criteria_value(criteria_options, value)
if value.blank?
"[#{l(:label_none)}]"
@@ -150,14 +107,14 @@ module TimelogHelper
# Column headers
headers = report.criteria.collect {|criteria| l(report.available_criteria[criteria][:label]) }
headers += report.periods
headers << l(:label_total)
headers << l(:label_total_time)
csv << headers.collect {|c| Redmine::CodesetUtil.from_utf8(
c.to_s,
l(:general_csv_encoding) ) }
# Content
report_criteria_to_csv(csv, report.available_criteria, report.columns, report.criteria, report.periods, report.hours)
# Total row
str_total = Redmine::CodesetUtil.from_utf8(l(:label_total), l(:general_csv_encoding))
str_total = Redmine::CodesetUtil.from_utf8(l(:label_total_time), l(:general_csv_encoding))
row = [ str_total ] + [''] * (report.criteria.size - 1)
total = 0
report.periods.each do |period|

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -20,24 +20,31 @@
module WatchersHelper
def watcher_tag(object, user, options={})
content_tag("span", watcher_link(object, user), :class => watcher_css(object))
ActiveSupport::Deprecation.warn "#watcher_tag is deprecated and will be removed in Redmine 3.0. Use #watcher_link instead."
watcher_link(object, user)
end
def watcher_link(object, user)
return '' unless user && user.logged? && object.respond_to?('watched_by?')
watched = object.watched_by?(user)
url = {:controller => 'watchers',
:action => (watched ? 'unwatch' : 'watch'),
:object_type => object.class.to_s.underscore,
:object_id => object.id}
link_to((watched ? l(:button_unwatch) : l(:button_watch)), url,
:remote => true, :method => 'post', :class => (watched ? 'icon icon-fav' : 'icon icon-fav-off'))
def watcher_link(objects, user)
return '' unless user && user.logged?
objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)}
css = [watcher_css(objects), watched ? 'icon icon-fav' : 'icon icon-fav-off'].join(' ')
text = watched ? l(:button_unwatch) : l(:button_watch)
url = watch_path(
:object_type => objects.first.class.to_s.underscore,
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end
# Returns the css class used to identify watch links for a given +object+
def watcher_css(object)
"#{object.class.to_s.underscore}-#{object.id}-watcher"
def watcher_css(objects)
objects = Array.wrap(objects)
id = (objects.size == 1 ? objects.first.id : 'bulk')
"#{objects.first.class.to_s.underscore}-#{id}-watcher"
end
# Returns a comma separated list of users watching the given object
@@ -56,11 +63,11 @@ module WatchersHelper
:user_id => user}
s << ' '
s << link_to(image_tag('delete.png'), url,
:remote => true, :method => 'post', :style => "vertical-align: middle", :class => "delete")
:remote => true, :method => 'delete', :class => "delete")
end
content << content_tag('li', s)
content << content_tag('li', s, :class => "user-#{user.id}")
end
content.present? ? content_tag('ul', content) : content
content.present? ? content_tag('ul', content, :class => 'watchers') : content
end
def watchers_checkboxes(object, users, checked=nil)

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require "digest/md5"
require "fileutils"
class Attachment < ActiveRecord::Base
belongs_to :container, :polymorphic => true
@@ -92,9 +93,6 @@ class Attachment < ActiveRecord::Base
def filename=(arg)
write_attribute :filename, sanitize_filename(arg.to_s)
if new_record? && disk_filename.blank?
self.disk_filename = Attachment.disk_filename(filename)
end
filename
end
@@ -102,7 +100,13 @@ class Attachment < ActiveRecord::Base
# and computes its MD5 hash
def files_to_final_location
if @temp_file && (@temp_file.size > 0)
self.disk_directory = target_directory
self.disk_filename = Attachment.disk_filename(filename, disk_directory)
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)")
path = File.dirname(diskfile)
unless File.directory?(path)
FileUtils.mkdir_p(path)
end
md5 = Digest::MD5.new
File.open(diskfile, "wb") do |f|
if @temp_file.respond_to?(:read)
@@ -134,7 +138,7 @@ class Attachment < ActiveRecord::Base
# Returns file's location on disk
def diskfile
File.join(self.class.storage_path, disk_filename.to_s)
File.join(self.class.storage_path, disk_directory.to_s, disk_filename.to_s)
end
def title
@@ -154,11 +158,19 @@ class Attachment < ActiveRecord::Base
end
def visible?(user=User.current)
container && container.attachments_visible?(user)
if container_id
container && container.attachments_visible?(user)
else
author == user
end
end
def deletable?(user=User.current)
container && container.attachments_deletable?(user)
if container_id
container && container.attachments_deletable?(user)
else
author == user
end
end
def image?
@@ -251,6 +263,26 @@ class Attachment < ActiveRecord::Base
Attachment.where("created_on < ? AND (container_type IS NULL OR container_type = '')", Time.now - age).destroy_all
end
# Moves an existing attachment to its target directory
def move_to_target_directory!
if !new_record? & readable?
src = diskfile
self.disk_directory = target_directory
dest = diskfile
if src != dest && FileUtils.mkdir_p(File.dirname(dest)) && FileUtils.mv(src, dest)
update_column :disk_directory, disk_directory
end
end
end
# Moves existing attachments that are stored at the root of the files
# directory (ie. created before Redmine 2.3) to their target subdirectories
def self.move_from_root_to_target_directory
Attachment.where("disk_directory IS NULL OR disk_directory = ''").find_each do |attachment|
attachment.move_to_target_directory!
end
end
private
# Physically deletes the file from the file system
@@ -268,8 +300,15 @@ class Attachment < ActiveRecord::Base
@filename = just_filename.gsub(/[\/\?\%\*\:\|\"\'<>]+/, '_')
end
# Returns an ASCII or hashed filename
def self.disk_filename(filename)
# Returns the subdirectory in which the attachment will be saved
def target_directory
time = created_on || DateTime.now
time.strftime("%Y/%m")
end
# Returns an ASCII or hashed filename that do not
# exists yet in the given subdirectory
def self.disk_filename(filename, directory=nil)
timestamp = DateTime.now.strftime("%y%m%d%H%M%S")
ascii = ''
if filename =~ %r{^[a-zA-Z0-9_\.\-]*$}
@@ -279,7 +318,7 @@ class Attachment < ActiveRecord::Base
# keep the extension if any
ascii << $1 if filename =~ %r{(\.[a-zA-Z0-9]+)$}
end
while File.exist?(File.join(@@storage_path, "#{timestamp}_#{ascii}"))
while File.exist?(File.join(storage_path, directory.to_s, "#{timestamp}_#{ascii}"))
timestamp.succ!
end
"#{timestamp}_#{ascii}"

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -48,6 +48,24 @@ class AuthSource < ActiveRecord::Base
write_ciphered_attribute(:account_password, arg)
end
def searchable?
false
end
def self.search(q)
results = []
AuthSource.all.each do |source|
begin
if source.searchable?
results += source.search(q)
end
rescue AuthSourceException => e
logger.error "Error while searching users in #{source.name}: #{e.message}"
end
end
results
end
def allow_password_changes?
self.class.allow_password_changes?
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -15,7 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'iconv'
require 'net/ldap'
require 'net/ldap/dn'
require 'timeout'
@@ -64,6 +63,32 @@ class AuthSourceLdap < AuthSource
"LDAP"
end
# Returns true if this source can be searched for users
def searchable?
!account.to_s.include?("$login") && %w(login firstname lastname mail).all? {|a| send("attr_#{a}?")}
end
# Searches the source for users and returns an array of results
def search(q)
q = q.to_s.strip
return [] unless searchable? && q.present?
results = []
search_filter = base_filter & Net::LDAP::Filter.begins(self.attr_login, q)
ldap_con = initialize_ldap_con(self.account, self.account_password)
ldap_con.search(:base => self.base_dn,
:filter => search_filter,
:attributes => ['dn', self.attr_login, self.attr_firstname, self.attr_lastname, self.attr_mail],
:size => 10) do |entry|
attrs = get_user_attributes_from_ldap_entry(entry)
attrs[:login] = AuthSourceLdap.get_attr(entry, self.attr_login)
results << attrs
end
results
rescue Net::LDAP::LdapError => e
raise AuthSourceException.new(e.message)
end
private
def with_timeout(&block)
@@ -84,6 +109,14 @@ class AuthSourceLdap < AuthSource
nil
end
def base_filter
filter = Net::LDAP::Filter.eq("objectClass", "*")
if f = ldap_filter
filter = filter & f
end
filter
end
def validate_filter
if filter.present? && ldap_filter.nil?
errors.add(:filter, :invalid)
@@ -140,14 +173,8 @@ class AuthSourceLdap < AuthSource
else
ldap_con = initialize_ldap_con(self.account, self.account_password)
end
login_filter = Net::LDAP::Filter.eq( self.attr_login, login )
object_filter = Net::LDAP::Filter.eq( "objectClass", "*" )
attrs = {}
search_filter = object_filter & login_filter
if f = ldap_filter
search_filter = search_filter & f
end
search_filter = base_filter & Net::LDAP::Filter.eq(self.attr_login, login)
ldap_con.search( :base => self.base_dn,
:filter => search_filter,

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -30,8 +30,9 @@ class Board < ActiveRecord::Base
validates_length_of :description, :maximum => 255
validate :validate_board
scope :visible, lambda {|*args| { :include => :project,
:conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } }
scope :visible, lambda {|*args|
includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_messages, *args))
}
safe_attributes 'name', 'description', 'parent_id', 'move_to'

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -15,8 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'iconv'
class Changeset < ActiveRecord::Base
belongs_to :repository
belongs_to :user
@@ -49,9 +47,9 @@ class Changeset < ActiveRecord::Base
validates_uniqueness_of :revision, :scope => :repository_id
validates_uniqueness_of :scmid, :scope => :repository_id, :allow_nil => true
scope :visible,
lambda {|*args| { :include => {:repository => :project},
:conditions => Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args) } }
scope :visible, lambda {|*args|
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
}
after_create :scan_for_issues
before_create :before_create_cs

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -29,6 +29,9 @@ class CustomField < ActiveRecord::Base
validate :validate_custom_field
before_validation :set_searchable
after_save :handle_multiplicity_change
scope :sorted, lambda { order("#{table_name}.position ASC") }
CUSTOM_FIELDS_TABS = [
{:name => 'IssueCustomField', :partial => 'custom_fields/index',
@@ -158,12 +161,18 @@ class CustomField < ActiveRecord::Base
possible_values_options = possible_values_options(customized)
if possible_values_options.present?
keyword = keyword.to_s.downcase
possible_values_options.detect {|text, id| text.downcase == keyword}.try(:last)
if v = possible_values_options.detect {|text, id| text.downcase == keyword}
if v.is_a?(Array)
v.last
else
v
end
end
else
keyword
end
end
# Returns a ORDER BY clause that can used to sort customized
# objects by their value of the custom field.
# Returns nil if the custom field can not be used for sorting.
@@ -172,18 +181,12 @@ class CustomField < ActiveRecord::Base
case field_format
when 'string', 'text', 'list', 'date', 'bool'
# COALESCE is here to make sure that blank and NULL values are sorted equally
"COALESCE((SELECT cv_sort.value FROM #{CustomValue.table_name} cv_sort" +
" WHERE cv_sort.customized_type='#{self.class.customized_class.base_class.name}'" +
" AND cv_sort.customized_id=#{self.class.customized_class.table_name}.id" +
" AND cv_sort.custom_field_id=#{id} LIMIT 1), '')"
"COALESCE(#{join_alias}.value, '')"
when 'int', 'float'
# Make the database cast values into numeric
# Postgresql will raise an error if a value can not be casted!
# CustomValue validations should ensure that it doesn't occur
"(SELECT CAST(cv_sort.value AS decimal(60,3)) FROM #{CustomValue.table_name} cv_sort" +
" WHERE cv_sort.customized_type='#{self.class.customized_class.base_class.name}'" +
" AND cv_sort.customized_id=#{self.class.customized_class.table_name}.id" +
" AND cv_sort.custom_field_id=#{id} AND cv_sort.value <> '' AND cv_sort.value IS NOT NULL LIMIT 1)"
"CAST(CASE #{join_alias}.value WHEN '' THEN '0' ELSE #{join_alias}.value END AS decimal(30,3))"
when 'user', 'version'
value_class.fields_for_order_statement(value_join_alias)
else
@@ -193,16 +196,13 @@ class CustomField < ActiveRecord::Base
# Returns a GROUP BY clause that can used to group by custom value
# Returns nil if the custom field can not be used for grouping.
def group_statement
def group_statement
return nil if multiple?
case field_format
when 'list', 'date', 'bool', 'int'
order_statement
when 'user', 'version'
"COALESCE((SELECT cv_sort.value FROM #{CustomValue.table_name} cv_sort" +
" WHERE cv_sort.customized_type='#{self.class.customized_class.base_class.name}'" +
" AND cv_sort.customized_id=#{self.class.customized_class.table_name}.id" +
" AND cv_sort.custom_field_id=#{id} LIMIT 1), '')"
"COALESCE(#{join_alias}.value, '')"
else
nil
end
@@ -221,7 +221,26 @@ class CustomField < ActiveRecord::Base
" AND #{join_alias}_2.customized_id = #{join_alias}.customized_id" +
" AND #{join_alias}_2.custom_field_id = #{join_alias}.custom_field_id)" +
" LEFT OUTER JOIN #{value_class.table_name} #{value_join_alias}" +
" ON CAST(#{join_alias}.value as decimal(60,0)) = #{value_join_alias}.id"
" ON CAST(CASE #{join_alias}.value WHEN '' THEN '0' ELSE #{join_alias}.value END AS decimal(30,0)) = #{value_join_alias}.id"
when 'int', 'float'
"LEFT OUTER JOIN #{CustomValue.table_name} #{join_alias}" +
" ON #{join_alias}.customized_type = '#{self.class.customized_class.base_class.name}'" +
" AND #{join_alias}.customized_id = #{self.class.customized_class.table_name}.id" +
" AND #{join_alias}.custom_field_id = #{id}" +
" AND #{join_alias}.value <> ''" +
" AND #{join_alias}.id = (SELECT max(#{join_alias}_2.id) FROM #{CustomValue.table_name} #{join_alias}_2" +
" WHERE #{join_alias}_2.customized_type = #{join_alias}.customized_type" +
" AND #{join_alias}_2.customized_id = #{join_alias}.customized_id" +
" AND #{join_alias}_2.custom_field_id = #{join_alias}.custom_field_id)"
when 'string', 'text', 'list', 'date', 'bool'
"LEFT OUTER JOIN #{CustomValue.table_name} #{join_alias}" +
" ON #{join_alias}.customized_type = '#{self.class.customized_class.base_class.name}'" +
" AND #{join_alias}.customized_id = #{self.class.customized_class.table_name}.id" +
" AND #{join_alias}.custom_field_id = #{id}" +
" AND #{join_alias}.id = (SELECT max(#{join_alias}_2.id) FROM #{CustomValue.table_name} #{join_alias}_2" +
" WHERE #{join_alias}_2.customized_type = #{join_alias}.customized_type" +
" AND #{join_alias}_2.customized_id = #{join_alias}.customized_id" +
" AND #{join_alias}_2.custom_field_id = #{join_alias}.custom_field_id)"
else
nil
end
@@ -256,7 +275,7 @@ class CustomField < ActiveRecord::Base
# to move in project_custom_field
def self.for_all
find(:all, :conditions => ["is_for_all=?", true], :order => 'position')
where(:is_for_all => true).order('position').all
end
def type_name
@@ -317,4 +336,20 @@ class CustomField < ActiveRecord::Base
end
errs
end
# Removes multiple values for the custom field after setting the multiple attribute to false
# We kepp the value with the highest id for each customized object
def handle_multiplicity_change
if !new_record? && multiple_was && !multiple
ids = custom_values.
where("EXISTS(SELECT 1 FROM #{CustomValue.table_name} cve WHERE cve.custom_field_id = #{CustomValue.table_name}.custom_field_id" +
" AND cve.customized_type = #{CustomValue.table_name}.customized_type AND cve.customized_id = #{CustomValue.table_name}.customized_id" +
" AND cve.id > #{CustomValue.table_name}.id)").
pluck(:id)
if ids.any?
custom_values.where(:id => ids).delete_all
end
end
end
end

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2012 Jean-Philippe Lang
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -19,19 +19,20 @@ class Document < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :project
belongs_to :category, :class_name => "DocumentCategory", :foreign_key => "category_id"
acts_as_attachable :delete_permission => :manage_documents
acts_as_attachable :delete_permission => :delete_documents
acts_as_searchable :columns => ['title', "#{table_name}.description"], :include => :project
acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"},
:author => Proc.new {|o| (a = o.attachments.find(:first, :order => "#{Attachment.table_name}.created_on ASC")) ? a.author : nil },
:author => Proc.new {|o| o.attachments.reorder("#{Attachment.table_name}.created_on ASC").first.try(:author) },
:url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
acts_as_activity_provider :find_options => {:include => :project}
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 60
scope :visible, lambda {|*args| { :include => :project,
:conditions => Project.allowed_to_condition(args.shift || User.current, :view_documents, *args) } }
scope :visible, lambda {|*args|
includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_documents, *args))
}
safe_attributes 'category_id', 'title', 'description'

Some files were not shown because too many files have changed in this diff Show More