Compare commits

..

683 Commits
0.6.2 ... nbc

Author SHA1 Message Date
Nicolas Chuche
8c669eeb80 r18658@gaspard (orig r1900): jplang | 2008-09-22 21:50:10 +0200
Truncate comments on changeset list.
 r18659@gaspard (orig r1901):  jplang | 2008-09-23 19:03:51 +0200
 Fixes html escaping.
 r18660@gaspard (orig r1902):  winterheart | 2008-09-24 16:45:20 +0200
 Patch #1938, update for nl.yml
 r18661@gaspard (orig r1903):  jplang | 2008-09-24 19:30:36 +0200
 Fixes back_url in login filter (#1900).
 r18662@gaspard (orig r1904):  jplang | 2008-09-24 19:32:49 +0200
 Reverts r1903.
 r18663@gaspard (orig r1905):  jplang | 2008-09-24 19:33:02 +0200
 Fixes back_url in login filter (#1900).
 r18667@gaspard (orig r1907):  jplang | 2008-09-25 20:51:03 +0200
 Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled.
 r18669@gaspard (orig r1909):  winterheart | 2008-09-27 21:06:48 +0200
 Fixed #1961, pt-br update
 r18670@gaspard (orig r1910):  jplang | 2008-09-28 09:54:41 +0200
 Fixed: Latest news appear on the homepage for projects with the News module disabled (#1941).
 r18671@gaspard (orig r1911):  jplang | 2008-09-28 10:05:55 +0200
 Fixed: the default status is lost when reordering issue statuses (#1955).
 r18672@gaspard (orig r1912):  jplang | 2008-09-28 10:19:25 +0200
 Wrap 'Assigned to' column on the issue list (#1960).
 r18673@gaspard (orig r1913):  jplang | 2008-09-28 10:41:17 +0200
 Fixed: Status list on bulk edit form does not follow normal sequence (#1956).
 r18674@gaspard (orig r1914):  jplang | 2008-09-28 14:03:17 +0200
 Adds a workflow overview screen.
 Workflow setup moved to a dedicated controller.
 r18675@gaspard (orig r1915):  jplang | 2008-09-28 14:20:47 +0200
 Fixes workflow setup link on trackers list (follows r1914).
 r18676@gaspard (orig r1916):  jplang | 2008-09-28 14:36:30 +0200
 Slight changes to the workflow setup screen.
 r18677@gaspard (orig r1917):  jplang | 2008-09-28 15:10:00 +0200
 Fixes Workflow.count_by_tracker_and_role.
 r18678@gaspard (orig r1918):  edavis10 | 2008-09-30 01:55:11 +0200
 Slight non-code change
 
 r18679@gaspard (orig r1919):  edavis10 | 2008-09-30 01:56:35 +0200
 Reverting slight non-code change
 
 r18680@gaspard (orig r1920):  edavis10 | 2008-09-30 02:02:46 +0200
 Slight non-code change to test git sync
 
 r18681@gaspard (orig r1921):  edavis10 | 2008-09-30 07:18:50 +0200
 Adds :view_layouts_base_body_bottom hook
 
 r18682@gaspard (orig r1922):  edavis10 | 2008-10-02 04:40:29 +0200
 Fixed a failing assertion in test_post_edit_with_attachment_only that would
 occur when running the full test suite but not the functional test suite.
 
 r18683@gaspard (orig r1923):  edavis10 | 2008-10-02 05:23:35 +0200
 Added tests to cover IssueStatus.destroy and IssueStatus.check_integrity
 
 r18684@gaspard (orig r1924):  jplang | 2008-10-04 19:38:31 +0200
 Escape image filename regexp (#1971).
 r18685@gaspard (orig r1925):  winterheart | 2008-10-05 21:30:58 +0200
 #1988, update for ko.yml
 r18686@gaspard (orig r1926):  winterheart | 2008-10-05 22:40:25 +0200
 Patch #1987, ca.yml update, thanks to Joan Duran for file
 r18687@gaspard (orig r1927):  winterheart | 2008-10-06 17:00:56 +0200
 #1992 update pt.yml, thanks to Pedro Araújo
 r18688@gaspard (orig r1928):  winterheart | 2008-10-07 19:41:16 +0200
 Patch #2001, update for Polish language
 r18689@gaspard (orig r1929):  winterheart | 2008-10-11 13:32:30 +0200
 Patch #2005, nl.yml update
 r18690@gaspard (orig r1930):  jplang | 2008-10-12 21:13:36 +0200
 Remove pre tag attributes.
 r18691@gaspard (orig r1931):  nbc | 2008-10-16 00:30:57 +0200
 bugfix to two failed tests
 r18692@gaspard (orig r1932):  nbc | 2008-10-16 01:50:33 +0200
 add plain text option for mail #2029
 r18693@gaspard (orig r1933):  jplang | 2008-10-16 21:13:43 +0200
 Makes email address case-insensitive in MailHandler (#2032).
 r18694@gaspard (orig r1934):  winterheart | 2008-10-16 22:50:50 +0200
 #2036 update for hu.yml
 r18695@gaspard (orig r1935):  winterheart | 2008-10-16 22:51:27 +0200
 Update for ru.yml
 r18696@gaspard (orig r1936):  edavis10 | 2008-10-18 01:30:37 +0200
 Added a plugin hook :routes that plugins can use to add and even override routes
 
 r18697@gaspard (orig r1937):  winterheart | 2008-10-18 12:03:50 +0200
 #2043, #2044, #2046, translation updates
 r18698@gaspard (orig r1938):  jplang | 2008-10-18 12:07:49 +0200
 Adds 'Delete wiki pages attachments' permission.
 r18699@gaspard (orig r1939):  jplang | 2008-10-18 12:18:21 +0200
 Show the most recent file when displaying an inline image.
 r18700@gaspard (orig r1940):  jplang | 2008-10-18 12:42:29 +0200
 link_to project homepage instead of auto_link (#1937).
 r18701@gaspard (orig r1941):  jplang | 2008-10-18 13:25:27 +0200
 Fixed: textile footnotes no longer work after r1113 (#974).
 r18702@gaspard (orig r1942):  winterheart | 2008-10-23 17:24:16 +0200
 #1928 it.yml update
 r18703@gaspard (orig r1943):  jplang | 2008-10-24 17:24:35 +0200
 Makes permission screens localized (#2070).
 r18704@gaspard (orig r1944):  jplang | 2008-10-24 17:39:40 +0200
 AuthSource list: display associated users count and disable 'Delete' buton if any (#2041).
 r18705@gaspard (orig r1945):  jplang | 2008-10-24 18:59:15 +0200
 Adds the ability to search for a user on the administration users list.
 r18706@gaspard (orig r1946):  jplang | 2008-10-24 19:01:42 +0200
 Adds functional test for user search.
 r18707@gaspard (orig r1947):  jplang | 2008-10-24 19:12:39 +0200
 Adds the ability to search for a project name or identifier on the administration projects list.
 r18708@gaspard (orig r1948):  edavis10 | 2008-10-25 06:21:57 +0200
 Added hook :view_repositories_show_contextual to allow adding items to the
 repository's contextual menu.
 
   #2073
 
 r18709@gaspard (orig r1949):  edavis10 | 2008-10-25 06:37:31 +0200
 Renamed the .rb files in the plugin_generator to end in .erb.  The .rb was
 causing rdoc to try to document them and fail.
 
 * Updated the generator's manifest to use the new files
 * Renamed template README to README.rdoc
 
   #2011
 
 r18710@gaspard (orig r1950):  edavis10 | 2008-10-25 06:46:21 +0200
 Added the board's description below the board's name.
 
 Thanks to Go MAEDA for the patch.  #2079
 
 r18711@gaspard (orig r1951):  jplang | 2008-10-25 11:35:51 +0200
 Renames template ruby files to erb.
 r18712@gaspard (orig r1952):  jplang | 2008-10-25 11:55:31 +0200
 Adds #delete_menu_item to the plugin API (#2087).
 r18713@gaspard (orig r1953):  jplang | 2008-10-25 12:23:29 +0200
 Check that git changeset is not in the database before creating it (#1419).
 r18714@gaspard (orig r1954):  jplang | 2008-10-26 16:17:26 +0100
 Slight change to english string (#2088).
 r18715@gaspard (orig r1955):  jplang | 2008-10-27 12:08:29 +0100
 Makes wiki text formatter pluggable.
 Original patch #2025 by Yuki Sonoda slightly edited.
 r18716@gaspard (orig r1956):  jplang | 2008-10-27 12:50:23 +0100
 Adds back textile acronyms support (#2077).
 r18717@gaspard (orig r1957):  jplang | 2008-10-27 13:34:01 +0100
 Makes GLoc language global.
 r18718@gaspard (orig r1958):  jplang | 2008-10-28 11:43:34 +0100
 Fixed: Inline images don't work if file name has upper case letters or if image is in BMP format (#2102).
 r18719@gaspard (orig r1959):  winterheart | 2008-10-28 17:08:19 +0100
 #2080, #2097, #2100 - ja, zh-tw, zh updates
 r18720@gaspard (orig r1960):  edavis10 | 2008-10-28 21:29:38 +0100
 Added :view_timelog_edit_form_bottom hook to the timelog/edit form.
 
 r18721@gaspard (orig r1961):  winterheart | 2008-10-29 00:31:14 +0100
 Update for ru.yml
 
 r18722@gaspard (orig r1962):  edavis10 | 2008-10-30 03:58:04 +0100
 Gravatar support for issue detai, user grid, and activity stream
 
 r18723@gaspard (orig r1963):  edavis10 | 2008-10-30 03:58:10 +0100
 styling tweaks for gravatars
 
 r18724@gaspard (orig r1964):  edavis10 | 2008-10-30 03:58:16 +0100
 styling tweaks for gravatars
 
 r18725@gaspard (orig r1965):  edavis10 | 2008-10-30 03:58:23 +0100
 Reduced the size of the gravatar on the issue history
 
 r18726@gaspard (orig r1966):  edavis10 | 2008-10-30 03:58:28 +0100
 Fixed a bug with using gravatar on a nil value.
 
 r18727@gaspard (orig r1967):  edavis10 | 2008-10-30 03:58:34 +0100
 Added gravatar image to the user's public account page
 
 r18728@gaspard (orig r1968):  edavis10 | 2008-10-30 04:29:30 +0100
 Fixed typo in an English string, 'View calender'
 
 r18729@gaspard (orig r1969):  edavis10 | 2008-10-30 04:49:04 +0100
 Link the version name to VersionsController#show in the issue list.
 
 r18730@gaspard (orig r1970):  edavis10 | 2008-10-31 01:09:36 +0100
 Tweaking of the CSS for the gravatars. #1776
 
 r18731@gaspard (orig r1971):  edavis10 | 2008-10-31 01:19:48 +0100
 Tighened up the gravator CSS in the issue div
 
 r18732@gaspard (orig r1972):  edavis10 | 2008-10-31 01:41:28 +0100
 Added an option to turn user Gravatars on or off
 
 * Option can be found in Administration > General, called
   "Use Gravatar user icons"
 * Defaulting Gravatars to off
 * Added a helper gravatar_for_mail to check the setting before rendering
   the Gravatar.
 
   #1776
 
 r18733@gaspard (orig r1973):  winterheart | 2008-10-31 15:38:09 +0100
 Populating new string with rake gloc:update
 r18734@gaspard (orig r1974):  winterheart | 2008-10-31 15:48:07 +0100
 Update pt-rb, #2105
 r18735@gaspard (orig r1975):  winterheart | 2008-10-31 15:49:33 +0100
 Update zh-tw, #2116
 r18736@gaspard (orig r1976):  winterheart | 2008-10-31 15:58:05 +0100
 update ru.yml
 r18737@gaspard (orig r1977):  winterheart | 2008-11-01 17:42:49 +0100
 #2121, pt-br update
 r18738@gaspard (orig r1978):  edavis10 | 2008-11-04 19:27:13 +0100
 Added :view_projects_form plugin hook
 
 r18739@gaspard (orig r1979):  edavis10 | 2008-11-06 06:37:29 +0100
 Included Redmine::Hook::Helper to ActionController::Base so call_hook
 is available in all controllers. #2111
 
 r18740@gaspard (orig r1980):  winterheart | 2008-11-07 11:41:10 +0100
 #2127, #2129, #2130, #2135, translation updates. Thanks to all participants :)
 r18741@gaspard (orig r1981):  winterheart | 2008-11-07 11:53:09 +0100
 Intial support Vietnamese language (#2125), thanks to Kỳ Anh Huỳnh for work
 r18742@gaspard (orig r1982):  winterheart | 2008-11-07 12:07:25 +0100
 Ooops, wrong.
 r18743@gaspard (orig r1983):  winterheart | 2008-11-07 12:12:12 +0100
 Intial support Vietnamese language (#2125), thanks to Kỳ Anh Huỳnh for work (now - really)
 r18744@gaspard (orig r1984):  winterheart | 2008-11-07 12:20:25 +0100
 refreshing vn.yml (#2125)
 r18745@gaspard (orig r1985):  winterheart | 2008-11-07 12:22:26 +0100
 D'oh...
 
 r18746@gaspard (orig r1986):  winterheart | 2008-11-07 12:28:29 +0100
 Update for pl.yml, #1299
 
 r18747@gaspard (orig r1987):  jplang | 2008-11-07 14:08:01 +0100
 French translation update.
 r18748@gaspard (orig r1988):  jplang | 2008-11-07 15:35:18 +0100
 Email address should be lowercased for gravatar (#2145).
 r18749@gaspard (orig r1989):  jplang | 2008-11-07 16:37:17 +0100
 Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122).
 r18750@gaspard (orig r1990):  jplang | 2008-11-07 18:27:56 +0100
 Fixed: broken subject when submitting issue via email written in japanese (Patch #2059 by Go MAEDA).
 r18751@gaspard (orig r1991):  edavis10 | 2008-11-08 01:12:43 +0100
 Removing the custom Redmine hook in routes in favor of Engine's hook.
 
 * Plugins' routes.rb are now added automatically to Redmine's routing,
   including the ability to override Redmine's default routing.
 
   Thank you to Jean-Baptiste Barth for the suggestion.  #2142
 
 r18752@gaspard (orig r1992):  jplang | 2008-11-08 14:25:45 +0100
 Do not use @:skip_relative_url_root@ to generate urls in Mailer (#2122).
 r18753@gaspard (orig r1993):  jplang | 2008-11-08 16:18:02 +0100
 Fixes syntax highlighting broken by r1930 (#2143).
 r18754@gaspard (orig r1994):  jplang | 2008-11-08 16:28:00 +0100
 Fixed Bazaar shared repository browsing (#2101, patch #1685 by Dmitry Shaposhnik).
 r18755@gaspard (orig r1995):  jplang | 2008-11-08 16:50:51 +0100
 Tells git to output dates in ISO format.
 Fixes: Git Adapter date parsing ignores timezone (#2149).
 r18756@gaspard (orig r1996):  jplang | 2008-11-08 18:15:18 +0100
 git path reverted.
 r18757@gaspard (orig r1997):  winterheart | 2008-11-08 23:34:41 +0100
 #2126, initial support of Slovak, thank to Stanislav Pach for translation
 r18758@gaspard (orig r1998):  winterheart | 2008-11-09 01:29:20 +0100
 populating new string, updates for ru.yml and sv.yml (#2126)
 r18759@gaspard (orig r1999):  jplang | 2008-11-09 13:07:35 +0100
 Git adapter: use commit time instead of author time (#2108).
 r18760@gaspard (orig r2000):  jplang | 2008-11-09 15:52:16 +0100
 Changes ApplicationHelper#gravatar_for_mail to #avatar that takes a User or a String (less code in views).
 r18761@gaspard (orig r2001):  jplang | 2008-11-09 18:53:30 +0100
 Fixes activity date param.
 r18762@gaspard (orig r2002):  jplang | 2008-11-09 18:56:20 +0100
 Link to activity view when displaying dates.
 r18763@gaspard (orig r2003):  jplang | 2008-11-09 21:39:49 +0100
 Hide Redmine version in atom feeds and pdf properties (#794).
 r18764@gaspard (orig r2004):  jplang | 2008-11-10 12:33:04 +0100
 Fixed: non-ASCII subversion path can't be displayed (patch #1993 by Chaoqun Zou).
 r18765@gaspard (orig r2005):  jplang | 2008-11-10 13:23:54 +0100
 Include GLoc in hook listener base class (#2112).
 r18766@gaspard (orig r2006):  jplang | 2008-11-10 19:59:06 +0100
 Maps repository users to Redmine users (#1383).
 Users with same username or email are automatically mapped. Mapping can be manually adjusted in repository settings. Multiple usernames can be mapped to the same Redmine user.
 r18767@gaspard (orig r2007):  jplang | 2008-11-10 20:09:00 +0100
 Eager-load users.
 r18768@gaspard (orig r2008):  jplang | 2008-11-11 13:07:03 +0100
 Fixes a typo in en.yml.
 r18769@gaspard (orig r2009):  jplang | 2008-11-11 13:50:11 +0100
 Eager-load users.
 r18770@gaspard (orig r2010):  jplang | 2008-11-11 13:59:28 +0100
 Sort users by their display names so that user dropdown lists are sorted alphabetically (#2015).
 r18771@gaspard (orig r2011):  jplang | 2008-11-11 14:22:05 +0100
 Trac importer improvements (patch #2050 by Karl Heinz Marbaise).
 r18772@gaspard (orig r2012):  jplang | 2008-11-11 14:28:13 +0100
 Fixed: Trac migration of ticket:123 or [ticket:34] do not work (#2053).
 r18773@gaspard (orig r2013):  jplang | 2008-11-11 14:28:48 +0100
 Fixed: Trac migration of ticket:123 or [ticket:34] do not work (#2053).
 r18774@gaspard (orig r2014):  jplang | 2008-11-11 14:32:22 +0100
 Fixed: Trac milestone links not correctly converted (#2052).
 r18775@gaspard (orig r2015):  jplang | 2008-11-11 14:37:10 +0100
 Documents Wiki page anchors (#1647).
 r18776@gaspard (orig r2016):  jplang | 2008-11-11 14:49:07 +0100
 Updated pt-br and zh-tw lang files.
 r18777@gaspard (orig r2017):  jplang | 2008-11-11 14:54:10 +0100
 Changes ruby bang path to #!/usr/bin/env ruby (#1876).
 r18778@gaspard (orig r2018):  jplang | 2008-11-11 15:24:06 +0100
 Turn ftps and sftp proto into links (#1514).
 r18779@gaspard (orig r2019):  jplang | 2008-11-11 16:07:55 +0100
 Adds permissions to let users edit and/or delete their messages (#854, patch by Markus Knittig with slight changes).
 r18780@gaspard (orig r2020):  jplang | 2008-11-11 17:26:05 +0100
 Less agressive Redcloth lang attribute parsing (#2091).
 r18781@gaspard (orig r2021):  jplang | 2008-11-11 17:49:20 +0100
 Hungarian language file updated.
 r18782@gaspard (orig r2022):  jplang | 2008-11-11 19:10:21 +0100
 Pluggable admin menu (patch #2031 by Yuki Sonoda with slight changes).
 r18783@gaspard (orig r2023):  winterheart | 2008-11-12 16:13:49 +0100
 update for pt-br (#2164)
 r18784@gaspard (orig r2024):  winterheart | 2008-11-12 16:17:47 +0100
 update for zh (#2151)
 r18785@gaspard (orig r2025):  winterheart | 2008-11-12 16:18:55 +0100
 Populating new strings for zh.yml
 r18786@gaspard (orig r2026):  winterheart | 2008-11-12 16:22:57 +0100
 New file for sk (#2126)
 r18787@gaspard (orig r2027):  winterheart | 2008-11-12 16:23:52 +0100
 Populating new strings for sk.yml
 r18788@gaspard (orig r2028):  winterheart | 2008-11-12 16:34:11 +0100
 update for ru
 r18789@gaspard (orig r2029):  edavis10 | 2008-11-13 02:07:58 +0100
 Changed the CSS clear on journals so they will wrap around the revisions. #2165
 
 r18790@gaspard (orig r2030):  jplang | 2008-11-13 17:39:50 +0100
 Fixes #2171: issue pdf export broken by r2006.
 r18791@gaspard (orig r2031):  jplang | 2008-11-13 17:43:39 +0100
 Fixes #2170: user display format in application settings broken by r2010.
 r18792@gaspard (orig r2032):  winterheart | 2008-11-14 16:00:23 +0100
 Missed %s in label, thank Martin Bächtold for reporting (#2186)
 r18793@gaspard (orig r2033):  winterheart | 2008-11-14 16:18:13 +0100
 Translation updates (#2168, #2172, #2176, #2178)
 r18794@gaspard (orig r2034):  winterheart | 2008-11-14 16:33:27 +0100
 Polish update, #2188
 r18795@gaspard (orig r2035):  winterheart | 2008-11-15 09:35:17 +0100
 Translation updates (#2189, #2193)
 r18796@gaspard (orig r2036):  jplang | 2008-11-16 12:49:37 +0100
 Changes version naming rule (#2162).
 r18797@gaspard (orig r2037):  jplang | 2008-11-16 12:58:41 +0100
 Moves plugin list to its own administration menu item.
 r18798@gaspard (orig r2038):  jplang | 2008-11-16 16:22:48 +0100
 Adds plugin id attribute.
 r18799@gaspard (orig r2039):  jplang | 2008-11-16 16:38:37 +0100
 Adds .find and .all Plugin class methods.
 r18800@gaspard (orig r2040):  jplang | 2008-11-16 17:08:25 +0100
 Adds a few Plugin tests.
 r18801@gaspard (orig r2041):  jplang | 2008-11-16 18:12:02 +0100
 Adds url and author_url plugin attributes (#2162).
 r18802@gaspard (orig r2042):  jplang | 2008-11-16 21:00:20 +0100
 Adds Plugin#requires_redmine method so that plugin compatibility can be checked against current Redmine version (#2162).
 r18803@gaspard (orig r2043):  jplang | 2008-11-17 18:27:08 +0100
 Do not query multiple times git for branch (#1435).
 r18804@gaspard (orig r2044):  jplang | 2008-11-18 18:22:28 +0100
 Vietnamese language updated (#2125).
 r18805@gaspard (orig r2045):  jplang | 2008-11-18 19:36:47 +0100
 SubversionAdapter#entries performance improvement.
 r18806@gaspard (orig r2046):  jplang | 2008-11-18 22:11:25 +0100
 Fixed: Printing long roadmap doesn't split across pages (#2203).
 r18807@gaspard (orig r2047):  winterheart | 2008-11-19 16:52:09 +0100
 Typo in sv, #2213
 r18808@gaspard (orig r2048):  jplang | 2008-11-19 20:38:19 +0100
 Remove eclipse files
 r18811@gaspard (orig r2051):  winterheart | 2008-11-21 17:35:00 +0100
 fix for Polish, #2215
 r18812@gaspard (orig r2052):  winterheart | 2008-11-21 17:40:11 +0100
 removing BOM, sorting, #2169
 r18813@gaspard (orig r2053):  jplang | 2008-11-22 12:44:07 +0100
 Extends child_pages macro to display child pages based on page parameter (#1975).
 It can also be called from anywhere now (not only from wiki pages).
 r18814@gaspard (orig r2054):  jplang | 2008-11-23 17:40:35 +0100
 Fixed date filters accuracy with SQLite (#2221).
 r18815@gaspard (orig r2055):  jplang | 2008-11-25 18:37:41 +0100
 Slight tests fixes.
 r18816@gaspard (orig r2056):  jplang | 2008-11-25 20:33:41 +0100
 Do not request blank LDAP attributes.
 r18817@gaspard (orig r2057):  winterheart | 2008-11-26 18:32:56 +0100
 rake gloc:update, update for Serbian (#2232)
 r18819@gaspard (orig r2059):  jplang | 2008-11-27 19:04:48 +0100
 Adds a css class on menu items in order to apply item specific styles (eg. icons).
 r18820@gaspard (orig r2060):  jplang | 2008-11-27 19:41:40 +0100
 Typo in lang files (#2241).
 r18821@gaspard (orig r2061):  jplang | 2008-11-27 19:43:18 +0100
 Typo in gloc:update task description (#2243).
 r18822@gaspard (orig r2062):  jplang | 2008-11-27 21:15:45 +0100
 Fixed: inappropriate redirection to login or register page may occur (#2206). Eg. user clicks login link twice before logging in.
 r18823@gaspard (orig r2063):  winterheart | 2008-11-28 16:44:59 +0100
 Italian update (#2239)
 r18826@gaspard (orig r2066):  jplang | 2008-11-30 12:18:22 +0100
 Display latest user's activity on account/show view.
 r18827@gaspard (orig r2067):  jplang | 2008-11-30 13:12:06 +0100
 Makes activity view accept a user_id param to show user's activity (#1002).
 r18828@gaspard (orig r2068):  jplang | 2008-11-30 13:14:12 +0100
 Fixes activity atom link params (when not on first page).
 r18829@gaspard (orig r2069):  jplang | 2008-11-30 13:18:59 +0100
 Adds atom feed on user's account page.
 r18830@gaspard (orig r2070):  jplang | 2008-11-30 14:38:07 +0100
 Adds links between account and user's activity pages.
 r18831@gaspard (orig r2071):  jplang | 2008-11-30 14:42:15 +0100
 Slight changes to profile on account page and last connexion date added.
 r18832@gaspard (orig r2072):  jplang | 2008-11-30 15:23:57 +0100
 Obfuscates email address on user's account page using javascript.
 r18833@gaspard (orig r2073):  jplang | 2008-11-30 15:31:01 +0100
 Adds link to user's account on issue history.
 r18834@gaspard (orig r2074):  jplang | 2008-11-30 15:55:45 +0100
 Mail handler: check workflow for status set/change.
 r18835@gaspard (orig r2075):  jplang | 2008-11-30 15:57:46 +0100
 Adds status option to email integration rake tasks.
 r18836@gaspard (orig r2076):  jplang | 2008-11-30 16:51:44 +0100
 Adds --status option to rdm-mailhandler.
 r18837@gaspard (orig r2077):  jplang | 2008-11-30 17:00:45 +0100
 Adds To and Cc as watchers when submitting an issue by email (#2245).
 Only works if the sender has the 'Add issue watchers' permission.
 r18838@gaspard (orig r2078):  jplang | 2008-11-30 17:34:39 +0100
 Changes Portuguese decimal separator (#1372).
 r18839@gaspard (orig r2079):  jplang | 2008-11-30 17:57:56 +0100
 Replaces User.find_active with a named scope.
 r18840@gaspard (orig r2080):  winterheart | 2008-12-01 17:00:54 +0100
 Translation updates (#2249, #2250, #2252, #2254)
 r18841@gaspard (orig r2081):  winterheart | 2008-12-01 17:11:05 +0100
 ru.yml update
 r18842@gaspard (orig r2082):  jplang | 2008-12-01 18:27:44 +0100
 Fixed: 404 when "Apply" clicked on activity page (#2251).
 r18843@gaspard (orig r2083):  jplang | 2008-12-02 18:16:06 +0100
 Fixed: activity broken by r2066 with postgresql (#2266).
 r18844@gaspard (orig r2084):  jplang | 2008-12-02 18:29:52 +0100
 Use style attribute for setting width of table cells in progress bars (#2267).
 r18845@gaspard (orig r2085):  jplang | 2008-12-02 18:57:13 +0100
 Fixed: wrong digest for text files under Windows (#2264).
 r18846@gaspard (orig r2086):  edavis10 | 2008-12-04 00:18:07 +0100
 Added :controller_issues_edit_before_save hook
 
 r18847@gaspard (orig r2087):  edavis10 | 2008-12-04 00:18:12 +0100
 Added :view_issues_edit_notes_bottom hook
 
 r18848@gaspard (orig r2088):  jplang | 2008-12-05 16:41:32 +0100
 Cross-project gantt and calendar (#1157).
 r18849@gaspard (orig r2089):  edavis10 | 2008-12-05 22:03:55 +0100
 Added :view_issues_history_journal_bottom hook
 
 r18850@gaspard (orig r2090):  edavis10 | 2008-12-05 23:56:03 +0100
 Refactor: Extracted new method Query#sql_for_field from Query#statement in
 order to clean up Query#statement.
 
 r18851@gaspard (orig r2091):  edavis10 | 2008-12-05 23:56:08 +0100
 Bit more refactoring on Query#sql_for_field to remove multiple returns
 
 r18852@gaspard (orig r2092):  edavis10 | 2008-12-05 23:56:13 +0100
 Final refactoring on Query#sql_for_field to rename v to value
 
 r18853@gaspard (orig r2093):  edavis10 | 2008-12-06 01:51:03 +0100
 Added several useful hooks to the Issue sidebar
 
 * :view_issues_sidebar_issues_bottom
 * :view_issues_sidebar_planning_bottom
 * :view_issues_sidebar_queries_bottom
 
 r18854@gaspard (orig r2094):  jplang | 2008-12-06 12:21:10 +0100
 Changes issue history headings.
 r18855@gaspard (orig r2095):  jplang | 2008-12-06 18:20:37 +0100
 Fixes Darcs#cat with Postgresql.
 r18856@gaspard (orig r2096):  jplang | 2008-12-06 18:40:54 +0100
 Fixed: CVS connexion string may not contain @.
 r18857@gaspard (orig r2097):  jplang | 2008-12-06 19:01:20 +0100
 Slight change to css so that gravatar is vertically centered on user's page.
 r18858@gaspard (orig r2098):  jplang | 2008-12-06 23:40:50 +0100
 Translations updates.
 r18860@gaspard (orig r2100):  jplang | 2008-12-07 09:41:54 +0100
 Changelog updated.
 r18861@gaspard (orig r2101):  jplang | 2008-12-07 09:48:29 +0100
 Show project name in front of related issues if cross-project issue relations are enabled (#2282).
 r18862@gaspard (orig r2102):  jplang | 2008-12-07 10:53:27 +0100
 Upgrade to Rails 2.1.2
 r18863@gaspard (orig r2103):  jplang | 2008-12-07 10:54:37 +0100
 Set version to 0.8
 r18864@gaspard (orig r2104):  jplang | 2008-12-07 10:56:28 +0100
 Update changelog for 0.8 rc1
 r18865@gaspard (orig r2105):  jplang | 2008-12-07 10:59:19 +0100
 UPGRADING updated
 r18869@gaspard (orig r2109):  jplang | 2008-12-07 14:12:19 +0100
 Makes logged-in username in topbar linking to (#2291).
 r18870@gaspard (orig r2110):  jplang | 2008-12-07 15:40:33 +0100
 Use options hash in UnifiedDiff.new
 r18871@gaspard (orig r2111):  jplang | 2008-12-07 15:44:08 +0100
 Follows r2110.
 r18872@gaspard (orig r2112):  jplang | 2008-12-07 16:21:40 +0100
 Adds a setting to limit the number of diff lines that should be displayed (default to 1500).
 r18874@gaspard (orig r2114):  jplang | 2008-12-08 19:20:26 +0100
 Fixed: project activity truncated after viewing user's activity.
 r18876@gaspard (orig r2116):  jplang | 2008-12-09 17:54:46 +0100
 AttachmentsController now handles attachments deletion.
 r18877@gaspard (orig r2117):  jplang | 2008-12-09 19:00:27 +0100
 Files module: makes version field non required (#1053).
 r18878@gaspard (orig r2118):  jplang | 2008-12-09 19:30:22 +0100
 Fixed: Firefox cuts off large diffs (#2234).
 r18879@gaspard (orig r2119):  winterheart | 2008-12-10 18:01:39 +0100
 Translation updates (#2310, #2309, #2306, #2304, #2302, #2300, #2299)
 r18880@gaspard (orig r2120):  winterheart | 2008-12-10 18:13:04 +0100
 russian update
 r18881@gaspard (orig r2121):  edavis10 | 2008-12-11 00:44:22 +0100
 Added plugin hooks around Journal editing
 
 * :controller_journals_edit_post
 * :view_journals_notes_form_after_notes
 * :view_journals_update_rjs_bottom
 
 r18882@gaspard (orig r2122):  jplang | 2008-12-12 13:07:09 +0100
 Makes User.find_by_mail case-insensitive (password reminder #2322, repo users mapping).
 r18883@gaspard (orig r2123):  jplang | 2008-12-12 14:32:39 +0100
 Fixed: default flag removed when editing a default enumeration (#2327).
 r18884@gaspard (orig r2124):  jplang | 2008-12-12 14:49:14 +0100
 Fixed: default category ignored when adding a document (#2328).
 r18885@gaspard (orig r2125):  jplang | 2008-12-12 17:01:35 +0100
 Escape back_url field value (#2320).
 r18886@gaspard (orig r2126):  jplang | 2008-12-12 17:03:57 +0100
 Rescue back_url param parsing on redirect.
 r18887@gaspard (orig r2127):  jplang | 2008-12-12 17:04:54 +0100
 Undo unwanted change.
 r18888@gaspard (orig r2128):  jplang | 2008-12-12 17:07:14 +0100
 Capture scm CLI stderr to log/scm.stderr.log when running in dev environment
 r18889@gaspard (orig r2129):  jplang | 2008-12-12 20:11:16 +0100
 Make use of User.find_by_mail
 r18890@gaspard (orig r2130):  winterheart | 2008-12-12 20:34:31 +0100
 translation updates
 r18891@gaspard (orig r2131):  winterheart | 2008-12-12 20:41:12 +0100
 Fixing quotes
 r18894@gaspard (orig r2134):  jplang | 2008-12-14 16:36:59 +0100
 Rails 2.1.2 deprecations (#2332).
 r18895@gaspard (orig r2135):  jplang | 2008-12-14 16:57:13 +0100
 Fixed: CVS browser should not show dead revisions (deleted files) (#2319).
 r18896@gaspard (orig r2136):  jplang | 2008-12-14 18:10:16 +0100
 Mail handler: strip tags when receiving a html-only email (#2312).
 r18897@gaspard (orig r2137):  jplang | 2008-12-15 19:02:25 +0100
 Fixes repository user mapping submission when a repository username is blank (#2339, Conflicting types for parameter containers).
 r18899@gaspard (orig r2139):  jplang | 2008-12-16 22:11:37 +0100
 Adds a helper that returns issues css classes.
 r18900@gaspard (orig r2140):  jplang | 2008-12-16 22:13:35 +0100
 Adds a css class (overdue) to overdue issues on issue lists and detail views (#2337).
 r18901@gaspard (orig r2141):  edavis10 | 2008-12-18 08:10:23 +0100
 Fixed a failing test caused by comparing a Time object (n.day.ago) with a Date object
 
 r18902@gaspard (orig r2142):  winterheart | 2008-12-18 23:27:32 +0100
 Typo on translation, #2352
 r18903@gaspard (orig r2143):  jplang | 2008-12-19 09:10:35 +0100
 Escape textarea content when editing a issue note.
 r18904@gaspard (orig r2144):  jplang | 2008-12-19 11:16:15 +0100
 Escape double-quotes in image titles.
 r18905@gaspard (orig r2145):  jplang | 2008-12-19 11:43:06 +0100
 Check that wiki page exists before processing (#2360).
 r18907@gaspard (orig r2147):  jplang | 2008-12-19 15:13:24 +0100
 CHANGELOG updated.
 r18924@gaspard (orig r2164):  jplang | 2008-12-22 20:21:02 +0100
 Adds watchers selection on new issue form (#398). Permission 'add issue watchers' required.
 r18925@gaspard (orig r2165):  jplang | 2008-12-22 20:24:17 +0100
 Do not hardcode Watcher string in r2164.
 r18926@gaspard (orig r2166):  jplang | 2008-12-22 20:25:07 +0100
 Sligth change to fr.yml.
 r18927@gaspard (orig r2167):  jplang | 2008-12-22 21:33:01 +0100
 Show view/annotate/download links on repositories/entries and repositories/annotate views (#2367).
 r18928@gaspard (orig r2168):  jplang | 2008-12-23 01:16:26 +0100
 Escape wiki annotate lines content (#2380).
 r18929@gaspard (orig r2169):  jplang | 2008-12-23 01:19:15 +0100
 Escape query names (#2379).
 r18930@gaspard (orig r2170):  jplang | 2008-12-23 18:05:38 +0100
 Escape textile titles and styles (#2377).
 r18931@gaspard (orig r2171):  jplang | 2008-12-24 11:03:13 +0100
 Validates sort_key and sort_order params (#2378).
 r18938@gaspard (orig r2178):  jplang | 2008-12-24 14:29:43 +0100
 Fixes a JS error on context_menu with IE (#2390).
 r18940@gaspard (orig r2180):  winterheart | 2008-12-24 16:44:43 +0100
 #2329, swedish lang update
 
 r18941@gaspard (orig r2181):  winterheart | 2008-12-24 16:47:24 +0100
 #2368, pt.yml update
 
 r18942@gaspard (orig r2182):  winterheart | 2008-12-24 16:48:59 +0100
 #2386, korean translation update
 
 r18943@gaspard (orig r2183):  jplang | 2008-12-27 15:05:03 +0100
 Prevent SQL error with old sessions after r2171.
 r18946@gaspard (orig r2186):  jplang | 2008-12-27 18:49:01 +0100
 Fixtures update.
 r18947@gaspard (orig r2187):  jplang | 2008-12-27 19:07:46 +0100
 Fixes functional test failures.
 r18948@gaspard (orig r2188):  jplang | 2008-12-27 19:10:36 +0100
 Do not show a link to the current annotate or view page (#2367).
 r18949@gaspard (orig r2189):  jplang | 2008-12-27 19:33:35 +0100
 Fixed: deleted files should not be shown when browsing a Darcs repository (#2385).
 r18950@gaspard (orig r2190):  jplang | 2008-12-28 10:46:16 +0100
 Fixes functional tests fixtures (#2398).
 r18951@gaspard (orig r2191):  jplang | 2008-12-28 11:12:09 +0100
 Fixed bold syntax around single character in series (#2351).
 r18952@gaspard (orig r2192):  jplang | 2008-12-28 14:38:34 +0100
 Disable textile inline styles to prevent XSS attacks (#2377).
 r18955@gaspard (orig r2195):  jplang | 2008-12-28 15:48:23 +0100
 Mail handler: add watchers before sending notification (#2245).
 r18956@gaspard (orig r2196):  jplang | 2008-12-29 13:40:56 +0100
 Renumbers projects_trackers fixtures (#2411).
 r18959@gaspard (orig r2199):  jplang | 2008-12-29 16:43:42 +0100
 Translations updates.
 r18961@gaspard (orig r2201):  jplang | 2008-12-29 17:08:31 +0100
 CHANGELOG updated.
 r18962@gaspard (orig r2202):  winterheart | 2008-12-29 19:27:27 +0100
 #2373, fixing encoding
 
 r18968@gaspard (orig r2208):  jplang | 2008-12-30 14:32:14 +0100
 CHANGELOG updated.
 r18969@gaspard (orig r2209):  jplang | 2008-12-30 14:32:51 +0100
 Increment project files downloads.
 r18970@gaspard (orig r2210):  jplang | 2008-12-30 15:24:51 +0100
 Jump to the current tab when using the project quick-jump combo (#2364).
 r18971@gaspard (orig r2211):  jplang | 2008-12-30 15:57:33 +0100
 Import custom fields values from emails (#2413).
 r18972@gaspard (orig r2212):  jplang | 2008-12-30 17:23:05 +0100
 Stricter textile links parsing (#2417).
 r18973@gaspard (orig r2213):  jplang | 2008-12-30 17:43:26 +0100
 Changes pt-br decimal separator (#1372).
 r18974@gaspard (orig r2214):  jplang | 2008-12-31 11:39:33 +0100
 Do not escape back_url twice when login fails.
 r18978@gaspard (orig r2218):  jplang | 2008-12-31 12:48:56 +0100
 Admin Info Screen: Display if plugin assets directory is writable (#2425).
 r18979@gaspard (orig r2219):  jplang | 2008-12-31 14:59:30 +0100
 Fix sv lang file
 r18980@gaspard (orig r2220):  jplang | 2008-12-31 15:56:30 +0100
 IMAP: add options to move received emails.
 r18981@gaspard (orig r2221):  jplang | 2009-01-03 14:09:36 +0100
 Lower the project identifier limit to a minimum of two characters (#2003).
 r18982@gaspard (orig r2222):  jplang | 2009-01-03 14:14:28 +0100
 Fixed: syntax highlight doesn't appear in new ticket preview (#1976).
 r18983@gaspard (orig r2223):  jplang | 2009-01-03 15:11:44 +0100
 Moves flash messages rendering to a helper method.
 r18984@gaspard (orig r2224):  jplang | 2009-01-03 15:44:12 +0100
 Display a warning if some attachments were not saved (#2008).
 r18985@gaspard (orig r2225):  jplang | 2009-01-03 17:03:12 +0100
 Fixed: email notification for changes I make still occurs when running Repository.fetch_changesets (#1957).
 r18986@gaspard (orig r2226):  jplang | 2009-01-04 13:03:39 +0100
 Move PDF stuff to a single helper.
 r18987@gaspard (orig r2227):  jplang | 2009-01-04 13:14:05 +0100
 Makes the app boot with Rails 2.2.2
 r18988@gaspard (orig r2228):  jplang | 2009-01-04 13:50:45 +0100
 Do not use compute_public_path.
 r18992@gaspard (orig r2232):  jplang | 2009-01-04 14:27:48 +0100
 Merged r2231 from 0.8-stable (#2402).
 r18993@gaspard (orig r2233):  jplang | 2009-01-04 15:54:19 +0100
 Scramble PDF title (#1204).
 r18994@gaspard (orig r2234):  jplang | 2009-01-04 18:09:25 +0100
 Slight changes to ease Rails 2.2 support.
 r18995@gaspard (orig r2235):  jplang | 2009-01-04 19:14:51 +0100
 Slight changes in functional tests.
 r19006@gaspard (orig r2246):  jplang | 2009-01-07 20:47:24 +0100
 Makes issue description a non-required field (#2456).
 r19007@gaspard (orig r2247):  jplang | 2009-01-07 21:03:33 +0100
 Refactor TabularFormBuilder field helpers (#2461).
 r19008@gaspard (orig r2248):  jplang | 2009-01-07 21:21:27 +0100
 Fixes functional test broken by r2246.
 r19009@gaspard (orig r2249):  jplang | 2009-01-07 21:22:06 +0100
 Fixes a test failure with svn < 1.5 (#2455).
 r19010@gaspard (orig r2250):  jplang | 2009-01-07 21:30:02 +0100
 Adds 'closed' css class to closed issues in the issue list (#2458).
 r19011@gaspard (orig r2251):  jplang | 2009-01-09 18:32:46 +0100
 Fixed: no error is raised when entering invalid hours on the issue update form (#2465).
 r19013@gaspard (orig r2253):  jplang | 2009-01-10 12:29:35 +0100
 Makes email adress uniqueness case-insensitive (#2473).
 r19016@gaspard (orig r2256):  jplang | 2009-01-11 12:01:35 +0100
 Different icon for closed issues in search result (#992).
 r19017@gaspard (orig r2257):  jplang | 2009-01-11 17:33:51 +0100
 Ability to sort the issue list by text, list, date and boolean custom fields (#1139).
 r19018@gaspard (orig r2258):  jplang | 2009-01-11 19:38:07 +0100
 Ability to sort the issue list by text, int and float custom fields (#1139).
 r19019@gaspard (orig r2259):  jplang | 2009-01-11 20:48:16 +0100
 Use margin-right instead of padding-right on top menu links.
 r19020@gaspard (orig r2260):  edavis10 | 2009-01-12 05:44:01 +0100
 Codified instructions from RUNNING_TESTS as rake tasks for convenience
 
 Rake tasks are in testing.rake and can be run by `rake test:scm:setup:<scm>`
 Updated RUNNING_TESTS
 
 Contributed by Gerrit Kaiser
 
 r19021@gaspard (orig r2261):  edavis10 | 2009-01-12 05:52:56 +0100
 Added two new plugin hooks to IssuesController:
 
 * :controller_issues_new_after_save
 * :controller_issues_edit_after_save
 
   #2475
 
 r19022@gaspard (orig r2262):  jplang | 2009-01-12 18:45:23 +0100
 Fixes r2226: exporting an issue with attachments to PDF raises an error (#2492).
 r19023@gaspard (orig r2263):  jplang | 2009-01-12 18:46:53 +0100
 Typo (#2489).
 r19025@gaspard (orig r2265):  jplang | 2009-01-16 18:20:41 +0100
 Adds a 'Create and continue' button on the new issue form, that will create the issue and display the form again (#2523).
 r19026@gaspard (orig r2266):  jplang | 2009-01-16 21:57:18 +0100
 Makes subject field get focus on 'New issue' form (#2522).
 r19027@gaspard (orig r2267):  jplang | 2009-01-16 22:02:03 +0100
 Use a textarea for custom fields possible values (#2472).
 r19028@gaspard (orig r2268):  jplang | 2009-01-16 22:02:56 +0100
 Adds custom fields functional tests.
 r19029@gaspard (orig r2269):  jplang | 2009-01-17 08:53:32 +0100
 Slight visual changes on the issue form.
 r19030@gaspard (orig r2270):  jplang | 2009-01-17 09:03:53 +0100
 Do not show Category field when categories are not defined.
 r19031@gaspard (orig r2271):  jplang | 2009-01-17 09:08:33 +0100
 Project jump box fix.
 r19032@gaspard (orig r2272):  jplang | 2009-01-17 09:25:55 +0100
 Make use of tracker_ids association in issue custom field form.
 r19033@gaspard (orig r2273):  jplang | 2009-01-17 09:41:30 +0100
 CustomFieldsController refactoring.
 r19034@gaspard (orig r2274):  jplang | 2009-01-17 09:46:23 +0100
 CustomFieldsController#list moved to #index.
 r19035@gaspard (orig r2275):  jplang | 2009-01-17 10:04:10 +0100
 Moves a few settings to a "Display" panel.
 r19036@gaspard (orig r2276):  jplang | 2009-01-17 12:18:04 +0100
 User custom fields can now be set as editable so that users can edit them on 'My account'.
 For existing user custom fields, this new attribute is set to false by default to preserve the prior behaviour (it can turned on by editing the custom field in admin area).
 
 Note: on the registration form, *required* custom fields will be displayed even if they are not defined as editable so that the account can be created.
 r19039@gaspard (orig r2279):  jplang | 2009-01-18 11:54:08 +0100
 Fixes 103_set_custom_fields_editable migration from r2276 (#2526).
 r19040@gaspard (orig r2280):  jplang | 2009-01-18 12:54:56 +0100
 Fixed that Trac importer was creating duplicate custom values (#2506).
 r19041@gaspard (orig r2281):  jplang | 2009-01-18 16:16:31 +0100
 Adds Message-Id and References headers to email notifications so that issues and messages threads can be displayed by email clients (#1401).
 r19042@gaspard (orig r2282):  jplang | 2009-01-18 21:00:03 +0100
 Fix in AttachmentsController#show.
 r19043@gaspard (orig r2283):  winterheart | 2009-01-19 16:55:54 +0100
 #2439, translation update
 r19044@gaspard (orig r2284):  winterheart | 2009-01-19 16:57:19 +0100
 #2442, translation update
 r19045@gaspard (orig r2285):  winterheart | 2009-01-19 17:02:57 +0100
 #2429, translation update
 r19046@gaspard (orig r2286):  winterheart | 2009-01-19 17:06:39 +0100
 #2442, small fix
 r19047@gaspard (orig r2287):  winterheart | 2009-01-19 17:43:28 +0100
 translation updates (#2535, #2505, #2524, #2434)
 r19048@gaspard (orig r2288):  jplang | 2009-01-19 19:29:07 +0100
 Use In-Reply-To and References headers to handle replies by email.
 r19049@gaspard (orig r2289):  jplang | 2009-01-19 20:03:53 +0100
 Allow email to reply to a forum message (#1616).
 r19050@gaspard (orig r2290):  winterheart | 2009-01-20 16:45:34 +0100
 #2453, sv.yml patch, some errors still exist (see ticket)
 r19051@gaspard (orig r2291):  winterheart | 2009-01-20 16:53:09 +0100
 #2445, nl.yml update
 r19052@gaspard (orig r2292):  winterheart | 2009-01-20 17:09:07 +0100
 #2463, partially solved
 r19053@gaspard (orig r2293):  winterheart | 2009-01-20 17:13:14 +0100
 #2540, pt-br update
 r19054@gaspard (orig r2294):  jplang | 2009-01-21 19:22:30 +0100
 Accept replies to forum messages by subject recognition (#1616).
 r19055@gaspard (orig r2295):  jplang | 2009-01-22 17:34:54 +0100
 Automatically focus several form fields.
 r19056@gaspard (orig r2296):  winterheart | 2009-01-23 16:37:59 +0100
 New Galician Translation (#2547), thanks to Martín Vázquez for intial translation
 r19057@gaspard (orig r2297):  winterheart | 2009-01-23 16:40:38 +0100
 #2562, update for zh.yml
 r19058@gaspard (orig r2298):  winterheart | 2009-01-23 16:46:22 +0100
 Translation updates (#2453, #2463, #2551)
 r19059@gaspard (orig r2299):  winterheart | 2009-01-23 16:58:58 +0100
 removing \r\n
 
 r19060@gaspard (orig r2300):  winterheart | 2009-01-23 17:30:04 +0100
 ru.yml update
 
 r19062@gaspard (orig r2302):  jplang | 2009-01-24 09:58:03 +0100
 Fixed: Details time log report CSV export doesn't honour date format from settings (patch #2466 by Russell Hind).
 r19063@gaspard (orig r2303):  jplang | 2009-01-24 10:02:55 +0100
 Fixes a test that was broken by r2294.
 r19064@gaspard (orig r2304):  jplang | 2009-01-24 12:31:15 +0100
 Merged nested projects branch. Removes limit on subproject nesting (#594).
 r19065@gaspard (orig r2305):  jplang | 2009-01-24 12:48:38 +0100
 Removes unused projects_count column from projects table.
 r19071@gaspard (orig r2311):  jplang | 2009-01-25 12:15:28 +0100
 Ignore archived subprojects in Project#rolled_up_trackers (#2550).
 r19072@gaspard (orig r2312):  jplang | 2009-01-25 13:13:27 +0100
 Fixed that the project jump box does not preserve current tab after r2304.
 r19073@gaspard (orig r2313):  jplang | 2009-01-25 14:12:56 +0100
 Adds ability to bulk copy issues (#1847).
 This can be done by checking the 'Copy' checkbox on the 'Move' form.
 r19074@gaspard (orig r2314):  jplang | 2009-01-25 14:18:44 +0100
 Removes spaces before colons.
 r19075@gaspard (orig r2315):  jplang | 2009-01-25 14:52:40 +0100
 Render the project list as a tree on Move form.
 r19076@gaspard (orig r2316):  jplang | 2009-01-25 17:04:28 +0100
 Ability to bulk edit custom fields of type 'list' (#461).
 r19077@gaspard (orig r2317):  edavis10 | 2009-01-26 02:47:51 +0100
 Converted routing and urls to follow the Rails REST convention.
 
 Patch supplied by commits from Gerrit Kaiser on Github.  Existing routes will
 still work (backwards compatible) but any new urls will be generated using the
 new routing rules.
 
 Changes listed below:
 
 * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id
 * prettier URL for project roadmap
 * more nice project URLs
 * use GET for filtering form
 * prettified URLs used on issues tab
 * custom route for activity atom feeds
 * prettier repository urls
 * fixed broken route definition
 * fixed failing tests for issuecontroller that were hardcoding the url string
 * more RESTful routes for boards and messages
 * RESTful routes for wiki pages
 * RESTful routes for documents
 * moved old routes that are retained for compatibility to the bottom and grouped them together
 * added RESTful URIs for issues
 * RESTfulness for the news section
 * fixed route order
 * changed hardcoded URLs in tests
 * fixed badly written tests
 * fixed forgotten parameter in routes
 * changed hardcoded URLS to new scheme
 * changed project add url to the standard POST to collection
 * create new issue by POSTing to collection
 * changed hardcoded URLs in integrations tests
 * made project add form work again
 * restful routes for project deletion
 * prettier routes for project (un)archival
 * made routes table more readable
 * fixed note quoting
 * user routing
 * fixed bug
 * always sort by GET
 * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled.
 * prettified URLs used on issues tab
 * urls for time log
 * fixed reply routing
 * eliminate revision query paremeter for diff and entry actions
 * fixed test failures with hard-coded urls
 * ensure ajax links always use get
 * refactored ajax link generation into separate method
 
   #1901
 
 r19078@gaspard (orig r2318):  jplang | 2009-01-26 18:43:58 +0100
 Fixes activity pagination broken by r2317.
 r19079@gaspard (orig r2319):  jplang | 2009-01-27 18:27:50 +0100
 Replaces the obsolete robots.txt with a cached action (#2491).
 r19080@gaspard (orig r2320):  jplang | 2009-01-27 18:40:55 +0100
 Fixed actions on issues (gantt, calendar, move, bulk_edit...) at global level broken by r2317.
 r19081@gaspard (orig r2321):  jplang | 2009-01-27 18:58:56 +0100
 Explicitly require 'rfpdf/fpdf' (#2584).
 r19082@gaspard (orig r2322):  jplang | 2009-01-27 19:19:27 +0100
 Fixed that 'My page' blocks may display issues that the user is no longer allowed to view (#2590).
 r19083@gaspard (orig r2323):  jplang | 2009-01-27 20:33:03 +0100
 Fixed: users should not be able to add relations with issues they're not allowed to view (#2589).
 r19084@gaspard (orig r2324):  edavis10 | 2009-01-27 21:42:19 +0100
 Fixes Issue sorting in a project, broken by #2317
 
 Issues were sorting but the project id wasn't being added so the
 IssuesController would return all issues (cross-project).
 
 r19085@gaspard (orig r2325):  edavis10 | 2009-01-27 21:59:02 +0100
 Fixed clearing the Issue filters in the issue list, broken by #2317
 
 r19086@gaspard (orig r2326):  jplang | 2009-01-28 21:52:39 +0100
 Fixed user's activity atom feed broken by r2317.
 r19087@gaspard (orig r2327):  jplang | 2009-01-28 22:11:13 +0100
 Fixed calendar navigation links broken by r2317.
 r19088@gaspard (orig r2328):  jplang | 2009-01-28 22:20:39 +0100
 Fixing calendar and gantt links broken by r2317.
 r19089@gaspard (orig r2329):  jplang | 2009-01-28 22:25:35 +0100
 Fixed project news atom link broken by r2317.
 r19090@gaspard (orig r2330):  jplang | 2009-01-29 10:05:36 +0100
 Sort target versions list on bulk edit form (#2616).
 r19091@gaspard (orig r2331):  jplang | 2009-01-29 12:09:46 +0100
 Fixes other formats download links on the project issue list (project_id lost) broken r2317.
 r19092@gaspard (orig r2332):  jplang | 2009-01-29 13:26:32 +0100
 Fixed an error when downloading gantt png at global level.
 r19093@gaspard (orig r2333):  jplang | 2009-01-29 14:53:17 +0100
 Adds an helper to render other formats download links.
 r19094@gaspard (orig r2334):  jplang | 2009-01-29 14:54:44 +0100
 Adds rel='nofollow' attribute to other formats download links (#2491).
 r19095@gaspard (orig r2335):  jplang | 2009-01-29 15:22:56 +0100
 Adds projects association on tracker form (#2578).
 r19096@gaspard (orig r2336):  jplang | 2009-01-29 17:33:45 +0100
 Fixed: TOC does not parse wiki page reference links with description (#2601).
 r19097@gaspard (orig r2337):  jplang | 2009-01-29 17:34:00 +0100
 Cleaning test.
 r19098@gaspard (orig r2338):  jplang | 2009-01-30 18:50:28 +0100
 Changes time related icons.
 r19099@gaspard (orig r2339):  jplang | 2009-01-31 12:43:54 +0100
 Adds :async_smtp and :async_sendmail delivery methods to perform email deliveries asynchronously.
 Code from http://www.datanoise.com/articles/2006/7/14/asynchronous-email-delivery.
 r19100@gaspard (orig r2340):  winterheart | 2009-01-31 13:02:37 +0100
 New translation - Slovenian, thank to Nejc Vidmar for work (#2577), translation updates (#2129, #2586)
 r19101@gaspard (orig r2341):  jplang | 2009-01-31 13:42:02 +0100
 Updates footer year.
 r19102@gaspard (orig r2342):  jplang | 2009-01-31 13:48:09 +0100
 Removes Issue.visible_by
 r19103@gaspard (orig r2343):  jplang | 2009-01-31 14:22:29 +0100
 Fixed: issue details view discloses relations to issues that the user is not allowed to view (#2589).
 r19104@gaspard (orig r2344):  jplang | 2009-01-31 15:50:56 +0100
 Less strict textile links parsing (#2582).
 r19105@gaspard (orig r2345):  jplang | 2009-02-01 15:36:38 +0100
 Fixed: Contextual divs after attachments are placed incorrectly in FireFox (#2633).
 r19106@gaspard (orig r2346):  jplang | 2009-02-01 16:48:56 +0100
 Do not repeat one-line commit logs on the activity view.
 r19107@gaspard (orig r2347):  jplang | 2009-02-01 16:57:01 +0100
 Show line breaks in activity events summary.
 r19108@gaspard (orig r2348):  jplang | 2009-02-01 17:00:20 +0100
 Changes color of activity events/search results summary.
 r19109@gaspard (orig r2349):  jplang | 2009-02-01 19:54:05 +0100
 Use estimated hours to weight issues in version completion calculation (#2182).
 r19110@gaspard (orig r2350):  jplang | 2009-02-01 20:54:50 +0100
 Adds a setting to limit the number of revisions displayed on a repository file log (default=100).
 r19111@gaspard (orig r2351):  jplang | 2009-02-01 21:56:10 +0100
 Include both last and first name when sorting issues by assignee (#1841).
 r19112@gaspard (orig r2352):  jplang | 2009-02-01 21:57:44 +0100
 Include both version date and name when sorting issues by target version (#1502).
 r19113@gaspard (orig r2353):  jplang | 2009-02-02 18:34:12 +0100
 Adds a 'box' div around news comment form (#2632).
 r19119@gaspard (orig r2359):  jplang | 2009-02-03 18:13:37 +0100
 Fixes message search eager loading (#2654).
 r19120@gaspard (orig r2360):  jplang | 2009-02-03 18:15:59 +0100
 Typos/fixes in views (#2654).
 r19121@gaspard (orig r2361):  jplang | 2009-02-03 18:32:07 +0100
 Closed issue are not overdue, fixes r2140 (#2337).
 r19122@gaspard (orig r2362):  jplang | 2009-02-05 18:43:49 +0100
 Typo in wiki link example (#2673).
 r19123@gaspard (orig r2363):  jplang | 2009-02-05 21:25:01 +0100
 Fixed: inline attached image should not match partial filename (#2683).
 r19159@gaspard (orig r2399):  jplang | 2009-02-07 21:11:03 +0100
 Fixed: path parameter is not an array when changing diff style (#2695), broken by r2317.
 r19175@gaspard (orig r2415):  jplang | 2009-02-08 18:24:39 +0100
 Fixed: migration 98 breaks when using table name prefix.
 r19183@gaspard (orig r2423):  jplang | 2009-02-09 18:18:41 +0100
 Fixed: TypeError (can't modify frozen string) on settings view (#2700).
 r19184@gaspard (orig r2424):  jplang | 2009-02-09 18:24:06 +0100
 Removes hardcoded table names (#2701).
 r19186@gaspard (orig r2426):  jplang | 2009-02-09 21:17:58 +0100
 Strip keywords from received email body (#2436).
 r19187@gaspard (orig r2427):  edavis10 | 2009-02-10 02:18:49 +0100
 Added plugin hook :view_projects_roadmap_version_bottom.  #2543
 r19188@gaspard (orig r2428):  edavis10 | 2009-02-10 02:24:32 +0100
 Added two new plugin hooks:
 
 * :view_layouts_base_sidebar
 * :view_layouts_base_content
 r19189@gaspard (orig r2429):  edavis10 | 2009-02-10 04:12:40 +0100
 Added request and controller objects to the hooks by default.
 
 The request and controller objects are now added to all hook contexts by
 default.  This will also make url_for work better in hooks by setting up
 the default_url_options :host, :port, and :protocol.
 
 Finally a new helper method @render_or@ has been added to ViewListener.  This
 will let a hook easily render a partial without a full method definition.
 
 Thanks to Thomas Löber for the original patch.  #2542
 r19190@gaspard (orig r2430):  edavis10 | 2009-02-10 04:12:45 +0100
 Renamed variables to be more descriptive. #2542
 r19191@gaspard (orig r2431):  winterheart | 2009-02-10 16:41:05 +0100
 Updated translations (#2577, #2640, #2644, #2652)
 
 r19192@gaspard (orig r2432):  winterheart | 2009-02-10 16:57:52 +0100
 Translation updates (#2643, #2645, #2668)
 r19193@gaspard (orig r2433):  winterheart | 2009-02-10 17:05:31 +0100
 New language - Macedonian (mk). Thank to Ilin Tatabitovski for work.
 
 r19194@gaspard (orig r2434):  jplang | 2009-02-10 18:18:19 +0100
 Fixes broken action url on time edit form (#2707).
 r19195@gaspard (orig r2435):  jplang | 2009-02-10 23:03:25 +0100
 Replaces the repositories management SOAP API with a simple REST API.
 reposman usage is unchanged but the script now requires activeresource.
 actionwebservice is now longer used and thus removed from plugins.
 r19196@gaspard (orig r2436):  jplang | 2009-02-10 23:54:22 +0100
 Leave wiki links untouched if target project doesn't exist or have no wiki.
 r19197@gaspard (orig r2437):  edavis10 | 2009-02-11 20:06:37 +0100
 Unpacked OpenID gem. #699
 r19198@gaspard (orig r2438):  edavis10 | 2009-02-11 20:06:45 +0100
 Added open_id_authentication plugin
 r19199@gaspard (orig r2439):  edavis10 | 2009-02-11 20:06:50 +0100
 Added OpenID tables. #699
 r19200@gaspard (orig r2440):  edavis10 | 2009-02-11 20:06:55 +0100
 Added identity_url to User. #699
 r19201@gaspard (orig r2441):  edavis10 | 2009-02-11 20:07:00 +0100
 Fixed a bug in open_id_authentication, where relative_url_root is defined
 on ActionController:AbstractRequest not Base
 
   #699
 r19202@gaspard (orig r2442):  edavis10 | 2009-02-11 20:07:07 +0100
 Added the ability to login via OpenID.
 
 * Refactored AccountController#login to use either
   password or openid based authentication
 * Extracted AccountController#successful_authentication
   to setup a user's session cookies and redirect
 * Implemented the start of AccountController#open_id_authentication
   which will check with the OpenID server and perform authentication.
 * Added text field for the OpenID url to /login
 * Added identity_url for OpenID to the user forms.
 * Added option to login with OpenID to the register form.
 * Added a root url route, which is used by the OpenID plugin
 
   #699
 r19203@gaspard (orig r2443):  edavis10 | 2009-02-11 20:07:12 +0100
 Hooked up on the fly OpenID user creation.
 
 * Use OpenID registration fields for the user.
 * Generate a random password when a user is created.
 r19204@gaspard (orig r2444):  edavis10 | 2009-02-11 20:07:18 +0100
 Adding OpenID mock and test. #699
 r19205@gaspard (orig r2445):  edavis10 | 2009-02-11 20:07:23 +0100
 Added tests for the other OpenID authentication cases.  #699
 r19206@gaspard (orig r2446):  edavis10 | 2009-02-11 20:07:28 +0100
 Added user setup needed based on the system's registration settings
 
 * Copied the register action's chunk of code used to setup the account
   based on Setting.self_registration
 * Extracted method for when onthefly_creation_failed
 * Added tests to confirm the behavior
 
   #699
 r19207@gaspard (orig r2447):  edavis10 | 2009-02-11 20:07:34 +0100
 Refactored common methods out of register and open_id_authenticate
 
 * Extracted register_by_email_activation
 * Extracted register_automatically
 * Extracted register_manually_by_administrator
 
   #699
 r19208@gaspard (orig r2448):  edavis10 | 2009-02-11 20:07:41 +0100
 Prevent registration via OpenID if self registration is off. #699
 r19209@gaspard (orig r2449):  edavis10 | 2009-02-11 20:24:28 +0100
 Added a system setting for allowing OpenID logins and registrations
 
 * Defaults to off
 * Is set in the Administration panel under Authentication
 
   #699
 r19210@gaspard (orig r2450):  edavis10 | 2009-02-11 20:45:53 +0100
 Added a space so words don't runtogeatherlikethis. #699
 r19211@gaspard (orig r2451):  jplang | 2009-02-11 21:25:05 +0100
 Slight changes to the issue lists displayed on My page.
 r19212@gaspard (orig r2452):  edavis10 | 2009-02-12 02:32:50 +0100
 Fixed the bundled ruby-openid gem
 
 * The open_id_authentication plugin will require the gem automatically so
   it doesn't need to be added to environment.rb
 * Changed the version requirement on the open_id_authentication to match
   the latest stable version.  Rails config.gem looks for a directory named
   after that specific version and will not load newer versions.
 
   #699
 r19213@gaspard (orig r2453):  edavis10 | 2009-02-12 05:31:28 +0100
 Normalize the identity_url when it's set.
 
 OpenId uses a specific format for the url it uses which requires the protocol
 and trailing slash.  This change will normalize the value to when a user sets it.
 
   #699
 r19214@gaspard (orig r2454):  jplang | 2009-02-12 18:19:32 +0100
 Hide openid stuff on my account if disabled (#699).
 r19215@gaspard (orig r2455):  jplang | 2009-02-12 18:30:56 +0100
 Adds missing strings (#699).
 r19216@gaspard (orig r2456):  jplang | 2009-02-12 18:35:57 +0100
 Adds ability to filter watched issues (#846).
 r19217@gaspard (orig r2457):  jplang | 2009-02-12 18:38:36 +0100
 Link to watched issues list on my page.
 r19218@gaspard (orig r2458):  jplang | 2009-02-12 22:25:50 +0100
 Removes the fat ruby-openid gem. Simply use 'gem install ruby-openid' to enable openid support.
 r19219@gaspard (orig r2459):  jplang | 2009-02-12 23:01:20 +0100
 Issues pagination loses project param after applying or clearing filter (#2726).
 r19220@gaspard (orig r2460):  jplang | 2009-02-12 23:14:22 +0100
 Adds watch/unwatch link on the issue context menu (#2730).
 r19221@gaspard (orig r2461):  jplang | 2009-02-13 18:29:49 +0100
 Removes invalid css class on issue details (#2733).
 r19223@gaspard (orig r2463):  jplang | 2009-02-13 18:59:45 +0100
 Timelog is ignored when updating an issue if user is admin but not a project member (#2717).


git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/nbc@2464 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-14 12:06:45 +00:00
Nicolas Chuche
7e46d9b35b implement local cache for mercurial remote repositories
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1908 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-27 11:00:05 +00:00
Nicolas Chuche
fdbe52a2f7 * use svnsync instead of checkout for subversion cache
* create repositories cache directory if it doesn't exists (default to RAILS_ROOT/tmp/scm)


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1906 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-24 20:08:51 +00:00
Nicolas Chuche
89b8bf3dc5 add local cache repository for speed purpose (subversion) or for browsing a external repository
for SCM that can handle only local copy (git).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1899 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-22 18:46:46 +00:00
Nicolas Chuche
9b94342bc3 r18645@gaspard (orig r1887): jplang | 2008-09-20 16:07:52 +0200
Fixed: Roadmap crashes when a version has a due date > 2037.
 r18646@gaspard (orig r1888):  jplang | 2008-09-21 10:54:02 +0200
 Fixed: invalid effective date (eg. 99999-01-01) causes an error on version edition screen.
 r18647@gaspard (orig r1889):  jplang | 2008-09-21 10:54:50 +0200
 Fixes VersionTest class.
 r18648@gaspard (orig r1890):  jplang | 2008-09-21 14:07:44 +0200
 Fixed: login filter providing incorrect back_url for Redmine installed in sub-directory (#1900).
 r18649@gaspard (orig r1891):  winterheart | 2008-09-21 14:31:34 +0200
 de.yml from #1745, thank to Sven Schuchmann and Thomas Löber for contribution
 r18650@gaspard (orig r1892):  winterheart | 2008-09-21 14:32:16 +0200
 #1928, update for Italian language
 r18651@gaspard (orig r1893):  jplang | 2008-09-21 14:45:22 +0200
 Unescape back_url param before calling redirect_to.
 r18652@gaspard (orig r1894):  jplang | 2008-09-21 15:28:12 +0200
 Strip LDAP attribute names before saving (#1890).
 r18653@gaspard (orig r1895):  jplang | 2008-09-21 20:45:30 +0200
 Switch order of current and previous revisions in side-by-side diff (#1903).
 r18654@gaspard (orig r1896):  jplang | 2008-09-21 22:38:36 +0200
 Typo in migration 97 name (#1929).
 r18655@gaspard (orig r1897):  winterheart | 2008-09-22 16:49:18 +0200
 #1921, pt translation


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1898 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-22 18:33:53 +00:00
Nicolas Chuche
d8549c5541 r18633@gaspard (orig r1875): jplang | 2008-09-17 21:18:31 +0200
reposman: change #log arguments.
 r18634@gaspard (orig r1876):  jplang | 2008-09-17 21:38:20 +0200
 Slight change on git repository creation command.
 r18635@gaspard (orig r1877):  jplang | 2008-09-17 21:47:36 +0200
 Make --command option usable on Windows.
 r18636@gaspard (orig r1878):  jplang | 2008-09-19 17:32:52 +0200
 Adds watch/unwatch functionality at forum topic level (#1912).
 Users who create/reply a topic are automatically added as watchers but are now able to unwatch the topic.
 r18637@gaspard (orig r1879):  winterheart | 2008-09-19 18:15:49 +0200
 update of ru.yml
 r18638@gaspard (orig r1880):  winterheart | 2008-09-19 18:17:35 +0200
 #1918, translation for zh-tw
 r18639@gaspard (orig r1881):  winterheart | 2008-09-19 18:20:45 +0200
 fixed #1920, patch for Hungarian language
 r18640@gaspard (orig r1882):  winterheart | 2008-09-19 18:23:04 +0200
 patch #1922, update for nl.yml
 r18641@gaspard (orig r1883):  winterheart | 2008-09-19 18:26:19 +0200
 #1923, updated zh.yml
 r18642@gaspard (orig r1884):  winterheart | 2008-09-19 18:30:39 +0200
 #1924, update for da.yml
 r18643@gaspard (orig r1885):  winterheart | 2008-09-19 18:33:08 +0200
 #1925, patch for lt.yml


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1886 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-19 20:14:13 +00:00
Nicolas Chuche
54433282d3 r18596@gaspard (orig r1860): nbc | 2008-09-14 21:03:46 +0200
bugfix
 r18597@gaspard (orig r1861):  winterheart | 2008-09-15 17:14:34 +0200
 #1902, translation for zh-tw
 r18598@gaspard (orig r1862):  winterheart | 2008-09-15 17:16:53 +0200
 #1907, translation for zh
 r18599@gaspard (orig r1863):  winterheart | 2008-09-15 17:19:51 +0200
 fixed #1905, patch for Hungarian language
 r18600@gaspard (orig r1864):  winterheart | 2008-09-15 17:22:53 +0200
 Minor typo, fixed #1897, thank Denis Tomashenko for reporting.
 r18601@gaspard (orig r1865):  winterheart | 2008-09-15 18:07:30 +0200
 Catalan translation (#1822), thanks to Joan Duran for contribuition. Some strings has wrong quoting, I fixed that.
 r18602@gaspard (orig r1866):  nbc | 2008-09-15 21:37:43 +0200
 * reposman can create git repository with "--scm git" option
 * light refactoring
 r18603@gaspard (orig r1867):  jplang | 2008-09-16 23:54:53 +0200
 Use RDoc.usage
 r18604@gaspard (orig r1868):  jplang | 2008-09-16 23:56:02 +0200
 mailhandler: fixes exit status and adds an explicit message if response code is 403.
 r18605@gaspard (orig r1869):  winterheart | 2008-09-17 17:31:35 +0200
 Patch #1909, updates for ru.yml
 r18606@gaspard (orig r1870):  jplang | 2008-09-17 18:39:23 +0200
 Render the commit changes list as a tree (#1896).
 r18607@gaspard (orig r1871):  jplang | 2008-09-17 18:48:04 +0200
 Fixed: http links containing parentheses fail to reder correctly (#1591). Patch by Paul Rivier.
 r18608@gaspard (orig r1872):  jplang | 2008-09-17 19:18:05 +0200
 Removes unused image references in stylesheets (#1914).
 r18609@gaspard (orig r1873):  jplang | 2008-09-17 19:23:08 +0200
 Fixed custom query sidebar links broken by r1797 (#1899).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1874 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-17 18:42:46 +00:00
Nicolas Chuche
e5aed8b912 r18566@gaspard (orig r1830): winterheart | 2008-09-14 15:08:02 +0200
sorting new string...


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1859 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:38:43 +00:00
Nicolas Chuche
056f72fd6d r18565@gaspard (orig r1829): winterheart | 2008-09-14 14:59:12 +0200
fixed #1216, thank Antti Perkiömäki for reporting


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1858 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:38:36 +00:00
Nicolas Chuche
c74648d86f r18564@gaspard (orig r1828): jplang | 2008-09-14 14:41:24 +0200
Functional tests fail when run on their own (#1895).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1857 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:38:21 +00:00
Nicolas Chuche
04040b822a r18563@gaspard (orig r1827): jplang | 2008-09-14 12:54:19 +0200
Adds :view_wiki_edits permission to default roles.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1856 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:38:10 +00:00
Nicolas Chuche
dc38a43d51 r18562@gaspard (orig r1826): winterheart | 2008-09-13 21:43:27 +0200
Fixed #1810, one string left


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1855 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:38:01 +00:00
Nicolas Chuche
c64d7f7697 r18561@gaspard (orig r1825): winterheart | 2008-09-13 21:12:50 +0200
fixed #1839, #1814, #1747 and #1698


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1854 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:37:48 +00:00
Nicolas Chuche
9cc4cc9830 r18560@gaspard (orig r1824): winterheart | 2008-09-13 21:05:14 +0200
fixed #1597, thank to Alexandre da Silva for patience :)


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1853 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:37:32 +00:00
Nicolas Chuche
b280742dca r18559@gaspard (orig r1823): winterheart | 2008-09-13 20:55:54 +0200
oops, we have newest #1849, sorry


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1852 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:36:46 +00:00
Nicolas Chuche
42c610104f r18558@gaspard (orig r1822): winterheart | 2008-09-13 20:52:27 +0200
fixed #1832


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1851 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:36:36 +00:00
Nicolas Chuche
baba12c09c r18557@gaspard (orig r1821): jplang | 2008-09-13 20:45:56 +0200
Fixed: unable to revert to a previous wiki page version.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1850 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:36:23 +00:00
Nicolas Chuche
c6f927ffc3 r18556@gaspard (orig r1820): jplang | 2008-09-13 20:32:37 +0200
Expand RAILS_ROOT path on startup (#1892).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1849 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:36:09 +00:00
Nicolas Chuche
7a79bbb9c3 r18555@gaspard (orig r1819): winterheart | 2008-09-13 20:12:19 +0200
fixed #1818, some strings untranslated


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1848 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:36:01 +00:00
Nicolas Chuche
589c7166a0 r18554@gaspard (orig r1818): winterheart | 2008-09-13 19:54:55 +0200
patch #1639, some new strings untranslated


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1847 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:35:54 +00:00
Nicolas Chuche
5231f0e1c0 r18553@gaspard (orig r1817): jplang | 2008-09-13 19:25:01 +0200
Adds Turkish translation by Ismail Sezen (#1866).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1846 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:35:42 +00:00
Nicolas Chuche
1a23493d87 r18552@gaspard (orig r1816): winterheart | 2008-09-13 19:06:37 +0200
fixed #1632, patch from Станислав Герман-Евтушенко


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1845 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:35:19 +00:00
Nicolas Chuche
3810bac939 r18551@gaspard (orig r1815): jplang | 2008-09-13 18:45:01 +0200
Adds a permission 'view wiki edits' so that wiki history can be hidden to certain users (#1154).
 A migration automatically adds this permission to roles that were allowed to view wiki pages.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1844 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:35:10 +00:00
Nicolas Chuche
b6e15f96e4 r18550@gaspard (orig r1814): jplang | 2008-09-13 18:31:11 +0200
Merged nbc branch @ r1812 (commit access permission and reposman improvements).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1843 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:34:59 +00:00
Nicolas Chuche
319bbed456 r18549@gaspard (orig r1813): winterheart | 2008-09-13 18:30:03 +0200
fixed #1635, merged changes to trunk, sorting all strings


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1842 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:34:51 +00:00
Nicolas Chuche
bd3777694a r18547@gaspard (orig r1811): jplang | 2008-09-13 17:33:46 +0200
Mailer compatibility with Rails 2.1.1.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1841 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:33:30 +00:00
Nicolas Chuche
1fdbdb818a r18546@gaspard (orig r1810): jplang | 2008-09-13 17:33:12 +0200
Engines compatibility with Rails 2.1.1 (#1886).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1840 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:33:22 +00:00
Nicolas Chuche
15a6352b59 r18539@gaspard (orig r1803): jplang | 2008-09-13 11:45:07 +0200
Removes double quotes in commit link syntax (#1872).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1839 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:33:08 +00:00
Nicolas Chuche
99a47d6f0c r18538@gaspard (orig r1802): jplang | 2008-09-12 19:17:25 +0200
Adds links to changesets atom feed on repository browser (#1873).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1838 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:33:01 +00:00
Nicolas Chuche
b6f7b138aa r18537@gaspard (orig r1801): jplang | 2008-09-11 19:45:21 +0200
Template error when user's timezone isn't set and UTC timestamps are used (#1889).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1837 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:32:43 +00:00
Nicolas Chuche
4508f1ca91 r18536@gaspard (orig r1800): jplang | 2008-09-11 19:19:26 +0200
Renames bundled RedCloth to RedCloth3 to avoid RedCloth 4 to be loaded instead (#1754).


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1836 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:32:30 +00:00
Nicolas Chuche
ea30dbada1 r18535@gaspard (orig r1799): jplang | 2008-09-11 19:08:00 +0200
Changes versions retrieval on gantt chart.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1835 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:32:21 +00:00
Nicolas Chuche
145107cb83 r18534@gaspard (orig r1798): jplang | 2008-09-11 19:03:26 +0200
Adds support for free ticket filtering and custom queries on Calendar.
 ProjectsController#calendar moved to IssuesController.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1834 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:32:13 +00:00
Nicolas Chuche
2252d61ef6 r18533@gaspard (orig r1797): jplang | 2008-09-10 20:26:13 +0200
Adds support for free ticket filtering and custom queries on Gantt chart.
 ProjectsController#gantt moved to IssuesController.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1833 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:32:03 +00:00
Nicolas Chuche
07a1c5beeb r18532@gaspard (orig r1796): edavis10 | 2008-09-10 03:49:51 +0200
Added context fields to the :view_projects_settings_members_table hooks
 
 * :view_projects_settings_members_table_header now has :project
 * :view_projects_settings_members_table_row now has :project
 * :view_projects_settings_members_table_row has a fixed :member field
 


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1832 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:30:23 +00:00
Nicolas Chuche
0f0217d39b r18531@gaspard (orig r1795): edavis10 | 2008-09-10 02:14:38 +0200
Reverting commit r1748 again.  r1786 pulled in in again
 


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1831 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-14 15:29:34 +00:00
Jean-Philippe Lang
7608eb4162 Renames commit access permission migration.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1812 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 16:27:30 +00:00
Jean-Philippe Lang
0b74888fb8 Adds --scm option support to reposman. It can be used to register non subversion repositories in Redmine.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1809 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 12:48:37 +00:00
Jean-Philippe Lang
3f35344aeb Removes reposman perl version since it's no longer compatible with repository API.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1808 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 11:13:43 +00:00
Jean-Philippe Lang
73123fa484 Adds support for --scm option to reposman.rb.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1807 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 11:11:48 +00:00
Jean-Philippe Lang
7bde4105b8 Adds SCM vendor argument (eg. 'Subversion') to repository_created API method.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1806 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 11:03:11 +00:00
Jean-Philippe Lang
231e98f0c7 Replaces repository_enable named scope on Project with a more generic one: has_module.
The new named scope uses raw sql condition to avoid enabled_modules association loading.

git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1805 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 10:37:23 +00:00
Jean-Philippe Lang
c77d9712ca Fixes functional tests.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1804 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-13 10:04:39 +00:00
Nicolas Chuche
8e48c9ff9d don't use direct table name
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1794 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-09 18:07:00 +00:00
Nicolas Chuche
2bda4e4c11 * reposman can now use an external command with "-c" to create repository of other kind than svn
* WS used by reposman only return projects with repository module enable (so reposman no longer create repository if module is disable)
* it doesn't create repository if repository definition already exists in redmine database (unless -f is used)

git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1793 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-08 17:42:15 +00:00
Nicolas Chuche
562d3aa6a6 add builtin named_scope
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1792 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-08 13:09:54 +00:00
Nicolas Chuche
f5f51f4f83 Add write control on repository from Redmine interface
* new methods to add/remove rights in app/models/role.rb
  * some unit tests
  * add write check in Redmine.pm

To keep compatibility migration add write rights to non builtin roles
but default clean install give write access only to manager and
developer, not to reporter.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1791 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-08 13:01:40 +00:00
Nicolas Chuche
473869db6b recreate new nbc branch from trunk
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1790 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-08 12:22:22 +00:00
Nicolas Chuche
c5d5045c83 r17045@gaspard (orig r916): nbc | 2007-11-18 19:51:48 +0100
* add Redmine.pm to authenticate with mod_perl
 * add a --test option in reposman.rb
 * change owner right to fit with apache write access to repositories
 * add a deprecated warning in reposman.pl
 


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1788 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-08 12:18:13 +00:00
Jean-Philippe Lang
f7acdd1afd Merged hooks branch @ r1785 into trunk.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1786 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-05 10:31:06 +00:00
Jean-Philippe Lang
4b9df2eac7 Fixes Repository#clear_changesets.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1783 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-04 19:35:08 +00:00
Nicolas Chuche
1bb237c3e0 r17044@gaspard (orig r915): jplang | 2007-11-18 18:46:55 +0100
There's now 3 account activation strategies (available in application settings):
 * activation by email: the user receives an email containing a link to active his account
 * manual activation: an email is sent to administrators for account approval (default)
 * automatic activation: the user can log in as soon as he has registered


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1781 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-01 17:52:12 +00:00
Nicolas Chuche
77f65a81c7 r17043@gaspard (orig r914): jplang | 2007-11-18 16:53:58 +0100
'fixed version' field can now be displayed on the issue list.
 Category and fixed version fields added to the CSV export.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1780 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-01 17:37:27 +00:00
Jean-Philippe Lang
696d21f8c8 Adds cross-project time reports support (#994).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1778 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-31 16:34:54 +00:00
Jean-Philippe Lang
dbad26c87d Adds an option to generate sequential project identifiers.
Disabled by default, it can be enabled on the 'Projects' tab in application settings.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1777 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-31 12:59:57 +00:00
Nicolas Chuche
25b4139028 bug in read only access handling
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1776 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-31 12:11:49 +00:00
Jean-Philippe Lang
ed349ca942 Sligth changes to issue comments quoting links.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1773 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-28 19:04:04 +00:00
Jean-Philippe Lang
bfd0fb067a Adds posts quoting functionality (#1825).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1772 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-28 18:56:47 +00:00
Eric Davis
8f3a04ce69 Reverting commit r1748. Some environments are not allowing the cached file to
write to public, causing all JavaScript to fail.

Javascripts are now cached into a single file for downloads in production mode.

  #1186


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1771 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-28 16:32:14 +00:00
Jean-Philippe Lang
6ad989f828 Adds checkboxes toggle links on permissions report.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1770 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-26 16:05:02 +00:00
Jean-Philippe Lang
5c6bee7f85 Simplified Chinese lang file update (#1809 by Chaoqun Zou).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1769 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-26 15:19:28 +00:00
Jean-Philippe Lang
d611339baa Fixes error with CVS+Postgresql and non-UTF8 commit logs (#917, #1659).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1768 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-26 12:28:15 +00:00
Jean-Philippe Lang
0cf15476a3 Adds support for commit logs reencoding to UTF-8 before insertion in the database (#834, #917, #1663).
Source encoding of commit logs can be selected in Application settings -> Repositories.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1767 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-26 12:13:15 +00:00
Jean-Philippe Lang
09eba46ec1 Fixed: document listing shows on "my page" when viewing documents is disabled for the role (#1772).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1766 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-26 11:08:45 +00:00
Jean-Philippe Lang
ea627ca98d One-click bulk edition using the issue list context menu within the same project (#1770).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1765 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-26 10:34:26 +00:00
Jean-Philippe Lang
999d47f986 Use example.net as domain in default configuration (#1762).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1764 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 16:35:20 +00:00
Jean-Philippe Lang
66a079f430 Changes help message about project identifiers (#1478).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1763 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 16:14:07 +00:00
Jean-Philippe Lang
e395d3e46d Fixes context menu with Opera (#1655).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1762 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 15:24:23 +00:00
Jean-Philippe Lang
954bddbadf Make the issue list context menu work under Mac OSX Leopard (#1485). Tested with FF3.0.1 and Safari 3.0.4 under OSX 10.5.2.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1761 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 15:09:31 +00:00
Jean-Philippe Lang
2042e3bbd9 Dots allowed in custom field name (#1723).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1760 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 14:37:44 +00:00
Jean-Philippe Lang
d93f96765b Adds support for file viewing with Darcs 2.0+ (patch #1799 by Ralph Lange slightly edited).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1759 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 14:33:30 +00:00
Jean-Philippe Lang
e339d0bcc0 Fixed: Issue updated_on is not updated when a user adds a note with no edit privilege.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1758 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 12:51:29 +00:00
Jean-Philippe Lang
dbf4438dda More detailed error message in log when scm command fails (#1682).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1757 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 12:31:53 +00:00
Jean-Philippe Lang
0d55652552 Fixes method name in AbstractAdapter.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1756 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 12:27:15 +00:00
Jean-Philippe Lang
6fc62d393c Fixed: invalid SQL query on User#destroy (#1781).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1755 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 11:55:40 +00:00
Jean-Philippe Lang
5ef0af6710 Fixed: Estimated time in issue's journal should be rounded to two decimals (#1793).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1754 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 11:43:48 +00:00
Jean-Philippe Lang
116091a1d2 Fixes platform determination under JRuby (#1804).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1753 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-25 11:01:37 +00:00
Eric Davis
2f3f2d8b12 Added the "Status:" keyword to the MailHandler for setting and changing an Issue status via email.
#1669


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1751 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-20 06:21:06 +00:00
Eric Davis
6db8fa8ef7 Messages on a Board can now be sorted by the number of replies.
#1761


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1750 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-20 06:14:44 +00:00
Eric Davis
af6b01f55d Hiding the View Differences button when a wiki page's history only has one version.
Patch contributed by Chaoqun Zou (#1743)


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1749 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-20 05:09:13 +00:00
Eric Davis
a899904f63 Javascripts are now cached into a single file for downloads in production mode.
Thanks to Philippe Lafoucrière for the patch.  (#1186)


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1748 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-20 04:26:46 +00:00
Jean-Philippe Lang
53078ca949 No warning about rcov each time a rake task is ran.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1747 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-15 18:44:46 +00:00
Eric Davis
910988133d Extracted rcov options and removed gems from the rcov report.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1745 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-13 04:20:23 +00:00
Eric Davis
fab5c1fdef Added rake tasks to generate rcov code coverage reports. rake -T test:coverage to see them all
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1744 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-13 04:20:16 +00:00
Eric Davis
ca2449d9cf Added missing documentation for setting up the Darcs test repository.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1743 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-13 03:54:54 +00:00
Jean-Philippe Lang
41d44c5285 Adds user count in status drop down on admin user list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1735 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-11 21:10:24 +00:00
Jean-Philippe Lang
d47400aa8d Adds Lock/Unlock/Activate link on user edit screen.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1734 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-11 21:02:36 +00:00
Jean-Philippe Lang
988f8d65fa Adds 'Edit' link on account/show for admin users.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1733 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-11 20:55:17 +00:00
Eric Davis
a3e729a263 Added doc/README_FOR_APP so RDoc can be built. (#1769)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1732 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-11 20:49:52 +00:00
Jean-Philippe Lang
237a3f52a2 Fixes custom fields display order at several places (#1768).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1731 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-11 18:24:39 +00:00
Jean-Philippe Lang
1631019026 Allow same name for custom fields on different object types.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1730 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-11 18:09:54 +00:00
Jean-Philippe Lang
1650920339 Adds links to forum messages using message#id syntax (#1756).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1729 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-10 22:18:23 +00:00
Jean-Philippe Lang
ab4873b83d Quote ids for attachment association since Trac's attachment.id is varchar (#1759).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1728 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-10 21:35:03 +00:00
Jean-Philippe Lang
2fdf4426cd Moves @layout 'base'@ to ApplicationController.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1727 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-10 15:22:54 +00:00
Jean-Philippe Lang
361138e16d Slight change to engines to let plugins override views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1723 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-07 19:59:02 +00:00
Jean-Philippe Lang
2e4e9b88d2 Fixes rdm-mailhandler SSL support (#1724).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1715 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-03 11:07:16 +00:00
Jean-Philippe Lang
91a5fa32d7 Fixes non-matching html tag (#1734).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1714 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-03 09:30:56 +00:00
Jean-Philippe Lang
d1a504f768 Fixed: logtime entry duplicated when edited from parent project (#1728).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1713 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-03 09:27:27 +00:00
Jean-Philippe Lang
a332e0a4fe Adds permissions for viewing the watcher list and adding new watchers on the issue detail view (#398).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1712 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-08-03 09:14:43 +00:00
Jean-Philippe Lang
6034067d86 Fixed: activity atom feed broken by r1701 (#1703).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1711 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-30 18:33:35 +00:00
Jean-Philippe Lang
3197814c62 Fixed: RedCloth#block_markdown_rule freezes when parsing many hyphen marks (#1704).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1710 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-30 18:28:01 +00:00
Jean-Philippe Lang
b91bdf8798 Fixed: tokens not escaped in highlight_tokens regexp (#1702).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1709 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-28 21:11:49 +00:00
Jean-Philippe Lang
b26e4932a2 Smaller font in context menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1708 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-28 18:01:05 +00:00
Jean-Philippe Lang
c3f9575eaf Adds category to the issue context menu (#1684).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1707 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-28 18:00:30 +00:00
Jean-Philippe Lang
198a8c602d Adds support for wiki links with anchor (#1647).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1706 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-28 17:20:31 +00:00
Jean-Philippe Lang
2dbc3d2943 Adds Trac-Like anchors on wiki headings (#1647).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1705 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-28 17:08:16 +00:00
Jean-Philippe Lang
b20281f151 Follows r1703.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1704 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-27 19:18:35 +00:00
Jean-Philippe Lang
3a4855d070 Activity provider example in sample plugin.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1703 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-27 19:10:56 +00:00
Jean-Philippe Lang
d05bcda2ba Adds #activity_provider shortcut method to the plugin API.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1702 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-27 18:38:31 +00:00
Jean-Philippe Lang
a774c5c48b Activity refactoring.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1701 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-27 17:54:09 +00:00
Jean-Philippe Lang
1721376542 Fixes tests (r1693).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1700 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-27 10:23:07 +00:00
Jean-Philippe Lang
ec7d135930 Adds child_pages macro for wiki pages (#528).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1699 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-26 12:54:54 +00:00
Jean-Philippe Lang
60d066f943 Wiki page hierarchy (#528). Parent page can be assigned on Rename screen.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1698 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-26 11:46:24 +00:00
Jean-Philippe Lang
b68fd4c04b When moving an issue to another project, reassign it to the category with same name if any (#1653).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1697 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-26 09:27:07 +00:00
Jean-Philippe Lang
6ddea3396b Adds estimated hours to issue filters (#1678).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1696 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-26 09:05:26 +00:00
Jean-Philippe Lang
9f92554319 Redirect user to the previous page after logging in (#1679).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1695 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-26 08:46:33 +00:00
Jean-Philippe Lang
5564dfbbd5 TOC rendered as an unordered list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1693 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 19:40:47 +00:00
Jean-Philippe Lang
a17b62b455 Fixes hard-coded table names in queries.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1692 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 19:07:43 +00:00
Jean-Philippe Lang
d84d38983a Adds boolean and list custom fields for time entries as criteria on timelog report.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1691 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 19:06:13 +00:00
Jean-Philippe Lang
f54c2d812d Adds custom fields to the time entries csv export.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1690 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 19:02:40 +00:00
Jean-Philippe Lang
898fac293b Adds custom fields on time entries (#772).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1689 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 18:52:00 +00:00
Jean-Philippe Lang
590a829a06 Removed unused exception definition (r1678).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1688 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 18:24:40 +00:00
Jean-Philippe Lang
a9932e3dbd Adds mailto link on the user administration list (#1670).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1687 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 17:59:45 +00:00
Jean-Philippe Lang
9b579de9e2 Appends the filename to the attachment url so that clients that ignore content-disposition http header get the real filename (#1649).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1686 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 17:55:19 +00:00
Jean-Philippe Lang
8a7bfc72b2 Move VersionsController#download to AttachmentsController.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1685 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-22 17:20:02 +00:00
Jean-Philippe Lang
aaca2c50e5 Fixed: 'search titles only' box ignored after one search is done on titles only.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1684 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-21 19:19:06 +00:00
Jean-Philippe Lang
9d3dfea1ac Adds username to the password reminder email (#1668).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1683 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-21 19:13:46 +00:00
Jean-Philippe Lang
c39161a6fc Fixed: searchable model can't be loaded if table is not yet created (#1421).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1682 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-20 17:31:11 +00:00
Jean-Philippe Lang
be2b8a62f4 Search engine: display total results count (#906) and count by result type.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1681 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-20 17:26:07 +00:00
Jean-Philippe Lang
83baccb71a Strikethru closed issue links (#1127).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1680 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-20 09:50:33 +00:00
Jean-Philippe Lang
1ddd9bb55b Fixed: dependency on ruby 1.8.7 introduced in r1660 (#1643).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1679 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-20 09:25:30 +00:00
Jean-Philippe Lang
eb1d969237 Improved on-the-fly account creation. If some attributes are missing (eg. not present in the LDAP) or are invalid, the registration form is displayed so that the user is able to fill or fix these attributes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1678 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-19 10:47:19 +00:00
Jean-Philippe Lang
93201e7386 Fixed: Wiki Linking Fails on News Item Preview (#1661).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1677 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-19 07:29:05 +00:00
Jean-Philippe Lang
324495643b Small fix to gloc error messages translation.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1676 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-19 07:19:55 +00:00
Jean-Philippe Lang
1701e0bd79 Fixed: default configuration can not be loaded for :it, :pt and :ro languages (#1660).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1675 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-17 16:27:29 +00:00
Jean-Philippe Lang
795220a1e6 Adds links to the user page on various views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1674 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-16 19:33:15 +00:00
Jean-Philippe Lang
aef25a5e32 Fixes r1672.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1673 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-16 19:22:09 +00:00
Jean-Philippe Lang
83385cbca8 Adds timelog link to the issue context menu (#1645).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1672 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-16 19:10:29 +00:00
Jean-Philippe Lang
7c6f191cf5 Fixed: Context menu overwritten by calendar on My Page (#1644).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1671 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-16 18:48:50 +00:00
Jean-Philippe Lang
025581bb28 Fixes boolean custom fields tags (broken by r1592) (#1640).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1668 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-14 17:29:06 +00:00
Jean-Philippe Lang
6d3c0dab01 Javascript fix (#1636).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1667 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-14 15:46:02 +00:00
Jean-Philippe Lang
fc07ba2a99 Clear changesets and changes with raw sql when deleting a repository (#1627).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1666 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 21:55:13 +00:00
Jean-Philippe Lang
0eba42423a Set order on wiki pages association.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1665 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 21:44:38 +00:00
Jean-Philippe Lang
9ba4075c88 Fixes search tests for Postgresql.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1664 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 21:01:38 +00:00
Jean-Philippe Lang
937cee7269 Prevent blank menu caption.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1663 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 13:25:37 +00:00
Jean-Philippe Lang
ad497bdcba Admin and Help links at the end of top menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1661 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 12:25:01 +00:00
Jean-Philippe Lang
7b8a4fc28b Menu mapper: add support for :before, :after and :last options to #push method and add #delete method.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1660 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 12:12:58 +00:00
Jean-Philippe Lang
c4eef6314e Menu item caption can be a Proc.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1659 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-13 11:02:42 +00:00
Jean-Philippe Lang
591407c5c8 Adds auto links tests.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1658 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 11:12:33 +00:00
Jean-Philippe Lang
4e7336dac9 Fixes engines assets mirroring.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1657 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 11:04:41 +00:00
Jean-Philippe Lang
a01a562261 Fixed: Plugin's setting page is broken after upgrading to rails 2.1.0 (#1620).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1656 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 10:31:41 +00:00
Jean-Philippe Lang
0b1343834d Translations updates.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1655 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 10:28:09 +00:00
Jean-Philippe Lang
c28cbd5790 Adds engines 2.1.0 plugin.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1654 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 10:17:14 +00:00
Jean-Philippe Lang
b5444b5fcd Fixed: no :author method error on projects atom feed (#1623).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1653 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 09:42:18 +00:00
Jean-Philippe Lang
622b6121f4 Fixes nil error when svn binary version is unknown (#1607).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1652 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-12 09:06:19 +00:00
Jean-Philippe Lang
9ff53f97ee Do not use partial in PDF templates (not supported when using rfpdf with Rails 2.1) (#1619).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1651 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-10 16:23:42 +00:00
Jean-Philippe Lang
d7eb689c74 Fixed: trailing period should not be included in redmine links of type class:id (#1612).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1650 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-10 13:36:28 +00:00
Jean-Philippe Lang
be4cc2f99e Fixed: search engine may reveal private projects (#1613).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1649 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-10 12:31:49 +00:00
Jean-Philippe Lang
de3d5a88e4 Fixes links to entries on the revision view (Rails 2.1 compatibility) (#1600).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1648 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-09 17:25:19 +00:00
Jean-Philippe Lang
bb76561ca6 Fixes Gantt chart with ruby 1.8.7 (#1606).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1647 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-09 17:16:37 +00:00
Jean-Philippe Lang
40efaae6d5 Mail handler: more control over issue attributes (#1110).
Tracker, category and priority attributes can be specified in command line arguments and/or individually specified as overridable by email body keywords.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1643 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-06 16:26:25 +00:00
Jean-Philippe Lang
bfba84d526 Better naming of activity feed if only one kind of event is displayed (#1323).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1642 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-06 13:57:10 +00:00
Jean-Philippe Lang
d4f55a86fd Adds project name to issues feed title (#1323).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1641 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-06 13:47:59 +00:00
Jean-Philippe Lang
8c6c3eab5c Fixes "source:" links URLs (r1617).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1640 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-06 12:43:51 +00:00
Jean-Philippe Lang
bc9a8494d2 Merged CHANGELOG from 0.7 stable.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1639 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-06 12:24:14 +00:00
Jean-Philippe Lang
29fb8db936 Adds MercurialAdapter.client_version and prevent @hg --version@ to be called on each request.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1628 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-05 09:39:00 +00:00
Jean-Philippe Lang
12fbd06c02 Display svn properties in the browser, svn >= 1.5.0 only (#1581).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1627 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-05 08:59:04 +00:00
Jean-Philippe Lang
1e6b8a482a Removes calls to TimeZone#adjust (#1584).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1626 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-05 07:39:07 +00:00
Jean-Philippe Lang
fc42dd2cef Email delivery configuration moved to an unversioned YAML file (config/email.yml, see the sample file) (#1412).
Email delivery is disabled. It's automatically turned on when configuration is found.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1625 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-04 18:55:45 +00:00
Jean-Philippe Lang
5d0b53544c Updated INSTALL doc.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1624 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-04 18:03:43 +00:00
Jean-Philippe Lang
7cdd88a6ce Merged Rails 2.1 compatibility branch.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1623 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-04 17:58:14 +00:00
Jean-Philippe Lang
22558f7709 Fixes test broken by r1610.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1616 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-03 16:22:51 +00:00
Jean-Philippe Lang
9703f576d9 Escapes HTML tags.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1612 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-07-02 17:27:16 +00:00
Jean-Philippe Lang
be57c20cd8 Fixes quick jump to a revision.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1611 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-30 21:52:29 +00:00
Jean-Philippe Lang
72076d391e Fixed: issues always created with default tracker (#1553).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1610 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-30 17:57:53 +00:00
Jean-Philippe Lang
87a16f395a Fixes relative paths to images in wiki_syntax.html (#1218).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1609 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-30 17:35:40 +00:00
Jean-Philippe Lang
ee608f24f4 Fixed: Comment too long message when updating issue (#1550).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1608 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-30 17:31:50 +00:00
Jean-Philippe Lang
b29b39290a Redirects back after clicking watch/unwatch links without javascript (#1337).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1607 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 19:56:20 +00:00
Jean-Philippe Lang
0f5a34b7ab Removes no longer needed helper method (r1605).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1606 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 19:51:14 +00:00
Jean-Philippe Lang
47064c02f1 Makes issue update link work without javascript (#1337).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1605 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 19:50:07 +00:00
Jean-Philippe Lang
5d6e9494ad Translations updates:
* Traditional Chinese (ChunChang Luo)
* Finnish (Jani Tiainen)
* Lithuanian (Sergej Jegorov)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1604 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 12:23:07 +00:00
Jean-Philippe Lang
32fa1a4e90 Do not silently ignore timelog validation failure on issue edit.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1603 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 12:16:58 +00:00
Jean-Philippe Lang
1424b0f215 Addq "please select" to activity select box if no activity is set as default (#937).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1602 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 12:01:20 +00:00
Jean-Philippe Lang
94cf4f258f Wider SVG graphs in repository stats.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1601 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 11:13:10 +00:00
Jean-Philippe Lang
a0f707e54b Fixed: Entourage (and some old client) fails to correctly render notification styles (#1425).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1600 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 09:50:42 +00:00
Jean-Philippe Lang
00593f2f34 Reduces memory usage when importing large git repositories (#1482).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1599 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 09:41:42 +00:00
Jean-Philippe Lang
a40add57de Adds HTML titles to forums related views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1598 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 09:08:58 +00:00
Jean-Philippe Lang
0344719482 Makes importer work with Trac 0.8.x (#1540).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1597 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 09:03:03 +00:00
Jean-Philippe Lang
22c9a43899 Fixed: associated revisions are displayed in wrong order on issue view (#1546).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1596 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 08:55:37 +00:00
Jean-Philippe Lang
fa88a592fd Fixed #1545: migration on fresh install fails (broken by r1592).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1595 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-29 08:14:13 +00:00
Jean-Philippe Lang
75a5dbd01d Upgraded to Prototype 1.6.0.1.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1594 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-28 11:34:53 +00:00
Jean-Philippe Lang
bd3191f80d New rake task name in comments for creating sessions migration (#1520).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1593 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-27 20:18:23 +00:00
Jean-Philippe Lang
ce6cf66f6c Custom fields refactoring: most of code moved from controllers to models (using new module ActsAsCustomizable).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1592 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-27 20:13:56 +00:00
Jean-Philippe Lang
a4a8b6381e Adds a key in lang files (general_csv_decimal_separator) to set the decimal separator (point or comma) in csv exports (#1372).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1591 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 19:46:57 +00:00
Jean-Philippe Lang
864ac367e8 Translations updates:
* Simplified Chinese (chaoqun zou)
* Hungarian (Gábor Takács)
* Russian (Denis Tomashenko)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1590 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 19:29:05 +00:00
Jean-Philippe Lang
f79f19f84c Fixed: timelog redirects inappropriately when :back_url is blank (#1524).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1589 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 19:11:07 +00:00
Jean-Philippe Lang
0fd9b102be Adds anchor to atom feed messages links.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1588 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 19:04:58 +00:00
Jean-Philippe Lang
b3939fb134 Link to view specific file on revision view fails with Subversion repository subdirectory (#1525).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1587 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 17:02:09 +00:00
Jean-Philippe Lang
ad7816cea4 Tests: create tmp/test if it doesn't exist.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1586 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 14:59:03 +00:00
Jean-Philippe Lang
31e3d180c0 Add project name to cross-project Atom feeds (#1527).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1585 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-26 14:54:45 +00:00
Jean-Philippe Lang
25bba80c9e Adds a simple API and a standalone script that can be used to forward emails from a local or remote email server to Redmine (#1110).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1584 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-25 19:25:28 +00:00
Jean-Philippe Lang
4d6f50d3fe Encoding set to utf8 in example database.yml (#1506).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1583 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-24 18:39:49 +00:00
Jean-Philippe Lang
c97a5efde9 Fixed: private method 'gsub' called for nil:NilClass on activity (#1519).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1582 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-24 16:52:41 +00:00
Jean-Philippe Lang
8474d05e99 Fixes test broken by r1578.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1581 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-24 16:49:51 +00:00
Jean-Philippe Lang
3121e0b5d0 Smaller font size for activity events and search results descriptions.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1580 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-23 17:12:12 +00:00
Jean-Philippe Lang
810ec643f8 Strip pre/code tags content from activity view events.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1579 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-23 17:06:58 +00:00
Jean-Philippe Lang
dc57b06b6c Adds a class ('me') to events of the activity view created by current user.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1578 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-23 17:01:21 +00:00
Jean-Philippe Lang
28c094f50e Turn ftp urls into links (#1514).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1577 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-23 16:51:13 +00:00
Jean-Philippe Lang
0d5b03bab7 Add filters on cross-project issue list for custom fields marked as 'For all projects'.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1576 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 15:35:11 +00:00
Jean-Philippe Lang
b025b63111 Hide 'Target version' filter if no version is defined.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1575 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 15:20:59 +00:00
Jean-Philippe Lang
b14aa23c8c Revision view: do not display links for deleted files.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1574 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 14:40:45 +00:00
Jean-Philippe Lang
c107fee54e Use new image instead of expand.png
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1573 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 14:35:56 +00:00
Jean-Philippe Lang
8b6dd3fdcd IMAP: fetch unseen messages only.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1572 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 13:14:45 +00:00
Jean-Philippe Lang
8b33565b3e IMAP: Mark emails as Seen.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1571 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 12:56:10 +00:00
Jean-Philippe Lang
268165a013 Fixes reply attachments handling.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1570 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 12:37:24 +00:00
Jean-Philippe Lang
3d8d4fa0d6 Adds a rake task (redmine:email:receive_imap) to read emails from an IMAP server (#1110).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1569 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 12:27:00 +00:00
Jean-Philippe Lang
a01f976b4c Adds basic support for issue creation via email (#1110).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1568 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-22 10:45:03 +00:00
Jean-Philippe Lang
bb1edda6e8 Display issue notes in the activity view (#1509).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1567 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-21 12:32:47 +00:00
Jean-Philippe Lang
ba8a36a39b Removes spaces before colons on issue detail view (#1512).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1566 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-21 10:15:07 +00:00
Jean-Philippe Lang
9cfa233001 Track project and tracker changes in issue history.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1565 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-19 18:52:20 +00:00
Jean-Philippe Lang
0870f6267f Add target version to the issue list context menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1564 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-18 20:15:51 +00:00
Jean-Philippe Lang
fda7bcdfb6 Mercurial adapter tests fix (#1469).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1563 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-18 17:02:39 +00:00
Jean-Philippe Lang
af734b1b38 Enable syntax highlight on issues, messages and news (#1473, #1466).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1562 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-18 16:49:40 +00:00
Jean-Philippe Lang
7d143bc3f7 Allow dot in firstnames and lastnames (closes #1426).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1561 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-17 20:14:31 +00:00
Jean-Philippe Lang
062a2d6f5d Adds atom feed on time entries details (#1479).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1560 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-17 20:01:15 +00:00
Jean-Philippe Lang
d991e46f12 Fixed: urls containing @ are parsed as email adress by the wiki formatter (#1456).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1559 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-17 19:27:03 +00:00
Jean-Philippe Lang
3c95f761e6 Ability to remove enumerations (activities, priorities, document categories) that are in use. Associated objects can be reassigned to another value (#1467).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1558 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-17 19:10:54 +00:00
Jean-Philippe Lang
f4e0c77c83 Prevent unwanted textile link parsing at end of line.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1557 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-16 19:37:09 +00:00
Jean-Philippe Lang
0223b87612 RepositoriesController cleanup with rescue_from.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1555 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 16:11:07 +00:00
Jean-Philippe Lang
9737beecc4 Adds a field on the repository view to browse at specific revision (#1443).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1554 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 15:56:47 +00:00
Jean-Philippe Lang
ca6e69ec24 Fixed: view file at given revision with CVS.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1553 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 15:47:28 +00:00
Jean-Philippe Lang
93b3dba926 Makes changes link to entries on the revision view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1552 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 14:40:05 +00:00
Jean-Philippe Lang
7c1c2e1ba2 Fixes test broken by r1549.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1551 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 14:39:52 +00:00
Jean-Philippe Lang
8a54c455b8 Fixes test broken by r1549.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1550 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 14:34:23 +00:00
Jean-Philippe Lang
5051566e51 Prettier url for changesets (#1443).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1549 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 14:19:06 +00:00
Jean-Philippe Lang
576130f363 Doc update for 0.7.2 release.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1546 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 12:25:48 +00:00
Jean-Philippe Lang
597c1e6c09 Adds links to repository directories in the browser (#1094).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1544 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 11:40:13 +00:00
Jean-Philippe Lang
11e9891425 Fixed: TOC does not remove colorization markups (#1423).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1542 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 11:00:40 +00:00
Jean-Philippe Lang
8b2105e20a Translation updates.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1540 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 09:49:16 +00:00
Jean-Philippe Lang
622798a5ed Close statement handler in Redmine.pm (#1433).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1539 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 09:43:53 +00:00
Jean-Philippe Lang
2b3009d91d Hungarian translation update (closes #1408).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1538 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-15 09:38:02 +00:00
Jean-Philippe Lang
b1a8790a36 File size display with Bazaar repositories (#1149).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1537 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-14 15:44:36 +00:00
Jean-Philippe Lang
34bcd5b80b Fixed: Logtime info lost when there's an error updating an issue (#1400).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1535 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-14 14:10:47 +00:00
Jean-Philippe Lang
846045fd05 Fixed: time entries created with the default activity even if a different one is specified (#1302).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1533 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-14 12:31:32 +00:00
Jean-Philippe Lang
40a9bbe946 CVS: add support for modules names with spaces (#1434).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1527 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-14 11:42:50 +00:00
Jean-Philippe Lang
d2ad4edc86 Fixed: page has no title when adding a project (#1436).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1526 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-14 11:15:57 +00:00
Jean-Philippe Lang
b42b697ffb Fixed: unexpected nil when viewing differences on CVS (#1444).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1525 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-14 10:51:15 +00:00
Jean-Philippe Lang
cc9b8f7878 Fixed: SVG::Graph raises an error when using external stylesheet (#1402).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1524 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-09 20:05:32 +00:00
Jean-Philippe Lang
53b5703981 Slight changes to diff view and style.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1523 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-09 19:15:40 +00:00
Jean-Philippe Lang
efe790a8d3 Removed inconsistent revision numbers on diff view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1522 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-09 19:02:22 +00:00
Jean-Philippe Lang
19cb6f96f4 Log the user in after registration if account activation is not needed.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1521 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-09 18:59:15 +00:00
Jean-Philippe Lang
80a7486f95 File viewer for attached text files.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1520 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-09 18:40:59 +00:00
Jean-Philippe Lang
aa0beecad0 Move the file viewer to a partial.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1519 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-09 17:02:55 +00:00
Jean-Philippe Lang
e46b56d7fc "New Project" link on Projects page for admin users (#1082).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1518 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 22:45:22 +00:00
Jean-Philippe Lang
0389c60129 Fixed: notextile tag has no effect.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1517 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 20:31:36 +00:00
Jean-Philippe Lang
d77c1d2829 Unified diff viewer for attached files with .patch or .diff extension (#1403).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1516 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 18:26:39 +00:00
Jean-Philippe Lang
e833cab30e Move diff viewer to a partial.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1515 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 18:10:49 +00:00
Jean-Philippe Lang
b78b62df8d SCM browser: ability to download raw unified diffs.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1514 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 16:48:21 +00:00
Jean-Philippe Lang
ec0525d497 Move unified diff parser out of the scm abstract adapter so it can be reused for viewing attached diffs (#1403).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1513 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 16:28:42 +00:00
Jean-Philippe Lang
731d15fe9b Don't search for the changeset if revision identifier is nil.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1512 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 15:47:55 +00:00
Jean-Philippe Lang
0aba4255f5 Don't display the table headers if there is no changeset to display.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1511 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 15:46:15 +00:00
Jean-Philippe Lang
a0d1414606 Filesystem adapter: read files in binary mode.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1510 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 15:44:23 +00:00
Jean-Philippe Lang
5dea200774 Filesystem adapter: negative size is displayed for large files under win32.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1509 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 15:43:32 +00:00
Jean-Philippe Lang
e69b4647f2 Adds Filesystem adapter (patch #1393 by Paul R).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1508 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 15:40:24 +00:00
Jean-Philippe Lang
dfe62d7f51 Ability to disable unused SCM adapters in application settings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1507 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 14:59:26 +00:00
Jean-Philippe Lang
05cd95987f Fixes tabulation with Firefox 2 on tabular forms.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1506 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-08 10:10:54 +00:00
Jean-Philippe Lang
2e8b2d5e13 Display status change before subject of issue on the activity view otherwise it may be truncated.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1505 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 20:06:44 +00:00
Jean-Philippe Lang
383da1e6d6 Fixes functional tests broken by r1501.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1504 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 15:14:42 +00:00
Jean-Philippe Lang
d446469f5d Removes constraint on enumerations name (#1384).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1503 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 15:08:59 +00:00
Jean-Philippe Lang
042da97f54 Trac importer: read session_attribute table to find user's email and real name (#1340).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1502 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 14:55:32 +00:00
Jean-Philippe Lang
956ad0a3f9 Fixed: Reply/Quote Function Newline Issue in Internet Explorer (#1362).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1501 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 11:42:37 +00:00
Jean-Philippe Lang
6d5db302ee Subversion adapter: ignore directories with no commit date (#1370).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1500 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 10:08:11 +00:00
Jean-Philippe Lang
aa9d04a4a7 Mercurial adapter improvements (patch #1199 by Pierre Paysant-Le Roux).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1499 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 09:19:50 +00:00
Jean-Philippe Lang
a6da479a63 Translations updates.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1498 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 09:03:20 +00:00
Jean-Philippe Lang
f4aa04b96e Fixes Chinese pdf export when the issue description is too long (#1170).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1497 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-07 08:39:06 +00:00
Jean-Philippe Lang
9f901a0ba2 Fixed: Atom link on saved query does not include query_id (#1390).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1496 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-06 15:20:08 +00:00
Jean-Philippe Lang
a0f83e42e4 Hides the "Replies" heading below a message if there is no reply (#1350).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1495 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-06 15:14:09 +00:00
Jean-Philippe Lang
8aa57058cf Trac importer: improves wiki link conversion (#1287).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1494 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-06 15:02:47 +00:00
Jean-Philippe Lang
a5ee8f8986 Fixed: SVN errors lead to svn username/password being displayed to end users (#1368).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1493 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-06 14:37:49 +00:00
Jean-Philippe Lang
cd824c6ecf Redmine links regexp fix (#1369, url hash turned into a ticket link).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1492 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-04 21:30:12 +00:00
Jean-Philippe Lang
4db45b8ced Fixed: changesets titles should not be multiline in atom feeds (#1356).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1491 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-04 18:13:14 +00:00
Jean-Philippe Lang
735db3dae5 Allow empty cells in wiki tables.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1490 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-04 17:12:59 +00:00
Jean-Philippe Lang
a77fb3b591 Missing strings (r1488).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1489 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-03 18:41:36 +00:00
Jean-Philippe Lang
7042879811 Make the 'duplicates of' relation asymmetric:
* closing a issue will close its duplicates
* closing a duplicate won't close the main issue

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1488 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-03 18:30:29 +00:00
Jean-Philippe Lang
891a71ad47 Fixed: new line at the end of a file is not displayed in diff.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1487 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-02 20:14:06 +00:00
Jean-Philippe Lang
36162c6cf2 Diff: adds some space between 2 changes in the same file and reduces html size.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1486 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-02 19:18:17 +00:00
Jean-Philippe Lang
870e8654b4 Fixed: Atom feeds don't provide author section for repository revisions (#1348).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1485 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-02 18:16:56 +00:00
Jean-Philippe Lang
4cc3ba88a8 Fixed: Link to PDF doesn't work after creating new issue (#1346).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1484 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-02 17:01:02 +00:00
Jean-Philippe Lang
a06d2c41d5 Fixed: Reminder emails shouldn't include archived projects (#1351).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1483 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-06-02 16:59:15 +00:00
Jean-Philippe Lang
50c338b229 Additional test for r1481.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1482 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-30 18:42:56 +00:00
Jean-Philippe Lang
9894a3781e Fixed: browser's accept-language subcodes ignored (#1320).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1481 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-30 18:40:02 +00:00
Jean-Philippe Lang
5d2abb84bd Adds a Reply link to each issue note (#739). Reply is pre-filled with the quoted note.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1480 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-30 17:42:25 +00:00
Jean-Philippe Lang
88dea1a06d Adds multi-levels blockquotes support by using > at the beginning of lines.
Textile is preserved inside quoted text.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1479 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-30 16:35:36 +00:00
Jean-Philippe Lang
4311ecbc04 Fixed: Incorrect weekend definition in Hebrew calendar locale (#1328).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1478 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-30 15:34:53 +00:00
Jean-Philippe Lang
ffea044699 Trac importer: migrate attachments descriptions (#1326).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1477 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-29 19:31:21 +00:00
Jean-Philippe Lang
6ebdf848a5 Fixed: Unable to use angular braces after include word in c code highlighting (#1230).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1476 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-29 19:12:17 +00:00
Jean-Philippe Lang
e1a86106d0 Fixed: GitAdapter#get_rev should use current branch instead of hardwiring @master@ (#1319).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1475 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-29 18:48:00 +00:00
Jean-Philippe Lang
39216f327c Fixed: can not access old projects created with a numeric identifier (#1322).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1473 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-29 17:42:10 +00:00
Jean-Philippe Lang
eb0e218603 Adds new projects atom feed (#1290).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1465 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-27 16:49:18 +00:00
Jean-Philippe Lang
744d866926 Moved ProjectsController#list to ProjectsController#index.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1464 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-26 20:10:32 +00:00
Jean-Philippe Lang
aa87a73e41 No multiline text for textile links.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1463 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-26 19:39:51 +00:00
Jean-Philippe Lang
54138d2b17 Fixed roadmap links to versions (#1297).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1462 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-26 19:12:29 +00:00
Jean-Philippe Lang
d6daeca40a Fixed: IssueController#edit doesn't set default Activity as default (#1302).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1461 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-26 17:12:11 +00:00
Jean-Philippe Lang
b3e5f1a1c3 Fixed zh lang file.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1460 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 20:49:07 +00:00
Jean-Philippe Lang
0c81052770 Adds a rake task to send reminders. An email is sent to each user with a list of the issues due in the next days, if any.
See @rake -D redmine:send_reminders@ for options.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1459 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 17:31:50 +00:00
Jean-Philippe Lang
d99dc4070a Remove edit step from Status context menu (#1197).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1458 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 15:09:42 +00:00
Jean-Philippe Lang
dfcc8e1492 Change projects homepage limit to 255 chars (#663, #1095).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1457 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 13:37:29 +00:00
Jean-Philippe Lang
c7d83be613 Test for striked through wiki link (#199).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1456 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 13:30:54 +00:00
Jean-Philippe Lang
a92749ef93 Gantt chart: display issues that don't have a due date if they are assigned to a version with a date (#184).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1455 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 13:26:21 +00:00
Jean-Philippe Lang
03f0236a6e Prevents NoMethodError on @available_filters.has_key? in query.rb (#1178).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1454 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 12:50:33 +00:00
Jean-Philippe Lang
02757f5892 Translations updates.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1453 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 12:42:56 +00:00
Jean-Philippe Lang
fbafff8363 Hungarian translation added (#1198 by Gábor Takács).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1452 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 12:18:49 +00:00
Jean-Philippe Lang
e8d092e46a Fixed: using '*' as keyword for repository referencing keywords doesn't work when issue id is at the beginning of a line (#1253).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1451 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 11:43:20 +00:00
Jean-Philippe Lang
39fc8f38b8 Prevent admin users from making themselves non-administrator (#1276).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1449 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-25 11:22:53 +00:00
Jean-Philippe Lang
7f134a8c67 Prevent admin users from locking their own account (#1276).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1448 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-24 18:42:53 +00:00
Jean-Philippe Lang
0e5edccaf2 Fixed: Issue number display clipped on 'my issues' (#1291).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1447 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-24 18:37:06 +00:00
Jean-Philippe Lang
193b2450f4 Fixed: View differences for individual file of a changeset fails if the subversion repository URL doesn't point to the repository root (#1209, #1262, #1275).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1446 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-24 17:58:34 +00:00
Jean-Philippe Lang
9d4e71adf3 Fixed: error when previewing a new wiki page (#1292) introduced in r1415.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1445 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-23 16:29:40 +00:00
Jean-Philippe Lang
e02e047dd4 Fixed: TypeError in WikiController#destroy_attachment (#1281).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1444 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-22 18:26:43 +00:00
Jean-Philippe Lang
82c12d09e9 Fixed: non member or anonymous permissions change is effective only after an application restart (#1280).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1443 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-22 18:08:54 +00:00
Jean-Philippe Lang
62125cad33 Fixed: encoding problem when adding non-ASCII issue category in the new issue page (#1286).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1442 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-22 17:02:29 +00:00
Jean-Philippe Lang
e5bc1d370a Use display: block; for activity item descriptions.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1441 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-20 20:49:06 +00:00
Jean-Philippe Lang
03308028c9 Slight changes to the search results.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1440 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-20 20:45:53 +00:00
Jean-Philippe Lang
b0be3b95aa Ability to search a project and its subprojects (#1264).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1439 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-20 20:31:04 +00:00
Liwiusz Ociepa
94dbf641ff Memory leak (postgres -> zlib + ssl) has been fixed by apache developers.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1438 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-19 12:41:40 +00:00
Jean-Philippe Lang
82f204d8ac Adds icons on search results.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1436 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-18 16:33:50 +00:00
Jean-Philippe Lang
073818f8bc Ability to search all projects or the projects the user belongs to (#791).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1435 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-18 16:15:22 +00:00
Jean-Philippe Lang
1907c31138 Fixed: bold, italics, underline not working within parentheses (#1225).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1434 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-18 08:24:31 +00:00
Jean-Philippe Lang
439c697237 Fixed: possible error when attachment's filename is non-ASCII (#747, #1243, #1089).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1433 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-17 11:03:43 +00:00
Jean-Philippe Lang
9e225cc63f Fixed: private subprojects are listed on the issues view (#1217).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1432 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-14 18:19:37 +00:00
Jean-Philippe Lang
7ee38a95a0 Fixed: Calendar and Gantt show private subprojects even if current user is not a member of them (#1217).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1431 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-14 18:01:13 +00:00
Jean-Philippe Lang
06e44b8e64 Do not toggle assignable check box when using un/check all permissions links on role form.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1430 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-14 17:26:13 +00:00
Jean-Philippe Lang
4c6b9d9ce5 Fixed: Check All / Uncheck All in Email Settings doesn't work (#1180).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1429 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-14 17:23:40 +00:00
Jean-Philippe Lang
835cc7ed7c Fixed: Redmine::Scm::Adapters::GitAdapter#get_rev ignored GIT_BIN constant (#1207).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1428 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-13 17:54:51 +00:00
Jean-Philippe Lang
75d25b7e61 Fixed: Update issue form: comment field from log time end out of screen (#1227).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1427 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-13 17:51:55 +00:00
Jean-Philippe Lang
77e87eb0ba Fixed: some labels overflow the form box (#1228).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1426 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-13 16:56:34 +00:00
Liwiusz Ociepa
c4560c4f3b Merge changes from branch swistak.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1425 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-13 09:41:19 +00:00
Jean-Philippe Lang
0476669735 Wiki page protection (#851, patch #1146 by Mateo Murphy with slight changes).
New permission added: protect wiki pages. Once a page is protected, it can be edited/renamed/deleted only by users who have this permission.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1415 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-04 15:05:38 +00:00
Jean-Philippe Lang
556df99456 Doc update for 0.7.1 release.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1412 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-04 10:20:16 +00:00
Jean-Philippe Lang
9e5624c362 Prevent "can't convert nil into String" error when :sort_order param is not present.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1410 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-03 15:09:06 +00:00
Jean-Philippe Lang
35321d938b Translations updates (closes #1128, #1129, #1135, #1148, #1163).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1409 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-03 10:41:28 +00:00
Jean-Philippe Lang
251b1f75e9 Fixed: error on Trac import when :due attribute is nil (#1164).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1406 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-02 16:48:09 +00:00
Jean-Philippe Lang
c65d696f41 Fixed: error when using upcase language name in coderay (#1162) (Windows specific).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1405 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-02 15:35:41 +00:00
Jean-Philippe Lang
63951812a1 Split user edit screen into tabs.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1404 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-02 15:21:21 +00:00
Jean-Philippe Lang
7a969dafac Escape HTML comment tags (#1160).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1403 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-02 15:16:17 +00:00
Jean-Philippe Lang
7f8d959171 Show the project hierarchy in the drop down list for new membership on user administration screen.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1401 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-01 13:50:39 +00:00
Jean-Philippe Lang
f705b889d9 Hide the 'Latest projects' box on the welcome screen if there are no projects (#1156).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1400 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-01 13:01:23 +00:00
Jean-Philippe Lang
2d11265ec5 Fixed: private subprojects names are revealed on the project overview (#1152).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1399 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-01 12:56:59 +00:00
Jean-Philippe Lang
6d637ad982 Add Redcloth's :block_markdown_rule to allow horizontal rules in wiki (#967).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1389 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-05-01 08:44:40 +00:00
Jean-Philippe Lang
b2abe48592 Use GET instead of POST on roadmap (#718), gantt and calendar forms.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1388 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-30 12:14:15 +00:00
Jean-Philippe Lang
f1ae453688 Fixed: Updating tickets add a time log with zero hours (#1147).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1385 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-30 09:09:28 +00:00
Jean-Philippe Lang
4525a7429a Fixed: Home, Logout, Login links are absolute (#1122, #1145).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1384 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-30 08:51:12 +00:00
Jean-Philippe Lang
4403e300ff Thai translation added (Gampol Thitinilnithi, #1136).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1383 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-30 08:47:14 +00:00
Jean-Philippe Lang
5f58e2ced2 Fixed: Search for target version of "none" fails with postgres 8.3 (#1134).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1379 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-29 09:57:47 +00:00
Jean-Philippe Lang
05d39eeb35 Changelog update.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1369 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-28 10:26:05 +00:00
Jean-Philippe Lang
e55c1d82e6 Notify project members when a message is posted if they want to receive notifications for everything on the project (#1079).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1368 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-28 09:25:51 +00:00
Jean-Philippe Lang
67e7758185 Translation updates (closes #1123, #1124):
* Spanish (Gumer Coronel)
* Norvegian (Kai Olav Fredriksen)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1367 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-28 08:52:35 +00:00
Jean-Philippe Lang
c72b53a8fa Forces Redmine to use rails 2.0.2 gem when vendor/rails is not present.
If you don't want to upgrade rails gem, freeze Redmine by running the following command in your Redmine directory:

  rake rails:freeze:edge TAG=rel_2-0-2

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1366 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-27 16:34:42 +00:00
Jean-Philippe Lang
a73f68a185 Fixed: Links to repository directories don't work (#1119).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1365 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-27 10:12:15 +00:00
Jean-Philippe Lang
6a3236daea Include subprojects versions on calendar and gantt (#1116).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1364 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-27 08:20:53 +00:00
Jean-Philippe Lang
ffbdc6b25b Postgresql 8.3 compatibility fix (#834).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1363 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-26 17:56:26 +00:00
Jean-Philippe Lang
64474802f9 Fixes custom field filters behaviour (#1078).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1362 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-26 16:55:24 +00:00
Jean-Philippe Lang
a6311a9603 Estimated time recognizes improved time formats (#1092).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1361 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-26 11:59:51 +00:00
Jean-Philippe Lang
1d570a40ff Fixed: ActiveRecord::StaleObjectError exception on closing a set of circular duplicate issues (#1105).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1360 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-26 10:54:46 +00:00
Jean-Philippe Lang
76b92fb999 Warn user that subprojects are also deleted when deleting a project (#1111) and add a checkbox to confirm the deletion.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1359 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-26 10:20:48 +00:00
Jean-Philippe Lang
a9f86444fc Fixed: Modules selection not remembered when new project creation fails (#1109).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1358 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-26 09:49:16 +00:00
Jean-Philippe Lang
596de073f9 Commits per author graph: remove email adress in usernames (#1066).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1357 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-24 18:35:56 +00:00
Jean-Philippe Lang
2b412e9e07 Fixed: trying to preview a new issue raises an exception (closes #984).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1356 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-24 17:35:04 +00:00
Jean-Philippe Lang
76b8d3eff2 CVS duplicate key violation fix (#996, #1098).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1355 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-24 17:28:55 +00:00
Jean-Philippe Lang
1a4f81163d Redirected user to where he is coming from after logging hours (#1062).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1354 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-16 17:27:53 +00:00
Jean-Philippe Lang
7061f73708 ApplicationHelperTest fix.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1353 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-15 20:27:10 +00:00
Jean-Philippe Lang
277bee62eb Issue list shows all tickets when going back to a global query inside a project (closes #1055).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1352 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-14 19:21:58 +00:00
Jean-Philippe Lang
741ddfb50b Hide export links in print media css.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1351 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-14 19:13:22 +00:00
Jean-Philippe Lang
0329094f01 Include macro can include a page of another project wiki using !{{include(projectname:Foo)}} (#1052).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1350 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-13 16:22:55 +00:00
Jean-Philippe Lang
e644435715 Add css class for ticket changes (#1032).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1349 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-13 13:24:03 +00:00
Jean-Philippe Lang
97fe797ad3 Replace closing html tags with html entity (#910).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1348 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-13 12:45:17 +00:00
Jean-Philippe Lang
8b9fb29d95 Translation updates (closes #1010, #1017, #1047):
* Finnish (Antti Perkiömäki)
* Spanish (Gumer Coronel)
* Czech (Maxim Krušina)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1347 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-13 12:25:22 +00:00
Jean-Philippe Lang
56683967da Left align filter buttons (closes #872) and reduce filters spacing.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1346 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-13 11:18:09 +00:00
Jean-Philippe Lang
a340d8c957 Better error message and AR errors in log for failed LDAP on-the-fly user creation (closes #932, #1042).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1345 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-13 09:12:43 +00:00
Jean-Philippe Lang
8eb86396e1 Fixed: Double dot displayed on ticket view when ticket not updated (closes #813).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1344 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-12 17:25:06 +00:00
Jean-Philippe Lang
7aaa538fd9 Fixed: error when browsing an empty Mercurial repository (#1046).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1343 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-12 17:13:17 +00:00
Jean-Philippe Lang
6d2a89142a Add an icon to each event on the activity view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1342 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-12 16:54:14 +00:00
Jean-Philippe Lang
85f040c536 Fixed: preview fails when updating an issue (broken by r1322). Patch #1027.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1341 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-09 17:52:41 +00:00
Jean-Philippe Lang
a3c89d4f69 Custom fields (list and boolean) can be used as criteria in time report (#1012).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1340 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-09 17:45:39 +00:00
Jean-Philippe Lang
f025b16be7 Fix date range filter js behaviour and css fix for IE.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1339 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-07 17:56:32 +00:00
Jean-Philippe Lang
5d34548539 CSV export added to timelog report (#1009).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1338 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-07 17:18:09 +00:00
Jean-Philippe Lang
fc1a295d8a Redmine.pm doc update
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1337 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-07 17:03:02 +00:00
Jean-Philippe Lang
2bcb782087 Redmine.pm for webdav authentication:
* make Authen::Simple::LDAP module optional
* handle TLS flag set in Redmine

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1336 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 17:36:26 +00:00
Jean-Philippe Lang
246e8f67c5 Redmine.pm support for LDAP authentication (patch by Liwiusz Ociepa). Closes #879, #918.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1335 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 17:29:09 +00:00
Jean-Philippe Lang
0249ae5f50 Preserve status filter and page number when using lock/unlock/activate links on the users list (closes #998).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1334 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 13:15:09 +00:00
Jean-Philippe Lang
beff2c54bc Mercurial: display working directory files sizes unless browsing a specific revision (#999).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1333 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 12:22:59 +00:00
Jean-Philippe Lang
db7f890030 Mercurial: Get proper file action on revision (#983).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1332 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 12:00:11 +00:00
Jean-Philippe Lang
a7ca01a8de Translation updates:
* Norwegian (Kai Olav Fredriksen)
* German (Thomas Löber)
* Bulgarian (Nikolay Solakov)
* Hebrew (Ficoos Bangaly)
* Russian (Michael Pirogov)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1331 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 11:07:16 +00:00
Jean-Philippe Lang
fe74ab8c06 Make the project files list sortable (#997).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1330 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 10:53:18 +00:00
Jean-Philippe Lang
154f60edd3 Fix repository browsing at given revision for various scm and add tests for this.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1329 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-06 10:35:55 +00:00
Jean-Philippe Lang
c37abb6415 Inline images alt attribute set to the attachment description.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1328 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-05 18:56:08 +00:00
Jean-Philippe Lang
c6271d8361 Fixed: inline image not displayed when including a wiki page (closes #1001).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1327 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-05 17:39:19 +00:00
Jean-Philippe Lang
4e961f44ef Various timelog report enhancements:
* report can be done using days as columns (#993)
* add a total column to the time report
* replace upper-right links by tabs to switch between details and report
* preserve date range filter when switching between details and report


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1326 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-05 16:40:26 +00:00
Jean-Philippe Lang
8d4aa6f9ad Fixed: single file 'View difference' links do not work because of duplicate slashes in url.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1325 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-03 22:29:58 +00:00
Jean-Philippe Lang
14a2b7e9b5 Verify rev and rev_to params format in RepositoriesController. And turn revision arguments into integers in SubversionAdapter.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1324 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-03 16:50:53 +00:00
Jean-Philippe Lang
f6ce427a00 Display the context menu above and/or to the left of the click if needed (patch by Mike Duchene, closes #960).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1323 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-03 16:38:06 +00:00
Jean-Philippe Lang
7f0aa56119 Fixed: trying to preview a new issue raises an exception with postgresql (close #984).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1322 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-03 13:16:51 +00:00
Jean-Philippe Lang
6348eeaf8a Attachment model clean up: fixed some inconsistent indentation and an inaccurate comment (closes patch #903 by Rocco Stanzione).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1321 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-02 21:30:32 +00:00
Jean-Philippe Lang
4cbe6b626e Accept the following formats for the timelog "hours" field: 1h, 1 h, 1 hour, 2 hours, 30m, 30min, 1h30, 1h30m, 1:30.
Also accept 1,5 for 1.5 hour (closes #975). Note that 1.5 is still equal to 1h30 and not 1h50 (#947).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1320 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-02 19:52:12 +00:00
Jean-Philippe Lang
467f74510e Time report can be done at issue level (closes #970) + timelog views xhtml validation.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1319 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-01 22:42:10 +00:00
Jean-Philippe Lang
043cb37b16 Add predefined date ranges to the time report in the same way as the details view (closes #972). It nows defaults to 'All time'.
This patch also fixes time report periods (columns) computation.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1318 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-01 19:40:40 +00:00
Jean-Philippe Lang
e4da9d6f10 Prevent NoMethodError on nil class if custom_fields params is not present in IssuesController#new (#969).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1317 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-01 17:48:11 +00:00
Jean-Philippe Lang
80a5ad7ff3 Fixed: Boards are not deleted when project is deleted (closes #963).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1316 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-04-01 17:43:20 +00:00
Jean-Philippe Lang
68fe7856c9 Move repetitive calendar include code from views into helper (patch #966 by Peter Suschlik).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1315 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-31 21:48:01 +00:00
Jean-Philippe Lang
0d9e419646 Add overflow:auto to the content div (closes #676, #748, #961).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1314 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-31 20:51:56 +00:00
Jean-Philippe Lang
da641f4122 Global queries can be saved from the global issue list (follows r1311 and closes #897).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1312 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-30 14:20:07 +00:00
Jean-Philippe Lang
287d86e363 Queries can be marked as 'For all projects'. Such queries will be available on all projects and on the global issue list (#897, closes #671).
Only admin users can create/edit queries that are public and for all projects.
Note: this change does not allow to save a query from the global issue list. You have to be inside a project but then you can mark the query as 'For all projects'.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1311 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-30 12:29:07 +00:00
Jean-Philippe Lang
faf1f1e812 Fixed: Feed content limit setting has no effect (closes #954).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1310 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-30 08:33:04 +00:00
Jean-Philippe Lang
cd64338a7f Fixed: Priorities not ordered when displayed as a filter in issue list (#956).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1309 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-30 08:19:56 +00:00
Jean-Philippe Lang
1b8c5d4058 Fixed: can not display attached images inline in message replies.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1308 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-29 22:35:04 +00:00
Jean-Philippe Lang
5ccbeba5c2 Use #blank? instead of #empty? in news/show view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1307 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-29 20:03:20 +00:00
Jean-Philippe Lang
a381b0978f Changelog updated.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1304 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-29 11:43:07 +00:00
Jean-Philippe Lang
0dfa2ad3cf Show date range on the activity (closes #837).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1303 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-29 11:12:57 +00:00
Jean-Philippe Lang
1bb51f743a Fixed: migrate_from_trac doesn't import timestamps of wiki and tickets (patch #882 by Andreas Neuhaus slightly edited).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1302 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-29 10:54:24 +00:00
Jean-Philippe Lang
85858cebe6 Fixed: https urls in the wiki are not displayed as external (closes #943).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1301 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-29 09:24:09 +00:00
Jean-Philippe Lang
6331809bd9 Translation updates: (closes #915, #927, #929, #923, #914, #919)
* Japanese (Satoru Kurashiki)
* Simplified Chinese (chaoqun zou)
* Danish (kim madsen)
* Norwegian (Kai Olav Fredriksen)
* Traditional Chinese (shortie lo)
* German (Sven Schuchmann)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1300 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-27 19:27:40 +00:00
Jean-Philippe Lang
b9e380c9fe Add breadcrumb nav for the forums (#892).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1299 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-27 18:41:42 +00:00
Jean-Philippe Lang
8960200409 If 'Display subprojects issues on main projects' is set to false:
* do not include subprojects in the issue count of the parent project overview (#939)
* do not include subproject timelogs on the parent project (#848)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1298 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-27 18:22:12 +00:00
Jean-Philippe Lang
ef80597c39 Trac importer: exclude more Trac wiki pages (#933).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1297 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-26 23:22:33 +00:00
Jean-Philippe Lang
ecc742f3ce Make the versions with the same date sorted by name (#864).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1296 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-26 22:56:30 +00:00
Jean-Philippe Lang
7a434c902a Bigger wiki h3 headings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1295 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-26 22:46:18 +00:00
Jean-Philippe Lang
d37a30846f Fixed: when bulk editing, setting "Assigned to" to "nobody" causes an sql error with Postgresql (#935).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1294 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-26 22:22:45 +00:00
Jean-Philippe Lang
805864590a Do not use javascript to hide tabs content on page loading and make tabs work with javascript disabled.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1293 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-26 18:49:12 +00:00
Jean-Philippe Lang
1c49bd4258 Add the description field to the issue csv export (#753).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1292 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-26 18:08:24 +00:00
Jean-Philippe Lang
051875429e Fixed: 'This week' condition in filter consider monday as the first day of the week even if language sets otherwise (closes #913).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1291 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-23 16:16:55 +00:00
Jean-Philippe Lang
6936eb1022 Make 'Planning' string translatable (closes #890).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1290 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-23 09:04:21 +00:00
Jean-Philippe Lang
de5b0ad0a8 Translations (closes #875, #876, #889, #891, #909):
* Norwegian added (Kai Olav Fredriksen)
* Finnish updated (Antti Perkiömäki)
* Czech updated (Maxim Krušina)
* Russian updated (Michael Pirogov)
* Polish updated (Mariusz Olejnik)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1289 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-23 08:34:13 +00:00
Jean-Philippe Lang
472654aebe Fixed: revision is ignored in MercurialAdapter#cat.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1288 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 22:19:37 +00:00
Jean-Philippe Lang
5f78b8a9a0 Added links to repository files in wiki syntax help.
Styles added and small fixes to the detailed wiki syntax help.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1287 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 22:05:23 +00:00
Jean-Philippe Lang
7fb72e671b Trac importer: prevent validation failure due to the default value when saving the Resolution custom field if it already exists (#869).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1286 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 21:37:40 +00:00
Jean-Philippe Lang
180fe8f6a4 Fix IE6 display bug on the issue list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1285 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 21:08:00 +00:00
Jean-Philippe Lang
60c12ca3ab Doc update before 0.7-rc1 release.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1284 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 20:24:10 +00:00
Jean-Philippe Lang
a8e6f68aaf Add unloadable to the sample plugin controller (http://dev.rubyonrails.org/ticket/6001).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1283 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 20:17:09 +00:00
Jean-Philippe Lang
27cf6d8d64 Add unloadable to the sample plugin controller (http://dev.rubyonrails.org/ticket/6001).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1282 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 20:02:41 +00:00
Jean-Philippe Lang
09bf503fd2 Load Engines plugin if available (closes #180).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1281 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 19:59:43 +00:00
Jean-Philippe Lang
35a14cbfdc Wiki links:
* fixes wiki links with pipe in table (closes #893, #870, #894)
* prevent wiki link matching on multiple lines

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1280 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 17:39:02 +00:00
Jean-Philippe Lang
bbf422e229 Add done_ratio to the right-click context menu.
Closes #904 (back_to variable used in patch #641 and in r1277 is no longer defined).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1279 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-21 17:32:15 +00:00
John Goerzen
8ed97f43d2 Revert "Make an issue's done_ratio field adjustable from the right-click"
Reverts commit r1277
fixes #904
refs #641

This had been working for me in testing for some time, but received
issue #904 saying it broke the context menu.  I was able to make it do
so on a new project as well.  Will revert and comment in #641 about this.


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1278 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-20 19:25:18 +00:00
John Goerzen
4ff77cc624 Make an issue's done_ratio field adjustable from the right-click
context menu.

Uses patch from, and fixes #641.  Patch by Dov Murik.


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1277 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-20 17:41:03 +00:00
Jean-Philippe Lang
0cccce0c43 Change the tick image and replace the issue selection pencil with a small tick.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1276 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-19 21:39:21 +00:00
Jean-Philippe Lang
43fc812e0e Default theme: smaller font in top menu and new style for main menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1275 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-19 18:22:16 +00:00
Jean-Philippe Lang
f162337e1b Always show 'View' and 'Annotate' links on repository files (download will be forced when clicking 'View' if the file is binary).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1274 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-19 17:51:13 +00:00
John Goerzen
93a33c6286 Added line under tracker name to make clear what is going on here
Partially implements the patch given in r730


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1273 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-18 18:50:52 +00:00
Jean-Philippe Lang
3e102f281d Add a simple java scanner.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1272 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-18 17:39:12 +00:00
Jean-Philippe Lang
7673d69b96 Fixes #880: code tags not formatted correctly in the wiki (broken by r1216).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1271 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-17 23:01:35 +00:00
Jean-Philippe Lang
1c4bcc5b55 Add NewsController and TimelogController tests.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1270 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-17 20:48:22 +00:00
Jean-Philippe Lang
8cb5acf453 Add some tests on RolesController.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1269 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-17 20:02:51 +00:00
Jean-Philippe Lang
030afe7428 Small fix to the Redmine links regexp.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1268 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-17 18:01:26 +00:00
Jean-Philippe Lang
93d1b2e0a4 Add Redmine links for repository files using source: and export: keyworkds (#867).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1267 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-17 17:45:01 +00:00
Jean-Philippe Lang
cab300e650 Prevent page reloading if something goes wrong in the 'add more file' javascript.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1266 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 21:41:36 +00:00
Jean-Philippe Lang
f271e772af Add the following headers to email notifications (#830, #247):
* X-Redmine-Host: host name defined in application settings
* X-Redmine-Site: application title defined in settings
* X-Redmine-Project: identifier of the project that the notification is related to, if any
* X-Redmine-Issue-Id, -Author, -Assignee: ticket related info
* X-Redmine-Topic-Id: identifies the thread a message belongs to

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1265 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 16:52:49 +00:00
Jean-Philippe Lang
4bd35dae8d Allow issue list to be sorted by target version (#832).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1264 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 15:04:33 +00:00
Jean-Philippe Lang
2d01398d67 Trac importer:
* prevent duplication of associated trackers when the target project already exists (closes #829)
* warn user if the target project already exists

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1263 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 14:54:36 +00:00
Jean-Philippe Lang
f5b5688e8a Move the filters buttons inside the filters fieldset on the issue list (closes #614).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1262 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 14:31:17 +00:00
Jean-Philippe Lang
2eb085506b Adds a title attribute to the next/previous links on the activity view, containing the corresponding date range (#837).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1261 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 14:18:36 +00:00
Jean-Philippe Lang
a8fcf8487d Add a time tracking block for 'My page' (#615).
It lists current user's time entries for the last 7 days across all projects, grouped by day with subtotals for each day, and a grand total.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1260 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 12:21:54 +00:00
Jean-Philippe Lang
5b6978a1f3 Add a margin to the bottom of wiki tables (#843).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1259 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-16 10:09:35 +00:00
John Goerzen
888b254844 Further refine WikiCaps processing for Trac to eliminate problems in
some corner cases


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1258 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 13:24:08 +00:00
Jean-Philippe Lang
83061e9ca2 Fix tests broken by r1243 (Redirect to issue page after creating a new issue).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1257 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 11:27:46 +00:00
Jean-Philippe Lang
451aa6ba4e Add "--encoding utf8" option to the Mercurial "hg log" command in order to get utf8 encoded commit logs (#834).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1256 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 11:05:22 +00:00
Jean-Philippe Lang
01fdaf5977 Mercurial adapter:
* fetch changesets by batches of 100 (rather than in a single transaction)
* fix: fetch_changesets tries to re-insert the last revision that exists in the db (#860)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1255 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 10:30:56 +00:00
Jean-Philippe Lang
a59e6bfb02 Remove hardcoded "Redmine" strings in account related emails. And use application title instead.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1254 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 09:40:16 +00:00
Jean-Philippe Lang
185ecd5854 Translations update (close #845, #822):
* Finnish (Antti Perkiömäki)
* Czech (Maxim Krušina)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1253 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 09:25:35 +00:00
Jean-Philippe Lang
aec989707e Workflow copy:
* added the ability the copy an existing workflow when creating a new role (closes #841)
* use a single raw insert statement to copy tracker/role workflow rather than instantiating hundreds/thousands of objects

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1252 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-15 08:27:38 +00:00
Jean-Philippe Lang
993b60d61e Adds 2 permissions (closes #859):
* edit_time_entries: lets a user edit/delete any time entry
* edit_own_time_entries: lets a user edit/delete its own time entries only

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1249 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-14 21:17:09 +00:00
Jean-Philippe Lang
4957752d12 Strip repository urls (closes #852).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1248 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-14 18:59:10 +00:00
John Goerzen
b8b991a7dc Added documentation of commit: syntax to detailed wiki syntax screen
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1247 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-14 13:48:32 +00:00
John Goerzen
cdf3e2b6ef Fix trac converter WikiCaps to put a space before converted WikiCaps words
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1246 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-14 00:52:26 +00:00
John Goerzen
84d2ea054d Update Simplified Chinese lang file
Closes #840 and uses patch from chaoqun zou contained therein, updated
to trunk


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1245 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-13 21:46:31 +00:00
John Goerzen
076d9e7ade This patch takes the RedmineWikiFormatting page and makes it available
as a static HTML file locally. This way, intranet deployments, or
other deployments do not need to be dependent upon redmine.org in
order to display this help.

Closes #815.


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1244 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-13 14:14:32 +00:00
John Goerzen
c67c375357 Redirect to issue page after creating a new issue
Previous behavior was to redirect to the issue list with a "successful
creation" message.  This patch will redirect to the page for the
newly-created issue, still with the "successful creation" message.

This matches the behavior after editing an issue and also provides
instant feedback for the user to see if anything went wrong.

Closes #261 and uses the patch contained therein


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1243 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-13 13:59:21 +00:00
John Goerzen
87fb78be0b Support WikiCaps for Trac migrations
Trac wikis support WikiCaps for links to pages.  They also use
!WikiCaps syntax to prevent links.  Support both.

Uses patch from and closes #758.


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1242 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-13 05:48:37 +00:00
John Goerzen
eafaae73b7 Updated zh-tw lang file from shortie lo.
Closes #847.


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1241 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-13 05:41:31 +00:00
John Goerzen
4f16dc53a4 Add commit: link type feature to wiki_syntax.html
The commit: feature merged to trunk in r1236


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1240 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-13 05:41:28 +00:00
Jean-Philippe Lang
ea161c9ea4 Prevent unexpected nil error in GitAdapter#info if the repository path is invalid.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1239 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-12 23:09:11 +00:00
Jean-Philippe Lang
2c1e63720e SCM AbstractAdapter use shell_quote to more properly escape path (closes #838 by John Goerzen).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1238 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-12 23:00:11 +00:00
Jean-Philippe Lang
d4429a544c Fixes #820: invalid project id causes a NoMethodError in SearchController (Angel Dobbs-Sciortino).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1237 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-12 20:50:48 +00:00
Jean-Philippe Lang
3a9b0988c7 Merged Git support branch (r1200 to r1226).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1236 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-12 20:28:49 +00:00
Jean-Philippe Lang
6fcc512cb7 Adds a setting for whether new projects should be public by default (closes #842, #839).
Patch by Rocco Stanzione, slightly edited.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1235 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-12 19:58:19 +00:00
Jean-Philippe Lang
3a75b6771f Prevent LDAP authentication with empty password related problems.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1231 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-12 17:56:19 +00:00
Jean-Philippe Lang
a9c972fbb3 Quotes Mercurial entries command depending on the OS.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1229 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-11 20:15:05 +00:00
Jean-Philippe Lang
71d3bb2f7b Fixes Mercurial browsing under unix-like os and for directory depth > 2 and (patch #826 by Frederic Moulins, slightly edited to preserve win32 compatibility).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1228 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-11 20:06:25 +00:00
Jean-Philippe Lang
624723d0ce Activity enhancements:
* overall activity view and feed added, link is available on the project list (#423, #494)
* switch added on the project activity view to include subprojects (closes #530)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1227 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-11 19:33:38 +00:00
Jean-Philippe Lang
64fb0a561a Removes the Redmine version from the footer (closes #794). It can still be viewed on admin -> info.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1225 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 22:24:38 +00:00
Jean-Philippe Lang
76a29ae337 Adds atom feed link on boards index.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1224 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 20:16:48 +00:00
Jean-Philippe Lang
4f35ec97e8 Replaces del tags by a css style (a.issue.closed) for closed issue links.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1223 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 18:27:55 +00:00
Jean-Philippe Lang
8195f95464 Fixes migrations that change string limits for sqlite.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1222 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 18:25:37 +00:00
Jean-Philippe Lang
494a6ecfb0 Trac and Mantis importers: check that default configuration is loaded before processing.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1221 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 17:23:22 +00:00
Jean-Philippe Lang
66594d46b2 Allow longer version names (#711, closes #712).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1220 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 15:36:47 +00:00
Jean-Philippe Lang
0ec13848b0 Show replies as well when choosing to display messages in the activity.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1217 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 12:15:27 +00:00
Jean-Philippe Lang
a92cce3851 Textile formatting:
* escape html tags, except pre tags (#807, #795)
* try to avoid unwanted quick phrase modifiers

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1216 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 11:47:36 +00:00
Jean-Philippe Lang
522b9e6b5b Display date/time instead of date on files list (#817).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1215 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-09 11:39:00 +00:00
Jean-Philippe Lang
07882590bb Strip out email address from authors in repository screens (#814).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1208 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-08 13:46:07 +00:00
Jean-Philippe Lang
9b59ea7256 Version details view changes:
* display related issues on the version detail view
* display total estimated and spent hours on the version detail view
* fixed wiki headings size (same as r1168)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1207 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-08 11:17:03 +00:00
Jean-Philippe Lang
1830064918 Changes 'Fixed version' label to 'Target version' (closes #723, #808).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1206 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-08 09:06:16 +00:00
Jean-Philippe Lang
a4c6c62c8b Added preview for forum messages.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1205 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-07 17:49:44 +00:00
Jean-Philippe Lang
4458a7282b Translations (closes #789, #790, #798, #803, #809):
* Danish added (Mads Vestergaard)
* Polish updated (Mariusz Olejnik)
* Finnish updated (Antti Perkiömäki)
* Simplified Chinese updated (chaoqun zou)
* Traditional Chinese updated (shortie lo)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1204 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-07 17:15:50 +00:00
Jean-Philippe Lang
e8035c22b2 Fixes module names localization on projects/add (closes #797).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1203 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-07 17:04:16 +00:00
Jean-Philippe Lang
482d9a4e82 Fix LDAP authentication (#714, broken by r1194).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1199 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-06 17:22:21 +00:00
Jean-Philippe Lang
533994e5ea Adds an application setting to choose whether or not subprojects issues should be displayed by default on the issue list, calendar and gantt (r1178). Default is true.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1198 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-06 08:32:56 +00:00
Jean-Philippe Lang
e951d84584 Add a user preference to choose how comments/replies are displayed: in chronological or reverse chronological order (#589, #776).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1197 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 15:41:54 +00:00
Jean-Philippe Lang
bbe8ea29e8 Display the last 30 days on the activity view rather than the current month.
Number of days can be configured in the application settings.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1196 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 13:44:08 +00:00
Jean-Philippe Lang
fbcdfee622 Trac importer: support database schema for Trac migration (#757 by John Goerzen).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1195 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 12:54:20 +00:00
Jean-Philippe Lang
a70737ad59 Fixed "LdapError: invalid binding information" when no username/password are set on the LDAP account (#764).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1194 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 12:43:14 +00:00
Jean-Philippe Lang
745fec76d0 Fixes #773: Changeset block is smashing the update frame on issues/show.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1193 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 11:59:56 +00:00
Jean-Philippe Lang
1eca3947a1 Reversed versions ordering on files list (closes #763).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1192 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 11:54:54 +00:00
Jean-Philippe Lang
d09f7d73b3 Added jsp mime type.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1191 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 11:42:59 +00:00
Jean-Philippe Lang
c61424e57a Display wiki syntax quick ref link within the jstoolbar (closes #629, #767).
Added named links syntax on quick ref (closes #766, #778).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1190 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 11:14:35 +00:00
Jean-Philippe Lang
b0754ca720 Fixes migration 87 error when running MySQL with STRICT_TRANS_TABLES on (#771).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1189 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 09:16:19 +00:00
Jean-Philippe Lang
4f9f3097d9 Fixes #765: Date pickers don't work on issues' bulk edit view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1188 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 09:06:00 +00:00
Jean-Philippe Lang
d8c97b32dd Fixes #780: Redmine fails to start with a const_missing error on Redmine::MenuManager::MenuItem::GLoc (occurs when a Redmine plugin is loaded before GLoc).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1187 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 09:01:37 +00:00
Jean-Philippe Lang
918937c873 Translations updates:
* Finnish (Antti Perkiömäki)
* Russian (Michael Pirogov)
* Chinese Traditional (shortie lo)
* Japanese (Satoru Kurashiki)
* Korean (Jongyoon Choi)
* Simplified Chinese (chaoqun zou)
* German (Thomas Löber)

Fixed zh and zh-tw encoding in PDF (chaoqun zou).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1186 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 08:54:26 +00:00
Jean-Philippe Lang
942091f9e8 Display links to Atom feeds (closes #496, #750).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1185 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-05 08:25:22 +00:00
Jean-Philippe Lang
8ea2ecb983 Fixed #759: Can not view a project without View time entries permission (broken by r1176).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1184 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-01 20:09:57 +00:00
Jean-Philippe Lang
7ee55562ff Fixed: fetch_changesets fails on commit comments that close 2 duplicates issues.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1183 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-03-01 09:00:02 +00:00
Jean-Philippe Lang
c01c64e978 Let the user choose when deleting issues with reported hours (closes #734, #71):
* to delete the hours
* to assign the hours to the project
* to reassign the hours to another issue


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1182 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-29 22:54:07 +00:00
Jean-Philippe Lang
87742f23ed Login field name changed to username (#755).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1181 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-29 21:18:35 +00:00
Jean-Philippe Lang
9daf39ec52 Adds an optional description to attachments.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1180 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-29 19:46:58 +00:00
Jean-Philippe Lang
4b15dc10c1 Fixed: Multiple "new" statuses in filing new ticket (closes #751).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1179 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-28 22:00:56 +00:00
Jean-Philippe Lang
b6bd5c7f12 Include subprojects on the issue list, calendar and gantt by default.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1178 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-28 21:57:03 +00:00
Jean-Philippe Lang
1ddb59df2a Fixed JournalControllerTest.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1177 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-27 23:01:35 +00:00
Jean-Philippe Lang
200842ba5e Propagates time tracking to the parent project (closes #433). Time report enhancements.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1176 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-27 20:50:19 +00:00
Jean-Philippe Lang
421d420311 Trac importer fix:
* error when trying to convert too long ticket ids (closes #719)

Enhancements (#619):
* Trac guide wiki pages skipped
* wiki attachments migration added

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1175 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-26 19:47:29 +00:00
Jean-Philippe Lang
8531e176aa Do not send an email with no recipient, cc or bcc (closes #743).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1174 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-26 18:30:24 +00:00
Jean-Philippe Lang
328df74dd1 Adds date range filter and pagination on time entries detail view (closes #434).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1173 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-26 18:15:58 +00:00
Jean-Philippe Lang
792b7f30e3 Menus items:
* fixed broken translation when a plugin is installed (closes #649)
* small fix to the plugin API: options parameter added to Redmine::Plugin#menu

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1172 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-22 18:19:00 +00:00
Jean-Philippe Lang
b0bb41ad35 Fixed: Issue custom fields "required" flag not stored (broken by r1090). Closes #715.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1171 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-22 17:48:37 +00:00
Jean-Philippe Lang
b935aebd99 Fixed: LDAP authentication without password may be possible (#714).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1169 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-22 17:26:53 +00:00
Jean-Philippe Lang
ade572048a Roadmap enhancements (closes #697, #698):
* separate related issues from wiki contents
* leading h1 in version wiki pages is hidden (done using css, won't work with IE6)
* smaller wiki headings
* xhtml validation

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1168 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-21 19:49:47 +00:00
Jean-Philippe Lang
7d10755072 Fixed: "undefined method 'textilizable'" error on email notification when running Repository#fetch_changesets from the console.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1167 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-21 19:30:27 +00:00
Jean-Philippe Lang
3f4a8469ac Added 'estimated time' in the csv export of the issue list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1166 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-21 17:57:00 +00:00
Jean-Philippe Lang
d461363d27 Fixed: Adding time when Updating a ticket is gone (closes #701).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1165 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-21 17:50:33 +00:00
Jean-Philippe Lang
948097bc4d Do not clear issue relations when moving an issue to another project if cross-project issue relations are allowed (closes #696).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1164 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-21 17:45:49 +00:00
Jean-Philippe Lang
09bd61da74 Order issues by id on the roadmap.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1163 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-18 18:28:37 +00:00
Jean-Philippe Lang
652dc1a73a Fixed: auto closing of duplicates doesn't work.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1162 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-17 15:02:54 +00:00
Jean-Philippe Lang
e5daf25618 Fixes:
* email notifications: host name is missing in generated links (#639, #201)
* email notifications: referenced changesets, wiki pages, attachments... are not turned into links (only ticket ids are)
* attachment links and inline images don't work in issue notes

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1161 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-17 14:17:20 +00:00
Jean-Philippe Lang
5d6d0136c1 Fixes for wiki_syntax.html (#678) by Thomas Löber.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1160 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 21:24:12 +00:00
Jean-Philippe Lang
d69a05a6ee Rescue and display an error message when trying to delete a role that is in use.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1159 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 21:05:10 +00:00
Jean-Philippe Lang
33493f8010 Mantis importer: do not duplicate Mantis username in firstname and lastname if realname is blank.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1158 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 19:28:24 +00:00
Jean-Philippe Lang
a798a1ac4d Removed fragment caching on gantt and calendar.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1157 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 18:28:46 +00:00
Jean-Philippe Lang
53a04b0a44 Fixed: CVS repository doesn't work if port is used in the url (#653).
Added functional tests for CVS adapter.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1156 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 18:09:26 +00:00
Jean-Philippe Lang
0153954ebb Added a simple rake task to fetch changesets from the repositories:
rake redmine:fetch_changesets

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1155 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 16:25:58 +00:00
Jean-Philippe Lang
153c4c242d Atom feeds:
* prevent duplicate entry ids for issue changes
* prevent empty email in author element

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1154 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 16:20:35 +00:00
Jean-Philippe Lang
0582337372 Added:
* the 'include' macro to include a wiki page
* macro escaping support (with exclamation mark)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1153 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 15:34:17 +00:00
Jean-Philippe Lang
1c8cf4ef83 Added the following permissions (#527, #585, #627):
* edit_issue_notes: let user edit any notes
* edit_own_issue_notes: let user edit his own notes only

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1152 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 13:19:33 +00:00
Jean-Philippe Lang
abb0b15407 Added translation support for project modules names and a few other strings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1151 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 10:15:19 +00:00
Jean-Philippe Lang
384a444cee Fix grammar error in e-mail footer (closes #673).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1150 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-16 09:14:59 +00:00
Jean-Philippe Lang
38307c0979 Added Ukrainan translation (Natalia Konovka & Mykhaylo Sorochan).
Translation updates:
* Lithuanian (Sergej Jegorov)
* Russian (Michael Pirogov)
* Traditional Chinese (Shortie Lo)
* Finnish (Antti Perkiömäki)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1149 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-15 17:47:19 +00:00
Jean-Philippe Lang
96b78fdae5 Fix applied to ruby-net-ldap (#608).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1148 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-15 17:22:21 +00:00
Jean-Philippe Lang
377a45ae1a Slight changes to calendar and activity h2 titles.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1147 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-15 17:04:27 +00:00
Jean-Philippe Lang
29e297d273 Make Mantis importer preserve bug ids.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1146 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-15 16:41:44 +00:00
Jean-Philippe Lang
71d089c833 Escape titles in activity view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1145 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-14 21:17:28 +00:00
Jean-Philippe Lang
8adb320978 Fixed a bug in localization introduced by r1131 (anonymous users inherit the language of the first anonymous user).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1144 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-13 20:47:27 +00:00
Jean-Philippe Lang
0b6a010a12 Translation for various hard-coded strings (#577).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1143 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-12 22:43:37 +00:00
Jean-Philippe Lang
4dc7f662e3 Added issue subject to the time entries view and subject + tracker to the csv export (#616). Default order on date column set to desc.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1142 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-12 21:43:54 +00:00
Jean-Philippe Lang
a2626bbccf Fixed: not null constraints not removed with Postgresql.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1140 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-12 21:11:16 +00:00
Jean-Philippe Lang
616899d879 Fixed: empty status list shouldn't be displayed when the user can not change the status.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1139 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-12 18:33:38 +00:00
Jean-Philippe Lang
30a7314b86 Fixed: wiki and changeset links not displayed when previewing issue description or notes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1138 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-12 18:31:15 +00:00
Jean-Philippe Lang
c5d998528f The following menus can now be extended by plugins: top_menu, account_menu, application_menu (empty by default).
Sligth layout change: links in the top menu are now li elements.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1137 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-12 17:58:46 +00:00
Jean-Philippe Lang
93ef8b7f77 Replaced window.hash= by Element.scrollTo()
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1136 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-11 20:45:46 +00:00
Jean-Philippe Lang
15ed53cf17 Footer update.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1135 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-11 18:08:36 +00:00
Jean-Philippe Lang
5152771fdd Fixed: 404 error when selecting an other project on issues/move.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1134 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-11 18:06:38 +00:00
Jean-Philippe Lang
913a806f90 Fixed: context menu not available if the initial issue list is empty.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1133 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-11 17:59:41 +00:00
Jean-Philippe Lang
d859d38dd9 Translation updates:
* Finnish (Antti Perkiömäki, #612)
* Russian (Michael Pirogov, #622)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1132 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-10 14:24:51 +00:00
Jean-Philippe Lang
14b3d6d012 Fixed: Anonymous users may not see the issue list headers in the correct language.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1131 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-10 14:14:18 +00:00
Jean-Philippe Lang
4155c97222 Issue list now supports bulk edit/move/delete (#563, #607). For now, issues from different projects can not be bulk edited/moved/deleted at once.
There are 2 ways to select a set of issues on the issue list:
* by using checkbox and/or the little pencil that will select/unselect all issues (#567)
* by clicking on the rows (but not on the links), Ctrl and Shift keys can be used to select multiple issues

Context menu was disabled on links so that the default context menu of the browser is displayed when right-clicking on a link (#545).
All this was tested with Firefox 2, IE 6/7, Opera 8 (use Alt+Click instead of Right-click) and Safari 2/3.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1130 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-10 13:17:41 +00:00
Jean-Philippe Lang
43a6f312ed Merged IssuesController #edit and #update into a single actions.
Users with 'edit issues' permission can now update any property including custom fields when adding a note or changing the status (#519, #581, #587).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1129 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-09 16:11:18 +00:00
Jean-Philippe Lang
6d109258c9 Added a few extensions/mimetypes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1128 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-07 18:06:35 +00:00
Jean-Philippe Lang
9a2ec76a81 Mantis importer: few fixes in user mapping.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1127 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-06 20:43:31 +00:00
Jean-Philippe Lang
c80c1e1ead Create a journal and send an email when an issue is closed by commit (#609).
The redmine user is found using the committer username or email. Otherwise, the journal is created with anonymous user.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1126 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-06 20:02:30 +00:00
Jean-Philippe Lang
943ba3e34f Trac importer: handle nil usernames.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1125 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-06 19:05:42 +00:00
Jean-Philippe Lang
68d3305ae2 Fixed settings.yml syntax (yaml parsing fails with JRuby 1.0.3: #606).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1124 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-06 18:56:52 +00:00
Jean-Philippe Lang
fde2a497da Activity test fix (r1120).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1123 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-05 18:50:21 +00:00
Jean-Philippe Lang
14b2d3f4b9 Slight change to the issue added/updated email templates.
Translations updates:
* Simplified Chinese (Liang Jin)
* Bulgarian (Nikolay Solakov)
* Lithuanian (Sergej Jegorov)
* Traditional Chinese (Shortie Lo)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1122 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-05 18:38:05 +00:00
Jean-Philippe Lang
54ff294da1 More appropriate default sort order on sortable columns.
Sortable column added on issue subject (#580).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1121 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-05 17:28:02 +00:00
Jean-Philippe Lang
80a60247f5 Slight changes to the activity view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1120 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-04 19:37:23 +00:00
Jean-Philippe Lang
a3dda6dc4a Use Postgresql's reset_pk_sequence in Trac importer to reset issue id sequence (#595).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1119 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-04 18:01:38 +00:00
Jean-Philippe Lang
4e244be21c Slight changes on users list view and hide Anonymous user.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1118 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 19:53:52 +00:00
Jean-Philippe Lang
09cfef094c New icons for the wiki toolbar (from http://www.famfamfam.com/lab/icons/silk/).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1117 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 18:05:26 +00:00
Jean-Philippe Lang
9c451ac157 Set wiki class to issue notes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1116 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 17:34:31 +00:00
Jean-Philippe Lang
5dd3c239d3 Fixed: error when uploading a file with no content-type specified by the browser.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1115 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 17:24:58 +00:00
Jean-Philippe Lang
0beafecd3b Fixed #208: Issue list does not scroll up when you click next
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1114 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 16:21:51 +00:00
Jean-Philippe Lang
2920daf2c8 Do not use RedCloth's glyphs (#210).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1113 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 15:34:58 +00:00
Jean-Philippe Lang
c3d909e0cc Slight style changes on issue associated changesets list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1112 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 15:15:52 +00:00
Jean-Philippe Lang
1ecef3a95a ProjectsController#add_news moved to NewsController#new.
Preview added when adding/editing a news (#590).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1111 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 14:38:04 +00:00
Jean-Philippe Lang
b124501a4e Add 'Author' to the available columns for the issue list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1110 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 14:02:23 +00:00
Jean-Philippe Lang
225637c5dc Translations updates (#254, #255, #260):
* Traditional Chinese (Shortie Lo)
* German (Thomas Löber)
* Russian (Michael Pirogov)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1109 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-03 13:54:59 +00:00
Jean-Philippe Lang
0123dc3651 Do not authorize project identifier with numbers only (would be interpreted as the project id in urls).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1108 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-02 15:51:48 +00:00
Jean-Philippe Lang
12c0f5f66e Do not show Roadmap menu item if the project doesn't define any versions.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1107 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-02 11:08:04 +00:00
Jean-Philippe Lang
45b69c4a65 Fixed an error on issue feeds.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1106 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-02 10:54:31 +00:00
Jean-Philippe Lang
bea49ae245 Administrators can edit issue notes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1105 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-02-02 10:50:31 +00:00
Jean-Philippe Lang
4abb82fd7b Fixed RepositoriesController: undefined local variable or method `show_error' (broken by r1094).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1104 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-25 10:55:16 +00:00
Jean-Philippe Lang
79f92a675a User display format is now configurable in administration settings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1103 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-25 10:31:06 +00:00
Jean-Philippe Lang
3d5d1a38e3 Translations updates:
* Russian (Michael Pirogov)
* Finnish (Antti Perkiömäki)
* Traditional Chinese wiki toolbar (Shortie Lo)
* German wiki toolbar (Thomas Löber)


git-svn-id: http://redmine.rubyforge.org/svn/trunk@1102 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-24 18:31:02 +00:00
Jean-Philippe Lang
e13f49d919 Prevent unexpected nil in custom value validation.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1101 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-24 18:15:38 +00:00
Jean-Philippe Lang
7a1e928b8d Mantis importer:
* do not truncate projects descriptions
* encode attachment filenames to utf8

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1100 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 22:31:26 +00:00
Jean-Philippe Lang
b0f3de5c3b Fixed: PostgreSQL issues_seq_id not updated when using Trac importer.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1099 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 22:19:24 +00:00
Jean-Philippe Lang
2247700f24 Fixed: Incorrect filtering for unset values when using 'is not' filter.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1098 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 20:07:17 +00:00
Jean-Philippe Lang
d8ac6d2b79 Issue properties below the description textarea.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1097 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 19:58:11 +00:00
Jean-Philippe Lang
2d9e669e85 Added preview for issue notes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1096 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 18:21:42 +00:00
Jean-Philippe Lang
d54ba39e7a Fixed: can not lock a topic when creating it.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1095 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 17:48:48 +00:00
Jean-Philippe Lang
91dc13f4b2 Show explicit error message when the scm command failed (eg. when svn binary is not available).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1094 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-23 17:25:11 +00:00
Jean-Philippe Lang
97e7432ce6 Fixed migration 87 (mysql: TEXT column can't have a default value).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1093 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-22 17:17:52 +00:00
Jean-Philippe Lang
dad5f6d403 Fixed search with all words (broken in r994).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1092 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-21 18:52:45 +00:00
Jean-Philippe Lang
c65ab7c0f2 Missing migration for r1090.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1091 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 23:38:55 +00:00
Jean-Philippe Lang
d6bfb7fa4d Added default value for custom fields. Fixed javascript on custom field form for project and user custom fields.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1090 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 21:29:51 +00:00
Jean-Philippe Lang
59c5d995c3 Fixed: custom fields empty on issue/edit (broken by r1086).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1089 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 19:45:08 +00:00
Jean-Philippe Lang
df99d8f308 Unlimited and optional project description. The project list will show truncated descriptions only (the first fews lines).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1088 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 18:37:51 +00:00
Jean-Philippe Lang
d5b9dedca2 Added tabindex property on wiki toolbar buttons and 'new category' link.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1087 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 17:36:01 +00:00
Jean-Philippe Lang
0b4a02f607 Display custom fields in two columns on the issue form.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1086 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 17:20:34 +00:00
Jean-Philippe Lang
b6549d763a Added related changesets messages on issue details view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1085 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 15:38:11 +00:00
Jean-Philippe Lang
5e2a01656d Test environments cleanup.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1084 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 14:24:19 +00:00
Jean-Philippe Lang
d79c20c4f2 Fixed: custom field selection is not saved when unchecking them all on project settings
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1083 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 14:01:02 +00:00
Jean-Philippe Lang
889bf388be Fixed: error when removing a project member (postgresql and sqlite only).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1082 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 13:53:45 +00:00
Jean-Philippe Lang
16e9ffce0d Added a 'New issue' link in the main menu (accesskey 7).
The drop-down lists to add an issue on the project overview and the issue list are removed.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1081 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 13:07:19 +00:00
Jean-Philippe Lang
44ac1a0deb ProjectsController#add_issue moved to IssuesController#new.
Tracker can now be changed/selected on the new issue form. This action can be invoked without the tracker_id parameter (the first enabled tracker will be used by default).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1080 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 11:30:57 +00:00
Jean-Philippe Lang
1b002983c3 Display the issue status in the email subject only if the status was actually changed.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1079 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 10:42:16 +00:00
Jean-Philippe Lang
1535ac1220 Fixed: when changing the status of an issue, the email subject contains the previous status of the issue.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1078 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-20 09:49:25 +00:00
Jean-Philippe Lang
2a945f794f Wiki toolbar Russian and Czech translations (Michael Pirogov).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1077 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-19 12:29:41 +00:00
Jean-Philippe Lang
0faa4568a0 Highlight the current item of the main menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1076 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-19 11:53:43 +00:00
Jean-Philippe Lang
3e031b4243 Fixed: locked users should not receive email notifications.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1075 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-17 19:58:03 +00:00
Jean-Philippe Lang
32b9bf0ef2 Added i18n support to the jstoolbar (only english and french are actually translated).
Translations can be found in public/javascripts/jstoolbar/lang/

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1074 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-17 18:39:17 +00:00
Jean-Philippe Lang
1c5a9b1773 Prettier tabs for settings views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1073 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-17 17:43:54 +00:00
Jean-Philippe Lang
061977d77d Fixed: typo in en.yml
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1072 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-17 17:40:45 +00:00
Jean-Philippe Lang
049051103b On the calendar, the gantt and in the Tracker filter on the issue list, only active trackers of the project (and its sub projects) can be selected.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1071 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-16 21:27:48 +00:00
Jean-Philippe Lang
18066ba8bf Added a couple of mime types so that corresponding files can be viewed in the browser.
Added a simple (and not perfect) CodeRay scanner for php.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1070 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-16 20:45:13 +00:00
Jean-Philippe Lang
ad25d15d6c Fixed error on migration 85 with Oracle (index name can not be more than 30 characters long).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1069 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-15 20:40:59 +00:00
Jean-Philippe Lang
e228110614 Lithuanian translation added (Sergej Jegorov).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1068 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-15 19:03:17 +00:00
Jean-Philippe Lang
8a39862b19 Fixed: issue queries can not use custom fields marked as 'for all projects' in a project context.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1067 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-15 18:31:45 +00:00
Jean-Philippe Lang
bf3066d698 Fixed: Date custom fields not displayed as specified in application settings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1066 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-15 18:30:21 +00:00
Jean-Philippe Lang
35c17355fb Fixed: issue filters may be lost when paginating after r1026.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1065 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-15 18:18:49 +00:00
Jean-Philippe Lang
702b521b45 Redmine links can be used to link to documents, versions and attachments.
For now, attachments of the current object can be referenced only (if you're on an issue, it's possible reference attachments of this issue only).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1064 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-15 18:12:12 +00:00
Jean-Philippe Lang
4e1e5985a1 Wiki toolbar improvements (mainly for Firefox).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1063 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-13 18:39:37 +00:00
Jean-Philippe Lang
8b710cf9de Do not show sticky and locked checkboxes when replying to a message.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1062 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-13 18:33:55 +00:00
Jean-Philippe Lang
df30e18a8c Added missing wiki div on news/index and news/show.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1059 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-12 16:26:37 +00:00
Jean-Philippe Lang
64eaf328ea Fixed: wrong url for wiki syntax pop-up when Redmine urls are prefixed.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1058 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-12 14:54:26 +00:00
Jean-Philippe Lang
941f9bf3dd Non-ascii attachement filename fix for IE.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1053 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-10 22:42:41 +00:00
Jean-Philippe Lang
a39f655a7c Added details by assignees on issue summary view (Hans Yoon).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1052 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-10 19:20:36 +00:00
Jean-Philippe Lang
84cdc8f2bc Translations:
* Finnish added (Antti Perkiömäki)
* Traditional Chinese updated (Shortie Lo)
* Russian updated
* Polish updated (Mariusz Olejnik)
* Korean updated (Hans Yoon)
* Japanese calendar fix (Nobuhiro Imai)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1051 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-10 18:34:14 +00:00
Jean-Philippe Lang
b2b56adbfa Fixed: Themes are not applied with Rails 2.0
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1047 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-07 20:14:50 +00:00
Jean-Philippe Lang
a80dbc49b1 Admin settings screen split to tabs.
Email notification options moved to this view as a tab and LDAP list is accessible from the 'Authentication' tab.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1046 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-06 20:24:26 +00:00
Jean-Philippe Lang
78d9ae9754 Fixed: crash when fetching Mercurial changesets if changeset[:files] is nil (same fix as r921).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1045 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-06 17:33:41 +00:00
Jean-Philippe Lang
3d920c13b4 wrapper div added to the layout.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1044 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-06 17:28:20 +00:00
Jean-Philippe Lang
976a31e941 Merged IssuesController change_status and add_note actions.
The 'Change status' specific form removed and now accessible from issue/show view with no additional request (click on 'Update' to show the form).
The 'Change issue status' permission is removed. To change the status, the user just needs to have either 'Edit' or 'Add note' permissions and some workflow transitions allowed.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1043 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-06 17:06:14 +00:00
Jean-Philippe Lang
4a729036bf Prevent 'has already been taken' error messages for user login and email if these fields are left empty.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1042 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-06 13:09:23 +00:00
Jean-Philippe Lang
c9fd7513ed Default configuration data can now be loaded from the administration screen.
A message is automatically displayed on this screen if roles, trackers,... have not been configured yet.
The rake task is still available and the data loading code is wrapped in a transaction.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1040 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-05 11:33:49 +00:00
Jean-Philippe Lang
8d9b04865b Fixed Serbian lang file.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1039 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-04 20:03:31 +00:00
Jean-Philippe Lang
4024f4ac39 Updated Serbian translation (Dragan Matic).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1038 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-04 19:07:16 +00:00
Jean-Philippe Lang
6ae87d7c4c Moved redmine:load_default_data code to a module so that it can be called from the application.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1037 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-04 18:27:05 +00:00
Jean-Philippe Lang
860ff9345f Fixed: private projects name are displayed on account/show even if the current user doesn't have access to these private projects.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1036 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-04 18:02:34 +00:00
Jean-Philippe Lang
bd85c0cbb1 Fixed: table of content not rendered properly when used in an issue or document description.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1035 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-04 17:55:08 +00:00
Jean-Philippe Lang
832c7eaaa5 Fixed: undefined local variable or method 'log' in CvsAdapter when a cvs command fails.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1034 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-03 18:28:14 +00:00
Jean-Philippe Lang
b21e85b6dc Updated Spanish translation (Gumer Coronel Pérez).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1033 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-03 18:10:52 +00:00
Jean-Philippe Lang
3e0acc0b7e Slight improvements to the browser views.
ApplicationHelper#set_html_title replaced by html_title with arguments and can be called several times in views to append elements to the title.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1032 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-01-02 22:41:53 +00:00
Jean-Philippe Lang
636579b17d Fix query management broken by r1027.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1031 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-31 12:37:32 +00:00
Jean-Philippe Lang
97f0da0b1a Moved login and logout links to ApplicationHelper methods for easier customization.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1030 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-30 11:44:46 +00:00
Jean-Philippe Lang
9072753489 Moved current user management to a dedicated method for modularity.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1029 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-30 10:51:34 +00:00
Jean-Philippe Lang
66420fe4b7 TabularFormBuilder moved out of application_helper.rb
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1028 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-30 10:48:11 +00:00
Jean-Philippe Lang
5bc7dc77e2 Do not store query object in session but id or filters only. This allows to use Rails 2.0 cookie based sessions.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1027 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-30 10:46:09 +00:00
Jean-Philippe Lang
9a1b46fe42 New setting added to specify how many objects should be displayed on most paginated lists.
Default is: 25, 50, 100 (users can choose one of these values).
If one value only is entered in this setting (eg. 25), the 'per page' links are not displayed (prior behaviour).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1026 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-29 11:36:30 +00:00
Jean-Philippe Lang
7eec539222 Fixed r1024: context submenus on the issue list don’t show up with IE6.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1025 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-29 10:43:33 +00:00
Jean-Philippe Lang
7f3c516940 Fixed: context submenus on the issue list don't show up with IE6.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1024 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-28 21:58:33 +00:00
Jean-Philippe Lang
3ff95e4031 Fixed 'export to' links positioning on wiki page.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1023 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-22 12:47:23 +00:00
Jean-Philippe Lang
bb8d360188 Set doctype to transitional. Fixed a few non matching tags in views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1022 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-21 18:01:02 +00:00
Jean-Philippe Lang
9595029709 Trunk version changed to 0.6.devel
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1021 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-20 19:44:16 +00:00
Jean-Philippe Lang
31c6ebb310 Added wiki annotate view. It's accessible for each version from the page history view.
Slight style change: pre-wrap added on file/diff contents.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1020 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-20 19:10:24 +00:00
Jean-Philippe Lang
3d5381b24b Do not run Mercurial functional tests if the test repository is not set up.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1019 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-19 22:14:03 +00:00
Jean-Philippe Lang
a456225852 Add email notification to IssuesController#edit.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1018 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-19 22:09:31 +00:00
Jean-Philippe Lang
5f871e9657 Fixed: Textile image with style attribute cause internal server error.
Also added tests for inline images with attributes and moved auto_link and auto_mailto rules after textile rules.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1017 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-19 21:06:06 +00:00
Jean-Philippe Lang
bf3b2ec973 Change status select box default to current status (Rocco Stanzione).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1016 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-19 20:23:03 +00:00
Jean-Philippe Lang
49bdf62243 Add autoscroll div for each file diff.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1015 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-19 20:19:48 +00:00
Jean-Philippe Lang
e219af1fbd Ignore empty diffs.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1014 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-19 20:11:44 +00:00
Jean-Philippe Lang
4a2efa9252 Ported r1009 from 0.6-stable branch.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1013 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-18 19:07:54 +00:00
Jean-Philippe Lang
8e00f57a88 Moved ProjectsController#list_documents and add_document to DocumentsController#index and new.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1011 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-18 18:50:41 +00:00
Jean-Philippe Lang
524cd689cf Project identifier is now used in URLs (instead of project id).
URLs with a project id will still be recognized.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1007 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-17 21:00:56 +00:00
Nicolas Chuche
f48cf8e67d r16121@gaspard (orig r912): jplang | 2007-11-18 15:32:39 +0100
Added an alternate theme which provides issue list colorization based on issues priority.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@913 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-11-18 15:03:57 +00:00
Nicolas Chuche
d6e8121ef1 change owner rights to work with mod_perl authentication. add a test option that just connect to WS and say what should be done
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@911 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-11-18 12:39:13 +00:00
Jean-Philippe Lang
83b6fa57f6 Added nbc branch.
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@910 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-11-18 11:58:02 +00:00
859 changed files with 54634 additions and 19727 deletions

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2008 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,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class AccountController < ApplicationController
layout 'base'
helper :custom_fields
include CustomFieldsHelper
@@ -25,13 +24,17 @@ class AccountController < ApplicationController
# Show user's account
def show
@user = User.find_active(params[:id])
@custom_values = @user.custom_values.find(:all, :include => :custom_field)
@user = User.active.find(params[:id])
@custom_values = @user.custom_values
# show only public projects and private projects that the logged in user is also a member of
@memberships = @user.memberships.select do |membership|
membership.project.is_public? || (User.current.role_for_project(membership.project))
membership.project.is_public? || (User.current.member_of?(membership.project))
end
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10)
@events_by_day = events.group_by(&:event_date)
rescue ActiveRecord::RecordNotFound
render_404
end
@@ -43,17 +46,10 @@ class AccountController < ApplicationController
self.logged_user = nil
else
# Authenticate user
user = User.try_to_login(params[:login], params[:password])
if user
self.logged_user = user
# generate a key and set cookie if autologin
if params[:autologin] && Setting.autologin?
token = Token.create(:user => user, :action => 'autologin')
cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }
end
redirect_back_or_default :controller => 'my', :action => 'page'
if Setting.openid? && using_open_id?
open_id_authenticate(params[:openid_url])
else
flash.now[:error] = l(:notice_account_invalid_creditentials)
password_authentication
end
end
end
@@ -105,43 +101,35 @@ class AccountController < ApplicationController
# User self-registration
def register
redirect_to(home_url) && return unless Setting.self_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)
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
else
@user = User.new(params[:user])
@user.admin = false
@user.login = params[:user][:login]
@user.status = User::STATUS_REGISTERED
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x,
:customized => @user,
:value => (params["custom_fields"] ? params["custom_fields"][x.id.to_s] : nil)) }
@user.custom_values = @custom_values
case Setting.self_registration
when '1'
# Email activation
token = Token.new(:user => @user, :action => "register")
if @user.save and token.save
Mailer.deliver_register(token)
flash[:notice] = l(:notice_account_register_done)
redirect_to :action => 'login'
end
when '3'
# Automatic activation
if session[:auth_source_registration]
@user.status = User::STATUS_ACTIVE
@user.login = session[:auth_source_registration][:login]
@user.auth_source_id = session[:auth_source_registration][:auth_source_id]
if @user.save
session[:auth_source_registration] = nil
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)
redirect_to :action => 'login'
redirect_to :controller => 'my', :action => 'account'
end
else
# Manual activation by the administrator
if @user.save
# Sends an email to the administrators
Mailer.deliver_account_activation_request(@user)
flash[:notice] = l(:notice_account_pending)
redirect_to :action => 'login'
@user.login = params[:user][:login]
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
case Setting.self_registration
when '1'
register_by_email_activation(@user)
when '3'
register_automatically(@user)
else
register_manually_by_administrator(@user)
end
end
end
@@ -172,4 +160,119 @@ private
session[:user_id] = nil
end
end
def password_authentication
user = User.try_to_login(params[:username], params[:password])
if user.nil?
# Invalid credentials
flash.now[:error] = l(:notice_account_invalid_creditentials)
elsif user.new_record?
# Onthefly creation failed, display the registration form to fill/fix attributes
@user = user
session[:auth_source_registration] = {:login => user.login, :auth_source_id => user.auth_source_id }
render :action => 'register'
else
# Valid user
successful_authentication(user)
end
end
def open_id_authenticate(openid_url)
authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url) 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?
# Create on the fly
user.login = registration['nickname'] unless registration['nickname'].nil?
user.mail = registration['email'] unless registration['email'].nil?
user.firstname, user.lastname = registration['fullname'].split(' ') unless registration['fullname'].nil?
user.random_password
user.status = User::STATUS_REGISTERED
case Setting.self_registration
when '1'
register_by_email_activation(user) do
onthefly_creation_failed(user, {:login => user.login, :identity_url => identity_url })
end
when '3'
register_automatically(user) do
onthefly_creation_failed(user, {:login => user.login, :identity_url => identity_url })
end
else
register_manually_by_administrator(user) do
onthefly_creation_failed(user, {:login => user.login, :identity_url => identity_url })
end
end
else
# Existing record
successful_authentication(user)
end
end
end
end
def successful_authentication(user)
# Valid user
self.logged_user = user
# generate a key and set cookie if autologin
if params[:autologin] && Setting.autologin?
token = Token.create(:user => user, :action => 'autologin')
cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }
end
redirect_back_or_default :controller => 'my', :action => 'page'
end
# Onthefly creation failed, display the registration form to fill/fix attributes
def onthefly_creation_failed(user, auth_source_options = { })
@user = user
session[:auth_source_registration] = auth_source_options unless auth_source_options.empty?
render :action => 'register'
end
# Register a user for email activation.
#
# Pass a block for behavior when a user fails to save
def register_by_email_activation(user, &block)
token = Token.new(:user => user, :action => "register")
if user.save and token.save
Mailer.deliver_register(token)
flash[:notice] = l(:notice_account_register_done)
redirect_to :action => 'login'
else
yield if block_given?
end
end
# Automatically register a user
#
# Pass a block for behavior when a user fails to save
def register_automatically(user, &block)
# Automatic activation
user.status = User::STATUS_ACTIVE
if user.save
self.logged_user = user
flash[:notice] = l(:notice_account_activated)
redirect_to :controller => 'my', :action => 'account'
else
yield if block_given?
end
end
# Manual activation by the administrator
#
# Pass a block for behavior when a user fails to save
def register_manually_by_administrator(user, &block)
if user.save
# Sends an email to the administrators
Mailer.deliver_account_activation_request(user)
flash[:notice] = l(:notice_account_pending)
redirect_to :action => 'login'
else
yield if block_given?
end
end
end

View File

@@ -16,44 +16,46 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class AdminController < ApplicationController
layout 'base'
before_filter :require_admin
helper :sort
include SortHelper
def index
def index
@no_configuration_data = Redmine::DefaultData::Loader::no_data?
end
def projects
sort_init 'name', 'asc'
sort_update
@status = params[:status] ? params[:status].to_i : 1
c = ARCondition.new(@status == 0 ? "status <> 0" : ["status = ?", @status])
@status = params[:status] ? params[:status].to_i : 0
conditions = nil
conditions = ["status=?", @status] unless @status == 0
unless params[:name].blank?
name = "%#{params[:name].strip.downcase}%"
c << ["LOWER(identifier) LIKE ? OR LOWER(name) LIKE ?", name, name]
end
@project_count = Project.count(:conditions => conditions)
@project_pages = Paginator.new self, @project_count,
25,
params['page']
@projects = Project.find :all, :order => sort_clause,
:conditions => conditions,
:limit => @project_pages.items_per_page,
:offset => @project_pages.current.offset
@projects = Project.find :all, :order => 'lft',
:conditions => c.conditions
render :action => "projects", :layout => false if request.xhr?
end
def mail_options
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
def plugins
@plugins = Redmine::Plugin.all
end
# Loads the default configuration
# (roles, trackers, statuses, workflow, enumerations)
def default_configuration
if request.post?
settings = (params[:settings] || {}).dup.symbolize_keys
settings[:notified_events] ||= []
settings.each { |name, value| Setting[name] = value }
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'admin', :action => 'mail_options'
begin
Redmine::DefaultData::Loader::load(params[:lang])
flash[:notice] = l(:notice_default_data_loaded)
rescue Exception => e
flash[:error] = l(:error_can_t_load_default_data, e.message)
end
end
redirect_to :action => 'index'
end
def test_email
@@ -67,7 +69,7 @@ class AdminController < ApplicationController
flash[:error] = l(:notice_email_error, e.message)
end
ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
redirect_to :action => 'mail_options'
redirect_to :controller => 'settings', :action => 'edit', :tab => 'notifications'
end
def info
@@ -75,8 +77,8 @@ class AdminController < ApplicationController
@flags = {
:default_admin_changed => User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?,
:file_repository_writable => File.writable?(Attachment.storage_path),
:plugin_assets_writable => File.writable?(Engines.public_directory),
:rmagick_available => Object.const_defined?(:Magick)
}
@plugins = Redmine::Plugin.registered_plugins
end
end

View File

@@ -15,10 +15,18 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'uri'
require 'cgi'
class ApplicationController < ActionController::Base
layout 'base'
before_filter :user_setup, :check_if_login_required, :set_localization
filter_parameter_logging :password
include Redmine::MenuManager::MenuController
helper Redmine::MenuManager::MenuHelper
REDMINE_SUPPORTED_SCM.each do |scm|
require_dependency "repository/#{scm.underscore}"
end
@@ -28,18 +36,23 @@ class ApplicationController < ActionController::Base
end
def user_setup
# Check the settings cache for each request
Setting.check_cache
# Find the current user
User.current = find_current_user
end
# Returns the current user or nil if no user is logged in
def find_current_user
if session[:user_id]
# existing session
User.current = User.find(session[:user_id])
(User.active.find(session[:user_id]) rescue nil)
elsif cookies[:autologin] && Setting.autologin?
# auto-login feature
User.current = User.find_by_autologin_key(cookies[:autologin])
User.find_by_autologin_key(cookies[:autologin])
elsif params[:key] && accept_key_auth_actions.include?(params[:action])
# RSS key authentication
User.current = User.find_by_rss_key(params[:key])
else
User.current = User.anonymous
User.find_by_rss_key(params[:key])
end
end
@@ -51,13 +64,14 @@ class ApplicationController < ActionController::Base
end
def set_localization
User.current.language = nil unless User.current.logged?
lang = begin
if !User.current.language.blank? and GLoc.valid_languages.include? User.current.language.to_sym
if !User.current.language.blank? && GLoc.valid_language?(User.current.language)
User.current.language
elsif request.env['HTTP_ACCEPT_LANGUAGE']
accept_lang = parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first.split('-').first
if accept_lang and !accept_lang.empty? and GLoc.valid_languages.include? accept_lang.to_sym
accept_lang
accept_lang = parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first.downcase
if !accept_lang.blank? && (GLoc.valid_language?(accept_lang) || GLoc.valid_language?(accept_lang = accept_lang.split('-').first))
User.current.language = accept_lang
end
end
rescue
@@ -68,8 +82,7 @@ class ApplicationController < ActionController::Base
def require_login
if !User.current.logged?
store_location
redirect_to :controller => "account", :action => "login"
redirect_to :controller => "account", :action => "login", :back_url => url_for(params)
return false
end
true
@@ -83,39 +96,47 @@ class ApplicationController < ActionController::Base
end
true
end
def deny_access
User.current.logged? ? render_403 : require_login
end
# Authorize the user for the requested action
def authorize(ctrl = params[:controller], action = params[:action])
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project)
allowed ? true : (User.current.logged? ? render_403 : require_login)
allowed ? true : deny_access
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
unless @project.active?
if @project && @project.active?
if @project.is_public? || User.current.member_of?(@project) || User.current.admin?
true
else
User.current.logged? ? render_403 : require_login
end
else
@project = nil
render_404
return false
false
end
return true if @project.is_public? || User.current.member_of?(@project) || User.current.admin?
User.current.logged? ? render_403 : require_login
end
# store current uri in session.
# return to this location by calling redirect_back_or_default
def store_location
session[:return_to_params] = params
end
# move to the last store_location call or to the passed default one
def redirect_back_or_default(default)
if session[:return_to_params].nil?
redirect_to default
else
redirect_to session[:return_to_params]
session[:return_to_params] = nil
back_url = CGI.unescape(params[:back_url].to_s)
if !back_url.blank?
begin
uri = URI.parse(back_url)
# do not redirect user to another host or to the login or register page
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
redirect_to(back_url) and return
end
rescue URI::InvalidURIError
# redirect to default
end
end
redirect_to default
end
def render_403
@@ -129,9 +150,15 @@ class ApplicationController < ActionController::Base
return false
end
def render_error(msg)
flash.now[:error] = msg
render :nothing => true, :layout => !request.xhr?, :status => 500
end
def render_feed(items, options={})
@items = items || []
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
@items = @items.slice(0, Setting.feeds_limit.to_i)
@title = options[:title] || Setting.app_title
render :template => "common/feed.atom.rxml", :layout => false, :content_type => 'application/atom+xml'
end
@@ -146,16 +173,39 @@ class ApplicationController < ActionController::Base
end
# TODO: move to model
def attach_files(obj, files)
attachments = []
if files && files.is_a?(Array)
files.each do |file|
next unless file.size > 0
a = Attachment.create(:container => obj, :file => file, :author => User.current)
attachments << a unless a.new_record?
def attach_files(obj, attachments)
attached = []
unsaved = []
if attachments && attachments.is_a?(Hash)
attachments.each_value do |attachment|
file = attachment['file']
next unless file && file.size > 0
a = Attachment.create(:container => obj,
:file => file,
:description => attachment['description'].to_s.strip,
:author => User.current)
a.new_record? ? (unsaved << a) : (attached << a)
end
if unsaved.any?
flash[:warning] = l(:warning_attachments_not_saved, unsaved.size)
end
end
attachments
attached
end
# Returns the number of objects that should be displayed
# on the paginated list
def per_page_option
per_page = nil
if params[:per_page] && Setting.per_page_options_array.include?(params[:per_page].to_s.to_i)
per_page = params[:per_page].to_s.to_i
session[:per_page] = per_page
elsif session[:per_page]
per_page = session[:per_page]
else
per_page = Setting.per_page_options_array.first || 25
end
per_page
end
# qvalues http header parser
@@ -176,4 +226,9 @@ class ApplicationController < ActionController::Base
end
return tmp
end
# Returns a string that can be used as filename value in Content-Disposition header
def filename_for_content_disposition(name)
request.env['HTTP_USER_AGENT'] =~ %r{MSIE} ? ERB::Util.url_encode(name) : name
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2008 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,24 +16,59 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class AttachmentsController < ApplicationController
layout 'base'
before_filter :find_project, :check_project_privacy
before_filter :find_project
before_filter :read_authorize, :except => :destroy
before_filter :delete_authorize, :only => :destroy
verify :method => :post, :only => :destroy
def show
if @attachment.is_diff?
@diff = File.new(@attachment.diskfile, "rb").read
render :action => 'diff'
elsif @attachment.is_text?
@content = File.new(@attachment.diskfile, "rb").read
render :action => 'file'
else
download
end
end
def download
if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project)
@attachment.increment_download
end
# images are sent inline
send_file @attachment.diskfile, :filename => @attachment.filename,
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
:type => @attachment.content_type,
:disposition => (@attachment.image? ? 'inline' : 'attachment')
rescue
# in case the disk file was deleted
render_404
end
def destroy
# Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment)
redirect_to :back
rescue ::ActionController::RedirectBackError
redirect_to :controller => 'projects', :action => 'show', :id => @project
end
private
def find_project
@attachment = Attachment.find(params[:id])
# Show 404 if the filename in the url is wrong
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
@project = @attachment.project
rescue
rescue ActiveRecord::RecordNotFound
render_404
end
def read_authorize
@attachment.visible? ? true : deny_access
end
def delete_authorize
@attachment.deletable? ? true : deny_access
end
end

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class AuthSourcesController < ApplicationController
layout 'base'
before_filter :require_admin
def index

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class BoardsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
helper :messages
@@ -36,12 +35,14 @@ class BoardsController < ApplicationController
end
def show
sort_init "#{Message.table_name}.updated_on", "desc"
sort_update
sort_init 'updated_on', 'desc'
sort_update 'created_on' => "#{Message.table_name}.created_on",
'replies' => "#{Message.table_name}.replies_count",
'updated_on' => "#{Message.table_name}.updated_on"
@topic_count = @board.topics.count
@topic_pages = Paginator.new self, @topic_count, 25, params['page']
@topics = @board.topics.find :all, :order => "#{Message.table_name}.sticky DESC, #{sort_clause}",
@topic_pages = Paginator.new self, @topic_count, per_page_option, params['page']
@topics = @board.topics.find :all, :order => ["#{Message.table_name}.sticky DESC", sort_clause].compact.join(', '),
:include => [:author, {:last_reply => :author}],
:limit => @topic_pages.items_per_page,
:offset => @topic_pages.current.offset

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2009 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,36 +16,25 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class CustomFieldsController < ApplicationController
layout 'base'
before_filter :require_admin
def index
list
render :action => 'list' unless request.xhr?
end
def list
@custom_fields_by_type = CustomField.find(:all).group_by {|f| f.class.name }
@tab = params[:tab] || 'IssueCustomField'
render :action => "list", :layout => false if request.xhr?
end
def new
case params[:type]
when "IssueCustomField"
@custom_field = IssueCustomField.new(params[:custom_field])
@custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
when "UserCustomField"
@custom_field = UserCustomField.new(params[:custom_field])
when "ProjectCustomField"
@custom_field = ProjectCustomField.new(params[:custom_field])
else
redirect_to :action => 'list'
return
end
@custom_field = begin
if params[:type].to_s.match(/.+CustomField$/)
params[:type].to_s.constantize.new(params[:custom_field])
end
rescue
end
redirect_to(:action => 'index') and return unless @custom_field.is_a?(CustomField)
if request.post? and @custom_field.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list', :tab => @custom_field.class.name
redirect_to :action => 'index', :tab => @custom_field.class.name
end
@trackers = Tracker.find(:all, :order => 'position')
end
@@ -53,11 +42,8 @@ class CustomFieldsController < ApplicationController
def edit
@custom_field = CustomField.find(params[:id])
if request.post? and @custom_field.update_attributes(params[:custom_field])
if @custom_field.is_a? IssueCustomField
@custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list', :tab => @custom_field.class.name
redirect_to :action => 'index', :tab => @custom_field.class.name
end
@trackers = Tracker.find(:all, :order => 'position')
end
@@ -74,14 +60,14 @@ class CustomFieldsController < ApplicationController
when 'lowest'
@custom_field.move_to_bottom
end if params[:position]
redirect_to :action => 'list', :tab => @custom_field.class.name
redirect_to :action => 'index', :tab => @custom_field.class.name
end
def destroy
@custom_field = CustomField.find(params[:id]).destroy
redirect_to :action => 'list', :tab => @custom_field.class.name
redirect_to :action => 'index', :tab => @custom_field.class.name
rescue
flash[:error] = "Unable to delete custom field"
redirect_to :action => 'list'
redirect_to :action => 'index'
end
end

View File

@@ -16,13 +16,43 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class DocumentsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
before_filter :find_project, :only => [:index, :new]
before_filter :find_document, :except => [:index, :new]
before_filter :authorize
helper :attachments
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]
case @sort_by
when 'date'
@grouped = documents.group_by {|d| d.created_on.to_date }
when 'title'
@grouped = documents.group_by {|d| d.title.first.upcase}
when 'author'
@grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author}
else
@grouped = documents.group_by(&:category)
end
@document = @project.documents.build
render :layout => false if request.xhr?
end
def show
@attachments = @document.attachments.find(:all, :order => "created_on DESC")
end
def new
@document = @project.documents.build(params[:document])
if request.post? and @document.save
attach_files(@document, params[:attachments])
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
redirect_to :action => 'index', :project_id => @project
end
end
def edit
@categories = Enumeration::get_values('DCAT')
if request.post? and @document.update_attributes(params[:document])
@@ -33,33 +63,26 @@ class DocumentsController < ApplicationController
def destroy
@document.destroy
redirect_to :controller => 'projects', :action => 'list_documents', :id => @project
redirect_to :controller => 'documents', :action => 'index', :project_id => @project
end
def download
@attachment = @document.attachments.find(params[:attachment_id])
@attachment.increment_download
send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type
rescue
render_404
end
def add_attachment
attachments = attach_files(@document, params[:attachments])
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('document_added')
redirect_to :action => 'show', :id => @document
end
def destroy_attachment
@document.attachments.find(params[:attachment_id]).destroy
redirect_to :action => 'show', :id => @document
end
private
def find_project
@project = Project.find(params[:project_id])
rescue ActiveRecord::RecordNotFound
render_404
end
def find_document
@document = Document.find(params[:id])
@project = @document.project
rescue ActiveRecord::RecordNotFound
render_404
end
end
end

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class EnumerationsController < ApplicationController
layout 'base'
before_filter :require_admin
def index
@@ -75,11 +74,20 @@ class EnumerationsController < ApplicationController
end
def destroy
Enumeration.find(params[:id]).destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to :action => 'list'
rescue
flash[:error] = "Unable to delete enumeration"
redirect_to :action => 'list'
@enumeration = Enumeration.find(params[:id])
if !@enumeration.in_use?
# No associated objects
@enumeration.destroy
redirect_to :action => 'index'
elsif params[:reassign_to_id]
if reassign_to = Enumeration.find_by_opt_and_id(@enumeration.opt, params[:reassign_to_id])
@enumeration.destroy(reassign_to)
redirect_to :action => 'index'
end
end
@enumerations = Enumeration.get_values(@enumeration.opt) - [@enumeration]
#rescue
# flash[:error] = 'Unable to delete enumeration'
# redirect_to :action => 'index'
end
end

View File

@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueCategoriesController < ApplicationController
layout 'base'
menu_item :settings
before_filter :find_project, :authorize
verify :method => :post, :only => :destroy

View File

@@ -16,12 +16,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueRelationsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
def new
@relation = IssueRelation.new(params[:relation])
@relation.issue_from = @issue
if params[:relation] && !params[:relation][:issue_to_id].blank?
@relation.issue_to = Issue.visible.find_by_id(params[:relation][:issue_to_id])
end
@relation.save if request.post?
respond_to do |format|
format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue }

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueStatusesController < ApplicationController
layout 'base'
before_filter :require_admin
verify :method => :post, :only => [ :destroy, :create, :update, :move ],

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2008 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,19 +16,20 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssuesController < ApplicationController
layout 'base'
before_filter :find_project, :authorize, :except => [:index, :changes, :preview]
before_filter :find_optional_project, :only => [:index, :changes]
accept_key_auth :index, :changes
menu_item :new_issue, :only => :new
cache_sweeper :issue_sweeper, :only => [ :edit, :change_status, :destroy ]
before_filter :find_issue, :only => [:show, :edit, :reply]
before_filter :find_issues, :only => [:bulk_edit, :move, :destroy]
before_filter :find_project, :only => [:new, :update_form, :preview]
before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :update_form, :context_menu]
before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar]
accept_key_auth :index, :changes
helper :journals
helper :projects
include ProjectsHelper
helper :custom_fields
include CustomFieldsHelper
helper :ifpdf
include IfpdfHelper
helper :issue_relations
include IssueRelationsHelper
helper :watchers
@@ -39,13 +40,22 @@ class IssuesController < ApplicationController
helper :sort
include SortHelper
include IssuesHelper
helper :timelog
include Redmine::Export::PDF
def index
sort_init "#{Issue.table_name}.id", "desc"
sort_update
retrieve_query
sort_init 'id', 'desc'
sort_update({'id' => "#{Issue.table_name}.id"}.merge(@query.columns.inject({}) {|h, c| h[c.name.to_s] = c.sortable; h}))
if @query.valid?
limit = %w(pdf csv).include?(params[:format]) ? Setting.issues_export_limit.to_i : 25
limit = per_page_option
respond_to do |format|
format.html { }
format.atom { }
format.csv { limit = Setting.issues_export_limit.to_i }
format.pdf { limit = Setting.issues_export_limit.to_i }
end
@issue_count = Issue.count(:include => [:status, :project], :conditions => @query.statement)
@issue_pages = Paginator.new self, @issue_count, limit, params['page']
@issues = Issue.find :all, :order => sort_clause,
@@ -55,169 +65,410 @@ class IssuesController < ApplicationController
:offset => @issue_pages.current.offset
respond_to do |format|
format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
format.atom { render_feed(@issues, :title => l(:label_issue_plural)) }
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
format.csv { send_data(issues_to_csv(@issues, @project).read, :type => 'text/csv; header=present', :filename => 'export.csv') }
format.pdf { send_data(render(:template => 'issues/index.rfpdf', :layout => false), :type => 'application/pdf', :filename => 'export.pdf') }
format.pdf { send_data(issues_to_pdf(@issues, @project), :type => 'application/pdf', :filename => 'export.pdf') }
end
else
# Send html if the query is not valid
render(:template => 'issues/index.rhtml', :layout => !request.xhr?)
end
rescue ActiveRecord::RecordNotFound
render_404
end
def changes
sort_init "#{Issue.table_name}.id", "desc"
sort_update
retrieve_query
sort_init 'id', 'desc'
sort_update({'id' => "#{Issue.table_name}.id"}.merge(@query.columns.inject({}) {|h, c| h[c.name.to_s] = c.sortable; h}))
if @query.valid?
@changes = Journal.find :all, :include => [ :details, :user, {:issue => [:project, :author, :tracker, :status]} ],
@journals = Journal.find :all, :include => [ :details, :user, {:issue => [:project, :author, :tracker, :status]} ],
:conditions => @query.statement,
:limit => 25,
:order => "#{Journal.table_name}.created_on DESC"
end
@title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
render :layout => false, :content_type => 'application/atom+xml'
rescue ActiveRecord::RecordNotFound
render_404
end
def show
@custom_values = @issue.custom_values.find(:all, :include => :custom_field, :order => "#{CustomField.table_name}.position")
@journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")
@status_options = @issue.status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)
@journals.each_with_index {|j,i| j.indice = i+1}
@journals.reverse! if User.current.wants_comments_in_reverse_order?
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
@priorities = Enumeration::get_values('IPRI')
@time_entry = TimeEntry.new
respond_to do |format|
format.html { render :template => 'issues/show.rhtml' }
format.pdf { send_data(render(:template => 'issues/show.rfpdf', :layout => false), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") }
format.atom { render :action => 'changes', :layout => false, :content_type => 'application/atom+xml' }
format.pdf { send_data(issue_to_pdf(@issue), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") }
end
end
def edit
@priorities = Enumeration::get_values('IPRI')
@custom_values = []
if request.get?
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) }
else
begin
@issue.init_journal(User.current)
# Retrieve custom fields and values
if params["custom_fields"]
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
@issue.custom_values = @custom_values
end
@issue.attributes = params[:issue]
if @issue.save
flash[:notice] = l(:notice_successful_update)
redirect_to(params[:back_to] || {:action => 'show', :id => @issue})
end
rescue ActiveRecord::StaleObjectError
# Optimistic locking exception
flash[:error] = l(:notice_locking_conflict)
end
end
end
def add_note
journal = @issue.init_journal(User.current, params[:notes])
attachments = attach_files(@issue, params[:attachments])
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
if journal.save
flash[:notice] = l(:notice_successful_update)
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
redirect_to :action => 'show', :id => @issue
# Add a new issue
# The new issue will be created from an existing one if copy_from parameter is given
def new
@issue = Issue.new
@issue.copy_from(params[:copy_from]) if params[:copy_from]
@issue.project = @project
# Tracker must be set before custom field values
@issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)
if @issue.tracker.nil?
flash.now[:error] = 'No tracker is associated to this project. Please check the Project settings.'
render :nothing => true, :layout => true
return
end
show
if params[:issue].is_a?(Hash)
@issue.attributes = params[:issue]
@issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project)
end
@issue.author = User.current
default_status = IssueStatus.default
unless default_status
flash.now[:error] = 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
render :nothing => true, :layout => true
return
end
@issue.status = default_status
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)).uniq
if request.get? || request.xhr?
@issue.start_date ||= Date.today
else
requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
# Check that the user is allowed to apply the requested status
@issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
if @issue.save
attach_files(@issue, params[:attachments])
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
redirect_to(params[:continue] ? { :action => 'new', :tracker_id => @issue.tracker } :
{ :action => 'show', :id => @issue })
return
end
end
@priorities = Enumeration::get_values('IPRI')
render :layout => !request.xhr?
end
# Attributes that can be updated on workflow transition (without :edit permission)
# TODO: make it configurable (at least per role)
UPDATABLE_ATTRS_ON_TRANSITION = %w(status_id assigned_to_id fixed_version_id done_ratio) unless const_defined?(:UPDATABLE_ATTRS_ON_TRANSITION)
def edit
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
@priorities = Enumeration::get_values('IPRI')
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
@time_entry = TimeEntry.new
@notes = params[:notes]
journal = @issue.init_journal(User.current, @notes)
# User can change issue attributes only if he has :edit permission or if a workflow transition is allowed
if (@edit_allowed || !@allowed_statuses.empty?) && params[:issue]
attrs = params[:issue].dup
attrs.delete_if {|k,v| !UPDATABLE_ATTRS_ON_TRANSITION.include?(k) } unless @edit_allowed
attrs.delete(:status_id) unless @allowed_statuses.detect {|s| s.id.to_s == attrs[:status_id].to_s}
@issue.attributes = attrs
end
def change_status
@status_options = @issue.status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)
@new_status = IssueStatus.find(params[:new_status_id])
if params[:confirm]
begin
journal = @issue.init_journal(User.current, params[:notes])
@issue.status = @new_status
if @issue.update_attributes(params[:issue])
attachments = attach_files(@issue, params[:attachments])
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
# Log time
if current_role.allowed_to?(:log_time)
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
@time_entry.attributes = params[:time_entry]
@time_entry.save
end
if request.post?
@time_entry = TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
@time_entry.attributes = params[:time_entry]
attachments = attach_files(@issue, params[:attachments])
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
call_hook(:controller_issues_edit_before_save, { :params => params, :issue => @issue, :time_entry => @time_entry, :journal => journal})
if (@time_entry.hours.nil? || @time_entry.valid?) && @issue.save
# Log spend time
if User.current.allowed_to?(:log_time, @project)
@time_entry.save
end
if !journal.new_record?
# Only send notification if something was actually changed
flash[:notice] = l(:notice_successful_update)
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
redirect_to :action => 'show', :id => @issue
end
rescue ActiveRecord::StaleObjectError
# Optimistic locking exception
flash[:error] = l(:notice_locking_conflict)
call_hook(:controller_issues_edit_after_save, { :params => params, :issue => @issue, :time_entry => @time_entry, :journal => journal})
redirect_to(params[:back_to] || {:action => 'show', :id => @issue})
end
end
@assignable_to = @project.members.find(:all, :include => :user).collect{ |m| m.user }
@activities = Enumeration::get_values('ACTI')
end
rescue ActiveRecord::StaleObjectError
# Optimistic locking exception
flash.now[:error] = l(:notice_locking_conflict)
end
def reply
journal = Journal.find(params[:journal_id]) if params[:journal_id]
if journal
user = journal.user
text = journal.notes
else
user = @issue.author
text = @issue.description
end
content = "#{ll(Setting.default_language, :text_user_wrote, user)}\\n> "
content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n"
render(:update) { |page|
page.<< "$('notes').value = \"#{content}\";"
page.show 'update'
page << "Form.Element.focus('notes');"
page << "Element.scrollTo('update');"
page << "$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;"
}
end
# Bulk edit a set of issues
def bulk_edit
if request.post?
status = params[:status_id].blank? ? nil : IssueStatus.find_by_id(params[:status_id])
priority = params[:priority_id].blank? ? nil : Enumeration.find_by_id(params[:priority_id])
assigned_to = (params[:assigned_to_id].blank? || params[:assigned_to_id] == 'none') ? nil : User.find_by_id(params[:assigned_to_id])
category = (params[:category_id].blank? || params[:category_id] == 'none') ? nil : @project.issue_categories.find_by_id(params[:category_id])
fixed_version = (params[:fixed_version_id].blank? || params[:fixed_version_id] == 'none') ? nil : @project.versions.find_by_id(params[:fixed_version_id])
custom_field_values = params[:custom_field_values] ? params[:custom_field_values].reject {|k,v| v.blank?} : nil
unsaved_issue_ids = []
@issues.each do |issue|
journal = issue.init_journal(User.current, params[:notes])
issue.priority = priority if priority
issue.assigned_to = assigned_to if assigned_to || params[:assigned_to_id] == 'none'
issue.category = category if category || params[:category_id] == 'none'
issue.fixed_version = fixed_version if fixed_version || params[:fixed_version_id] == 'none'
issue.start_date = params[:start_date] unless params[:start_date].blank?
issue.due_date = params[:due_date] unless params[:due_date].blank?
issue.done_ratio = params[:done_ratio] unless params[:done_ratio].blank?
issue.custom_field_values = custom_field_values if custom_field_values && !custom_field_values.empty?
call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
# Don't save any change to the issue if the user is not authorized to apply the requested status
if (status.nil? || (issue.status.new_status_allowed_to?(status, current_role, issue.tracker) && issue.status = status)) && issue.save
# Send notification for each issue (if changed)
Mailer.deliver_issue_edit(journal) if journal.details.any? && Setting.notified_events.include?('issue_updated')
else
# Keep unsaved issue ids to display them in flash error
unsaved_issue_ids << issue.id
end
end
if unsaved_issue_ids.empty?
flash[:notice] = l(:notice_successful_update) unless @issues.empty?
else
flash[:error] = l(:notice_failed_to_save_issues, unsaved_issue_ids.size, @issues.size, '#' + unsaved_issue_ids.join(', #'))
end
redirect_to(params[:back_to] || {:controller => 'issues', :action => 'index', :project_id => @project})
return
end
# Find potential statuses the user could be allowed to switch issues to
@available_statuses = Workflow.find(:all, :include => :new_status,
:conditions => {:role_id => current_role.id}).collect(&:new_status).compact.uniq.sort
@custom_fields = @project.issue_custom_fields.select {|f| f.field_format == 'list'}
end
def move
@allowed_projects = []
# find projects to which the user is allowed to move the issue
if User.current.admin?
# admin is allowed to move issues to any active (visible) project
@allowed_projects = Project.find(:all, :conditions => Project.visible_by(User.current))
else
User.current.memberships.each {|m| @allowed_projects << m.project if m.role.allowed_to?(:move_issues)}
end
@target_project = @allowed_projects.detect {|p| p.id.to_s == params[:new_project_id]} if params[:new_project_id]
@target_project ||= @project
@trackers = @target_project.trackers
if request.post?
new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id])
unsaved_issue_ids = []
@issues.each do |issue|
issue.init_journal(User.current)
unsaved_issue_ids << issue.id unless issue.move_to(@target_project, new_tracker, params[:copy_options])
end
if unsaved_issue_ids.empty?
flash[:notice] = l(:notice_successful_update) unless @issues.empty?
else
flash[:error] = l(:notice_failed_to_save_issues, unsaved_issue_ids.size, @issues.size, '#' + unsaved_issue_ids.join(', #'))
end
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
return
end
render :layout => false if request.xhr?
end
def destroy
@issue.destroy
@hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
if @hours > 0
case params[:todo]
when 'destroy'
# nothing to do
when 'nullify'
TimeEntry.update_all('issue_id = NULL', ['issue_id IN (?)', @issues])
when 'reassign'
reassign_to = @project.issues.find_by_id(params[:reassign_to_id])
if reassign_to.nil?
flash.now[:error] = l(:error_issue_not_found_in_project)
return
else
TimeEntry.update_all("issue_id = #{reassign_to.id}", ['issue_id IN (?)', @issues])
end
else
# display the destroy form
return
end
end
@issues.each(&:destroy)
redirect_to :action => 'index', :project_id => @project
end
def destroy_attachment
a = @issue.attachments.find(params[:attachment_id])
a.destroy
journal = @issue.init_journal(User.current)
journal.details << JournalDetail.new(:property => 'attachment',
:prop_key => a.id,
:old_value => a.filename)
journal.save
redirect_to :action => 'show', :id => @issue
def gantt
@gantt = Redmine::Helpers::Gantt.new(params)
retrieve_query
if @query.valid?
events = []
# Issues that have start and due dates
events += Issue.find(:all,
:order => "start_date, due_date",
:include => [:tracker, :status, :assigned_to, :priority, :project],
:conditions => ["(#{@query.statement}) AND (((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null)", @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to]
)
# Issues that don't have a due date but that are assigned to a version with a date
events += Issue.find(:all,
:order => "start_date, effective_date",
:include => [:tracker, :status, :assigned_to, :priority, :project, :fixed_version],
:conditions => ["(#{@query.statement}) AND (((start_date>=? and start_date<=?) or (effective_date>=? and effective_date<=?) or (start_date<? and effective_date>?)) and start_date is not null and due_date is null and effective_date is not null)", @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to]
)
# Versions
events += Version.find(:all, :include => :project,
:conditions => ["(#{@query.project_statement}) AND effective_date BETWEEN ? AND ?", @gantt.date_from, @gantt.date_to])
@gantt.events = events
end
respond_to do |format|
format.html { render :template => "issues/gantt.rhtml", :layout => !request.xhr? }
format.png { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{@project.nil? ? '' : "#{@project.identifier}-" }gantt.png") } if @gantt.respond_to?('to_image')
format.pdf { send_data(gantt_to_pdf(@gantt, @project), :type => 'application/pdf', :filename => "#{@project.nil? ? '' : "#{@project.identifier}-" }gantt.pdf") }
end
end
def calendar
if params[:year] and params[:year].to_i > 1900
@year = params[:year].to_i
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
@month = params[:month].to_i
end
end
@year ||= Date.today.year
@month ||= Date.today.month
@calendar = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :month)
retrieve_query
if @query.valid?
events = []
events += Issue.find(:all,
:include => [:tracker, :status, :assigned_to, :priority, :project],
:conditions => ["(#{@query.statement}) AND ((start_date BETWEEN ? AND ?) OR (due_date BETWEEN ? AND ?))", @calendar.startdt, @calendar.enddt, @calendar.startdt, @calendar.enddt]
)
events += Version.find(:all, :include => :project,
:conditions => ["(#{@query.project_statement}) AND effective_date BETWEEN ? AND ?", @calendar.startdt, @calendar.enddt])
@calendar.events = events
end
render :layout => false if request.xhr?
end
def context_menu
@issues = Issue.find_all_by_id(params[:ids], :include => :project)
if (@issues.size == 1)
@issue = @issues.first
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
end
projects = @issues.collect(&:project).compact.uniq
@project = projects.first if projects.size == 1
@can = {:edit => (@project && User.current.allowed_to?(:edit_issues, @project)),
:log_time => (@project && User.current.allowed_to?(:log_time, @project)),
:update => (@project && (User.current.allowed_to?(:edit_issues, @project) || (User.current.allowed_to?(:change_status, @project) && @allowed_statuses && !@allowed_statuses.empty?))),
:move => (@project && User.current.allowed_to?(:move_issues, @project)),
:copy => (@issue && @project.trackers.include?(@issue.tracker) && User.current.allowed_to?(:add_issues, @project)),
:delete => (@project && User.current.allowed_to?(:delete_issues, @project))
}
if @project
@assignables = @project.assignable_users
@assignables << @issue.assigned_to if @issue && @issue.assigned_to && !@assignables.include?(@issue.assigned_to)
end
@priorities = Enumeration.get_values('IPRI').reverse
@statuses = IssueStatus.find(:all, :order => 'position')
@allowed_statuses = @issue.status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)
@assignables = @issue.assignable_users
@assignables << @issue.assigned_to if @issue.assigned_to && !@assignables.include?(@issue.assigned_to)
@can = {:edit => User.current.allowed_to?(:edit_issues, @project),
:change_status => User.current.allowed_to?(:change_issue_status, @project),
:add => User.current.allowed_to?(:add_issues, @project),
:move => User.current.allowed_to?(:move_issues, @project),
:copy => (@project.trackers.include?(@issue.tracker) && User.current.allowed_to?(:add_issues, @project)),
:delete => User.current.allowed_to?(:delete_issues, @project)}
@back = request.env['HTTP_REFERER']
render :layout => false
end
def update_form
@issue = Issue.new(params[:issue])
render :action => :new, :layout => false
end
def preview
issue = Issue.find_by_id(params[:id])
@attachements = issue.attachments if issue
@text = params[:issue][:description]
@issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
@attachements = @issue.attachments if @issue
@text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil)
render :partial => 'common/preview'
end
private
def find_project
def find_issue
@issue = Issue.find(params[:id], :include => [:project, :tracker, :status, :author, :priority, :category])
@project = @issue.project
rescue ActiveRecord::RecordNotFound
render_404
end
def find_optional_project
return true unless params[:project_id]
# Filter for bulk operations
def find_issues
@issues = Issue.find_all_by_id(params[:id] || params[:ids])
raise ActiveRecord::RecordNotFound if @issues.empty?
projects = @issues.collect(&:project).compact.uniq
if projects.size == 1
@project = projects.first
else
# TODO: let users bulk edit/move/destroy issues from different projects
render_error 'Can not bulk edit/move/destroy issues from different projects' and return false
end
rescue ActiveRecord::RecordNotFound
render_404
end
def find_project
@project = Project.find(params[:project_id])
authorize
rescue ActiveRecord::RecordNotFound
render_404
end
def find_optional_project
@project = Project.find(params[:project_id]) unless params[:project_id].blank?
allowed = User.current.allowed_to?({:controller => params[:controller], :action => params[:action]}, @project, :global => true)
allowed ? true : deny_access
rescue ActiveRecord::RecordNotFound
render_404
end
# Retrieve query from session or build a new query
def retrieve_query
if params[:query_id]
@query = Query.find(params[:query_id], :conditions => {:project_id => (@project ? @project.id : nil)})
session[:query] = @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.project = @project
session[:query] = {:id => @query.id, :project_id => @query.project_id}
else
if params[:set_filter] or !session[:query] or session[:query].project != @project
if 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.project = @project
@@ -230,9 +481,11 @@ private
@query.add_short_filter(field, params[field]) if params[field]
end
end
session[:query] = @query
session[:query] = {:project_id => @query.project_id, :filters => @query.filters}
else
@query = session[:query]
@query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
@query ||= Query.new(:name => "_", :project => @project, :filters => session[:query][:filters])
@query.project = @project
end
end
end

View File

@@ -0,0 +1,41 @@
# redMine - project management software
# Copyright (C) 2006-2008 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.
class JournalsController < ApplicationController
before_filter :find_journal
def edit
if request.post?
@journal.update_attributes(:notes => params[:notes]) if params[:notes]
@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.js { render :action => 'update' }
end
end
end
private
def find_journal
@journal = Journal.find(params[:id])
render_403 and return false unless @journal.editable_by?(User.current)
@project = @journal.journalized.project
rescue ActiveRecord::RecordNotFound
render_404
end
end

View File

@@ -0,0 +1,44 @@
# redMine - project management software
# Copyright (C) 2006-2008 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.
class MailHandlerController < ActionController::Base
before_filter :check_credential
verify :method => :post,
:only => :index,
:render => { :nothing => true, :status => 405 }
# Submits an incoming email to MailHandler
def index
options = params.dup
email = options.delete(:email)
if MailHandler.receive(email, options)
render :nothing => true, :status => :created
else
render :nothing => true, :status => :unprocessable_entity
end
end
private
def check_credential
User.current = nil
unless Setting.mail_handler_api_enabled? && params[:key] == Setting.mail_handler_api_key
render :nothing => true, :status => 403
end
end
end

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MembersController < ApplicationController
layout 'base'
before_filter :find_member, :except => :new
before_filter :find_project, :only => :new
before_filter :authorize

View File

@@ -16,18 +16,22 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MessagesController < ApplicationController
layout 'base'
before_filter :find_board, :only => :new
before_filter :find_message, :except => :new
before_filter :authorize
menu_item :boards
before_filter :find_board, :only => [:new, :preview]
before_filter :find_message, :except => [:new, :preview]
before_filter :authorize, :except => [:preview, :edit, :destroy]
verify :method => :post, :only => [ :reply, :destroy ], :redirect_to => { :action => :show }
verify :xhr => true, :only => :quote
helper :watchers
helper :attachments
include AttachmentsHelper
# Show a topic and its replies
def show
@replies = @topic.children.find(:all, :include => [:author, :attachments, {:board => :project}])
@replies.reverse! if User.current.wants_comments_in_reverse_order?
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => false if request.xhr?
end
@@ -61,7 +65,8 @@ class MessagesController < ApplicationController
# Edit a message
def edit
if params[:message] && User.current.allowed_to?(:edit_messages, @project)
render_403 and return false unless @message.editable_by?(User.current)
if params[:message]
@message.locked = params[:message]['locked']
@message.sticky = params[:message]['sticky']
end
@@ -74,12 +79,34 @@ class MessagesController < ApplicationController
# Delete a messages
def destroy
render_403 and return false unless @message.destroyable_by?(User.current)
@message.destroy
redirect_to @message.parent.nil? ?
{ :controller => 'boards', :action => 'show', :project_id => @project, :id => @board } :
{ :action => 'show', :id => @message.parent }
end
def quote
user = @message.author
text = @message.content
content = "#{ll(Setting.default_language, :text_user_wrote, user)}\\n> "
content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n"
render(:update) { |page|
page.<< "$('message_content').value = \"#{content}\";"
page.show 'reply'
page << "Form.Element.focus('message_content');"
page << "Element.scrollTo('reply');"
page << "$('message_content').scrollTop = $('message_content').scrollHeight - $('message_content').clientHeight;"
}
end
def preview
message = @board.messages.find_by_id(params[:id])
@attachements = message.attachments if message
@text = (params[:message] || params[:reply])[:content]
render :partial => 'common/preview'
end
private
def find_message
find_board

View File

@@ -16,17 +16,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MyController < ApplicationController
helper :issues
layout 'base'
before_filter :require_login
helper :issues
helper :custom_fields
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
'issuesreportedbyme' => :label_reported_issues,
'issueswatched' => :label_watched_issues,
'news' => :label_news_latest,
'calendar' => :label_calendar,
'documents' => :label_document_plural
'documents' => :label_document_plural,
'timelog' => :label_spent_time
}.freeze
DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'],

View File

@@ -16,8 +16,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class NewsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize, :except => :index
before_filter :find_news, :except => [:new, :index, :preview]
before_filter :find_project, :only => [:new, :preview]
before_filter :authorize, :except => [:index, :preview]
before_filter :find_optional_project, :only => :index
accept_key_auth :index
@@ -34,8 +35,22 @@ class NewsController < ApplicationController
end
def show
@comments = @news.comments
@comments.reverse! if User.current.wants_comments_in_reverse_order?
end
def new
@news = News.new(:project => @project, :author => User.current)
if request.post?
@news.attributes = params[:news]
if @news.save
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_news_added(@news) if Setting.notified_events.include?('news_added')
redirect_to :controller => 'news', :action => 'index', :project_id => @project
end
end
end
def edit
if request.post? and @news.update_attributes(params[:news])
flash[:notice] = l(:notice_successful_update)
@@ -64,14 +79,25 @@ class NewsController < ApplicationController
redirect_to :action => 'index', :project_id => @project
end
def preview
@text = (params[:news] ? params[:news][:description] : nil)
render :partial => 'common/preview'
end
private
def find_project
def find_news
@news = News.find(params[:id])
@project = @news.project
rescue ActiveRecord::RecordNotFound
render_404
end
def find_project
@project = Project.find(params[:project_id])
rescue ActiveRecord::RecordNotFound
render_404
end
def find_optional_project
return true unless params[:project_id]
@project = Project.find(params[:project_id])

View File

@@ -16,22 +16,29 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ProjectsController < ApplicationController
layout 'base'
before_filter :find_project, :except => [ :index, :list, :add ]
before_filter :authorize, :except => [ :index, :list, :add, :archive, :unarchive, :destroy ]
before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ]
accept_key_auth :activity, :calendar
menu_item :overview
menu_item :activity, :only => :activity
menu_item :roadmap, :only => :roadmap
menu_item :files, :only => [:list_files, :add_file]
menu_item :settings, :only => :settings
menu_item :issues, :only => [:changelog]
before_filter :find_project, :except => [ :index, :list, :add, :activity ]
before_filter :find_optional_project, :only => :activity
before_filter :authorize, :except => [ :index, :list, :add, :archive, :unarchive, :destroy, :activity ]
before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ]
accept_key_auth :activity
after_filter :only => [:add, :edit, :archive, :unarchive, :destroy] do |controller|
if controller.request.post?
controller.send :expire_action, :controller => 'welcome', :action => 'robots.txt'
end
end
cache_sweeper :project_sweeper, :only => [ :add, :edit, :archive, :unarchive, :destroy ]
cache_sweeper :issue_sweeper, :only => [ :add_issue ]
cache_sweeper :version_sweeper, :only => [ :add_version ]
helper :sort
include SortHelper
helper :custom_fields
include CustomFieldsHelper
helper :ifpdf
include IfpdfHelper
helper :issues
helper IssuesHelper
helper :queries
@@ -40,38 +47,34 @@ class ProjectsController < ApplicationController
include RepositoriesHelper
include ProjectsHelper
def index
list
render :action => 'list' unless request.xhr?
end
# Lists visible projects
def list
projects = Project.find :all,
:conditions => Project.visible_by(User.current),
:include => :parent
@project_tree = projects.group_by {|p| p.parent || p}
@project_tree.each_key {|p| @project_tree[p] -= [p]}
def index
respond_to do |format|
format.html {
@projects = Project.visible.find(:all, :order => 'lft')
}
format.atom {
projects = Project.visible.find(:all, :order => 'created_on DESC',
:limit => Setting.feeds_limit.to_i)
render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
}
end
end
# Add a new project
def add
@custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@trackers = Tracker.all
@root_projects = Project.find(:all,
:conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}",
:order => 'name')
@project = Project.new(params[:project])
@project.enabled_module_names = Redmine::AccessControl.available_project_modules
if request.get?
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
@project.identifier = Project.next_identifier if Setting.sequential_project_identifiers?
@project.trackers = Tracker.all
@project.is_public = Setting.default_projects_public?
@project.enabled_module_names = Redmine::AccessControl.available_project_modules
else
@project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => (params[:custom_fields] ? params["custom_fields"][x.id.to_s] : nil)) }
@project.custom_values = @custom_values
@project.enabled_module_names = params[:enabled_modules]
if @project.save
@project.enabled_module_names = params[:enabled_modules]
@project.set_parent!(params[:project]['parent_id']) if User.current.admin? && params[:project].has_key?('parent_id')
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'admin', :action => 'projects'
end
@@ -80,26 +83,39 @@ class ProjectsController < ApplicationController
# Show @project
def show
@custom_values = @project.custom_values.find(:all, :include => :custom_field, :order => "#{CustomField.table_name}.position")
if params[:jump]
# try to redirect to the requested menu item
redirect_to_project_menu_item(@project, params[:jump]) && return
end
@members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
@subprojects = @project.active_children
@subprojects = @project.children.visible
@ancestors = @project.ancestors.visible
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
@trackers = @project.trackers
@open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN #{IssueStatus.table_name} ON #{IssueStatus.table_name}.id = #{Issue.table_name}.status_id", :conditions => ["project_id=? and #{IssueStatus.table_name}.is_closed=?", @project.id, false])
@total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
@total_hours = @project.time_entries.sum(:hours)
@trackers = @project.rolled_up_trackers
cond = @project.project_condition(Setting.display_subprojects_issues?)
@open_issues_by_tracker = Issue.visible.count(:group => :tracker,
:include => [:project, :status, :tracker],
:conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false])
@total_issues_by_tracker = Issue.visible.count(:group => :tracker,
:include => [:project, :status, :tracker],
:conditions => cond)
TimeEntry.visible_by(User.current) do
@total_hours = TimeEntry.sum(:hours,
:include => :project,
:conditions => cond).to_f
end
@key = User.current.rss_key
end
def settings
@root_projects = Project.find(:all,
:conditions => ["parent_id IS NULL AND status = #{Project::STATUS_ACTIVE} AND id <> ?", @project.id],
:order => 'name')
@custom_fields = IssueCustomField.find(:all)
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_category ||= IssueCategory.new
@member ||= @project.members.new
@trackers = Tracker.all
@custom_values ||= ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
@repository ||= @project.repository
@wiki ||= @project.wiki
end
@@ -107,13 +123,9 @@ class ProjectsController < ApplicationController
# Edit @project
def edit
if request.post?
@project.custom_fields = IssueCustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
if params[:custom_fields]
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
@project.custom_values = @custom_values
end
@project.attributes = params[:project]
if @project.save
@project.set_parent!(params[:project]['parent_id']) if User.current.admin? && params[:project].has_key?('parent_id')
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'settings', :id => @project
else
@@ -177,177 +189,29 @@ class ProjectsController < ApplicationController
end
end
# Add a new document to @project
def add_document
@document = @project.documents.build(params[:document])
if request.post? and @document.save
attach_files(@document, params[:attachments])
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
redirect_to :action => 'list_documents', :id => @project
end
end
# Show documents list of @project
def list_documents
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
documents = @project.documents.find :all, :include => [:attachments, :category]
case @sort_by
when 'date'
@grouped = documents.group_by {|d| d.created_on.to_date }
when 'title'
@grouped = documents.group_by {|d| d.title.first.upcase}
when 'author'
@grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author}
else
@grouped = documents.group_by(&:category)
end
render :layout => false if request.xhr?
end
# Add a new issue to @project
# The new issue will be created from an existing one if copy_from parameter is given
def add_issue
@issue = params[:copy_from] ? Issue.new.copy_from(params[:copy_from]) : Issue.new(params[:issue])
@issue.project = @project
@issue.author = User.current
@issue.tracker ||= @project.trackers.find(params[:tracker_id])
default_status = IssueStatus.default
unless default_status
flash.now[:error] = 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
render :nothing => true, :layout => true
return
end
@issue.status = default_status
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker))
if request.get?
@issue.start_date ||= Date.today
@custom_values = @issue.custom_values.empty? ?
@project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) } :
@issue.custom_values
else
requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
# Check that the user is allowed to apply the requested status
@issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
@issue.custom_values = @custom_values
if @issue.save
attach_files(@issue, params[:attachments])
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
return
end
end
@priorities = Enumeration::get_values('IPRI')
end
# Bulk edit issues
def bulk_edit_issues
if request.post?
status = params[:status_id].blank? ? nil : IssueStatus.find_by_id(params[:status_id])
priority = params[:priority_id].blank? ? nil : Enumeration.find_by_id(params[:priority_id])
assigned_to = params[:assigned_to_id].blank? ? nil : User.find_by_id(params[:assigned_to_id])
category = params[:category_id].blank? ? nil : @project.issue_categories.find_by_id(params[:category_id])
fixed_version = params[:fixed_version_id].blank? ? nil : @project.versions.find_by_id(params[:fixed_version_id])
issues = @project.issues.find_all_by_id(params[:issue_ids])
unsaved_issue_ids = []
issues.each do |issue|
journal = issue.init_journal(User.current, params[:notes])
issue.priority = priority if priority
issue.assigned_to = assigned_to if assigned_to || params[:assigned_to_id] == 'none'
issue.category = category if category
issue.fixed_version = fixed_version if fixed_version
issue.start_date = params[:start_date] unless params[:start_date].blank?
issue.due_date = params[:due_date] unless params[:due_date].blank?
issue.done_ratio = params[:done_ratio] unless params[:done_ratio].blank?
# Don't save any change to the issue if the user is not authorized to apply the requested status
if (status.nil? || (issue.status.new_status_allowed_to?(status, current_role, issue.tracker) && issue.status = status)) && issue.save
# Send notification for each issue (if changed)
Mailer.deliver_issue_edit(journal) if journal.details.any? && Setting.notified_events.include?('issue_updated')
else
# Keep unsaved issue ids to display them in flash error
unsaved_issue_ids << issue.id
end
end
if unsaved_issue_ids.empty?
flash[:notice] = l(:notice_successful_update) unless issues.empty?
else
flash[:error] = l(:notice_failed_to_save_issues, unsaved_issue_ids.size, issues.size, '#' + unsaved_issue_ids.join(', #'))
end
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
return
end
if current_role && User.current.allowed_to?(:change_issue_status, @project)
# Find potential statuses the user could be allowed to switch issues to
@available_statuses = Workflow.find(:all, :include => :new_status,
:conditions => {:role_id => current_role.id}).collect(&:new_status).compact.uniq
end
render :update do |page|
page.hide 'query_form'
page.replace_html 'bulk-edit', :partial => 'issues/bulk_edit_form'
end
end
def move_issues
@issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
redirect_to :controller => 'issues', :action => 'index', :project_id => @project and return unless @issues
@projects = []
# find projects to which the user is allowed to move the issue
if User.current.admin?
# admin is allowed to move issues to any active (visible) project
@projects = Project.find(:all, :conditions => Project.visible_by(User.current), :order => 'name')
else
User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:move_issues)}
end
@target_project = @projects.detect {|p| p.id.to_s == params[:new_project_id]} if params[:new_project_id]
@target_project ||= @project
@trackers = @target_project.trackers
if request.post?
new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id])
unsaved_issue_ids = []
@issues.each do |issue|
unsaved_issue_ids << issue.id unless issue.move_to(@target_project, new_tracker)
end
if unsaved_issue_ids.empty?
flash[:notice] = l(:notice_successful_update) unless @issues.empty?
else
flash[:error] = l(:notice_failed_to_save_issues, unsaved_issue_ids.size, @issues.size, '#' + unsaved_issue_ids.join(', #'))
end
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
return
end
render :layout => false if request.xhr?
end
# Add a news to @project
def add_news
@news = News.new(:project => @project, :author => User.current)
if request.post?
@news.attributes = params[:news]
if @news.save
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_news_added(@news) if Setting.notified_events.include?('news_added')
redirect_to :controller => 'news', :action => 'index', :project_id => @project
end
end
end
def add_file
if request.post?
@version = @project.versions.find_by_id(params[:version_id])
attachments = attach_files(@issue, params[:attachments])
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id]))
attachments = attach_files(container, params[:attachments])
if !attachments.empty? && Setting.notified_events.include?('file_added')
Mailer.deliver_attachments_added(attachments)
end
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
return
end
@versions = @project.versions.sort
end
def list_files
@versions = @project.versions.sort
sort_init 'filename', 'asc'
sort_update 'filename' => "#{Attachment.table_name}.filename",
'created_on' => "#{Attachment.table_name}.created_on",
'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
render :layout => !request.xhr?
end
# Show changelog for @project
@@ -365,167 +229,43 @@ class ProjectsController < ApplicationController
end
def activity
if params[:year] and params[:year].to_i > 1900
@year = params[:year].to_i
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
@month = params[:month].to_i
end
end
@year ||= Date.today.year
@month ||= Date.today.month
case params[:format]
when 'atom'
# 30 last days
@date_from = Date.today - 30
@date_to = Date.today + 1
else
# current month
@date_from = Date.civil(@year, @month, 1)
@date_to = @date_from >> 1
end
@days = Setting.activity_days_default.to_i
@event_types = %w(issues news files documents changesets wiki_pages messages)
@event_types.delete('wiki_pages') unless @project.wiki
@event_types.delete('changesets') unless @project.repository
@event_types.delete('messages') unless @project.boards.any?
# only show what the user is allowed to view
@event_types = @event_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
@scope = @event_types.select {|t| params["show_#{t}"]}
# default events if none is specified in parameters
@scope = (@event_types - %w(wiki_pages messages))if @scope.empty?
@events = []
if @scope.include?('issues')
@events += @project.issues.find(:all, :include => [:author, :tracker], :conditions => ["#{Issue.table_name}.created_on>=? and #{Issue.table_name}.created_on<=?", @date_from, @date_to] )
@events += @project.issues_status_changes(@date_from, @date_to)
end
if @scope.include?('news')
@events += @project.news.find(:all, :conditions => ["#{News.table_name}.created_on>=? and #{News.table_name}.created_on<=?", @date_from, @date_to], :include => :author )
end
if @scope.include?('files')
@events += Attachment.find(:all, :select => "#{Attachment.table_name}.*", :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author )
end
if @scope.include?('documents')
@events += @project.documents.find(:all, :conditions => ["#{Document.table_name}.created_on>=? and #{Document.table_name}.created_on<=?", @date_from, @date_to] )
@events += Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author )
end
if @scope.include?('wiki_pages')
select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
"#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title, " +
"#{WikiContent.versioned_table_name}.page_id, #{WikiContent.versioned_table_name}.author_id, " +
"#{WikiContent.versioned_table_name}.id"
joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
"LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id "
conditions = ["#{Wiki.table_name}.project_id = ? AND #{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?",
@project.id, @date_from, @date_to]
@events += WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => conditions)
if params[:from]
begin; @date_to = params[:from].to_date + 1; rescue; end
end
if @scope.include?('changesets')
@events += Changeset.find(:all, :include => :repository, :conditions => ["#{Repository.table_name}.project_id = ? AND #{Changeset.table_name}.committed_on BETWEEN ? AND ?", @project.id, @date_from, @date_to])
end
@date_to ||= Date.today + 1
@date_from = @date_to - @days
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
if @scope.include?('messages')
@events += Message.find(:all,
:include => [:board, :author],
:conditions => ["#{Board.table_name}.project_id=? AND #{Message.table_name}.parent_id IS NULL AND #{Message.table_name}.created_on BETWEEN ? AND ?", @project.id, @date_from, @date_to])
end
@events_by_day = @events.group_by(&:event_date)
@activity = Redmine::Activity::Fetcher.new(User.current, :project => @project,
:with_subprojects => @with_subprojects,
:author => @author)
@activity.scope_select {|t| !params["show_#{t}"].nil?}
@activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
events = @activity.events(@date_from, @date_to)
respond_to do |format|
format.html { render :layout => false if request.xhr? }
format.atom { render_feed(@events, :title => "#{@project.name}: #{l(:label_activity)}") }
end
end
def calendar
@trackers = Tracker.find(:all, :order => 'position')
retrieve_selected_tracker_ids(@trackers)
if params[:year] and params[:year].to_i > 1900
@year = params[:year].to_i
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
@month = params[:month].to_i
end
end
@year ||= Date.today.year
@month ||= Date.today.month
@calendar = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :month)
events = []
@project.issues_with_subprojects(params[:with_subprojects]) do
events += Issue.find(:all,
:include => [:tracker, :status, :assigned_to, :priority, :project],
:conditions => ["((start_date BETWEEN ? AND ?) OR (due_date BETWEEN ? AND ?)) AND #{Issue.table_name}.tracker_id IN (#{@selected_tracker_ids.join(',')})", @calendar.startdt, @calendar.enddt, @calendar.startdt, @calendar.enddt]
) unless @selected_tracker_ids.empty?
end
events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @calendar.startdt, @calendar.enddt])
@calendar.events = events
render :layout => false if request.xhr?
end
def gantt
@trackers = Tracker.find(:all, :order => 'position')
retrieve_selected_tracker_ids(@trackers)
if params[:year] and params[:year].to_i >0
@year_from = params[:year].to_i
if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
@month_from = params[:month].to_i
else
@month_from = 1
end
else
@month_from ||= Date.today.month
@year_from ||= Date.today.year
format.html {
@events_by_day = events.group_by(&:event_date)
render :layout => false if request.xhr?
}
format.atom {
title = l(:label_activity)
if @author
title = @author.name
elsif @activity.scope.size == 1
title = l("label_#{@activity.scope.first.singularize}_plural")
end
render_feed(events, :title => "#{@project || Setting.app_title}: #{title}")
}
end
zoom = (params[:zoom] || User.current.pref[:gantt_zoom]).to_i
@zoom = (zoom > 0 && zoom < 5) ? zoom : 2
months = (params[:months] || User.current.pref[:gantt_months]).to_i
@months = (months > 0 && months < 25) ? months : 6
# Save gantt paramters as user preference (zoom and months count)
if (User.current.logged? && (@zoom != User.current.pref[:gantt_zoom] || @months != User.current.pref[:gantt_months]))
User.current.pref[:gantt_zoom], User.current.pref[:gantt_months] = @zoom, @months
User.current.preference.save
end
@date_from = Date.civil(@year_from, @month_from, 1)
@date_to = (@date_from >> @months) - 1
@events = []
@project.issues_with_subprojects(params[:with_subprojects]) do
@events += Issue.find(:all,
:order => "start_date, due_date",
:include => [:tracker, :status, :assigned_to, :priority, :project],
:conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
) unless @selected_tracker_ids.empty?
end
@events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
@events.sort! {|x,y| x.start_date <=> y.start_date }
if params[:format]=='pdf'
@options_for_rfpdf ||= {}
@options_for_rfpdf[:file_name] = "#{@project.identifier}-gantt.pdf"
render :template => "projects/gantt.rfpdf", :layout => false
elsif params[:format]=='png' && respond_to?('gantt_image')
image = gantt_image(@events, @date_from, @months, @zoom)
image.format = 'PNG'
send_data(image.to_blob, :disposition => 'inline', :type => 'image/png', :filename => "#{@project.identifier}-gantt.png")
else
render :template => "projects/gantt.rhtml"
end
rescue ActiveRecord::RecordNotFound
render_404
end
private
@@ -538,6 +278,14 @@ private
render_404
end
def find_optional_project
return true unless params[:id]
@project = Project.find(params[:id])
authorize
rescue ActiveRecord::RecordNotFound
render_404
end
def retrieve_selected_tracker_ids(selectable_trackers)
if ids = params[:tracker_ids]
@selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }

View File

@@ -16,20 +16,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class QueriesController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
def index
@queries = @project.queries.find(:all,
:order => "name ASC",
:conditions => ["is_public = ? or user_id = ?", true, (User.current.logged? ? User.current.id : 0)])
end
menu_item :issues
before_filter :find_query, :except => :new
before_filter :find_optional_project, :only => :new
def new
@query = Query.new(params[:query])
@query.project = @project
@query.project = params[:query_is_for_all] ? nil : @project
@query.user = User.current
@query.is_public = false unless current_role.allowed_to?(:manage_public_queries)
@query.is_public = false unless (@query.project && current_role.allowed_to?(:manage_public_queries)) || User.current.admin?
@query.column_names = nil if params[:default_columns]
params[:fields].each do |field|
@@ -51,7 +46,8 @@ class QueriesController < ApplicationController
@query.add_filter(field, params[:operators][field], params[:values][field])
end if params[:fields]
@query.attributes = params[:query]
@query.is_public = false unless current_role.allowed_to?(:manage_public_queries)
@query.project = nil if params[:query_is_for_all]
@query.is_public = false unless (@query.project && current_role.allowed_to?(:manage_public_queries)) || User.current.admin?
@query.column_names = nil if params[:default_columns]
if @query.save
@@ -63,18 +59,21 @@ class QueriesController < ApplicationController
def destroy
@query.destroy if request.post?
redirect_to :controller => 'queries', :project_id => @project
redirect_to :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1
end
private
def find_project
if params[:id]
@query = Query.find(params[:id])
@project = @query.project
render_403 unless @query.editable_by?(User.current)
else
@project = Project.find(params[:project_id])
end
def find_query
@query = Query.find(params[:id])
@project = @query.project
render_403 unless @query.editable_by?(User.current)
rescue ActiveRecord::RecordNotFound
render_404
end
def find_optional_project
@project = Project.find(params[:project_id]) if params[:project_id]
User.current.allowed_to?(:save_queries, @project, :global => true)
rescue ActiveRecord::RecordNotFound
render_404
end

View File

@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ReportsController < ApplicationController
layout 'base'
menu_item :issues
before_filter :find_project, :authorize
def issue_report
@@ -47,6 +47,12 @@ class ReportsController < ApplicationController
@data = issues_by_category
@report_title = l(:field_category)
render :template => "reports/issue_report_details"
when "assigned_to"
@field = "assigned_to_id"
@rows = @project.members.collect { |m| m.user }
@data = issues_by_assigned_to
@report_title = l(:field_assigned_to)
render :template => "reports/issue_report_details"
when "author"
@field = "author_id"
@rows = @project.members.collect { |m| m.user }
@@ -55,7 +61,7 @@ class ReportsController < ApplicationController
render :template => "reports/issue_report_details"
when "subproject"
@field = "project_id"
@rows = @project.active_children
@rows = @project.descendants.active
@data = issues_by_subproject
@report_title = l(:field_subproject)
render :template => "reports/issue_report_details"
@@ -64,12 +70,14 @@ class ReportsController < ApplicationController
@versions = @project.versions.sort
@priorities = Enumeration::get_values('IPRI')
@categories = @project.issue_categories
@assignees = @project.members.collect { |m| m.user }
@authors = @project.members.collect { |m| m.user }
@subprojects = @project.active_children
@subprojects = @project.descendants.active
issues_by_tracker
issues_by_version
issues_by_priority
issues_by_category
issues_by_assigned_to
issues_by_author
issues_by_subproject
@@ -180,7 +188,22 @@ private
and i.project_id=#{@project.id}
group by s.id, s.is_closed, c.id")
end
def issues_by_assigned_to
@issues_by_assigned_to ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
s.is_closed as closed,
a.id as assigned_to_id,
count(i.id) as total
from
#{Issue.table_name} i, #{IssueStatus.table_name} s, #{User.table_name} a
where
i.status_id=s.id
and i.assigned_to_id=a.id
and i.project_id=#{@project.id}
group by s.id, s.is_closed, a.id")
end
def issues_by_author
@issues_by_author ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
@@ -206,8 +229,8 @@ private
#{Issue.table_name} i, #{IssueStatus.table_name} s
where
i.status_id=s.id
and i.project_id IN (#{@project.active_children.collect{|p| p.id}.join(',')})
group by s.id, s.is_closed, i.project_id") if @project.active_children.any?
and i.project_id IN (#{@project.descendants.active.collect{|p| p.id}.join(',')})
group by s.id, s.is_closed, i.project_id") if @project.descendants.active.any?
@issues_by_subproject ||= []
end
end

View File

@@ -19,29 +19,46 @@ require 'SVG/Graph/Bar'
require 'SVG/Graph/BarHorizontal'
require 'digest/sha1'
class ChangesetNotFound < Exception
end
class ChangesetNotFound < Exception; end
class InvalidRevisionParam < Exception; end
class RepositoriesController < ApplicationController
layout 'base'
menu_item :repository
before_filter :find_repository, :except => :edit
before_filter :find_project, :only => :edit
before_filter :authorize
accept_key_auth :revisions
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
def edit
@repository = @project.repository
if !@repository
@repository = Repository.factory(params[:repository_scm])
@repository.project = @project
@repository.project = @project if @repository
end
if request.post?
if request.post? && @repository
@repository.attributes = params[:repository]
@repository.save
end
render(:update) {|page| page.replace_html "tab-content-repository", :partial => 'projects/settings/repository'}
end
def committers
@committers = @repository.committers
@users = @project.users
additional_user_ids = @committers.collect(&:last).collect(&:to_i) - @users.collect(&:id)
@users += User.find_all_by_id(additional_user_ids) unless additional_user_ids.empty?
@users.compact!
@users.sort!
if request.post? && params[:committers].is_a?(Hash)
# Build a hash with repository usernames as keys and corresponding user ids as values
@repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h}
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'committers', :id => @project
end
end
def destroy
@repository.destroy
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository'
@@ -50,11 +67,11 @@ class RepositoriesController < ApplicationController
def show
# check if new revisions have been committed in the repository
@repository.fetch_changesets if Setting.autofetch_changesets?
# get entries for the browse frame
@entries = @repository.entries('')
# root entries
@entries = @repository.entries('', @rev)
# latest changesets
@changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC")
show_error and return unless @entries || @changesets.any?
show_error_not_found unless @entries || @changesets.any?
end
def browse
@@ -62,24 +79,28 @@ class RepositoriesController < ApplicationController
if request.xhr?
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
else
show_error unless @entries
show_error_not_found and return unless @entries
@properties = @repository.properties(@path, @rev)
render :action => 'browse'
end
end
def changes
@entry = @repository.scm.entry(@path, @rev)
show_error and return unless @entry
@changesets = @repository.changesets_for_path(@path)
@entry = @repository.entry(@path, @rev)
show_error_not_found and return unless @entry
@changesets = @repository.changesets_for_path(@path, :limit => Setting.repository_log_display_limit.to_i)
@properties = @repository.properties(@path, @rev)
end
def revisions
@changeset_count = @repository.changesets.count
@changeset_pages = Paginator.new self, @changeset_count,
25,
per_page_option,
params['page']
@changesets = @repository.changesets.find(:all,
:limit => @changeset_pages.items_per_page,
:offset => @changeset_pages.current.offset)
:offset => @changeset_pages.current.offset,
:include => :user)
respond_to do |format|
format.html { render :layout => false if request.xhr? }
@@ -88,53 +109,67 @@ class RepositoriesController < ApplicationController
end
def entry
@content = @repository.scm.cat(@path, @rev)
show_error and return unless @content
if 'raw' == params[:format]
@entry = @repository.entry(@path, @rev)
show_error_not_found and return unless @entry
# If the entry is a dir, show the browser
browse and return if @entry.is_dir?
@content = @repository.cat(@path, @rev)
show_error_not_found and return unless @content
if 'raw' == params[:format] || @content.is_binary_data?
# Force the download if it's a binary file
send_data @content, :filename => @path.split('/').last
else
# Prevent empty lines when displaying a file with Windows style eol
@content.gsub!("\r\n", "\n")
end
end
end
def annotate
@entry = @repository.entry(@path, @rev)
show_error_not_found and return unless @entry
@annotate = @repository.scm.annotate(@path, @rev)
show_error and return if @annotate.nil? || @annotate.empty?
render_error l(:error_scm_annotate) and return if @annotate.nil? || @annotate.empty?
end
def revision
@changeset = @repository.changesets.find_by_revision(@rev)
raise ChangesetNotFound unless @changeset
@changes_count = @changeset.changes.size
@changes_pages = Paginator.new self, @changes_count, 150, params['page']
@changes = @changeset.changes.find(:all,
:limit => @changes_pages.items_per_page,
:offset => @changes_pages.current.offset)
respond_to do |format|
format.html
format.js {render :layout => false}
end
rescue ChangesetNotFound
show_error
show_error_not_found
end
def diff
@rev_to = params[:rev_to] ? params[:rev_to].to_i : (@rev - 1)
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
# Save diff type as user preference
if User.current.logged? && @diff_type != User.current.pref[:diff_type]
User.current.pref[:diff_type] = @diff_type
User.current.preference.save
end
@cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
unless read_fragment(@cache_key)
@diff = @repository.diff(@path, @rev, @rev_to, @diff_type)
show_error and return unless @diff
if params[:format] == 'diff'
@diff = @repository.diff(@path, @rev, @rev_to)
show_error_not_found and return unless @diff
filename = "changeset_r#{@rev}"
filename << "_r#{@rev_to}" if @rev_to
send_data @diff.join, :filename => "#{filename}.diff",
:type => 'text/x-patch',
:disposition => 'attachment'
else
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
# Save diff type as user preference
if User.current.logged? && @diff_type != User.current.pref[:diff_type]
User.current.pref[:diff_type] = @diff_type
User.current.preference.save
end
@cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
unless read_fragment(@cache_key)
@diff = @repository.diff(@path, @rev, @rev_to)
show_error_not_found unless @diff
end
end
end
@@ -164,20 +199,30 @@ private
render_404
end
REV_PARAM_RE = %r{^[a-f0-9]*$}
def find_repository
@project = Project.find(params[:id])
@repository = @project.repository
render_404 and return false unless @repository
@path = params[:path].join('/') unless params[:path].nil?
@path ||= ''
@rev = params[:rev].to_i if params[:rev]
@rev = params[:rev]
@rev_to = params[:rev_to]
raise InvalidRevisionParam unless @rev.to_s.match(REV_PARAM_RE) && @rev.to_s.match(REV_PARAM_RE)
rescue ActiveRecord::RecordNotFound
render_404
rescue InvalidRevisionParam
show_error_not_found
end
def show_error
flash.now[:error] = l(:notice_scm_error)
render :nothing => true, :layout => true
def show_error_not_found
render_error l(:error_scm_not_found)
end
# Handler for Redmine::Scm::Adapters::CommandFailed exception
def show_error_command_failed(exception)
render_error l(:error_scm_command_failed, exception.message)
end
def graph_commits_per_month(repository)
@@ -198,7 +243,7 @@ private
graph = SVG::Graph::Bar.new(
:height => 300,
:width => 500,
:width => 800,
:fields => fields.reverse,
:stack => :side,
:scale_integers => true,
@@ -236,9 +281,12 @@ private
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10
# Remove email adress in usernames
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
:height => 300,
:width => 500,
:height => 400,
:width => 800,
:fields => fields,
:stack => :side,
:scale_integers => true,

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class RolesController < ApplicationController
layout 'base'
before_filter :require_admin
verify :method => :post, :only => [ :destroy, :move ],
@@ -36,10 +35,15 @@ class RolesController < ApplicationController
# Prefills the form with 'Non member' role permissions
@role = Role.new(params[:role] || {:permissions => Role.non_member.permissions})
if request.post? && @role.save
# workflow copy
if !params[:copy_workflow_from].blank? && (copy_from = Role.find_by_id(params[:copy_workflow_from]))
@role.workflows.copy(copy_from)
end
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
end
@permissions = @role.setable_permissions
@roles = Role.find :all, :order => 'builtin, position'
end
def edit
@@ -53,12 +57,11 @@ class RolesController < ApplicationController
def destroy
@role = Role.find(params[:id])
#unless @role.members.empty?
# flash[:error] = 'Some members have this role. Can\'t delete it.'
#else
@role.destroy
#end
@role.destroy
redirect_to :action => 'list'
rescue
flash[:error] = 'This role is in use and can not be deleted.'
redirect_to :action => 'index'
end
def move
@@ -76,27 +79,6 @@ class RolesController < ApplicationController
redirect_to :action => 'list'
end
def workflow
@role = Role.find_by_id(params[:role_id])
@tracker = Tracker.find_by_id(params[:tracker_id])
if request.post?
Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
(params[:issue_status] || []).each { |old, news|
news.each { |new|
@role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
}
}
if @role.save
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'workflow', :role_id => @role, :tracker_id => @tracker
end
end
@roles = Role.find(:all, :order => 'builtin, position')
@trackers = Tracker.find(:all, :order => 'position')
@statuses = IssueStatus.find(:all, :order => 'position')
end
def report
@roles = Role.find(:all, :order => 'builtin, position')
@permissions = Redmine::AccessControl.permissions.select { |p| !p.public? }

View File

@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class SearchController < ApplicationController
layout 'base'
before_filter :find_optional_project
helper :messages
include MessagesHelper
@@ -27,6 +27,18 @@ class SearchController < ApplicationController
@all_words = params[:all_words] || (params[:submit] ? false : true)
@titles_only = !params[:titles_only].nil?
projects_to_search =
case params[:scope]
when 'all'
nil
when 'my_projects'
User.current.memberships.collect(&:project)
when 'subprojects'
@project ? (@project.self_and_descendants.active) : nil
else
@project
end
offset = nil
begin; offset = params[:offset].to_time if params[:offset]; rescue; end
@@ -36,21 +48,16 @@ class SearchController < ApplicationController
return
end
if params[:id]
find_project
return unless check_project_privacy
end
if @project
@object_types = %w(issues news documents changesets wiki_pages messages projects)
if projects_to_search.is_a? Project
# don't search projects
@object_types.delete('projects')
# only show what the user is allowed to view
@object_types = %w(issues news documents changesets wiki_pages messages)
@object_types = @object_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
@scope = @object_types.select {|t| params[t]}
@scope = @object_types if @scope.empty?
else
@object_types = @scope = %w(projects)
@object_types = @object_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, projects_to_search)}
end
@scope = @object_types.select {|t| params[t]}
@scope = @object_types if @scope.empty?
# extract tokens from the question
# eg. hello "bye bye" => ["hello", "bye bye"]
@@ -63,39 +70,34 @@ class SearchController < ApplicationController
@tokens.slice! 5..-1 if @tokens.size > 5
# strings used in sql like statement
like_tokens = @tokens.collect {|w| "%#{w.downcase}%"}
@results = []
@results_by_type = Hash.new {|h,k| h[k] = 0}
limit = 10
if @project
@scope.each do |s|
@results += s.singularize.camelcase.constantize.search(like_tokens, @project,
:all_words => @all_words,
:titles_only => @titles_only,
:limit => (limit+1),
:offset => offset,
:before => params[:previous].nil?)
end
@results = @results.sort {|a,b| b.event_datetime <=> a.event_datetime}
if params[:previous].nil?
@pagination_previous_date = @results[0].event_datetime if offset && @results[0]
if @results.size > limit
@pagination_next_date = @results[limit-1].event_datetime
@results = @results[0, limit]
end
else
@pagination_next_date = @results[-1].event_datetime if offset && @results[-1]
if @results.size > limit
@pagination_previous_date = @results[-(limit)].event_datetime
@results = @results[-(limit), limit]
end
@scope.each do |s|
r, c = s.singularize.camelcase.constantize.search(like_tokens, projects_to_search,
:all_words => @all_words,
:titles_only => @titles_only,
:limit => (limit+1),
:offset => offset,
:before => params[:previous].nil?)
@results += r
@results_by_type[s] += c
end
@results = @results.sort {|a,b| b.event_datetime <=> a.event_datetime}
if params[:previous].nil?
@pagination_previous_date = @results[0].event_datetime if offset && @results[0]
if @results.size > limit
@pagination_next_date = @results[limit-1].event_datetime
@results = @results[0, limit]
end
else
operator = @all_words ? ' AND ' : ' OR '
@results += Project.find(:all,
:limit => limit,
:conditions => [ (["(#{Project.visible_by(User.current)}) AND (LOWER(name) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort]
) if @scope.include? 'projects'
# if only one project is found, user is redirected to its overview
redirect_to :controller => 'projects', :action => 'show', :id => @results.first and return if @results.size == 1
@pagination_next_date = @results[-1].event_datetime if offset && @results[-1]
if @results.size > limit
@pagination_previous_date = @results[-(limit)].event_datetime
@results = @results[-(limit), limit]
end
end
else
@question = ""
@@ -104,8 +106,10 @@ class SearchController < ApplicationController
end
private
def find_project
def find_optional_project
return true unless params[:id]
@project = Project.find(params[:id])
check_project_privacy
rescue ActiveRecord::RecordNotFound
render_404
end

View File

@@ -5,41 +5,55 @@
# 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.
class SettingsController < ApplicationController
layout 'base'
before_filter :require_admin
def index
edit
render :action => 'edit'
end
def edit
if request.post? and params[:settings] and params[:settings].is_a? Hash
params[:settings].each { |name, value| Setting[name] = value }
redirect_to :action => 'edit' and return
end
end
def plugin
plugin_id = params[:id].to_sym
@plugin = Redmine::Plugin.registered_plugins[plugin_id]
if request.post?
Setting["plugin_#{plugin_id}"] = params[:settings]
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
if request.post? && params[:settings] && params[:settings].is_a?(Hash)
settings = (params[:settings] || {}).dup.symbolize_keys
settings.each do |name, value|
# remove blank values in array settings
value.delete_if {|v| v.blank? } if value.is_a?(Array)
Setting[name] = value
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'plugin', :id => params[:id]
redirect_to :action => 'edit', :tab => params[:tab]
return
end
@partial = "../../vendor/plugins/#{plugin_id}/app/views/" + @plugin.settings[:partial]
@settings = Setting["plugin_#{plugin_id}"]
@options = {}
@options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
@deliveries = ActionMailer::Base.perform_deliveries
@guessed_host_and_path = request.host_with_port.dup
@guessed_host_and_path << ('/'+ Redmine::Utils.relative_url_root.gsub(%r{^\/}, '')) unless Redmine::Utils.relative_url_root.blank?
end
def plugin
@plugin = Redmine::Plugin.find(params[:id])
if request.post?
Setting["plugin_#{@plugin.id}"] = params[:settings]
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'plugin', :id => @plugin.id
end
@partial = @plugin.settings[:partial]
@settings = Setting["plugin_#{@plugin.id}"]
rescue Redmine::PluginNotFound
render_404
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2009 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,32 +16,35 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class SysController < ActionController::Base
wsdl_service_name 'Sys'
web_service_api SysApi
web_service_scaffold :invoke
before_filter :check_enabled
before_invocation :check_enabled
# Returns the projects list, with their repositories
def projects
Project.find(:all, :include => :repository)
p = Project.active.has_module(:repository).find(:all, :include => :repository, :order => 'identifier')
render :xml => p.to_xml(:include => :repository)
end
def create_project_repository
project = Project.find(params[:id])
if project.repository
render :nothing => true, :status => 409
else
logger.info "Repository for #{project.name} was reported to be created by #{request.remote_ip}."
project.repository = Repository.factory(params[:vendor], params[:repository])
if project.repository && project.repository.save
render :xml => project.repository, :status => 201
else
render :nothing => true, :status => 422
end
end
end
# Registers a repository for the given project identifier
# (Subversion specific)
def repository_created(identifier, url)
project = Project.find_by_identifier(identifier)
# Do not create the repository if the project has already one
return 0 unless project && project.repository.nil?
logger.debug "Repository for #{project.name} was created"
repository = Repository.factory('Subversion', :project => project, :url => url)
repository.save
repository.id || 0
end
protected
protected
def check_enabled(name, args)
Setting.sys_api_enabled?
def check_enabled
User.current = nil
unless Setting.sys_api_enabled?
render :nothing => 'Access denied. Repository management WS is disabled.', :status => 403
return false
end
end
end

View File

@@ -16,55 +16,80 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class TimelogController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
menu_item :issues
before_filter :find_project, :authorize, :only => [:edit, :destroy]
before_filter :find_optional_project, :only => [:report, :details]
verify :method => :post, :only => :destroy, :redirect_to => { :action => :details }
helper :sort
include SortHelper
helper :issues
include TimelogHelper
helper :custom_fields
include CustomFieldsHelper
def report
@available_criterias = { 'version' => {:sql => "#{Issue.table_name}.fixed_version_id",
:values => @project.versions,
@available_criterias = { 'project' => {:sql => "#{TimeEntry.table_name}.project_id",
:klass => Project,
:label => :label_project},
'version' => {:sql => "#{Issue.table_name}.fixed_version_id",
:klass => Version,
:label => :label_version},
'category' => {:sql => "#{Issue.table_name}.category_id",
:values => @project.issue_categories,
:klass => IssueCategory,
:label => :field_category},
'member' => {:sql => "#{TimeEntry.table_name}.user_id",
:values => @project.users,
:klass => User,
:label => :label_member},
'tracker' => {:sql => "#{Issue.table_name}.tracker_id",
:values => Tracker.find(:all),
:klass => Tracker,
:label => :label_tracker},
'activity' => {:sql => "#{TimeEntry.table_name}.activity_id",
:values => Enumeration::get_values('ACTI'),
:label => :label_activity}
:klass => Enumeration,
:label => :label_activity},
'issue' => {:sql => "#{TimeEntry.table_name}.issue_id",
:klass => Issue,
:label => :label_issue}
}
# Add list and boolean custom fields as available criterias
custom_fields = (@project.nil? ? IssueCustomField.for_all : @project.all_issue_custom_fields)
custom_fields.select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
@available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'Issue' AND c.customized_id = #{Issue.table_name}.id)",
:format => cf.field_format,
:label => cf.name}
end if @project
# Add list and boolean time entry custom fields
TimeEntryCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
@available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'TimeEntry' AND c.customized_id = #{TimeEntry.table_name}.id)",
:format => cf.field_format,
:label => cf.name}
end
@criterias = params[:criterias] || []
@criterias = @criterias.select{|criteria| @available_criterias.has_key? criteria}
@criterias.uniq!
@criterias = @criterias[0,3]
@columns = (params[:period] && %w(year month week).include?(params[:period])) ? params[:period] : 'month'
@columns = (params[:columns] && %w(year month week day).include?(params[:columns])) ? params[:columns] : 'month'
if params[:date_from]
begin; @date_from = params[:date_from].to_date; rescue; end
end
if params[:date_to]
begin; @date_to = params[:date_to].to_date; rescue; end
end
@date_from ||= Date.civil(Date.today.year, 1, 1)
@date_to ||= (Date.civil(Date.today.year, Date.today.month, 1) >> 1) - 1
retrieve_date_range
unless @criterias.empty?
sql_select = @criterias.collect{|criteria| @available_criterias[criteria][:sql] + " AS " + criteria}.join(', ')
sql_group_by = @criterias.collect{|criteria| @available_criterias[criteria][:sql]}.join(', ')
sql = "SELECT #{sql_select}, tyear, tmonth, tweek, SUM(hours) AS hours"
sql << " FROM #{TimeEntry.table_name} LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id"
sql << " WHERE #{TimeEntry.table_name}.project_id = %s" % @project.id
sql << " AND spent_on BETWEEN '%s' AND '%s'" % [ActiveRecord::Base.connection.quoted_date(@date_from.to_time), ActiveRecord::Base.connection.quoted_date(@date_to.to_time)]
sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek"
sql = "SELECT #{sql_select}, tyear, tmonth, tweek, spent_on, SUM(hours) AS hours"
sql << " FROM #{TimeEntry.table_name}"
sql << " LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id"
sql << " LEFT JOIN #{Project.table_name} ON #{TimeEntry.table_name}.project_id = #{Project.table_name}.id"
sql << " WHERE"
sql << " (%s) AND" % @project.project_condition(Setting.display_subprojects_issues?) if @project
sql << " (%s) AND" % Project.allowed_to_condition(User.current, :view_time_entries)
sql << " (spent_on BETWEEN '%s' AND '%s')" % [ActiveRecord::Base.connection.quoted_date(@from.to_time), ActiveRecord::Base.connection.quoted_date(@to.to_time)]
sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek, spent_on"
@hours = ActiveRecord::Base.connection.select_all(sql)
@@ -76,53 +101,117 @@ class TimelogController < ApplicationController
row['month'] = "#{row['tyear']}-#{row['tmonth']}"
when 'week'
row['week'] = "#{row['tyear']}-#{row['tweek']}"
when 'day'
row['day'] = "#{row['spent_on']}"
end
end
@total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f}
@periods = []
# Date#at_beginning_of_ not supported in Rails 1.2.x
date_from = @from.to_time
# 100 columns max
while date_from <= @to.to_time && @periods.length < 100
case @columns
when 'year'
@periods << "#{date_from.year}"
date_from = (date_from + 1.year).at_beginning_of_year
when 'month'
@periods << "#{date_from.year}-#{date_from.month}"
date_from = (date_from + 1.month).at_beginning_of_month
when 'week'
@periods << "#{date_from.year}-#{date_from.to_date.cweek}"
date_from = (date_from + 7.day).at_beginning_of_week
when 'day'
@periods << "#{date_from.to_date}"
date_from = date_from + 1.day
end
end
end
@periods = []
date_from = @date_from
# 100 columns max
while date_from < @date_to && @periods.length < 100
case @columns
when 'year'
@periods << "#{date_from.year}"
date_from = date_from >> 12
when 'month'
@periods << "#{date_from.year}-#{date_from.month}"
date_from = date_from >> 1
when 'week'
@periods << "#{date_from.year}-#{date_from.cweek}"
date_from = date_from + 7
end
end
render :layout => false if request.xhr?
respond_to do |format|
format.html { render :layout => !request.xhr? }
format.csv { send_data(report_to_csv(@criterias, @periods, @hours).read, :type => 'text/csv; header=present', :filename => 'timelog.csv') }
end
end
def details
sort_init 'spent_on', 'desc'
sort_update
sort_update 'spent_on' => 'spent_on',
'user' => 'user_id',
'activity' => 'activity_id',
'project' => "#{Project.table_name}.name",
'issue' => 'issue_id',
'hours' => 'hours'
@entries = (@issue ? @issue : @project).time_entries.find(:all, :include => [:activity, :user, {:issue => [:tracker, :assigned_to, :priority]}], :order => sort_clause)
cond = ARCondition.new
if @project.nil?
cond << Project.allowed_to_condition(User.current, :view_time_entries)
elsif @issue.nil?
cond << @project.project_condition(Setting.display_subprojects_issues?)
else
cond << ["#{TimeEntry.table_name}.issue_id = ?", @issue.id]
end
retrieve_date_range
cond << ['spent_on BETWEEN ? AND ?', @from, @to]
@total_hours = @entries.inject(0) { |sum,entry| sum + entry.hours }
@owner_id = User.current.id
send_csv and return if 'csv' == params[:export]
render :action => 'details', :layout => false if request.xhr?
TimeEntry.visible_by(User.current) do
respond_to do |format|
format.html {
# Paginate results
@entry_count = TimeEntry.count(:include => :project, :conditions => cond.conditions)
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
@entries = TimeEntry.find(:all,
:include => [:project, :activity, :user, {:issue => :tracker}],
:conditions => cond.conditions,
:order => sort_clause,
:limit => @entry_pages.items_per_page,
:offset => @entry_pages.current.offset)
@total_hours = TimeEntry.sum(:hours, :include => :project, :conditions => cond.conditions).to_f
render :layout => !request.xhr?
}
format.atom {
entries = TimeEntry.find(:all,
:include => [:project, :activity, :user, {:issue => :tracker}],
:conditions => cond.conditions,
:order => "#{TimeEntry.table_name}.created_on DESC",
:limit => Setting.feeds_limit.to_i)
render_feed(entries, :title => l(:label_spent_time))
}
format.csv {
# Export all entries
@entries = TimeEntry.find(:all,
:include => [:project, :activity, :user, {:issue => [:tracker, :assigned_to, :priority]}],
:conditions => cond.conditions,
:order => sort_clause)
send_data(entries_to_csv(@entries).read, :type => 'text/csv; header=present', :filename => 'timelog.csv')
}
end
end
end
def edit
render_404 and return if @time_entry && @time_entry.user != User.current
render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
@time_entry.attributes = params[:time_entry]
if request.post? and @time_entry.save
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'details', :project_id => @time_entry.project, :issue_id => @time_entry.issue
redirect_back_or_default :action => 'details', :project_id => @time_entry.project
return
end
@activities = Enumeration::get_values('ACTI')
end
def destroy
render_404 and return unless @time_entry
render_403 and return unless @time_entry.editable_by?(User.current)
@time_entry.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to :back
rescue ::ActionController::RedirectBackError
redirect_to :action => 'details', :project_id => @time_entry.project
end
private
@@ -139,34 +228,63 @@ private
render_404
return false
end
rescue ActiveRecord::RecordNotFound
render_404
end
def send_csv
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
export = StringIO.new
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
# csv header fields
headers = [l(:field_spent_on),
l(:field_user),
l(:field_activity),
l(:field_issue),
l(:field_hours),
l(:field_comments)
]
csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
# csv lines
@entries.each do |entry|
fields = [l_date(entry.spent_on),
entry.user.name,
entry.activity.name,
(entry.issue ? entry.issue.id : nil),
entry.hours,
entry.comments
]
csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
def find_optional_project
if !params[:issue_id].blank?
@issue = Issue.find(params[:issue_id])
@project = @issue.project
elsif !params[:project_id].blank?
@project = Project.find(params[:project_id])
end
export.rewind
send_data(export.read, :type => 'text/csv; header=present', :filename => 'export.csv')
deny_access unless User.current.allowed_to?(:view_time_entries, @project, :global => true)
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 '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
end
@from, @to = @to, @from if @from && @to && @from > @to
@from ||= (TimeEntry.minimum(:spent_on, :include => :project, :conditions => Project.allowed_to_condition(User.current, :view_time_entries)) || Date.today) - 1
@to ||= (TimeEntry.maximum(:spent_on, :include => :project, :conditions => Project.allowed_to_condition(User.current, :view_time_entries)) || Date.today)
end
end

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class TrackersController < ApplicationController
layout 'base'
before_filter :require_admin
def index
@@ -37,16 +36,14 @@ class TrackersController < ApplicationController
if request.post? and @tracker.save
# workflow copy
if !params[:copy_workflow_from].blank? && (copy_from = Tracker.find_by_id(params[:copy_workflow_from]))
Workflow.transaction do
copy_from.workflows.find(:all, :include => [:role, :old_status, :new_status]).each do |w|
Workflow.create(:tracker_id => @tracker.id, :role => w.role, :old_status => w.old_status, :new_status => w.new_status)
end
end
@tracker.workflows.copy(copy_from)
end
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
return
end
@trackers = Tracker.find :all
@trackers = Tracker.find :all, :order => 'position'
@projects = Project.find(:all)
end
def edit
@@ -54,7 +51,9 @@ class TrackersController < ApplicationController
if request.post? and @tracker.update_attributes(params[:tracker])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
return
end
@projects = Project.find(:all)
end
def move

View File

@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class UsersController < ApplicationController
layout 'base'
before_filter :require_admin
helper :sort
@@ -31,18 +30,22 @@ class UsersController < ApplicationController
def list
sort_init 'login', 'asc'
sort_update
sort_update %w(login firstname lastname mail admin created_on last_login_on)
@status = params[:status] ? params[:status].to_i : 1
conditions = nil
conditions = ["status=?", @status] unless @status == 0
@status = params[:status] ? params[:status].to_i : 1
c = ARCondition.new(@status == 0 ? "status <> 0" : ["status = ?", @status])
unless params[:name].blank?
name = "%#{params[:name].strip.downcase}%"
c << ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ?", name, name, name]
end
@user_count = User.count(:conditions => conditions)
@user_count = User.count(:conditions => c.conditions)
@user_pages = Paginator.new self, @user_count,
15,
per_page_option,
params['page']
@users = User.find :all,:order => sort_clause,
:conditions => conditions,
:conditions => c.conditions,
:limit => @user_pages.items_per_page,
:offset => @user_pages.current.offset
@@ -52,14 +55,11 @@ class UsersController < ApplicationController
def add
if request.get?
@user = User.new(:language => Setting.default_language)
@custom_values = UserCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
else
@user = User.new(params[:user])
@user.admin = params[:user][:admin] || false
@user.login = params[:user][:login]
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless @user.auth_source_id
@custom_values = UserCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => (params[:custom_fields] ? params["custom_fields"][x.id.to_s] : nil)) }
@user.custom_values = @custom_values
if @user.save
Mailer.deliver_account_information(@user, params[:password]) if params[:send_information]
flash[:notice] = l(:notice_successful_create)
@@ -71,42 +71,34 @@ class UsersController < ApplicationController
def edit
@user = User.find(params[:id])
if request.get?
@custom_values = UserCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| @user.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
else
if request.post?
@user.admin = params[:user][:admin] if params[:user][:admin]
@user.login = params[:user][:login] if params[:user][:login]
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless params[:password].nil? or params[:password].empty? or @user.auth_source_id
if params[:custom_fields]
@custom_values = UserCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
@user.custom_values = @custom_values
end
if @user.update_attributes(params[:user])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
# Give a string to redirect_to otherwise it would use status param as the response code
redirect_to(url_for(:action => 'list', :status => params[:status], :page => params[:page]))
end
end
@auth_sources = AuthSource.find(:all)
@roles = Role.find_all_givable
@projects = Project.find(:all, :order => 'name', :conditions => "status=#{Project::STATUS_ACTIVE}") - @user.projects
@projects = Project.active.find(:all, :order => 'lft')
@membership ||= Member.new
@memberships = @user.memberships
end
def edit_membership
@user = User.find(params[:id])
@membership = params[:membership_id] ? Member.find(params[:membership_id]) : Member.new(:user => @user)
@membership.attributes = params[:membership]
if request.post? and @membership.save
flash[:notice] = l(:notice_successful_update)
end
redirect_to :action => 'edit', :id => @user and return
@membership.save if request.post?
redirect_to :action => 'edit', :id => @user, :tab => 'memberships'
end
def destroy_membership
@user = User.find(params[:id])
if request.post? and Member.find(params[:membership_id]).destroy
flash[:notice] = l(:notice_successful_update)
end
redirect_to :action => 'edit', :id => @user and return
Member.find(params[:membership_id]).destroy if request.post?
redirect_to :action => 'edit', :id => @user, :tab => 'memberships'
end
end

View File

@@ -16,11 +16,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class VersionsController < ApplicationController
layout 'base'
menu_item :roadmap
before_filter :find_project, :authorize
cache_sweeper :version_sweeper, :only => [ :edit, :destroy ]
def show
end
@@ -35,23 +33,9 @@ class VersionsController < ApplicationController
@version.destroy
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
rescue
flash[:error] = "Unable to delete version"
flash[:error] = l(:notice_unable_delete_version)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
end
def download
@attachment = @version.attachments.find(params[:attachment_id])
@attachment.increment_download
send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type
rescue
render_404
end
def destroy_file
@version.attachments.find(params[:attachment_id]).destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
end
def status_by
respond_to do |format|

View File

@@ -16,27 +16,38 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WatchersController < ApplicationController
layout 'base'
before_filter :require_login, :find_project, :check_project_privacy
before_filter :find_project
before_filter :require_login, :check_project_privacy, :only => [:watch, :unwatch]
before_filter :authorize, :only => :new
def add
user = User.current
@watched.add_watcher(user)
respond_to do |format|
format.html { render :text => 'Watcher added.', :layout => true }
format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user)} }
end
verify :method => :post,
:only => [ :watch, :unwatch ],
:render => { :nothing => true, :status => :method_not_allowed }
def watch
set_watcher(User.current, true)
end
def remove
user = User.current
@watched.remove_watcher(user)
respond_to do |format|
format.html { render :text => 'Watcher removed.', :layout => true }
format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user)} }
end
def unwatch
set_watcher(User.current, false)
end
def new
@watcher = Watcher.new(params[:watcher])
@watcher.watchable = @watched
@watcher.save if request.post?
respond_to do |format|
format.html { redirect_to :back }
format.js do
render :update do |page|
page.replace_html 'watchers', :partial => 'watchers/watchers', :locals => {:watched => @watched}
end
end
end
rescue ::ActionController::RedirectBackError
render :text => 'Watcher added.', :layout => true
end
private
def find_project
klass = Object.const_get(params[:object_type].camelcase)
@@ -46,4 +57,14 @@ private
rescue
render_404
end
def set_watcher(user, watching)
@watched.set_watcher(user, watching)
respond_to do |format|
format.html { redirect_to :back }
format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user)} }
end
rescue ::ActionController::RedirectBackError
render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true
end
end

View File

@@ -16,10 +16,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WelcomeController < ApplicationController
layout 'base'
caches_action :robots
def index
@news = News.latest User.current
@projects = Project.latest User.current
end
def robots
@projects = Project.public.active
render :layout => false, :content_type => 'text/plain'
end
end

View File

@@ -18,10 +18,10 @@
require 'diff'
class WikiController < ApplicationController
layout 'base'
before_filter :find_wiki, :authorize
before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy]
verify :method => :post, :only => [:destroy, :destroy_attachment], :redirect_to => { :action => :index }
verify :method => :post, :only => [:destroy, :protect], :redirect_to => { :action => :index }
helper :attachments
include AttachmentsHelper
@@ -39,28 +39,38 @@ class WikiController < ApplicationController
end
return
end
if params[:version] && !User.current.allowed_to?(:view_wiki_edits, @project)
# Redirects user to the current version if he's not allowed to view previous versions
redirect_to :version => nil
return
end
@content = @page.content_for_version(params[:version])
if params[:export] == 'html'
if params[:format] == 'html'
export = render_to_string :action => 'export', :layout => false
send_data(export, :type => 'text/html', :filename => "#{@page.title}.html")
return
elsif params[:export] == 'txt'
elsif params[:format] == 'txt'
send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt")
return
end
@editable = editable?
render :action => 'show'
end
# edit an existing page or a new one
def edit
@page = @wiki.find_or_new_page(params[:page])
return render_403 unless editable?
@page.content = WikiContent.new(:page => @page) if @page.new_record?
@content = @page.content_for_version(params[:version])
@content.text = "h1. #{@page.pretty_title}" if @content.text.blank?
@content.text = initial_page_content(@page) if @content.text.blank?
# don't keep previous comment
@content.comments = nil
if request.post?
if request.get?
# To prevent StaleObjectError exception when reverting to a previous version
@content.version = @page.content.version
else
if !@page.new_record? && @content.text == params[:content][:text]
# don't save if text wasn't changed
redirect_to :action => 'index', :id => @project, :page => @page.title
@@ -82,7 +92,7 @@ class WikiController < ApplicationController
# rename a page
def rename
@page = @wiki.find_page(params[:page])
return render_403 unless editable?
@page.redirect_existing_links = true
# used to display the *original* title if some AR validation errors occur
@original_title = @page.pretty_title
@@ -92,12 +102,15 @@ class WikiController < ApplicationController
end
end
def protect
@page.update_attribute :protected, params[:protected]
redirect_to :action => 'index', :id => @project, :page => @page.title
end
# show page history
def history
@page = @wiki.find_page(params[:page])
@version_count = @page.content.versions.count
@version_pages = Paginator.new self, @version_count, 25, params['p']
@version_pages = Paginator.new self, @version_count, per_page_option, params['p']
# don't load text
@versions = @page.content.versions.find :all,
:select => "id, author_id, comments, updated_on, version",
@@ -109,15 +122,19 @@ class WikiController < ApplicationController
end
def diff
@page = @wiki.find_page(params[:page])
@diff = @page.diff(params[:version], params[:version_from])
render_404 unless @diff
end
def annotate
@annotate = @page.annotate(params[:version])
render_404 unless @annotate
end
# remove a wiki page and its history
def destroy
@page = @wiki.find_page(params[:page])
@page.destroy if @page
return render_403 unless editable?
@page.destroy
redirect_to :action => 'special', :id => @project, :page => 'Page_index'
end
@@ -132,6 +149,7 @@ class WikiController < ApplicationController
:joins => "LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id",
:order => 'title'
@pages_by_date = @pages.group_by {|p| p.updated_on.to_date}
@pages_by_parent_id = @pages.group_by(&:parent_id)
# export wiki to a single html file
when 'export'
@pages = @wiki.pages.find :all, :order => 'title'
@@ -147,23 +165,22 @@ class WikiController < ApplicationController
def preview
page = @wiki.find_page(params[:page])
@attachements = page.attachments if page
# page is nil when previewing a new page
return render_403 unless page.nil? || editable?(page)
if page
@attachements = page.attachments
@previewed = page.content
end
@text = params[:content][:text]
render :partial => 'common/preview'
end
def add_attachment
@page = @wiki.find_page(params[:page])
return render_403 unless editable?
attach_files(@page, params[:attachments])
redirect_to :action => 'index', :page => @page.title
end
def destroy_attachment
@page = @wiki.find_page(params[:page])
@page.attachments.find(params[:attachment_id]).destroy
redirect_to :action => 'index', :page => @page.title
end
private
def find_wiki
@@ -173,4 +190,22 @@ private
rescue ActiveRecord::RecordNotFound
render_404
end
# Finds the requested page and returns a 404 error if it doesn't exist
def find_existing_page
@page = @wiki.find_page(params[:page])
render_404 if @page.nil?
end
# Returns true if the current user is allowed to edit the page, otherwise false
def editable?(page = @page)
page.editable_by?(User.current)
end
# Returns the default content of a new wiki page
def initial_page_content(page)
helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)
extend helper unless self.instance_of?(helper)
helper.instance_method(:initial_page_content).bind(self).call(page)
end
end

View File

@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikisController < ApplicationController
layout 'base'
menu_item :settings
before_filter :find_project, :authorize
# Create or update a project's wiki

View File

@@ -0,0 +1,45 @@
# Redmine - project management software
# Copyright (C) 2006-2008 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.
class WorkflowsController < ApplicationController
before_filter :require_admin
def index
@workflow_counts = Workflow.count_by_tracker_and_role
end
def edit
@role = Role.find_by_id(params[:role_id])
@tracker = Tracker.find_by_id(params[:tracker_id])
if request.post?
Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
(params[:issue_status] || []).each { |old, news|
news.each { |new|
@role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
}
}
if @role.save
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'edit', :role_id => @role, :tracker_id => @tracker
end
end
@roles = Role.find(:all, :order => 'builtin, position')
@trackers = Tracker.find(:all, :order => 'position')
@statuses = IssueStatus.find(:all, :order => 'position')
end
end

View File

@@ -17,7 +17,15 @@
module AdminHelper
def project_status_options_for_select(selected)
options_for_select([[l(:label_all), "*"],
options_for_select([[l(:label_all), ''],
[l(:status_active), 1]], selected)
end
def css_project_classes(project)
s = 'project'
s << ' root' if project.root?
s << ' child' if project.child?
s << (project.leaf? ? ' leaf' : ' parent')
s
end
end

View File

@@ -5,23 +5,32 @@
# 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.
require 'coderay'
require 'coderay/helpers/file_type'
require 'forwardable'
require 'cgi'
module ApplicationHelper
include Redmine::WikiFormatting::Macros::Definitions
include GravatarHelper::PublicMethods
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
def current_role
@current_role ||= User.current.role_for_project(@project)
end
# Return true if user is authorized for controller/action, otherwise false
def authorize_for(controller, action)
User.current.allowed_to?({:controller => controller, :action => action}, @project)
@@ -32,117 +41,293 @@ module ApplicationHelper
link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action])
end
# Display a link to remote if user is authorized
def link_to_remote_if_authorized(name, options = {}, html_options = nil)
url = options[:url] || {}
link_to_remote(name, options, html_options) if authorize_for(url[:controller] || params[:controller], url[:action])
end
# Display a link to user's account page
def link_to_user(user)
user ? link_to(user, :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
def link_to_user(user, options={})
(user && !user.anonymous?) ? link_to(user.name(options[:format]), :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
end
def link_to_issue(issue)
link_to "#{issue.tracker.name} ##{issue.id}", :controller => "issues", :action => "show", :id => issue
def link_to_issue(issue, options={})
options[:class] ||= ''
options[:class] << ' issue'
options[:class] << ' closed' if issue.closed?
link_to "#{issue.tracker.name} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, options
end
# Generates a link to an attachment.
# Options:
# * :text - Link text (default to attachment filename)
# * :download - Force download (default: false)
def link_to_attachment(attachment, options={})
text = options.delete(:text) || attachment.filename
action = options.delete(:download) ? 'download' : 'show'
link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options)
end
def toggle_link(name, id, options={})
onclick = "Element.toggle('#{id}'); "
onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
onclick << "return false;"
link_to(name, "#", :onclick => onclick)
end
def show_and_goto_link(name, id, options={})
onclick = "Element.show('#{id}'); "
onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
onclick << "location.href='##{id}-anchor'; "
onclick << "return false;"
link_to(name, "#", options.merge(:onclick => onclick))
end
def image_to_function(name, function, html_options = {})
html_options.symbolize_keys!
tag(:input, html_options.merge({
:type => "image", :src => image_path(name),
:onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
tag(:input, html_options.merge({
:type => "image", :src => image_path(name),
:onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
}))
end
def prompt_to_remote(name, text, param, url, html_options = {})
html_options[:onclick] = "promptToRemote('#{text}', '#{param}', '#{url_for(url)}'); return false;"
link_to name, {}, html_options
end
def format_date(date)
return nil unless date
# "Setting.date_format.size < 2" is a temporary fix (content of date_format setting changed)
@date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
date.strftime(@date_format)
end
def format_time(time, include_date = true)
return nil unless time
time = time.to_time if time.is_a?(String)
zone = User.current.time_zone
if time.utc?
local = zone ? zone.adjust(time) : time.getlocal
else
local = zone ? zone.adjust(time.getutc) : time
end
local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time)
@date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
@time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format)
include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format)
end
def authoring(created, author)
time_tag = content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created))
l(:label_added_time_by, author || 'Anonymous', time_tag)
def format_activity_title(text)
h(truncate_single_line(text, 100))
end
def format_activity_day(date)
date == Date.today ? l(:label_today).titleize : format_date(date)
end
def format_activity_description(text)
h(truncate(text.to_s, 120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...')).gsub(/[\r\n]+/, "<br />")
end
def distance_of_date_in_words(from_date, to_date = 0)
from_date = from_date.to_date if from_date.respond_to?(:to_date)
to_date = to_date.to_date if to_date.respond_to?(:to_date)
distance_in_days = (to_date - from_date).abs
lwr(:actionview_datehelper_time_in_words_day, distance_in_days)
end
def due_date_distance_in_words(date)
if date
l((date < Date.today ? :label_roadmap_overdue : :label_roadmap_due_in), distance_of_date_in_words(Date.today, date))
end
end
def render_page_hierarchy(pages, node=nil)
content = ''
if pages[node]
content << "<ul class=\"pages-hierarchy\">\n"
pages[node].each do |page|
content << "<li>"
content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'index', :id => page.project, :page => page.title},
:title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
content << "</li>\n"
end
content << "</ul>\n"
end
content
end
# Renders flash messages
def render_flash_messages
s = ''
flash.each do |k,v|
s << content_tag('div', v, :class => "flash #{k}")
end
s
end
# Renders the project quick-jump box
def render_project_jump_box
# Retrieve them now to avoid a COUNT query
projects = User.current.projects.all
if projects.any?
s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
"<option selected='selected'>#{ l(:label_jump_to_a_project) }</option>" +
'<option disabled="disabled">---</option>'
s << project_tree_options_for_select(projects) do |p|
{ :value => url_for(:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item) }
end
s << '</select>'
s
end
end
def project_tree_options_for_select(projects, options = {})
s = ''
project_tree(projects) do |project, level|
name_prefix = (level > 0 ? ('&nbsp;' * 2 * level + '&#187; ') : '')
tag_options = {:value => project.id, :selected => ((project == options[:selected]) ? 'selected' : nil)}
tag_options.merge!(yield(project)) if block_given?
s << content_tag('option', name_prefix + h(project), tag_options)
end
s
end
# Yields the given block for each project with its level in the tree
def project_tree(projects, &block)
ancestors = []
projects.sort_by(&:lft).each do |project|
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
end
yield project, ancestors.size
ancestors << project
end
end
def project_nested_ul(projects, &block)
s = ''
if projects.any?
ancestors = []
projects.sort_by(&:lft).each do |project|
if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
s << "<ul>\n"
else
ancestors.pop
s << "</li>"
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
s << "</ul></li>\n"
end
end
s << "<li>"
s << yield(project).to_s
ancestors << project
end
s << ("</li></ul>\n" * ancestors.size)
end
s
end
# Truncates and returns the string as a single line
def truncate_single_line(string, *args)
truncate(string, *args).gsub(%r{[\r\n]+}m, ' ')
end
def html_hours(text)
text.gsub(%r{(\d+)\.(\d+)}, '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>')
end
def authoring(created, author, options={})
time_tag = @project.nil? ? content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created)) :
link_to(distance_of_time_in_words(Time.now, created),
{:controller => 'projects', :action => 'activity', :id => @project, :from => created.to_date},
:title => format_time(created))
author_tag = (author.is_a?(User) && !author.anonymous?) ? link_to(h(author), :controller => 'account', :action => 'show', :id => author) : h(author || 'Anonymous')
l(options[:label] || :label_added_time_by, author_tag, time_tag)
end
def l_or_humanize(s, options={})
k = "#{options[:prefix]}#{s}".to_sym
l_has_string?(k) ? l(k) : s.to_s.humanize
end
def day_name(day)
l(:general_day_names).split(',')[day-1]
end
def month_name(month)
l(:actionview_datehelper_select_month_names).split(',')[month-1]
end
def pagination_links_full(paginator, options={}, html_options={})
def syntax_highlight(name, content)
type = CodeRay::FileType[name]
type ? CodeRay.scan(content, type).html : h(content)
end
def to_path_param(path)
path.to_s.split(%r{[/\\]}).select {|p| !p.blank?}
end
def pagination_links_full(paginator, count=nil, options={})
page_param = options.delete(:page_param) || :page
html = ''
html << link_to_remote(('&#171; ' + l(:label_previous)),
{:update => "content", :url => options.merge(page_param => paginator.current.previous)},
{:href => url_for(:params => options.merge(page_param => paginator.current.previous))}) + ' ' if paginator.current.previous
url_param = params.dup
# don't reuse query params if filters are present
url_param.merge!(:fields => nil, :values => nil, :operators => nil) if url_param.delete(:set_filter)
html = ''
if paginator.current.previous
html << link_to_remote_content_update('&#171; ' + l(:label_previous), url_param.merge(page_param => paginator.current.previous)) + ' '
end
html << (pagination_links_each(paginator, options) do |n|
link_to_remote(n.to_s,
{:url => {:params => options.merge(page_param => n)}, :update => 'content'},
{:href => url_for(:params => options.merge(page_param => n))})
link_to_remote_content_update(n.to_s, url_param.merge(page_param => n))
end || '')
html << ' ' + link_to_remote((l(:label_next) + ' &#187;'),
{:update => "content", :url => options.merge(page_param => paginator.current.next)},
{:href => url_for(:params => options.merge(page_param => paginator.current.next))}) if paginator.current.next
html
if paginator.current.next
html << ' ' + link_to_remote_content_update((l(:label_next) + ' &#187;'), url_param.merge(page_param => paginator.current.next))
end
unless count.nil?
html << [
" (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})",
per_page_links(paginator.items_per_page)
].compact.join(' | ')
end
html
end
def set_html_title(text)
@html_header_title = text
def per_page_links(selected=nil)
url_param = params.dup
url_param.clear if url_param.has_key?(:set_filter)
links = Setting.per_page_options_array.collect do |n|
n == selected ? n : link_to_remote(n, {:update => "content",
:url => params.dup.merge(:per_page => n),
:method => :get},
{:href => url_for(url_param.merge(:per_page => n))})
end
links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
end
def breadcrumb(*args)
elements = args.flatten
elements.any? ? content_tag('p', args.join(' &#187; ') + ' &#187; ', :class => 'breadcrumb') : nil
end
def html_title
title = []
title << @project.name if @project
title << @html_header_title
title << Setting.app_title
title.compact.join(' - ')
def other_formats_links(&block)
concat('<p class="other-formats">' + l(:label_export_to), block.binding)
yield Redmine::Views::OtherFormatsBuilder.new(self)
concat('</p>', block.binding)
end
def html_title(*args)
if args.empty?
title = []
title << @project.name if @project
title += @html_title if @html_title
title << Setting.app_title
title.compact.join(' - ')
else
@html_title ||= []
@html_title += args
end
end
ACCESSKEYS = {:edit => 'e',
:preview => 'r',
:quick_search => 'f',
:search => '4',
}.freeze unless const_defined?(:ACCESSKEYS)
def accesskey(s)
ACCESSKEYS[s]
Redmine::AccessKeys.key_for s
end
# Formats text according to system settings.
@@ -153,52 +338,57 @@ module ApplicationHelper
options = args.last.is_a?(Hash) ? args.pop : {}
case args.size
when 1
obj = nil
text = args.shift || ''
obj = options[:object]
text = args.shift
when 2
obj = args.shift
text = obj.send(args.shift)
text = obj.send(args.shift).to_s
else
raise ArgumentError, 'invalid arguments to textilizable'
end
return '' if text.blank?
only_path = options.delete(:only_path) == false ? false : true
# when using an image link, try to use an attachment, if possible
attachments = options[:attachments]
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
if attachments
text = text.gsub(/!([<>=]*)(\S+\.(gif|jpg|jpeg|png))!/) do |m|
align = $1
filename = $2
rf = Regexp.new(filename, Regexp::IGNORECASE)
attachments = attachments.sort_by(&:created_on).reverse
text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m|
style = $1
filename = $6.downcase
# search for the picture in attachments
if found = attachments.detect { |att| att.filename =~ rf }
image_url = url_for :controller => 'attachments', :action => 'download', :id => found.id
"!#{align}#{image_url}!"
if found = attachments.detect { |att| att.filename.downcase == filename }
image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1")
alt = desc.blank? ? nil : "(#{desc})"
"!#{style}#{image_url}#{alt}!"
else
"!#{align}#{filename}!"
m
end
end
end
text = (Setting.text_formatting == 'textile') ?
Redmine::WikiFormatting.to_html(text) { |macro, args| exec_macro(macro, obj, args) } :
simple_format(auto_link(h(text)))
text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text) { |macro, args| exec_macro(macro, obj, args) }
# different methods for formatting wiki links
case options[:wiki_links]
when :local
# used for local links to html files
format_wiki_link = Proc.new {|project, title| "#{title}.html" }
format_wiki_link = Proc.new {|project, title, anchor| "#{title}.html" }
when :anchor
# used for single-file wiki export
format_wiki_link = Proc.new {|project, title| "##{title}" }
format_wiki_link = Proc.new {|project, title, anchor| "##{title}" }
else
format_wiki_link = Proc.new {|project, title| url_for :controller => 'wiki', :action => 'index', :id => project, :page => title }
format_wiki_link = Proc.new {|project, title, anchor| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title, :anchor => anchor) }
end
project = options[:project] || @project
# turn wiki links into html links
# example:
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
# Wiki links
#
# Examples:
# [[mypage]]
# [[mypage|mytext]]
# wiki links can refer other project wikis, using project name or identifier:
@@ -206,52 +396,147 @@ module ApplicationHelper
# [[project:|mytext]]
# [[project:mypage]]
# [[project:mypage|mytext]]
text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) do |m|
text = text.gsub(/(!)?(\[\[([^\]\n\|]+)(\|([^\]\n\|]+))?\]\])/) do |m|
link_project = project
page = $1
title = $3
if page =~ /^([^\:]+)\:(.*)$/
link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
page = title || $2
title = $1 if page.blank?
end
if link_project && link_project.wiki
# check if page exists
wiki_page = link_project.wiki.find_page(page)
link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page)),
:class => ('wiki-page' + (wiki_page ? '' : ' new')))
esc, all, page, title = $1, $2, $3, $5
if esc.nil?
if page =~ /^([^\:]+)\:(.*)$/
link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
page = $2
title ||= $1 if page.blank?
end
if link_project && link_project.wiki
# extract anchor
anchor = nil
if page =~ /^(.+?)\#(.+)$/
page, anchor = $1, $2
end
# check if page exists
wiki_page = link_project.wiki.find_page(page)
link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page), anchor),
:class => ('wiki-page' + (wiki_page ? '' : ' new')))
else
# project or wiki doesn't exist
all
end
else
# project or wiki doesn't exist
title || page
all
end
end
# turn issue and revision ids into links
# example:
# #52 -> <a href="/issues/show/52">#52</a>
# r52 -> <a href="/repositories/revision/6?rev=52">r52</a> (project.id is 6)
text = text.gsub(%r{([\s\(,-^])(#|r)(\d+)(?=[[:punct:]]|\s|<|$)}) do |m|
leading, otype, oid = $1, $2, $3
# Redmine links
#
# Examples:
# Issues:
# #52 -> Link to issue #52
# Changesets:
# r52 -> Link to revision 52
# commit:a85130f -> Link to scmid starting with a85130f
# Documents:
# document#17 -> Link to document with id 17
# document:Greetings -> Link to the document with title "Greetings"
# document:"Some document" -> Link to the document with title "Some document"
# Versions:
# version#3 -> Link to version with id 3
# version:1.0.0 -> Link to version named "1.0.0"
# version:"1.0 beta 2" -> Link to version named "1.0 beta 2"
# Attachments:
# attachment:file.zip -> Link to the attachment of the current object named file.zip
# Source files:
# source:some/file -> Link to the file located at /some/file in the project's repository
# source:some/file@52 -> Link to the file's revision 52
# source:some/file#L120 -> Link to line 120 of the file
# source:some/file@52#L120 -> Link to line 120 of the file's revision 52
# export:some/file -> Force the download of the file
# Forum messages:
# message#1218 -> Link to message with id 1218
text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m|
leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
link = nil
if otype == 'r'
if project && (changeset = project.changesets.find_by_revision(oid))
link = link_to("r#{oid}", {:controller => 'repositories', :action => 'revision', :id => project.id, :rev => oid}, :class => 'changeset',
:title => truncate(changeset.comments, 100))
end
else
if issue = Issue.find_by_id(oid.to_i, :include => [:project, :status], :conditions => Project.visible_by(User.current))
link = link_to("##{oid}", {:controller => 'issues', :action => 'show', :id => oid}, :class => 'issue',
:title => "#{truncate(issue.subject, 100)} (#{issue.status.name})")
link = content_tag('del', link) if issue.closed?
if esc.nil?
if prefix.nil? && sep == 'r'
if project && (changeset = project.changesets.find_by_revision(oid))
link = link_to("r#{oid}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => oid},
:class => 'changeset',
:title => truncate_single_line(changeset.comments, 100))
end
elsif sep == '#'
oid = oid.to_i
case prefix
when nil
if issue = Issue.find_by_id(oid, :include => [:project, :status], :conditions => Project.visible_by(User.current))
link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid},
:class => (issue.closed? ? 'issue closed' : 'issue'),
:title => "#{truncate(issue.subject, 100)} (#{issue.status.name})")
link = content_tag('del', link) if issue.closed?
end
when 'document'
if document = Document.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
:class => 'document'
end
when 'version'
if version = Version.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
:class => 'version'
end
when 'message'
if message = Message.find_by_id(oid, :include => [:parent, {:board => :project}], :conditions => Project.visible_by(User.current))
link = link_to h(truncate(message.subject, 60)), {:only_path => only_path,
:controller => 'messages',
:action => 'show',
:board_id => message.board,
:id => message.root,
:anchor => (message.parent ? "message-#{message.id}" : nil)},
:class => 'message'
end
end
elsif sep == ':'
# removes the double quotes if any
name = oid.gsub(%r{^"(.*)"$}, "\\1")
case prefix
when 'document'
if project && document = project.documents.find_by_title(name)
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
:class => 'document'
end
when 'version'
if project && version = project.versions.find_by_name(name)
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
:class => 'version'
end
when 'commit'
if project && (changeset = project.changesets.find(:first, :conditions => ["scmid LIKE ?", "#{name}%"]))
link = link_to h("#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
:class => 'changeset',
:title => truncate_single_line(changeset.comments, 100)
end
when 'source', 'export'
if project && project.repository
name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
path, rev, anchor = $1, $3, $5
link = link_to h("#{prefix}:#{name}"), {:controller => 'repositories', :action => 'entry', :id => project,
:path => to_path_param(path),
:rev => rev,
:anchor => anchor,
:format => (prefix == 'export' ? 'raw' : nil)},
:class => (prefix == 'export' ? 'source download' : 'source')
end
when 'attachment'
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'
end
end
end
end
leading + (link || "#{otype}#{oid}")
leading + (link || "#{prefix}#{sep}#{oid}")
end
text
end
# Same as Rails' simple_format helper without using paragraphs
def simple_format_without_paragraph(text)
text.to_s.
@@ -259,7 +544,7 @@ module ApplicationHelper
gsub(/\n\n+/, "<br /><br />"). # 2+ newline -> 2 br
gsub(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
end
def error_messages_for(object_name, options = {})
options = options.symbolize_keys
object = instance_variable_get("@#{object_name}")
@@ -277,14 +562,14 @@ module ApplicationHelper
end
# retrieve custom values error messages
if object.errors[:custom_values]
object.custom_values.each do |v|
object.custom_values.each do |v|
v.errors.each do |attr, msg|
next if msg.nil?
msg = msg.first if msg.is_a? Array
full_messages << "&#171; " + v.custom_field.name + " &#187; " + l(msg)
end
end
end
end
content_tag("div",
content_tag(
options[:header_tag] || "span", lwr(:gui_validation_error, full_messages.length) + ":"
@@ -296,29 +581,35 @@ module ApplicationHelper
""
end
end
def lang_options_for_select(blank=true)
(blank ? [["(auto)", ""]] : []) +
(blank ? [["(auto)", ""]] : []) +
GLoc.valid_languages.collect{|lang| [ ll(lang.to_s, :general_lang_name), lang.to_s]}.sort{|x,y| x.last <=> y.last }
end
def label_tag_for(name, option_tags = nil, options = {})
label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
content_tag("label", label_text)
end
def labelled_tabular_form_for(name, object, options, &proc)
options[:html] ||= {}
options[:html].store :class, "tabular"
options[:html][:class] = 'tabular' unless options[:html].has_key?(:class)
form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
end
def back_url_hidden_field_tag
back_url = params[:back_url] || request.env['HTTP_REFERER']
back_url = CGI.unescape(back_url.to_s)
hidden_field_tag('back_url', CGI.escape(back_url)) unless back_url.blank?
end
def check_all_links(form_name)
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
" | " +
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end
def progress_bar(pcts, options={})
pcts = [pcts, pcts] unless pcts.is_a?(Array)
pcts[1] = pcts[1] - pcts[0]
@@ -327,13 +618,13 @@ module ApplicationHelper
legend = options[:legend] || ''
content_tag('table',
content_tag('tr',
(pcts[0] > 0 ? content_tag('td', '', :width => "#{pcts[0].floor}%;", :class => 'closed') : '') +
(pcts[1] > 0 ? content_tag('td', '', :width => "#{pcts[1].floor}%;", :class => 'done') : '') +
(pcts[2] > 0 ? content_tag('td', '', :width => "#{pcts[2].floor}%;", :class => 'todo') : '')
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0].floor}%;", :class => 'closed') : '') +
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1].floor}%;", :class => 'done') : '') +
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2].floor}%;", :class => 'todo') : '')
), :class => 'progress', :style => "width: #{width};") +
content_tag('p', legend, :class => 'pourcent')
end
def context_menu_link(name, url, options={})
options[:class] ||= ''
if options.delete(:selected)
@@ -349,59 +640,62 @@ module ApplicationHelper
end
link_to name, url, options
end
def calendar_for(field_id)
include_calendar_headers_tags
image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
end
def wikitoolbar_for(field_id)
return '' unless Setting.text_formatting == 'textile'
javascript_include_tag('jstoolbar') + javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.draw();")
def include_calendar_headers_tags
unless @calendar_headers_tags_included
@calendar_headers_tags_included = true
content_for :header_tags do
javascript_include_tag('calendar/calendar') +
javascript_include_tag("calendar/lang/calendar-#{current_language}.js") +
javascript_include_tag('calendar/calendar-setup') +
stylesheet_link_tag('calendar')
end
end
end
def content_for(name, content = nil, &block)
@has_content ||= {}
@has_content[name] = true
super(name, content, &block)
end
def has_content?(name)
(@has_content && @has_content[name]) || false
end
end
class TabularFormBuilder < ActionView::Helpers::FormBuilder
include GLoc
def initialize(object_name, object, template, options, proc)
set_language_if_valid options.delete(:lang)
@object_name, @object, @template, @options, @proc = object_name, object, template, options, proc
end
(field_helpers - %w(radio_button hidden_field) + %w(date_select)).each do |selector|
src = <<-END_SRC
def #{selector}(field, options = {})
return super if options.delete :no_label
label_text = l(options[:label]) if options[:label]
label_text ||= l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym)
label_text << @template.content_tag("span", " *", :class => "required") if options.delete(:required)
label = @template.content_tag("label", label_text,
:class => (@object && @object.errors[field] ? "error" : nil),
:for => (@object_name.to_s + "_" + field.to_s))
label + super
# Returns the avatar image tag for the given +user+ if avatars are enabled
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
def avatar(user, options = { })
if Setting.gravatar_enabled?
email = nil
if user.respond_to?(:mail)
email = user.mail
elsif user.to_s =~ %r{<(.+?)>}
email = $1
end
return gravatar(email.to_s.downcase, options) unless email.blank? rescue nil
end
END_SRC
class_eval src, __FILE__, __LINE__
end
private
def wiki_helper
helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)
extend helper
return self
end
def select(field, choices, options = {}, html_options = {})
label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
label = @template.content_tag("label", label_text,
:class => (@object && @object.errors[field] ? "error" : nil),
:for => (@object_name.to_s + "_" + field.to_s))
label + super
def link_to_remote_content_update(text, url_params)
link_to_remote(text,
{:url => url_params, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'},
{:href => url_for(:params => url_params)}
)
end
end

View File

@@ -16,10 +16,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module AttachmentsHelper
# displays the links to a collection of attachments
def link_to_attachments(attachments, options = {})
if attachments.any?
render :partial => 'attachments/links', :locals => {:attachments => attachments, :options => options}
# Displays view/delete links to the attachments of the given object
# Options:
# :author -- author names are not displayed if set to false
def link_to_attachments(container, options = {})
options.assert_valid_keys(:author)
if container.attachments.any?
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
render :partial => 'attachments/links', :locals => {:attachments => container.attachments, :options => options}
end
end
def to_utf8(str)
str
end
end

View File

@@ -17,38 +17,49 @@
module CustomFieldsHelper
def custom_fields_tabs
tabs = [{:name => 'IssueCustomField', :label => :label_issue_plural},
{:name => 'TimeEntryCustomField', :label => :label_spent_time},
{:name => 'ProjectCustomField', :label => :label_project_plural},
{:name => 'UserCustomField', :label => :label_user_plural}
]
end
# Return custom field html tag corresponding to its format
def custom_field_tag(custom_value)
def custom_field_tag(name, custom_value)
custom_field = custom_value.custom_field
field_name = "custom_fields[#{custom_field.id}]"
field_id = "custom_fields_#{custom_field.id}"
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_id = "#{name}_custom_field_values_#{custom_field.id}"
case custom_field.field_format
when "date"
text_field('custom_value', 'value', :name => field_name, :id => field_id, :size => 10) +
text_field_tag(field_name, custom_value.value, :id => field_id, :size => 10) +
calendar_for(field_id)
when "text"
text_area 'custom_value', 'value', :name => field_name, :id => field_id, :cols => 60, :rows => 3
text_area_tag(field_name, custom_value.value, :id => field_id, :rows => 3, :style => 'width:90%')
when "bool"
check_box 'custom_value', 'value', :name => field_name, :id => field_id
check_box_tag(field_name, '1', custom_value.true?, :id => field_id) + hidden_field_tag(field_name, '0')
when "list"
select 'custom_value', 'value', custom_field.possible_values, { :include_blank => true }, :name => field_name, :id => field_id
blank_option = custom_field.is_required? ?
(custom_field.default_value.blank? ? "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" : '') :
'<option></option>'
select_tag(field_name, blank_option + options_for_select(custom_field.possible_values, custom_value.value), :id => field_id)
else
text_field 'custom_value', 'value', :name => field_name, :id => field_id
text_field_tag(field_name, custom_value.value, :id => field_id)
end
end
# Return custom field label tag
def custom_field_label_tag(custom_value)
def custom_field_label_tag(name, custom_value)
content_tag "label", custom_value.custom_field.name +
(custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),
:for => "custom_fields_#{custom_value.custom_field.id}",
:for => "#{name}_custom_field_values_#{custom_value.custom_field.id}",
:class => (custom_value.errors.empty? ? nil : "error" )
end
# Return custom field tag with its label tag
def custom_field_tag_with_label(custom_value)
custom_field_label_tag(custom_value) + custom_field_tag(custom_value)
def custom_field_tag_with_label(name, custom_value)
custom_field_label_tag(name, custom_value) + custom_field_tag(name, custom_value)
end
# Return a string used to display a custom value
@@ -62,7 +73,7 @@ module CustomFieldsHelper
return "" unless value && !value.empty?
case field_format
when "date"
begin; l_date(value.to_date); rescue; value end
begin; format_date(value.to_date); rescue; value end
when "bool"
l_YesNo(value == "1")
else

View File

@@ -1,80 +0,0 @@
# redMine - project management software
# Copyright (C) 2006 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.
require 'iconv'
require 'rfpdf/chinese'
module IfpdfHelper
class IFPDF < FPDF
include GLoc
attr_accessor :footer_date
def initialize(lang)
super()
set_language_if_valid lang
case current_language
when :ja
extend(PDF_Japanese)
AddSJISFont()
@font_for_content = 'SJIS'
@font_for_footer = 'SJIS'
when :zh
extend(PDF_Chinese)
AddBig5Font()
@font_for_content = 'Big5'
@font_for_footer = 'Big5'
else
@font_for_content = 'Arial'
@font_for_footer = 'Helvetica'
end
SetCreator("redMine #{Redmine::VERSION}")
SetFont(@font_for_content)
end
def SetFontStyle(style, size)
SetFont(@font_for_content, style, size)
end
def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
@ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
# these quotation marks are not correctly rendered in the pdf
txt = txt.gsub(/[“”]/, '"') if txt
txt = begin
# 0x5c char handling
txtar = txt.split('\\')
txtar << '' if txt[-1] == ?\\
txtar.collect {|x| @ic.iconv(x)}.join('\\').gsub(/\\/, "\\\\\\\\")
rescue
txt
end || ''
super w,h,txt,border,ln,align,fill,link
end
def Footer
SetFont(@font_for_footer, 'I', 8)
SetY(-15)
SetX(15)
Cell(0, 5, @footer_date, 0, 0, 'L')
SetY(-15)
SetX(-30)
Cell(0, 5, PageNo().to_s + '/{nb}', 0, 0, 'C')
end
end
end

View File

@@ -32,6 +32,27 @@ module IssuesHelper
"<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
"<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}"
end
# Returns a string of css classes that apply to the given issue
def css_issue_classes(issue)
s = "issue status-#{issue.status.position} priority-#{issue.priority.position}"
s << ' closed' if issue.closed?
s << ' overdue' if issue.overdue?
s
end
def sidebar_queries
unless @sidebar_queries
# User can see public queries and his own queries
visible = ARCondition.new(["is_public = ? OR user_id = ?", true, (User.current.logged? ? User.current.id : 0)])
# Project specific queries and global queries
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
@sidebar_queries = Query.find(:all,
:order => "name ASC",
:conditions => visible.conditions)
end
@sidebar_queries
end
def show_detail(detail, no_html=false)
case detail.property
@@ -41,9 +62,15 @@ module IssuesHelper
when 'due_date', 'start_date'
value = format_date(detail.value.to_date) if detail.value
old_value = format_date(detail.old_value.to_date) if detail.old_value
when 'project_id'
p = Project.find_by_id(detail.value) and value = p.name if detail.value
p = Project.find_by_id(detail.old_value) and old_value = p.name if detail.old_value
when 'status_id'
s = IssueStatus.find_by_id(detail.value) and value = s.name if detail.value
s = IssueStatus.find_by_id(detail.old_value) and old_value = s.name if detail.old_value
when 'tracker_id'
t = Tracker.find_by_id(detail.value) and value = t.name if detail.value
t = Tracker.find_by_id(detail.old_value) and old_value = t.name if detail.old_value
when 'assigned_to_id'
u = User.find_by_id(detail.value) and value = u.name if detail.value
u = User.find_by_id(detail.old_value) and old_value = u.name if detail.old_value
@@ -56,6 +83,9 @@ module IssuesHelper
when 'fixed_version_id'
v = Version.find_by_id(detail.value) and value = v.name if detail.value
v = Version.find_by_id(detail.old_value) and old_value = v.name if detail.old_value
when 'estimated_hours'
value = "%0.02f" % detail.value.to_f unless detail.value.blank?
old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
end
when 'cf'
custom_field = CustomField.find_by_id(detail.prop_key)
@@ -67,7 +97,8 @@ module IssuesHelper
when 'attachment'
label = l(:label_attachment)
end
call_hook(:helper_issues_show_detail_after_setting, {:detail => detail, :label => label, :value => value, :old_value => old_value })
label ||= detail.prop_key
value ||= detail.value
old_value ||= detail.old_value
@@ -76,9 +107,9 @@ module IssuesHelper
label = content_tag('strong', label)
old_value = content_tag("i", h(old_value)) if detail.old_value
old_value = content_tag("strike", old_value) if detail.old_value and (!detail.value or detail.value.empty?)
if detail.property == 'attachment' && !value.blank? && Attachment.find_by_id(detail.prop_key)
if detail.property == 'attachment' && !value.blank? && a = Attachment.find_by_id(detail.prop_key)
# Link to the attachment if it has not been removed
value = link_to(value, :controller => 'attachments', :action => 'download', :id => detail.prop_key)
value = link_to_attachment(a)
else
value = content_tag("i", h(value)) if value
end
@@ -107,6 +138,7 @@ module IssuesHelper
def issues_to_csv(issues, project = nil)
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
decimal_separator = l(:general_csv_decimal_separator)
export = StringIO.new
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
# csv header fields
@@ -123,13 +155,16 @@ module IssuesHelper
l(:field_start_date),
l(:field_due_date),
l(:field_done_ratio),
l(:field_estimated_hours),
l(:field_created_on),
l(:field_updated_on)
]
# Export project custom fields if project is given
# otherwise export custom fields marked as "For all projects"
custom_fields = project.nil? ? IssueCustomField.for_all : project.all_custom_fields
custom_fields = project.nil? ? IssueCustomField.for_all : project.all_issue_custom_fields
custom_fields.each {|f| headers << f.name}
# Description in the last column
headers << l(:field_description)
csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
# csv lines
issues.each do |issue|
@@ -146,10 +181,12 @@ module IssuesHelper
format_date(issue.start_date),
format_date(issue.due_date),
issue.done_ratio,
issue.estimated_hours.to_s.gsub('.', decimal_separator),
format_time(issue.created_on),
format_time(issue.updated_on)
]
custom_fields.each {|f| fields << show_value(issue.custom_value_for(f)) }
fields << issue.description
csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
end

View File

@@ -0,0 +1,40 @@
# redMine - project management software
# Copyright (C) 2006-2008 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 JournalsHelper
def render_notes(journal, options={})
content = ''
editable = journal.editable_by?(User.current)
links = []
if !journal.notes.blank?
links << link_to_remote(image_tag('comment.png'),
{ :url => {:controller => 'issues', :action => 'reply', :id => journal.journalized, :journal_id => journal} },
:title => l(:button_quote)) if options[:reply_links]
links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
{ :controller => 'journals', :action => 'edit', :id => journal },
:title => l(:button_edit)) if editable
end
content << content_tag('div', links.join(' '), :class => 'contextual') unless links.empty?
content << textilizable(journal, :notes)
content_tag('div', content, :id => "journal-#{journal.id}-notes", :class => (editable ? 'wiki editable' : 'wiki'))
end
def link_to_in_place_notes_editor(text, field_id, url, options={})
onclick = "new Ajax.Request('#{url_for(url)}', {asynchronous:true, evalScripts:true, method:'get'}); return false;"
link_to text, '#', options.merge(:onclick => onclick)
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Copyright (C) 2006-2008 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,11 +15,5 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class SysApi < ActionWebService::API::Base
api_method :projects,
:expects => [],
:returns => [[Project]]
api_method :repository_created,
:expects => [:string, :string],
:returns => [:int]
module MailHandlerHelper
end

View File

@@ -18,12 +18,7 @@
module ProjectsHelper
def link_to_version(version, options = {})
return '' unless version && version.is_a?(Version)
link_to version.name, {:controller => 'projects',
:action => 'roadmap',
:id => version.project_id,
:completed => (version.completed? ? 1 : nil),
:anchor => version.name
}, options
link_to h(version.name), { :controller => 'versions', :action => 'show', :id => version }, options
end
def project_settings_tabs
@@ -39,161 +34,38 @@ module ProjectsHelper
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
# Generates a gantt image
# Only defined if RMagick is avalaible
def gantt_image(events, date_from, months, zoom)
date_to = (date_from >> months)-1
show_weeks = zoom > 1
show_days = zoom > 2
subject_width = 320
header_heigth = 18
# width of one day in pixels
zoom = zoom*2
g_width = (date_to - date_from + 1)*zoom
g_height = 20 * events.length + 20
headers_heigth = (show_weeks ? 2*header_heigth : header_heigth)
height = g_height + headers_heigth
imgl = Magick::ImageList.new
imgl.new_image(subject_width+g_width+1, height)
gc = Magick::Draw.new
# Subjects
top = headers_heigth + 20
gc.fill('black')
gc.stroke('transparent')
gc.stroke_width(1)
events.each do |i|
gc.text(4, top + 2, (i.is_a?(Issue) ? i.subject : i.name))
top = top + 20
end
# Months headers
month_f = date_from
left = subject_width
months.times do
width = ((month_f >> 1) - month_f) * zoom
gc.fill('white')
gc.stroke('grey')
gc.stroke_width(1)
gc.rectangle(left, 0, left + width, height)
gc.fill('black')
gc.stroke('transparent')
gc.stroke_width(1)
gc.text(left.round + 8, 14, "#{month_f.year}-#{month_f.month}")
left = left + width
month_f = month_f >> 1
end
# Weeks headers
if show_weeks
left = subject_width
height = header_heigth
if date_from.cwday == 1
# date_from is monday
week_f = date_from
else
# find next monday after date_from
week_f = date_from + (7 - date_from.cwday + 1)
width = (7 - date_from.cwday + 1) * zoom
gc.fill('white')
gc.stroke('grey')
gc.stroke_width(1)
gc.rectangle(left, header_heigth, left + width, 2*header_heigth + g_height-1)
left = left + width
end
while week_f <= date_to
width = (week_f + 6 <= date_to) ? 7 * zoom : (date_to - week_f + 1) * zoom
gc.fill('white')
gc.stroke('grey')
gc.stroke_width(1)
gc.rectangle(left.round, header_heigth, left.round + width, 2*header_heigth + g_height-1)
gc.fill('black')
gc.stroke('transparent')
gc.stroke_width(1)
gc.text(left.round + 2, header_heigth + 14, week_f.cweek.to_s)
left = left + width
week_f = week_f+7
end
end
# Days details (week-end in grey)
if show_days
left = subject_width
height = g_height + header_heigth - 1
wday = date_from.cwday
(date_to - date_from + 1).to_i.times do
width = zoom
gc.fill(wday == 6 || wday == 7 ? '#eee' : 'white')
gc.stroke('grey')
gc.stroke_width(1)
gc.rectangle(left, 2*header_heigth, left + width, 2*header_heigth + g_height-1)
left = left + width
wday = wday + 1
wday = 1 if wday > 7
end
end
# border
gc.fill('transparent')
gc.stroke('grey')
gc.stroke_width(1)
gc.rectangle(0, 0, subject_width+g_width, headers_heigth)
gc.stroke('black')
gc.rectangle(0, 0, subject_width+g_width, g_height+ headers_heigth-1)
# content
top = headers_heigth + 20
gc.stroke('transparent')
events.each do |i|
if i.is_a?(Issue)
i_start_date = (i.start_date >= date_from ? i.start_date : date_from )
i_end_date = (i.due_date <= date_to ? i.due_date : date_to )
i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor
i_done_date = (i_done_date <= date_from ? date_from : i_done_date )
i_done_date = (i_done_date >= date_to ? date_to : i_done_date )
i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
i_left = subject_width + ((i_start_date - date_from)*zoom).floor
i_width = ((i_end_date - i_start_date + 1)*zoom).floor # total width of the issue
d_width = ((i_done_date - i_start_date)*zoom).floor # done width
l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor : 0 # delay width
def parent_project_select_tag(project)
options = '<option></option>' + project_tree_options_for_select(project.possible_parents, :selected => project.parent)
content_tag('select', options, :name => 'project[parent_id]')
end
gc.fill('grey')
gc.rectangle(i_left, top, i_left + i_width, top - 6)
gc.fill('red')
gc.rectangle(i_left, top, i_left + l_width, top - 6) if l_width > 0
gc.fill('blue')
gc.rectangle(i_left, top, i_left + d_width, top - 6) if d_width > 0
gc.fill('black')
gc.text(i_left + i_width + 5,top + 1, "#{i.status.name} #{i.done_ratio}%")
else
i_left = subject_width + ((i.start_date - date_from)*zoom).floor
gc.fill('green')
gc.rectangle(i_left, top, i_left + 6, top - 6)
gc.fill('black')
gc.text(i_left + 11, top + 1, i.name)
# Renders a tree of projects as a nested set of unordered lists
# The given collection may be a subset of the whole project tree
# (eg. some intermediate nodes are private and can not be seen)
def render_project_hierarchy(projects)
s = ''
if projects.any?
ancestors = []
projects.each do |project|
if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
s << "<ul class='projects #{ ancestors.empty? ? 'root' : nil}'>\n"
else
ancestors.pop
s << "</li>"
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
s << "</ul></li>\n"
end
end
classes = (ancestors.empty? ? 'root' : 'child')
s << "<li class='#{classes}'><div class='#{classes}'>" +
link_to(h(project), {:controller => 'projects', :action => 'show', :id => project}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}")
s << "<div class='wiki description'>#{textilizable(project.short_description, :project => project)}</div>" unless project.description.blank?
s << "</div>\n"
ancestors << project
end
top = top + 20
s << ("</li></ul>\n" * ancestors.size)
end
# today red line
if Date.today >= date_from and Date.today <= date_to
gc.stroke('red')
x = (Date.today-date_from+1)*zoom + subject_width
gc.line(x, headers_heigth, x, headers_heigth + g_height-1)
end
gc.draw(imgl)
imgl
end if Object.const_defined?(:Magick)
def new_issue_selector
trackers = @project.trackers
# can't use form tag inside helper
content_tag('form',
select_tag('tracker_id', '<option></option>' + options_from_collection_for_select(trackers, 'id', 'name'), :onchange => "if (this.value != '') {this.form.submit()}"),
:action => url_for(:controller => 'projects', :action => 'add_issue', :id => @project), :method => 'get')
s
end
end

View File

@@ -22,7 +22,9 @@ module QueriesHelper
end
def column_header(column)
column.sortable ? sort_header_tag(column.sortable, :caption => column.caption) : content_tag('th', column.caption)
column.sortable ? sort_header_tag(column.name.to_s, :caption => column.caption,
:default_order => column.default_order) :
content_tag('th', column.caption)
end
def column_content(column, issue)
@@ -42,6 +44,8 @@ module QueriesHelper
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
when :done_ratio
progress_bar(value, :width => '80px')
when :fixed_version
link_to(h(value), { :controller => 'versions', :action => 'show', :id => issue.fixed_version_id })
else
h(value)
end

View File

@@ -15,14 +15,95 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'coderay'
require 'coderay/helpers/file_type'
require 'iconv'
module RepositoriesHelper
def syntax_highlight(name, content)
type = CodeRay::FileType[name]
type ? CodeRay.scan(content, type).html : h(content)
def format_revision(txt)
txt.to_s[0,8]
end
def truncate_at_line_break(text, length = 255)
if text
text.gsub(%r{^(.{#{length}}[^\n]*)\n.+$}m, '\\1...')
end
end
def render_properties(properties)
unless properties.nil? || properties.empty?
content = ''
properties.keys.sort.each do |property|
content << content_tag('li', "<b>#{h property}</b>: <span>#{h properties[property]}</span>")
end
content_tag('ul', content, :class => 'properties')
end
end
def render_changeset_changes
changes = @changeset.changes.find(:all, :limit => 1000, :order => 'path').collect do |change|
case change.action
when 'A'
# Detects moved/copied files
if !change.from_path.blank?
change.action = @changeset.changes.detect {|c| c.action == 'D' && c.path == change.from_path} ? 'R' : 'C'
end
change
when 'D'
@changeset.changes.detect {|c| c.from_path == change.path} ? nil : change
else
change
end
end.compact
tree = { }
changes.each do |change|
p = tree
dirs = change.path.to_s.split('/').select {|d| !d.blank?}
dirs.each do |dir|
p[:s] ||= {}
p = p[:s]
p[dir] ||= {}
p = p[dir]
end
p[:c] = change
end
render_changes_tree(tree[:s])
end
def render_changes_tree(tree)
return '' if tree.nil?
output = ''
output << '<ul>'
tree.keys.sort.each do |file|
s = !tree[file][:s].nil?
c = tree[file][:c]
style = 'change'
style << ' folder' if s
style << " change-#{c.action}" if c
text = h(file)
unless c.nil?
path_param = to_path_param(@repository.relative_path(c.path))
text = link_to(text, :controller => 'repositories',
:action => 'entry',
:id => @project,
:path => path_param,
:rev => @changeset.revision) unless s || c.action == 'D'
text << " - #{c.revision}" unless c.revision.blank?
text << ' (' + link_to('diff', :controller => 'repositories',
:action => 'diff',
:id => @project,
:path => path_param,
:rev => @changeset.revision) + ') ' if c.action == 'M'
text << ' ' + content_tag('span', c.from_path, :class => 'copied-from') unless c.from_path.blank?
end
output << "<li class='#{style}'>#{text}</li>"
output << render_changes_tree(tree[file][:s]) if s
end
output << '</ul>'
output
end
def to_utf8(str)
@@ -44,18 +125,24 @@ module RepositoriesHelper
end
def scm_select_tag(repository)
container = [[]]
REDMINE_SUPPORTED_SCM.each {|scm| container << ["Repository::#{scm}".constantize.scm_name, scm]}
scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']]
REDMINE_SUPPORTED_SCM.each do |scm|
scm_options << ["Repository::#{scm}".constantize.scm_name, scm] if Setting.enabled_scm.include?(scm) || (repository && repository.class.name.demodulize == scm)
end
select_tag('repository_scm',
options_for_select(container, repository.class.name.demodulize),
options_for_select(scm_options, repository.class.name.demodulize),
:disabled => (repository && !repository.new_record?),
:onchange => remote_function(:url => { :controller => 'repositories', :action => 'edit', :id => @project }, :method => :get, :with => "Form.serialize(this.form)")
)
end
def with_leading_slash(path)
path ||= ''
path.starts_with?("/") ? "/#{path}" : path
path.to_s.starts_with?('/') ? path : "/#{path}"
end
def without_leading_slash(path)
path.gsub(%r{^/+}, '')
end
def subversion_field_tags(form, repository)
@@ -65,7 +152,8 @@ module RepositoriesHelper
content_tag('p', form.password_field(:password, :size => 30, :name => 'ignore',
:value => ((repository.new_record? || repository.password.blank?) ? '' : ('x'*15)),
:onfocus => "this.value=''; this.name='repository[password]';",
:onchange => "this.name='repository[password]';"))
:onchange => "this.name='repository[password]';")) +
content_tag('p', form.check_box(:cache))
end
def darcs_field_tags(form, repository)
@@ -76,6 +164,10 @@ module RepositoriesHelper
content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
end
def git_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Path to .git directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
end
def cvs_field_tags(form, repository)
content_tag('p', form.text_field(:root_url, :label => 'CVSROOT', :size => 60, :required => true, :disabled => !repository.new_record?)) +
content_tag('p', form.text_field(:url, :label => 'Module', :size => 30, :required => true, :disabled => !repository.new_record?))
@@ -84,4 +176,8 @@ module RepositoriesHelper
def bazaar_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.new_record?)))
end
def filesystem_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
end
end

View File

@@ -18,7 +18,8 @@
module SearchHelper
def highlight_tokens(text, tokens)
return text unless text && tokens && !tokens.empty?
regexp = Regexp.new "(#{tokens.join('|')})", Regexp::IGNORECASE
re_tokens = tokens.collect {|t| Regexp.escape(t)}
regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE
result = ''
text.split(regexp).each_with_index do |words, i|
if result.length > 1200
@@ -35,4 +36,28 @@ module SearchHelper
end
result
end
def type_label(t)
l("label_#{t.singularize}_plural")
end
def project_select_tag
options = [[l(:label_project_all), 'all']]
options << [l(:label_my_projects), 'my_projects'] unless User.current.memberships.empty?
options << [l(:label_and_its_subprojects, @project.name), 'subprojects'] unless @project.nil? || @project.descendants.active.empty?
options << [@project.name, ''] unless @project.nil?
select_tag('scope', options_for_select(options, params[:scope].to_s)) if options.size > 1
end
def render_results_by_type(results_by_type)
links = []
# Sorts types by results count
results_by_type.keys.sort {|a, b| results_by_type[b] <=> results_by_type[a]}.each do |t|
c = results_by_type[t]
next if c == 0
text = "#{type_label(t)} (#{c})"
links << link_to(text, :q => params[:q], :titles_only => params[:title_only], :all_words => params[:all_words], :scope => params[:scope], t => 1)
end
('<ul>' + links.map {|link| content_tag('li', link)}.join(' ') + '</ul>') unless links.empty?
end
end

View File

@@ -16,4 +16,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module SettingsHelper
def administration_settings_tabs
tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
{:name => 'display', :partial => 'settings/display', :label => :label_display},
{:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
{:name => 'projects', :partial => 'settings/projects', :label => :label_project_plural},
{:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
{:name => 'notifications', :partial => 'settings/notifications', :label => l(:field_mail_notification)},
{:name => 'mail_handler', :partial => 'settings/mail_handler', :label => l(:label_incoming_emails)},
{:name => 'repositories', :partial => 'settings/repositories', :label => :label_repository_plural}
]
end
end

View File

@@ -67,23 +67,31 @@ module SortHelper
# Updates the sort state. Call this in the controller prior to calling
# sort_clause.
#
def sort_update()
if params[:sort_key]
sort = {:key => params[:sort_key], :order => params[:sort_order]}
# sort_keys can be either an array or a hash of allowed keys
def sort_update(sort_keys)
sort_key = params[:sort_key]
sort_key = nil unless (sort_keys.is_a?(Array) ? sort_keys.include?(sort_key) : sort_keys[sort_key])
sort_order = (params[:sort_order] == 'desc' ? 'DESC' : 'ASC')
if sort_key
sort = {:key => sort_key, :order => sort_order}
elsif session[@sort_name]
sort = session[@sort_name] # Previous sort.
else
sort = @sort_default
end
session[@sort_name] = sort
sort_column = (sort_keys.is_a?(Hash) ? sort_keys[sort[:key]] : sort[:key])
@sort_clause = (sort_column.blank? ? nil : [sort_column].flatten.collect {|s| "#{s} #{sort[:order]}"}.join(','))
end
# Returns an SQL sort clause corresponding to the current sort state.
# Use this to sort the controller's table items collection.
#
def sort_clause()
session[@sort_name][:key] + ' ' + session[@sort_name][:order]
@sort_clause
end
# Returns a link which sorts by the named column.
@@ -92,7 +100,7 @@ module SortHelper
# - The optional caption explicitly specifies the displayed link text.
# - A sort icon image is positioned to the right of the sort link.
#
def sort_link(column, caption=nil)
def sort_link(column, caption, default_order)
key, order = session[@sort_name][:key], session[@sort_name][:order]
if key == column
if order.downcase == 'asc'
@@ -104,15 +112,20 @@ module SortHelper
end
else
icon = nil
order = 'desc' # changed for desc order by default
order = default_order
end
caption = titleize(Inflector::humanize(column)) unless caption
url = {:sort_key => column, :sort_order => order, :issue_id => params[:issue_id], :project_id => params[:project_id]}
sort_options = { :sort_key => column, :sort_order => order }
# don't reuse params if filters are present
url_options = params.has_key?(:set_filter) ? sort_options : params.merge(sort_options)
# Add project_id to url_options
url_options = url_options.merge(:project_id => params[:project_id]) if params.has_key?(:project_id)
link_to_remote(caption,
{:update => "content", :url => url},
{:href => url_for(url)}) +
{:update => "content", :url => url_options, :method => :get},
{:href => url_for(url_options)}) +
(icon ? nbsp(2) + image_tag(icon) : '')
end
@@ -138,8 +151,9 @@ module SortHelper
#
def sort_header_tag(column, options = {})
caption = options.delete(:caption) || titleize(Inflector::humanize(column))
default_order = options.delete(:default_order) || 'asc'
options[:title]= l(:label_sort_by, "\"#{caption}\"") unless options[:title]
content_tag('th', sort_link(column, caption), options)
content_tag('th', sort_link(column, caption, default_order), options)
end
private

View File

@@ -16,8 +16,26 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module TimelogHelper
include ApplicationHelper
def render_timelog_breadcrumb
links = []
links << link_to(l(:label_project_all), {:project_id => nil, :issue_id => nil})
links << link_to(h(@project), {:project_id => @project, :issue_id => nil}) if @project
links << link_to_issue(@issue) if @issue
breadcrumb links
end
def activity_collection_for_select_options
activities = Enumeration::get_values('ACTI')
collection = []
collection << [ "--- #{l(:actionview_instancetag_blank_option)} ---", '' ] unless activities.detect(&:is_default)
activities.each { |a| collection << [a.name, a.id] }
collection
end
def select_hours(data, criteria, value)
data.select {|row| row[criteria] == value.to_s}
data.select {|row| row[criteria] == value}
end
def sum_hours(data)
@@ -27,4 +45,116 @@ module TimelogHelper
end
sum
end
def options_for_period_select(value)
options_for_select([[l(:label_all_time), 'all'],
[l(:label_today), 'today'],
[l(:label_yesterday), 'yesterday'],
[l(:label_this_week), 'current_week'],
[l(:label_last_week), 'last_week'],
[l(:label_last_n_days, 7), '7_days'],
[l(:label_this_month), 'current_month'],
[l(:label_last_month), 'last_month'],
[l(:label_last_n_days, 30), '30_days'],
[l(:label_this_year), 'current_year']],
value)
end
def entries_to_csv(entries)
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
decimal_separator = l(:general_csv_decimal_separator)
custom_fields = TimeEntryCustomField.find(:all)
export = StringIO.new
CSV::Writer.generate(export, 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| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
# 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_value_for(f)) }
csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
end
export.rewind
export
end
def format_criteria_value(criteria, value)
value.blank? ? l(:label_none) : ((k = @available_criterias[criteria][:klass]) ? k.find_by_id(value.to_i) : format_value(value, @available_criterias[criteria][:format]))
end
def report_to_csv(criterias, periods, hours)
export = StringIO.new
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
# Column headers
headers = criterias.collect {|criteria| l(@available_criterias[criteria][:label]) }
headers += periods
headers << l(:label_total)
csv << headers.collect {|c| to_utf8(c) }
# Content
report_criteria_to_csv(csv, criterias, periods, hours)
# Total row
row = [ l(:label_total) ] + [''] * (criterias.size - 1)
total = 0
periods.each do |period|
sum = sum_hours(select_hours(hours, @columns, period.to_s))
total += sum
row << (sum > 0 ? "%.2f" % sum : '')
end
row << "%.2f" %total
csv << row
end
export.rewind
export
end
def report_criteria_to_csv(csv, criterias, periods, hours, level=0)
hours.collect {|h| h[criterias[level]].to_s}.uniq.each do |value|
hours_for_value = select_hours(hours, criterias[level], value)
next if hours_for_value.empty?
row = [''] * level
row << to_utf8(format_criteria_value(criterias[level], value))
row += [''] * (criterias.length - level - 1)
total = 0
periods.each do |period|
sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s))
total += sum
row << (sum > 0 ? "%.2f" % sum : '')
end
row << "%.2f" %total
csv << row
if criterias.length > level + 1
report_criteria_to_csv(csv, criterias, periods, hours_for_value, level + 1)
end
end
end
def to_utf8(s)
@ic ||= Iconv.new(l(:general_csv_encoding), 'UTF-8')
begin; @ic.iconv(s.to_s); rescue; s.to_s; end
end
end

View File

@@ -16,10 +16,38 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module UsersHelper
def status_options_for_select(selected)
options_for_select([[l(:label_all), "*"],
[l(:status_active), 1],
[l(:status_registered), 2],
[l(:status_locked), 3]], selected)
def users_status_options_for_select(selected)
user_count_by_status = User.count(:group => 'status').to_hash
options_for_select([[l(:label_all), ''],
["#{l(:status_active)} (#{user_count_by_status[1].to_i})", 1],
["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", 2],
["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", 3]], selected)
end
# Options for the new membership projects combo-box
def options_for_membership_project_select(user, projects)
options = content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---")
options << project_tree_options_for_select(projects) do |p|
{:disabled => (user.projects.include?(p))}
end
options
end
def change_status_link(user)
url = {:action => 'edit', :id => user, :page => params[:page], :status => params[:status]}
if user.locked?
link_to l(:button_unlock), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :post, :class => 'icon icon-unlock'
elsif user.registered?
link_to l(:button_activate), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :post, :class => 'icon icon-unlock'
elsif user != User.current
link_to l(:button_lock), url.merge(:user => {:status => User::STATUS_LOCKED}), :method => :post, :class => 'icon icon-lock'
end
end
def user_settings_tabs
tabs = [{:name => 'general', :partial => 'users/general', :label => :label_general},
{:name => 'memberships', :partial => 'users/memberships', :label => :label_project_plural}
]
end
end

View File

@@ -24,7 +24,7 @@ module WatchersHelper
return '' unless user && user.logged? && object.respond_to?('watched_by?')
watched = object.watched_by?(user)
url = {:controller => 'watchers',
:action => (watched ? 'remove' : 'add'),
:action => (watched ? 'unwatch' : 'watch'),
:object_type => object.class.to_s.underscore,
:object_id => object.id}
link_to_remote((watched ? l(:button_unwatch) : l(:button_watch)),
@@ -33,4 +33,9 @@ module WatchersHelper
:class => (watched ? 'icon icon-fav' : 'icon icon-fav-off'))
end
# Returns a comma separated list of users watching the given object
def watchers_list(object)
object.watcher_users.collect {|u| content_tag('span', link_to_user(u), :class => 'user') }.join(",\n")
end
end

View File

@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module WikiHelper
def html_diff(wdiff)
words = wdiff.words.collect{|word| h(word)}
words_add = 0

View File

@@ -0,0 +1,19 @@
# Redmine - project management software
# Copyright (C) 2006-2008 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 WorkflowsHelper
end

View File

@@ -26,8 +26,21 @@ class Attachment < ActiveRecord::Base
validates_length_of :disk_filename, :maximum => 255
acts_as_event :title => :filename,
:description => :filename,
:url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}}
:url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id, :filename => o.filename}}
acts_as_activity_provider :type => 'files',
:permission => :view_files,
:author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*",
:joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
"LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id"}
acts_as_activity_provider :type => 'documents',
:permission => :view_documents,
:author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*",
:joins => "LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Document' AND #{Document.table_name}.id = #{Attachment.table_name}.container_id " +
"LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
cattr_accessor :storage_path
@@storage_path = "#{RAILS_ROOT}/files"
@@ -36,48 +49,46 @@ class Attachment < ActiveRecord::Base
errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes
end
def file=(incomming_file)
unless incomming_file.nil?
@temp_file = incomming_file
if @temp_file.size > 0
self.filename = sanitize_filename(@temp_file.original_filename)
self.disk_filename = DateTime.now.strftime("%y%m%d%H%M%S") + "_" + self.filename
self.content_type = @temp_file.content_type.chomp
self.filesize = @temp_file.size
end
end
end
def file=(incoming_file)
unless incoming_file.nil?
@temp_file = incoming_file
if @temp_file.size > 0
self.filename = sanitize_filename(@temp_file.original_filename)
self.disk_filename = Attachment.disk_filename(filename)
self.content_type = @temp_file.content_type.to_s.chomp
self.filesize = @temp_file.size
end
end
end
def file
nil
end
# Copy temp file to its final location
def before_save
if @temp_file && (@temp_file.size > 0)
logger.debug("saving '#{self.diskfile}'")
File.open(diskfile, "wb") do |f|
f.write(@temp_file.read)
end
self.digest = Digest::MD5.hexdigest(File.read(diskfile))
end
# Don't save the content type if it's longer than the authorized length
if self.content_type && self.content_type.length > 255
self.content_type = nil
end
end
# Deletes file on the disk
def after_destroy
if self.filename?
File.delete(diskfile) if File.exist?(diskfile)
end
end
# Returns file's location on disk
def diskfile
"#{@@storage_path}/#{self.disk_filename}"
end
def file
nil
end
# Copy temp file to its final location
def before_save
if @temp_file && (@temp_file.size > 0)
logger.debug("saving '#{self.diskfile}'")
File.open(diskfile, "wb") do |f|
f.write(@temp_file.read)
end
self.digest = self.class.digest(diskfile)
end
# Don't save the content type if it's longer than the authorized length
if self.content_type && self.content_type.length > 255
self.content_type = nil
end
end
# Deletes file on the disk
def after_destroy
File.delete(diskfile) if !filename.blank? && File.exist?(diskfile)
end
# Returns file's location on disk
def diskfile
"#{@@storage_path}/#{self.disk_filename}"
end
def increment_download
increment!(:downloads)
@@ -87,19 +98,54 @@ class Attachment < ActiveRecord::Base
container.project
end
def visible?(user=User.current)
container.attachments_visible?(user)
end
def deletable?(user=User.current)
container.attachments_deletable?(user)
end
def image?
self.filename =~ /\.(jpeg|jpg|gif|png)$/i
self.filename =~ /\.(jpe?g|gif|png)$/i
end
def is_text?
Redmine::MimeType.is_type?('text', filename)
end
def is_diff?
self.filename =~ /\.(patch|diff)$/i
end
private
def sanitize_filename(value)
# get only the filename, not the whole path
just_filename = value.gsub(/^.*(\\|\/)/, '')
# NOTE: File.basename doesn't work right with Windows paths on Unix
# INCORRECT: just_filename = File.basename(value.gsub('\\\\', '/'))
# get only the filename, not the whole path
just_filename = value.gsub(/^.*(\\|\/)/, '')
# NOTE: File.basename doesn't work right with Windows paths on Unix
# INCORRECT: just_filename = File.basename(value.gsub('\\\\', '/'))
# Finally, replace all non alphanumeric, underscore or periods with underscore
@filename = just_filename.gsub(/[^\w\.\-]/,'_')
# Finally, replace all non alphanumeric, hyphens or periods with underscore
@filename = just_filename.gsub(/[^\w\.\-]/,'_')
end
# Returns an ASCII or hashed filename
def self.disk_filename(filename)
df = DateTime.now.strftime("%y%m%d%H%M%S") + "_"
if filename =~ %r{^[a-zA-Z0-9_\.\-]*$}
df << filename
else
df << Digest::MD5.hexdigest(filename)
# keep the extension if any
df << $1 if filename =~ %r{(\.[a-zA-Z0-9]+)$}
end
df
end
# Returns the MD5 digest of the file at given path
def self.digest(filename)
File.open(filename, 'rb') do |f|
Digest::MD5.hexdigest(f.read)
end
end
end

View File

@@ -20,10 +20,7 @@ class AuthSource < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
validates_length_of :name, :host, :maximum => 60
validates_length_of :account_password, :maximum => 60, :allow_nil => true
validates_length_of :account, :base_dn, :maximum => 255
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30
validates_length_of :name, :maximum => 60
def authenticate(login, password)
end
@@ -41,7 +38,8 @@ class AuthSource < ActiveRecord::Base
begin
logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug?
attrs = source.authenticate(login, password)
rescue
rescue => e
logger.error "Error during authentication: #{e.message}"
attrs = nil
end
return attrs if attrs

View File

@@ -20,13 +20,19 @@ require 'iconv'
class AuthSourceLdap < AuthSource
validates_presence_of :host, :port, :attr_login
validates_presence_of :attr_firstname, :attr_lastname, :attr_mail, :if => Proc.new { |a| a.onthefly_register? }
validates_length_of :name, :host, :account_password, :maximum => 60, :allow_nil => true
validates_length_of :account, :base_dn, :maximum => 255, :allow_nil => true
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30, :allow_nil => true
validates_numericality_of :port, :only_integer => true
before_validation :strip_ldap_attributes
def after_initialize
self.port = 389 if self.port == 0
end
def authenticate(login, password)
return nil if login.blank? || password.blank?
attrs = []
# get user's DN
ldap_con = initialize_ldap_con(self.account, self.account_password)
@@ -67,16 +73,26 @@ class AuthSourceLdap < AuthSource
"LDAP"
end
private
private
def strip_ldap_attributes
[:attr_login, :attr_firstname, :attr_lastname, :attr_mail].each do |attr|
write_attribute(attr, read_attribute(attr).strip) unless read_attribute(attr).nil?
end
end
def initialize_ldap_con(ldap_user, ldap_password)
Net::LDAP.new( {:host => self.host,
:port => self.port,
:auth => { :method => :simple, :username => ldap_user, :password => ldap_password },
:encryption => (self.tls ? :simple_tls : nil)}
)
options = { :host => self.host,
:port => self.port,
:encryption => (self.tls ? :simple_tls : nil)
}
options.merge!(:auth => { :method => :simple, :username => ldap_user, :password => ldap_password }) unless ldap_user.blank? && ldap_password.blank?
Net::LDAP.new options
end
def self.get_attr(entry, attr_name)
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
if !attr_name.blank?
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
end
end
end

View File

@@ -19,4 +19,8 @@ class Change < ActiveRecord::Base
belongs_to :changeset
validates_presence_of :changeset_id, :action, :path
def relative_path
changeset.repository.relative_path(path)
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2008 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,29 +15,38 @@
# 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
has_many :changes, :dependent => :delete_all
has_and_belongs_to_many :issues
acts_as_event :title => Proc.new {|o| "#{l(:label_revision)} #{o.revision}" + (o.comments.blank? ? '' : (': ' + o.comments))},
:description => :comments,
acts_as_event :title => Proc.new {|o| "#{l(:label_revision)} #{o.revision}" + (o.short_comments.blank? ? '' : (': ' + o.short_comments))},
:description => :long_comments,
:datetime => :committed_on,
:author => :committer,
:url => Proc.new {|o| {:controller => 'repositories', :action => 'revision', :id => o.repository.project_id, :rev => o.revision}}
acts_as_searchable :columns => 'comments',
:include => :repository,
:include => {:repository => :project},
:project_key => "#{Repository.table_name}.project_id",
:date_column => 'committed_on'
acts_as_activity_provider :timestamp => "#{table_name}.committed_on",
:author_key => :user_id,
:find_options => {:include => {:repository => :project}}
validates_presence_of :repository_id, :revision, :committed_on, :commit_date
validates_numericality_of :revision, :only_integer => true
validates_uniqueness_of :revision, :scope => :repository_id
validates_uniqueness_of :scmid, :scope => :repository_id, :allow_nil => true
def revision=(r)
write_attribute :revision, (r.nil? ? nil : r.to_s)
end
def comments=(comment)
write_attribute(:comments, comment.strip)
write_attribute(:comments, Changeset.normalize_comments(comment))
end
def committed_on=(date)
@@ -45,9 +54,22 @@ class Changeset < ActiveRecord::Base
super
end
def project
repository.project
end
def author
user || committer.to_s.split('<').first
end
def before_create
self.user = repository.find_committer_user(committer)
end
def after_create
scan_comment_for_issue_ids
end
require 'pp'
def scan_comment_for_issue_ids
return if comments.blank?
@@ -67,7 +89,7 @@ class Changeset < ActiveRecord::Base
if ref_keywords.delete('*')
# find any issue ID in the comments
target_issue_ids = []
comments.scan(%r{([\s\(,-^])#(\d+)(?=[[:punct:]]|\s|<|$)}).each { |m| target_issue_ids << m[1] }
comments.scan(%r{([\s\(,-]|^)#(\d+)(?=[[:punct:]]|\s|<|$)}).each { |m| target_issue_ids << m[1] }
referenced_issues += repository.project.issues.find_all_by_id(target_issue_ids)
end
@@ -79,11 +101,19 @@ class Changeset < ActiveRecord::Base
# update status of issues
logger.debug "Issues fixed by changeset #{self.revision}: #{issue_ids.join(', ')}." if logger && logger.debug?
target_issues.each do |issue|
# don't change the status is the issue is already closed
# the issue may have been updated by the closure of another one (eg. duplicate)
issue.reload
# don't change the status is the issue is closed
next if issue.status.is_closed?
csettext = "r#{self.revision}"
if self.scmid && (! (csettext =~ /^r[0-9]+$/))
csettext = "commit:\"#{self.scmid}\""
end
journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
issue.status = fix_status
issue.done_ratio = done_ratio if done_ratio
issue.save
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
end
end
referenced_issues += target_issues
@@ -91,14 +121,49 @@ class Changeset < ActiveRecord::Base
self.issues = referenced_issues.uniq
end
def short_comments
@short_comments || split_comments.first
end
def long_comments
@long_comments || split_comments.last
end
# Returns the previous changeset
def previous
@previous ||= Changeset.find(:first, :conditions => ['revision < ? AND repository_id = ?', self.revision, self.repository_id], :order => 'revision DESC')
@previous ||= Changeset.find(:first, :conditions => ['id < ? AND repository_id = ?', self.id, self.repository_id], :order => 'id DESC')
end
# Returns the next changeset
def next
@next ||= Changeset.find(:first, :conditions => ['revision > ? AND repository_id = ?', self.revision, self.repository_id], :order => 'revision ASC')
@next ||= Changeset.find(:first, :conditions => ['id > ? AND repository_id = ?', self.id, self.repository_id], :order => 'id ASC')
end
# Strips and reencodes a commit log before insertion into the database
def self.normalize_comments(str)
to_utf8(str.to_s.strip)
end
private
def split_comments
comments =~ /\A(.+?)\r?\n(.*)$/m
@short_comments = $1 || comments
@long_comments = $2.to_s.strip
return @short_comments, @long_comments
end
def self.to_utf8(str)
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
encoding = Setting.commit_logs_encoding.to_s.strip
unless encoding.blank? || encoding == 'UTF-8'
begin
return Iconv.conv('UTF-8', encoding, str)
rescue Iconv::Failure
# do nothing here
end
end
str
end
end

View File

@@ -30,9 +30,9 @@ class CustomField < ActiveRecord::Base
}.freeze
validates_presence_of :name, :field_format
validates_uniqueness_of :name
validates_uniqueness_of :name, :scope => :type
validates_length_of :name, :maximum => 30
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
validates_format_of :name, :with => /^[\w\s\.\'\-]*$/i
validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys
def initialize(attributes = nil)
@@ -41,8 +41,6 @@ class CustomField < ActiveRecord::Base
end
def before_validation
# remove empty values
self.possible_values = self.possible_values.collect{|v| v unless v.empty?}.compact
# make sure these fields are not searchable
self.searchable = false if %w(int float date bool).include?(field_format)
true
@@ -53,15 +51,58 @@ class CustomField < ActiveRecord::Base
errors.add(:possible_values, :activerecord_error_blank) if self.possible_values.nil? || self.possible_values.empty?
errors.add(:possible_values, :activerecord_error_invalid) unless self.possible_values.is_a? Array
end
# validate default value
v = CustomValue.new(:custom_field => self.clone, :value => default_value, :customized => nil)
v.custom_field.is_required = false
errors.add(:default_value, :activerecord_error_invalid) unless v.valid?
end
# Makes possible_values accept a multiline string
def possible_values=(arg)
if arg.is_a?(Array)
write_attribute(:possible_values, arg.compact.collect(&:strip).select {|v| !v.blank?})
else
self.possible_values = arg.to_s.split(/[\n\r]+/)
end
end
# Returns a ORDER BY clause that can used to sort customized
# objects by their value of the custom field.
# Returns false, if the custom field can not be used for sorting.
def order_statement
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.name}'" +
" AND cv_sort.customized_id=#{self.class.customized_class.table_name}.id" +
" AND cv_sort.custom_field_id=#{id} LIMIT 1), '')"
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.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)"
else
nil
end
end
def <=>(field)
position <=> field.position
end
def self.customized_class
self.name =~ /^(.+)CustomField$/
begin; $1.constantize; rescue nil; end
end
# to move in project_custom_field
def self.for_all
find(:all, :conditions => ["is_for_all=?", true])
find(:all, :conditions => ["is_for_all=?", true], :order => 'position')
end
def type_name

View File

@@ -19,21 +19,49 @@ class CustomValue < ActiveRecord::Base
belongs_to :custom_field
belongs_to :customized, :polymorphic => true
def after_initialize
if custom_field && new_record? && (customized_type.blank? || (customized && customized.new_record?))
self.value ||= custom_field.default_value
end
end
# Returns true if the boolean custom value is true
def true?
self.value == '1'
end
def editable?
custom_field.editable?
end
def required?
custom_field.is_required?
end
def to_s
value.to_s
end
protected
def validate
errors.add(:value, :activerecord_error_blank) and return if custom_field.is_required? and value.blank?
errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp)
errors.add(:value, :activerecord_error_too_short) if custom_field.min_length > 0 and value.length < custom_field.min_length and value.length > 0
errors.add(:value, :activerecord_error_too_long) if custom_field.max_length > 0 and value.length > custom_field.max_length
case custom_field.field_format
when 'int'
errors.add(:value, :activerecord_error_not_a_number) unless value.blank? || value =~ /^[+-]?\d+$/
when 'float'
begin; !value.blank? && Kernel.Float(value); rescue; errors.add(:value, :activerecord_error_invalid) end
when 'date'
errors.add(:value, :activerecord_error_not_a_date) unless value =~ /^\d{4}-\d{2}-\d{2}$/ or value.blank?
when 'list'
errors.add(:value, :activerecord_error_inclusion) unless custom_field.possible_values.include?(value) or value.blank?
if value.blank?
errors.add(:value, :activerecord_error_blank) if custom_field.is_required? and value.blank?
else
errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp)
errors.add(:value, :activerecord_error_too_short) if custom_field.min_length > 0 and value.length < custom_field.min_length
errors.add(:value, :activerecord_error_too_long) if custom_field.max_length > 0 and value.length > custom_field.max_length
# Format specific validations
case custom_field.field_format
when 'int'
errors.add(:value, :activerecord_error_not_a_number) unless value =~ /^[+-]?\d+$/
when 'float'
begin; Kernel.Float(value); rescue; errors.add(:value, :activerecord_error_invalid) end
when 'date'
errors.add(:value, :activerecord_error_not_a_date) unless value =~ /^\d{4}-\d{2}-\d{2}$/
when 'list'
errors.add(:value, :activerecord_error_inclusion) unless custom_field.possible_values.include?(value)
end
end
end
end

View File

@@ -18,13 +18,20 @@
class Document < ActiveRecord::Base
belongs_to :project
belongs_to :category, :class_name => "Enumeration", :foreign_key => "category_id"
has_many :attachments, :as => :container, :dependent => :destroy
acts_as_attachable :delete_permission => :manage_documents
acts_as_searchable :columns => ['title', 'description']
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 },
: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
def after_initialize
if new_record?
self.category ||= Enumeration.default('DCAT')
end
end
end

View File

@@ -23,12 +23,12 @@ class Enumeration < ActiveRecord::Base
validates_presence_of :opt, :name
validates_uniqueness_of :name, :scope => [:opt]
validates_length_of :name, :maximum => 30
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
# Single table inheritance would be an option
OPTIONS = {
"IPRI" => :enumeration_issue_priorities,
"DCAT" => :enumeration_doc_categories,
"ACTI" => :enumeration_activities
"IPRI" => {:label => :enumeration_issue_priorities, :model => Issue, :foreign_key => :priority_id},
"DCAT" => {:label => :enumeration_doc_categories, :model => Document, :foreign_key => :category_id},
"ACTI" => {:label => :enumeration_activities, :model => TimeEntry, :foreign_key => :activity_id}
}.freeze
def self.get_values(option)
@@ -40,11 +40,32 @@ class Enumeration < ActiveRecord::Base
end
def option_name
OPTIONS[self.opt]
OPTIONS[self.opt][:label]
end
def before_save
Enumeration.update_all("is_default = #{connection.quoted_false}", {:opt => opt}) if is_default?
if is_default? && is_default_changed?
Enumeration.update_all("is_default = #{connection.quoted_false}", {:opt => opt})
end
end
def objects_count
OPTIONS[self.opt][:model].count(:conditions => "#{OPTIONS[self.opt][:foreign_key]} = #{id}")
end
def in_use?
self.objects_count != 0
end
alias :destroy_without_reassign :destroy
# Destroy the enumeration
# If a enumeration is specified, objects are reassigned
def destroy(reassign_to = nil)
if reassign_to && reassign_to.is_a?(Enumeration)
OPTIONS[self.opt][:model].update_all("#{OPTIONS[self.opt][:foreign_key]} = #{reassign_to.id}", "#{OPTIONS[self.opt][:foreign_key]} = #{id}")
end
destroy_without_reassign
end
def <=>(enumeration)
@@ -55,13 +76,6 @@ class Enumeration < ActiveRecord::Base
private
def check_integrity
case self.opt
when "IPRI"
raise "Can't delete enumeration" if Issue.find(:first, :conditions => ["priority_id=?", self.id])
when "DCAT"
raise "Can't delete enumeration" if Document.find(:first, :conditions => ["category_id=?", self.id])
when "ACTI"
raise "Can't delete enumeration" if TimeEntry.find(:first, :conditions => ["activity_id=?", self.id])
end
raise "Can't delete enumeration" if self.in_use?
end
end

View File

@@ -26,26 +26,39 @@ class Issue < ActiveRecord::Base
belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
has_many :journals, :as => :journalized, :dependent => :destroy
has_many :attachments, :as => :container, :dependent => :destroy
has_many :time_entries, :dependent => :nullify
has_many :custom_values, :dependent => :delete_all, :as => :customized
has_many :custom_fields, :through => :custom_values
has_and_belongs_to_many :changesets, :order => "revision ASC"
has_many :time_entries, :dependent => :delete_all
has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"
has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
acts_as_attachable :after_remove => :attachment_removed
acts_as_customizable
acts_as_watchable
acts_as_searchable :columns => ['subject', 'description'], :with => {:journal => :issue}
acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
:include => [:project, :journals],
# sort by id so that limited eager loading doesn't break with postgresql
:order_column => "#{table_name}.id"
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"},
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}}
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
:type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
validates_presence_of :subject, :description, :priority, :project, :tracker, :author, :status
acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
:author_key => :author_id
validates_presence_of :subject, :priority, :project, :tracker, :author, :status
validates_length_of :subject, :maximum => 255
validates_inclusion_of :done_ratio, :in => 0..100
validates_numericality_of :estimated_hours, :allow_nil => true
validates_associated :custom_values, :on => :update
named_scope :visible, lambda {|*args| { :include => :project,
:conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } }
# Returns true if usr or current user is allowed to view the issue
def visible?(usr=nil)
(usr || User.current).allowed_to?(:view_issues, self.project)
end
def after_initialize
if new_record?
# set default values for new records only
@@ -54,6 +67,11 @@ class Issue < ActiveRecord::Base
end
end
# Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
def available_custom_fields
(project && tracker) ? project.all_issue_custom_fields.select {|c| tracker.custom_fields.include? c } : []
end
def copy_from(arg)
issue = arg.is_a?(Issue) ? arg : Issue.find(arg)
self.attributes = issue.attributes.dup
@@ -61,37 +79,54 @@ class Issue < ActiveRecord::Base
self
end
# Move an issue to a new project and tracker
def move_to(new_project, new_tracker = nil)
# Moves/copies an issue to a new project and tracker
# Returns the moved/copied issue on success, false on failure
def move_to(new_project, new_tracker = nil, options = {})
options ||= {}
issue = options[:copy] ? self.clone : self
transaction do
if new_project && project_id != new_project.id
if new_project && issue.project_id != new_project.id
# delete issue relations
self.relations_from.clear
self.relations_to.clear
unless Setting.cross_project_issue_relations?
issue.relations_from.clear
issue.relations_to.clear
end
# issue is moved to another project
self.category = nil
self.fixed_version = nil
self.project = new_project
# reassign to the category with same name if any
new_category = issue.category.nil? ? nil : new_project.issue_categories.find_by_name(issue.category.name)
issue.category = new_category
issue.fixed_version = nil
issue.project = new_project
end
if new_tracker
self.tracker = new_tracker
issue.tracker = new_tracker
end
if save
# Manually update project_id on related time entries
TimeEntry.update_all("project_id = #{new_project.id}", {:issue_id => id})
if options[:copy]
issue.custom_field_values = self.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
issue.status = self.status
end
if issue.save
unless options[:copy]
# Manually update project_id on related time entries
TimeEntry.update_all("project_id = #{new_project.id}", {:issue_id => id})
end
else
rollback_db_transaction
Issue.connection.rollback_db_transaction
return false
end
end
return true
return issue
end
def priority_id=(pid)
self.priority = nil
write_attribute(:priority_id, pid)
end
def estimated_hours=(h)
write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
end
def validate
if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
errors.add :due_date, :activerecord_error_not_a_date
@@ -142,12 +177,17 @@ class Issue < ActiveRecord::Base
end
def after_save
# Reload is needed in order to get the right status
reload
# Update start/due dates of following issues
relations_from.each(&:set_issue_to_dates)
# Close duplicates if the issue was closed
if @issue_before_change && !@issue_before_change.closed? && self.closed?
duplicates.each do |duplicate|
# Reload is need in case the duplicate was updated by a previous duplicate
duplicate.reload
# Don't re-close it if it's already closed
next if duplicate.closed?
# Same user and notes
@@ -157,16 +197,14 @@ class Issue < ActiveRecord::Base
end
end
def custom_value_for(custom_field)
self.custom_values.each {|v| return v if v.custom_field_id == custom_field.id }
return nil
end
def init_journal(user, notes = "")
@current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
@issue_before_change = self.clone
@issue_before_change.status = self.status
@custom_values_before_change = {}
self.custom_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
# Make sure updated_on is updated when adding a note.
updated_on_will_change!
@current_journal
end
@@ -175,17 +213,29 @@ class Issue < ActiveRecord::Base
self.status.is_closed?
end
# Returns true if the issue is overdue
def overdue?
!due_date.nil? && (due_date < Date.today) && !status.is_closed?
end
# Users the issue can be assigned to
def assignable_users
project.assignable_users
end
# Returns an array of status that user is able to apply
def new_statuses_allowed_to(user)
statuses = status.find_new_statuses_allowed_to(user.role_for_project(project), tracker)
statuses << status unless statuses.empty?
statuses.uniq.sort
end
# Returns the mail adresses of users that should be notified for the issue
def recipients
recipients = project.recipients
# Author and assignee are always notified
recipients << author.mail if author
recipients << assigned_to.mail if assigned_to
# Author and assignee are always notified unless they have been locked
recipients << author.mail if author && author.active?
recipients << assigned_to.mail if assigned_to && assigned_to.active?
recipients.compact.uniq
end
@@ -206,9 +256,15 @@ class Issue < ActiveRecord::Base
dependencies
end
# Returns an array of the duplicate issues
# Returns an array of issues that duplicate this one
def duplicates
relations.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.other_issue(self)}
relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
end
# Returns the due date or the target due date if any
# Used on gantt chart
def due_before
due_date || (fixed_version ? fixed_version.effective_date : nil)
end
def duration
@@ -218,4 +274,19 @@ class Issue < ActiveRecord::Base
def soonest_start
@soonest_start ||= relations_to.collect{|relation| relation.successor_soonest_start}.compact.min
end
def to_s
"#{tracker} ##{id}: #{subject}"
end
private
# Callback on attachment deletion
def attachment_removed(obj)
journal = init_journal(User.current)
journal.details << JournalDetail.new(:property => 'attachment',
:prop_key => obj.id,
:old_value => obj.filename)
journal.save
end
end

View File

@@ -25,7 +25,7 @@ class IssueRelation < ActiveRecord::Base
TYPE_PRECEDES = "precedes"
TYPES = { TYPE_RELATES => { :name => :label_relates_to, :sym_name => :label_relates_to, :order => 1 },
TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicates, :order => 2 },
TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicated_by, :order => 2 },
TYPE_BLOCKS => { :name => :label_blocks, :sym_name => :label_blocked_by, :order => 3 },
TYPE_PRECEDES => { :name => :label_precedes, :sym_name => :label_follows, :order => 4 },
}.freeze
@@ -35,6 +35,8 @@ class IssueRelation < ActiveRecord::Base
validates_numericality_of :delay, :allow_nil => true
validates_uniqueness_of :issue_to_id, :scope => :issue_from_id
attr_protected :issue_from_id, :issue_to_id
def validate
if issue_from && issue_to
errors.add :issue_to_id, :activerecord_error_invalid if issue_from_id == issue_to_id

View File

@@ -25,8 +25,8 @@ class IssueStatus < ActiveRecord::Base
validates_length_of :name, :maximum => 30
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
def before_save
IssueStatus.update_all "is_default=#{connection.quoted_false}" if self.is_default?
def after_save
IssueStatus.update_all("is_default=#{connection.quoted_false}", ['id <> ?', id]) if self.is_default?
end
# Returns the default status for new issues
@@ -56,6 +56,10 @@ class IssueStatus < ActiveRecord::Base
false
end
def <=>(status)
position <=> status.position
end
def to_s; name end
private

View File

@@ -23,17 +23,21 @@ class Journal < ActiveRecord::Base
belongs_to :user
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
attr_accessor :indice
acts_as_searchable :columns => 'notes',
:include => :issue,
:project_key => "#{Issue.table_name}.project_id",
:date_column => "#{Issue.table_name}.created_on"
acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') },
acts_as_event :title => Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.id}#{status}: #{o.issue.subject}" },
:description => :notes,
:author => :user,
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id}}
:type => Proc.new {|o| (s = o.new_status) ? (s.is_closed? ? 'issue-closed' : 'issue-edit') : 'issue-note' },
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}}
acts_as_activity_provider :type => 'issues',
:permission => :view_issues,
:author_key => :user_id,
:find_options => {:include => [{:issue => :project}, :details, :user],
:conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" +
" (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')"}
def save
# Do not save an empty journal
(details.empty? && notes.blank?) ? false : super
@@ -44,4 +48,21 @@ class Journal < ActiveRecord::Base
c = details.detect {|detail| detail.prop_key == 'status_id'}
(c && c.value) ? IssueStatus.find_by_id(c.value.to_i) : nil
end
def new_value_for(prop)
c = details.detect {|detail| detail.prop_key == prop}
c ? c.value : nil
end
def editable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:edit_issue_notes, project) || (self.user == usr && usr.allowed_to?(:edit_own_issue_notes, project)))
end
def project
journalized.respond_to?(:project) ? journalized.project : nil
end
def attachments
journalized.respond_to?(:attachments) ? journalized.attachments : nil
end
end

View File

@@ -16,25 +16,224 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MailHandler < ActionMailer::Base
include ActionView::Helpers::SanitizeHelper
class UnauthorizedAction < StandardError; end
class MissingInformation < StandardError; end
attr_reader :email, :user
def self.receive(email, options={})
@@handler_options = options.dup
@@handler_options[:issue] ||= {}
@@handler_options[:allow_override] = @@handler_options[:allow_override].split(',').collect(&:strip) if @@handler_options[:allow_override].is_a?(String)
@@handler_options[:allow_override] ||= []
# Project needs to be overridable if not specified
@@handler_options[:allow_override] << 'project' unless @@handler_options[:issue].has_key?(:project)
# Status overridable by default
@@handler_options[:allow_override] << 'status' unless @@handler_options[:issue].has_key?(:status)
super email
end
# Processes incoming emails
# Currently, it only supports adding a note to an existing issue
# by replying to the initial notification message
def receive(email)
# find related issue by parsing the subject
m = email.subject.match %r{\[.*#(\d+)\]}
return unless m
issue = Issue.find_by_id(m[1])
return unless issue
# find user
user = User.find_active(:first, :conditions => {:mail => email.from.first})
return unless user
@email = email
@user = User.active.find_by_mail(email.from.first.to_s.strip)
unless @user
# Unknown user => the email is ignored
# TODO: ability to create the user's account
logger.info "MailHandler: email submitted by unknown user [#{email.from.first}]" if logger && logger.info
return false
end
User.current = @user
dispatch
end
private
MESSAGE_ID_RE = %r{^<redmine\.([a-z0-9_]+)\-(\d+)\.\d+@}
ISSUE_REPLY_SUBJECT_RE = %r{\[[^\]]+#(\d+)\]}
MESSAGE_REPLY_SUBJECT_RE = %r{\[[^\]]+msg(\d+)\]}
def dispatch
headers = [email.in_reply_to, email.references].flatten.compact
if headers.detect {|h| h.to_s =~ MESSAGE_ID_RE}
klass, object_id = $1, $2.to_i
method_name = "receive_#{klass}_reply"
if self.class.private_instance_methods.include?(method_name)
send method_name, object_id
else
# ignoring it
end
elsif m = email.subject.match(ISSUE_REPLY_SUBJECT_RE)
receive_issue_reply(m[1].to_i)
elsif m = email.subject.match(MESSAGE_REPLY_SUBJECT_RE)
receive_message_reply(m[1].to_i)
else
receive_issue
end
rescue ActiveRecord::RecordInvalid => e
# TODO: send a email to the user
logger.error e.message if logger
false
rescue MissingInformation => e
logger.error "MailHandler: missing information from #{user}: #{e.message}" if logger
false
rescue UnauthorizedAction => e
logger.error "MailHandler: unauthorized attempt from #{user}" if logger
false
end
# Creates a new issue
def receive_issue
project = target_project
tracker = (get_keyword(:tracker) && project.trackers.find_by_name(get_keyword(:tracker))) || project.trackers.find(:first)
category = (get_keyword(:category) && project.issue_categories.find_by_name(get_keyword(:category)))
priority = (get_keyword(:priority) && Enumeration.find_by_opt_and_name('IPRI', get_keyword(:priority)))
status = (get_keyword(:status) && IssueStatus.find_by_name(get_keyword(:status)))
# check permission
return unless user.allowed_to?(:add_issue_notes, issue.project)
raise UnauthorizedAction unless user.allowed_to?(:add_issues, project)
issue = Issue.new(:author => user, :project => project, :tracker => tracker, :category => category, :priority => priority)
# check workflow
if status && issue.new_statuses_allowed_to(user).include?(status)
issue.status = status
end
issue.subject = email.subject.chomp.toutf8
issue.description = plain_text_body
# custom fields
issue.custom_field_values = issue.available_custom_fields.inject({}) do |h, c|
if value = get_keyword(c.name, :override => true)
h[c.id] = value
end
h
end
issue.save!
add_attachments(issue)
logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger && logger.info
# add To and Cc as watchers
add_watchers(issue)
# send notification after adding watchers so that they can reply to Redmine
Mailer.deliver_issue_add(issue) if Setting.notified_events.include?('issue_added')
issue
end
def target_project
# TODO: other ways to specify project:
# * parse the email To field
# * specific project (eg. Setting.mail_handler_target_project)
target = Project.find_by_identifier(get_keyword(:project))
raise MissingInformation.new('Unable to determine target project') if target.nil?
target
end
# Adds a note to an existing issue
def receive_issue_reply(issue_id)
status = (get_keyword(:status) && IssueStatus.find_by_name(get_keyword(:status)))
issue = Issue.find_by_id(issue_id)
return unless issue
# check permission
raise UnauthorizedAction unless user.allowed_to?(:add_issue_notes, issue.project) || user.allowed_to?(:edit_issues, issue.project)
raise UnauthorizedAction unless status.nil? || user.allowed_to?(:edit_issues, issue.project)
# add the note
issue.init_journal(user, email.body.chomp)
issue.save
journal = issue.init_journal(user, plain_text_body)
add_attachments(issue)
# check workflow
if status && issue.new_statuses_allowed_to(user).include?(status)
issue.status = status
end
issue.save!
logger.info "MailHandler: issue ##{issue.id} updated by #{user}" if logger && logger.info
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
journal
end
# Reply will be added to the issue
def receive_journal_reply(journal_id)
journal = Journal.find_by_id(journal_id)
if journal && journal.journalized_type == 'Issue'
receive_issue_reply(journal.journalized_id)
end
end
# Receives a reply to a forum message
def receive_message_reply(message_id)
message = Message.find_by_id(message_id)
if message
message = message.root
if user.allowed_to?(:add_messages, message.project) && !message.locked?
reply = Message.new(:subject => email.subject.gsub(%r{^.*msg\d+\]}, '').strip,
:content => plain_text_body)
reply.author = user
reply.board = message.board
message.children << reply
add_attachments(reply)
reply
else
raise UnauthorizedAction
end
end
end
def add_attachments(obj)
if email.has_attachments?
email.attachments.each do |attachment|
Attachment.create(:container => obj,
:file => attachment,
:author => user,
:content_type => attachment.content_type)
end
end
end
# Adds To and Cc as watchers of the given object if the sender has the
# appropriate permission
def add_watchers(obj)
if user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project)
addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase}
unless addresses.empty?
watchers = User.active.find(:all, :conditions => ['LOWER(mail) IN (?)', addresses])
watchers.each {|w| obj.add_watcher(w)}
end
end
end
def get_keyword(attr, options={})
@keywords ||= {}
if @keywords.has_key?(attr)
@keywords[attr]
else
@keywords[attr] = begin
if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}:[ \t]*(.+)\s*$/i, '')
$1.strip
elsif !@@handler_options[:issue][attr].blank?
@@handler_options[:issue][attr]
end
end
end
end
# Returns the text/plain part of the email
# If not found (eg. HTML-only email), returns the body with tags removed
def plain_text_body
return @plain_text_body unless @plain_text_body.nil?
parts = @email.parts.collect {|c| (c.respond_to?(:parts) && !c.parts.empty?) ? c.parts : c}.flatten
if parts.empty?
parts << @email
end
plain_text_part = parts.detect {|p| p.content_type == 'text/plain'}
if plain_text_part.nil?
# no text/plain part found, assuming html-only email
# strip html tags and remove doctype directive
@plain_text_body = strip_tags(@email.body.to_s)
@plain_text_body.gsub! %r{^<!DOCTYPE .*$}, ''
else
@plain_text_body = plain_text_part.body.to_s
end
@plain_text_body.strip!
end
end

View File

@@ -5,53 +5,82 @@
# 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.
class Mailer < ActionMailer::Base
helper ApplicationHelper
helper IssuesHelper
helper CustomFieldsHelper
helper :application
helper :issues
helper :custom_fields
include ActionController::UrlWriter
def issue_add(issue)
recipients issue.recipients
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
def issue_add(issue)
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => issue.id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id issue
recipients issue.recipients
cc(issue.watcher_recipients - @recipients)
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
body :issue => issue,
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
end
def issue_edit(journal)
issue = journal.journalized
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => issue.id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id journal
references issue
@author = journal.user
recipients issue.recipients
# Watchers in cc
cc(issue.watcher_recipients - @recipients)
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
subject s
body :issue => issue,
:journal => journal,
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
end
def reminder(user, issues, days)
set_language_if_valid user.language
recipients user.mail
subject l(:mail_subject_reminder, issues.size)
body :issues => issues,
:days => days,
:issues_url => url_for(:controller => 'issues', :action => 'index', :set_filter => 1, :assigned_to_id => user.id, :sort_key => 'due_date', :sort_order => 'asc')
end
def document_added(document)
redmine_headers 'Project' => document.project.identifier
recipients document.project.recipients
subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
body :document => document,
:document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
end
def attachments_added(attachments)
container = attachments.first.container
added_to = ''
added_to_url = ''
case container.class.name
when 'Project'
added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
added_to = "#{l(:label_project)}: #{container}"
when 'Version'
added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
added_to = "#{l(:label_version)}: #{container.name}"
@@ -59,6 +88,7 @@ class Mailer < ActionMailer::Base
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}"
end
redmine_headers 'Project' => container.project.identifier
recipients container.project.recipients
subject "[#{container.project.name}] #{l(:label_attachment_new)}"
body :attachments => attachments,
@@ -67,6 +97,8 @@ class Mailer < ActionMailer::Base
end
def news_added(news)
redmine_headers 'Project' => news.project.identifier
message_id news
recipients news.project.recipients
subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
body :news => news,
@@ -74,25 +106,29 @@ class Mailer < ActionMailer::Base
end
def message_posted(message, recipients)
redmine_headers 'Project' => message.project.identifier,
'Topic-Id' => (message.parent_id || message.id)
message_id message
references message.parent unless message.parent.nil?
recipients(recipients)
subject "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
subject "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
body :message => message,
:message_url => url_for(:controller => 'messages', :action => 'show', :board_id => message.board_id, :id => message.root)
end
def account_information(user, password)
set_language_if_valid user.language
recipients user.mail
subject l(:mail_subject_register)
subject l(:mail_subject_register, Setting.app_title)
body :user => user,
:password => password,
:login_url => url_for(:controller => 'account', :action => 'login')
end
def account_activation_request(user)
# Send the email to all active administrators
recipients User.find_active(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
subject l(:mail_subject_account_activation_request)
recipients User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
subject l(:mail_subject_account_activation_request, Setting.app_title)
body :user => user,
:url => url_for(:controller => 'users', :action => 'index', :status => User::STATUS_REGISTERED, :sort_key => 'created_on', :sort_order => 'desc')
end
@@ -100,61 +136,162 @@ class Mailer < ActionMailer::Base
def lost_password(token)
set_language_if_valid(token.user.language)
recipients token.user.mail
subject l(:mail_subject_lost_password)
subject l(:mail_subject_lost_password, Setting.app_title)
body :token => token,
:url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
end
end
def register(token)
set_language_if_valid(token.user.language)
recipients token.user.mail
subject l(:mail_subject_register)
subject l(:mail_subject_register, Setting.app_title)
body :token => token,
:url => url_for(:controller => 'account', :action => 'activate', :token => token.value)
end
def test(user)
set_language_if_valid(user.language)
recipients user.mail
subject 'Redmine test'
body :url => url_for(:controller => 'welcome')
end
# Overrides default deliver! method to prevent from sending an email
# with no recipient, cc or bcc
def deliver!(mail = @mail)
return false if (recipients.nil? || recipients.empty?) &&
(cc.nil? || cc.empty?) &&
(bcc.nil? || bcc.empty?)
# Set Message-Id and References
if @message_id_object
mail.message_id = self.class.message_id_for(@message_id_object)
end
if @references_objects
mail.references = @references_objects.collect {|o| self.class.message_id_for(o)}
end
super(mail)
end
# Sends reminders to issue assignees
# Available options:
# * :days => how many days in the future to remind about (defaults to 7)
# * :tracker => id of tracker for filtering issues (defaults to all trackers)
# * :project => id or identifier of project to process (defaults to all projects)
def self.reminders(options={})
days = options[:days] || 7
project = options[:project] ? Project.find(options[:project]) : nil
tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil
s = ARCondition.new ["#{IssueStatus.table_name}.is_closed = ? AND #{Issue.table_name}.due_date <= ?", false, days.day.from_now.to_date]
s << "#{Issue.table_name}.assigned_to_id IS NOT NULL"
s << "#{Project.table_name}.status = #{Project::STATUS_ACTIVE}"
s << "#{Issue.table_name}.project_id = #{project.id}" if project
s << "#{Issue.table_name}.tracker_id = #{tracker.id}" if tracker
issues_by_assignee = Issue.find(:all, :include => [:status, :assigned_to, :project, :tracker],
:conditions => s.conditions
).group_by(&:assigned_to)
issues_by_assignee.each do |assignee, issues|
deliver_reminder(assignee, issues, days) unless assignee.nil?
end
end
private
def initialize_defaults(method_name)
super
set_language_if_valid Setting.default_language
from Setting.mail_from
default_url_options[:host] = Setting.host_name
# URL options
h = Setting.host_name
h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank?
default_url_options[:host] = h
default_url_options[:protocol] = Setting.protocol
# Common headers
headers 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name,
'X-Redmine-Site' => Setting.app_title
end
# Appends a Redmine header field (name is prepended with 'X-Redmine-')
def redmine_headers(h)
h.each { |k,v| headers["X-Redmine-#{k}"] = v }
end
# Overrides the create_mail method
def create_mail
# Removes the current user from the recipients and cc
# if he doesn't want to receive notifications about what he does
if User.current.pref[:no_self_notified]
recipients.delete(User.current.mail) if recipients
cc.delete(User.current.mail) if cc
@author ||= User.current
if @author.pref[:no_self_notified]
recipients.delete(@author.mail) if recipients
cc.delete(@author.mail) if cc
end
# Blind carbon copy recipients
if Setting.bcc_recipients?
bcc([recipients, cc].flatten.compact.uniq)
recipients []
cc []
end
end
super
end
# Renders a message with the corresponding layout
def render_message(method_name, body)
layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
layout = method_name.to_s.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
body[:content_for_layout] = render(:file => method_name, :body => body)
ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}")
ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}", :use_full_path => true)
end
# for the case of plain text only
def body(*params)
value = super(*params)
if Setting.plain_text_mail?
templates = Dir.glob("#{template_path}/#{@template}.text.plain.{rhtml,erb}")
unless String === @body or templates.empty?
template = File.basename(templates.first)
@body[:content_for_layout] = render(:file => template, :body => @body)
@body = ActionView::Base.new(template_root, @body, self).render(:file => "mailer/layout.text.plain.rhtml", :use_full_path => true)
return @body
end
end
return value
end
# Makes partial rendering work with Rails 1.2 (retro-compatibility)
def self.controller_path
''
end unless respond_to?('controller_path')
# Returns a predictable Message-Id for the given object
def self.message_id_for(object)
# id + timestamp should reduce the odds of a collision
# as far as we don't send multiple emails for the same object
hash = "redmine.#{object.class.name.demodulize.underscore}-#{object.id}.#{object.created_on.strftime("%Y%m%d%H%M%S")}"
host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')
host = "#{::Socket.gethostname}.redmine" if host.empty?
"<#{hash}@#{host}>"
end
private
def message_id(object)
@message_id_object = object
end
def references(object)
@references_objects ||= []
@references_objects << object
end
end
# Patch TMail so that message_id is not overwritten
module TMail
class Mail
def add_message_id( fqdn = nil )
self.message_id ||= ::TMail::new_message_id(fqdn)
end
end
end

View File

@@ -31,8 +31,12 @@ class Member < ActiveRecord::Base
self.user.name
end
def <=>(member)
role == member.role ? (user <=> member.user) : (role <=> member.role)
end
def before_destroy
# remove category based auto assignments for this member
project.issue_categories.update_all "assigned_to_id = NULL", ["assigned_to_id = ?", self.user.id]
IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id]
end
end

View File

@@ -19,24 +19,32 @@ class Message < ActiveRecord::Base
belongs_to :board
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
acts_as_tree :counter_cache => :replies_count, :order => "#{Message.table_name}.created_on ASC"
has_many :attachments, :as => :container, :dependent => :destroy
acts_as_attachable
belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
acts_as_searchable :columns => ['subject', 'content'],
:include => :board,
:include => {:board => :project},
:project_key => 'project_id',
:date_column => 'created_on'
:date_column => "#{table_name}.created_on"
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
:description => :content,
:url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id, :id => o.id}}
:type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'},
:url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id}.merge(o.parent_id.nil? ? {:id => o.id} :
{:id => o.parent_id, :anchor => "message-#{o.id}"})}
acts_as_activity_provider :find_options => {:include => [{:board => :project}, :author]},
:author_key => :author_id
acts_as_watchable
attr_protected :locked, :sticky
validates_presence_of :subject, :content
validates_length_of :subject, :maximum => 255
after_create :add_author_as_watcher
def validate_on_create
# Can not reply to a locked topic
errors.add_to_base 'Topic is locked' if root.locked?
errors.add_to_base 'Topic is locked' if root.locked? && self != root
end
def after_create
@@ -64,4 +72,18 @@ class Message < ActiveRecord::Base
def project
board.project
end
def editable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:edit_messages, project) || (self.author == usr && usr.allowed_to?(:edit_own_messages, project)))
end
def destroyable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:delete_messages, project) || (self.author == usr && usr.allowed_to?(:delete_own_messages, project)))
end
private
def add_author_as_watcher
Watcher.create(:watchable => self.root, :user => author)
end
end

View File

@@ -17,10 +17,13 @@
class MessageObserver < ActiveRecord::Observer
def after_create(message)
# send notification to the authors of the thread
recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
recipients = []
# send notification to the topic watchers
recipients += message.root.watcher_recipients
# send notification to the board watchers
recipients += message.board.watcher_recipients
# send notification to project members who want to be notified
recipients += message.board.project.recipients
recipients = recipients.compact.uniq
Mailer.deliver_message_posted(message, recipients) if !recipients.empty? && Setting.notified_events.include?('message_posted')
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2008 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,11 +24,13 @@ class News < ActiveRecord::Base
validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255
acts_as_searchable :columns => ['title', 'description']
acts_as_searchable :columns => ['title', "#{table_name}.description"], :include => :project
acts_as_event :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.id}}
acts_as_activity_provider :find_options => {:include => [:project, :author]},
:author_key => :author_id
# returns latest news for projects visible by user
def self.latest(user=nil, count=5)
find(:all, :limit => count, :conditions => Project.visible_by(user), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
def self.latest(user = User.current, count = 5)
find(:all, :limit => count, :conditions => Project.allowed_to_condition(user, :view_news), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
end
end

View File

@@ -22,7 +22,6 @@ class Project < ActiveRecord::Base
has_many :members, :include => :user, :conditions => "#{User.table_name}.status=#{User::STATUS_ACTIVE}"
has_many :users, :through => :members
has_many :custom_values, :dependent => :delete_all, :as => :customized
has_many :enabled_modules, :dependent => :delete_all
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
@@ -33,36 +32,43 @@ class Project < ActiveRecord::Base
has_many :documents, :dependent => :destroy
has_many :news, :dependent => :delete_all, :include => :author
has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
has_many :boards, :order => "position ASC"
has_many :boards, :dependent => :destroy, :order => "position ASC"
has_one :repository, :dependent => :destroy
has_many :changesets, :through => :repository
has_one :wiki, :dependent => :destroy
# Custom field for the project issues
has_and_belongs_to_many :custom_fields,
has_and_belongs_to_many :issue_custom_fields,
:class_name => 'IssueCustomField',
:order => "#{CustomField.table_name}.position",
:join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
:association_foreign_key => 'custom_field_id'
acts_as_tree :order => "name", :counter_cache => true
acts_as_nested_set :order => 'name', :dependent => :destroy
acts_as_attachable :view_permission => :view_files,
:delete_permission => :manage_files
acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'
acts_as_customizable
acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil
acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}},
:author => nil
attr_protected :status, :enabled_module_names
validates_presence_of :name, :description, :identifier
validates_presence_of :name, :identifier
validates_uniqueness_of :name, :identifier
validates_associated :custom_values, :on => :update
validates_associated :repository, :wiki
validates_length_of :name, :maximum => 30
validates_length_of :description, :maximum => 255
validates_length_of :homepage, :maximum => 60
validates_length_of :identifier, :in => 3..20
validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 2..20
validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
before_destroy :delete_all_members
named_scope :has_module, lambda { |mod| { :conditions => ["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s] } }
named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"}
named_scope :public, { :conditions => { :is_public => true } }
named_scope :visible, lambda { { :conditions => Project.visible_by(User.current) } }
def identifier=(identifier)
super unless identifier_frozen?
@@ -74,27 +80,19 @@ class Project < ActiveRecord::Base
def issues_with_subprojects(include_subprojects=false)
conditions = nil
if include_subprojects && !active_children.empty?
ids = [id] + active_children.collect {|c| c.id}
conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
if include_subprojects
ids = [id] + descendants.collect(&:id)
conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"]
end
conditions ||= ["#{Issue.table_name}.project_id = ?", id]
conditions ||= ["#{Project.table_name}.id = ?", id]
# Quick and dirty fix for Rails 2 compatibility
Issue.send(:with_scope, :find => { :conditions => conditions }) do
yield
Version.send(:with_scope, :find => { :conditions => conditions }) do
yield
end
end
end
# Return all issues status changes for the project between the 2 given dates
def issues_status_changes(from, to)
Journal.find(:all, :include => [:issue, :details, :user],
:conditions => ["#{Journal.table_name}.journalized_type = 'Issue'" +
" AND #{Issue.table_name}.project_id = ?" +
" AND #{JournalDetail.table_name}.prop_key = 'status_id'" +
" AND #{Journal.table_name}.created_on BETWEEN ? AND ?",
id, from, to+1])
end
# returns latest created projects
# non public projects will be returned only if user is a member of those
def self.latest(user=nil, count=5)
@@ -102,6 +100,7 @@ class Project < ActiveRecord::Base
end
def self.visible_by(user=nil)
user ||= User.current
if user && user.admin?
return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
elsif user && user.memberships.any?
@@ -111,10 +110,64 @@ class Project < ActiveRecord::Base
end
end
def self.allowed_to_condition(user, permission, options={})
statements = []
base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
if perm = Redmine::AccessControl.permission(permission)
unless perm.project_module.nil?
# If the permission belongs to a project module, make sure the module is enabled
base_statement << " AND EXISTS (SELECT em.id FROM #{EnabledModule.table_name} em WHERE em.name='#{perm.project_module}' AND em.project_id=#{Project.table_name}.id)"
end
end
if options[:project]
project_statement = "#{Project.table_name}.id = #{options[:project].id}"
project_statement << " OR (#{Project.table_name}.lft > #{options[:project].lft} AND #{Project.table_name}.rgt < #{options[:project].rgt})" if options[:with_subprojects]
base_statement = "(#{project_statement}) AND (#{base_statement})"
end
if user.admin?
# no restriction
else
statements << "1=0"
if user.logged?
statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission)
allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id}
statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any?
elsif Role.anonymous.allowed_to?(permission)
# anonymous user allowed on public project
statements << "#{Project.table_name}.is_public = #{connection.quoted_true}"
else
# anonymous user is not authorized
end
end
statements.empty? ? base_statement : "((#{base_statement}) AND (#{statements.join(' OR ')}))"
end
def project_condition(with_subprojects)
cond = "#{Project.table_name}.id = #{id}"
cond = "(#{cond} OR (#{Project.table_name}.lft > #{lft} AND #{Project.table_name}.rgt < #{rgt}))" if with_subprojects
cond
end
def self.find(*args)
if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
project = find_by_identifier(*args)
raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
project
else
super
end
end
def to_param
# id is used for projects with a numeric identifier (compatibility)
@to_param ||= (identifier.to_s =~ %r{^\d*$} ? id : identifier)
end
def active?
self.status == STATUS_ACTIVE
end
# Archives the project and its descendants recursively
def archive
# Archive subprojects if any
children.each do |subproject|
@@ -123,13 +176,63 @@ class Project < ActiveRecord::Base
update_attribute :status, STATUS_ARCHIVED
end
# Unarchives the project
# All its ancestors must be active
def unarchive
return false if parent && !parent.active?
return false if ancestors.detect {|a| !a.active?}
update_attribute :status, STATUS_ACTIVE
end
def active_children
children.select {|child| child.active?}
# Returns an array of projects the project can be moved to
def possible_parents
@possible_parents ||= (Project.active.find(:all) - self_and_descendants)
end
# Sets the parent of the project
# Argument can be either a Project, a String, a Fixnum or nil
def set_parent!(p)
unless p.nil? || p.is_a?(Project)
if p.to_s.blank?
p = nil
else
p = Project.find_by_id(p)
return false unless p
end
end
if p == parent && !p.nil?
# Nothing to do
true
elsif p.nil? || (p.active? && move_possible?(p))
# Insert the project so that target's children or root projects stay alphabetically sorted
sibs = (p.nil? ? self.class.roots : p.children)
to_be_inserted_before = sibs.detect {|c| c.name.to_s.downcase > name.to_s.downcase }
if to_be_inserted_before
move_to_left_of(to_be_inserted_before)
elsif p.nil?
if sibs.empty?
# move_to_root adds the project in first (ie. left) position
move_to_root
else
move_to_right_of(sibs.last) unless self == sibs.last
end
else
# move_to_child_of adds the project in last (ie.right) position
move_to_child_of(p)
end
true
else
# Can not move to the given target
false
end
end
# Returns an array of the trackers used by the project and its active sub projects
def rolled_up_trackers
@rolled_up_trackers ||=
Tracker.find(:all, :include => :projects,
:select => "DISTINCT #{Tracker.table_name}.*",
:conditions => ["#{Project.table_name}.lft >= ? AND #{Project.table_name}.rgt <= ? AND #{Project.table_name}.status = #{STATUS_ACTIVE}", lft, rgt],
:order => "#{Tracker.table_name}.position")
end
# Deletes all project's members
@@ -149,18 +252,27 @@ class Project < ActiveRecord::Base
# Returns an array of all custom fields enabled for project issues
# (explictly associated custom fields and custom fields enabled for all projects)
def custom_fields_for_issues(tracker)
all_custom_fields.select {|c| tracker.custom_fields.include? c }
def all_issue_custom_fields
@all_issue_custom_fields ||= (IssueCustomField.for_all + issue_custom_fields).uniq.sort
end
def all_custom_fields
@all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
def project
self
end
def <=>(project)
name.downcase <=> project.name.downcase
end
def to_s
name
end
# Returns a short description of the projects (first lines)
def short_description(length = 255)
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
end
def allows_to?(action)
if action.is_a? Hash
allowed_actions.include? "#{action[:controller]}/#{action[:action]}"
@@ -181,11 +293,16 @@ class Project < ActiveRecord::Base
enabled_modules << EnabledModule.new(:name => name.to_s)
end
end
# Returns an auto-generated project identifier based on the last identifier used
def self.next_identifier
p = Project.find(:first, :order => 'created_on DESC')
p.nil? ? nil : p.identifier.to_s.succ
end
protected
def validate
errors.add(parent_id, " must be a root project") if parent and parent.parent
errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
errors.add(:identifier, :activerecord_error_invalid) if !identifier.blank? && identifier.match(/^\d*$/)
end
private

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2008 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,12 +16,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class QueryColumn
attr_accessor :name, :sortable
attr_accessor :name, :sortable, :default_order
include GLoc
def initialize(name, options={})
self.name = name
self.sortable = options[:sortable]
self.default_order = options[:default_order]
end
def caption
@@ -34,7 +35,7 @@ class QueryCustomFieldColumn < QueryColumn
def initialize(custom_field)
self.name = "cf_#{custom_field.id}".to_sym
self.sortable = false
self.sortable = custom_field.order_statement || false
@cf = custom_field
end
@@ -53,7 +54,7 @@ class Query < ActiveRecord::Base
serialize :filters
serialize :column_names
attr_protected :project, :user
attr_protected :project_id, :user_id
validates_presence_of :name, :on => :save
validates_length_of :name, :maximum => 255
@@ -82,29 +83,30 @@ class Query < ActiveRecord::Base
@@operators_by_filter_type = { :list => [ "=", "!" ],
:list_status => [ "o", "=", "!", "c", "*" ],
:list_optional => [ "=", "!", "!*", "*" ],
:list_one_or_more => [ "*", "=" ],
:list_subprojects => [ "*", "!*", "=" ],
:date => [ "<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-" ],
:date_past => [ ">t-", "<t-", "t-", "t", "w" ],
:string => [ "=", "~", "!", "!~" ],
:text => [ "~", "!~" ],
:integer => [ "=", ">=", "<=" ] }
:integer => [ "=", ">=", "<=", "!*", "*" ] }
cattr_reader :operators_by_filter_type
@@available_columns = [
QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"),
QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"),
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position"),
QueryColumn.new(:subject),
QueryColumn.new(:assigned_to, :sortable => "#{User.table_name}.lastname"),
QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on"),
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
QueryColumn.new(:subject, :sortable => "#{Issue.table_name}.subject"),
QueryColumn.new(:author),
QueryColumn.new(:assigned_to, :sortable => ["#{User.table_name}.lastname", "#{User.table_name}.firstname"]),
QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'),
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name"),
QueryColumn.new(:fixed_version),
QueryColumn.new(:fixed_version, :sortable => ["#{Version.table_name}.effective_date", "#{Version.table_name}.name"], :default_order => 'desc'),
QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"),
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),
QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"),
QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio"),
QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on"),
QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'),
]
cattr_reader :available_columns
@@ -114,11 +116,16 @@ class Query < ActiveRecord::Base
set_language_if_valid(User.current.language)
end
def after_initialize
# Store the fact that project is nil (used in #editable_by?)
@is_for_all = project.nil?
end
def validate
filters.each_key do |field|
errors.add label_for(field), :activerecord_error_blank unless
# filter requires one or more values
(values_for(field) and !values_for(field).first.empty?) or
(values_for(field) and !values_for(field).first.blank?) or
# filter doesn't require any value
["o", "c", "!*", "*", "t", "w"].include? operator_for(field)
end if filters
@@ -126,21 +133,27 @@ class Query < ActiveRecord::Base
def editable_by?(user)
return false unless user
return true if !is_public && self.user_id == user.id
is_public && user.allowed_to?(:manage_public_queries, project)
# Admin can edit them all and regular users can edit their private queries
return true if user.admin? || (!is_public && self.user_id == user.id)
# Members can not edit public queries that are for all project (only admin is allowed to)
is_public && !@is_for_all && user.allowed_to?(:manage_public_queries, project)
end
def available_filters
return @available_filters if @available_filters
trackers = project.nil? ? Tracker.find(:all, :order => 'position') : project.rolled_up_trackers
@available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
"tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
"priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect{|s| [s.name, s.id.to_s] } },
"tracker_id" => { :type => :list, :order => 2, :values => trackers.collect{|s| [s.name, s.id.to_s] } },
"priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI'], :order => 'position').collect{|s| [s.name, s.id.to_s] } },
"subject" => { :type => :text, :order => 8 },
"created_on" => { :type => :date_past, :order => 9 },
"updated_on" => { :type => :date_past, :order => 10 },
"start_date" => { :type => :date, :order => 11 },
"due_date" => { :type => :date, :order => 12 },
"done_ratio" => { :type => :integer, :order => 13 }}
"estimated_hours" => { :type => :integer, :order => 13 },
"done_ratio" => { :type => :integer, :order => 14 }}
user_values = []
user_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
@@ -152,31 +165,26 @@ class Query < ActiveRecord::Base
end
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty?
@available_filters["author_id"] = { :type => :list, :order => 5, :values => user_values } unless user_values.empty?
if User.current.logged?
@available_filters["watcher_id"] = { :type => :list, :order => 15, :values => [["<< #{l(:label_me)} >>", "me"]] }
end
if project
# project specific filters
@available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } }
@available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.sort.collect{|s| [s.name, s.id.to_s] } }
unless @project.active_children.empty?
@available_filters["subproject_id"] = { :type => :list_one_or_more, :order => 13, :values => @project.active_children.collect{|s| [s.name, s.id.to_s] } }
# project specific filters
unless @project.issue_categories.empty?
@available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } }
end
@project.all_custom_fields.select(&:is_filter?).each do |field|
case field.field_format
when "text"
options = { :type => :text, :order => 20 }
when "list"
options = { :type => :list_optional, :values => field.possible_values, :order => 20}
when "date"
options = { :type => :date, :order => 20 }
when "bool"
options = { :type => :list, :values => [[l(:general_text_yes), "1"], [l(:general_text_no), "0"]], :order => 20 }
else
options = { :type => :string, :order => 20 }
end
@available_filters["cf_#{field.id}"] = options.merge({ :name => field.name })
unless @project.versions.empty?
@available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.sort.collect{|s| [s.name, s.id.to_s] } }
end
# remove category filter if no category defined
@available_filters.delete "category_id" if @available_filters["category_id"][:values].empty?
unless @project.descendants.active.empty?
@available_filters["subproject_id"] = { :type => :list_subprojects, :order => 13, :values => @project.descendants.visible.collect{|s| [s.name, s.id.to_s] } }
end
add_custom_fields_filters(@project.all_issue_custom_fields)
else
# global filters for cross project issue list
add_custom_fields_filters(IssueCustomField.find(:all, :conditions => {:is_filter => true, :is_for_all => true}))
end
@available_filters
end
@@ -215,7 +223,7 @@ class Query < ActiveRecord::Base
end
def label_for(field)
label = @available_filters[field][:name] if @available_filters.has_key?(field)
label = available_filters[field][:name] if available_filters.has_key?(field)
label ||= field.gsub(/\_id$/, "")
end
@@ -223,7 +231,7 @@ class Query < ActiveRecord::Base
return @available_columns if @available_columns
@available_columns = Query.available_columns
@available_columns += (project ?
project.custom_fields :
project.all_issue_custom_fields :
IssueCustomField.find(:all, :conditions => {:is_for_all => true})
).collect {|cf| QueryCustomFieldColumn.new(cf) }
end
@@ -250,93 +258,156 @@ class Query < ActiveRecord::Base
def has_default_columns?
column_names.nil? || column_names.empty?
end
def project_statement
project_clauses = []
if project && !@project.descendants.active.empty?
ids = [project.id]
if has_filter?("subproject_id")
case operator_for("subproject_id")
when '='
# include the selected subprojects
ids += values_for("subproject_id").each(&:to_i)
when '!*'
# main project only
else
# all subprojects
ids += project.descendants.collect(&:id)
end
elsif Setting.display_subprojects_issues?
ids += project.descendants.collect(&:id)
end
project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',')
elsif project
project_clauses << "#{Project.table_name}.id = %d" % project.id
end
project_clauses << Project.allowed_to_condition(User.current, :view_issues)
project_clauses.join(' AND ')
end
def statement
# project/subprojects clause
clause = ''
if project && has_filter?("subproject_id")
subproject_ids = []
if operator_for("subproject_id") == "="
subproject_ids = values_for("subproject_id").each(&:to_i)
else
subproject_ids = project.active_children.collect{|p| p.id}
end
clause << "#{Issue.table_name}.project_id IN (%d,%s)" % [project.id, subproject_ids.join(",")] if project
elsif project
clause << "#{Issue.table_name}.project_id=%d" % project.id
else
clause << Project.visible_by(User.current)
end
# filters clauses
filters_clauses = []
filters.each_key do |field|
next if field == "subproject_id"
v = values_for(field).clone
next unless v and !v.empty?
sql = ''
operator = operator_for(field)
# "me" value subsitution
if %w(assigned_to_id author_id watcher_id).include?(field)
v.push(User.current.logged? ? User.current.id.to_s : "0") if v.delete("me")
end
sql = ''
if field =~ /^cf_(\d+)$/
# custom field
db_table = CustomValue.table_name
db_field = 'value'
sql << "#{Issue.table_name}.id IN (SELECT #{db_table}.customized_id FROM #{db_table} where #{db_table}.customized_type='Issue' AND #{db_table}.customized_id=#{Issue.table_name}.id AND #{db_table}.custom_field_id=#{$1} AND "
is_custom_filter = true
sql << "#{Issue.table_name}.id IN (SELECT #{Issue.table_name}.id FROM #{Issue.table_name} LEFT OUTER JOIN #{db_table} ON #{db_table}.customized_type='Issue' AND #{db_table}.customized_id=#{Issue.table_name}.id AND #{db_table}.custom_field_id=#{$1} WHERE "
sql << sql_for_field(field, operator, v, db_table, db_field, true) + ')'
elsif field == 'watcher_id'
db_table = Watcher.table_name
db_field = 'user_id'
sql << "#{Issue.table_name}.id #{ operator == '=' ? 'IN' : 'NOT IN' } (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND "
sql << sql_for_field(field, '=', v, db_table, db_field) + ')'
else
# regular field
db_table = Issue.table_name
db_field = field
sql << '('
sql << '(' + sql_for_field(field, operator, v, db_table, db_field) + ')'
end
# "me" value subsitution
if %w(assigned_to_id author_id).include?(field)
v.push(User.current.logged? ? User.current.id.to_s : "0") if v.delete("me")
end
case operator_for field
when "="
sql = sql + "#{db_table}.#{db_field} IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
when "!"
sql = sql + "#{db_table}.#{db_field} NOT IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
when "!*"
sql = sql + "#{db_table}.#{db_field} IS NULL"
when "*"
sql = sql + "#{db_table}.#{db_field} IS NOT NULL"
when ">="
sql = sql + "#{db_table}.#{db_field} >= #{v.first.to_i}"
when "<="
sql = sql + "#{db_table}.#{db_field} <= #{v.first.to_i}"
when "o"
sql = sql + "#{IssueStatus.table_name}.is_closed=#{connection.quoted_false}" if field == "status_id"
when "c"
sql = sql + "#{IssueStatus.table_name}.is_closed=#{connection.quoted_true}" if field == "status_id"
when ">t-"
sql = sql + "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date((Date.today - v.first.to_i).to_time), connection.quoted_date((Date.today + 1).to_time)]
when "<t-"
sql = sql + "#{db_table}.#{db_field} <= '%s'" % connection.quoted_date((Date.today - v.first.to_i).to_time)
when "t-"
sql = sql + "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date((Date.today - v.first.to_i).to_time), connection.quoted_date((Date.today - v.first.to_i + 1).to_time)]
when ">t+"
sql = sql + "#{db_table}.#{db_field} >= '%s'" % connection.quoted_date((Date.today + v.first.to_i).to_time)
when "<t+"
sql = sql + "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(Date.today.to_time), connection.quoted_date((Date.today + v.first.to_i + 1).to_time)]
when "t+"
sql = sql + "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date((Date.today + v.first.to_i).to_time), connection.quoted_date((Date.today + v.first.to_i + 1).to_time)]
when "t"
sql = sql + "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(Date.today.to_time), connection.quoted_date((Date.today+1).to_time)]
when "w"
sql = sql + "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(Time.now.at_beginning_of_week), connection.quoted_date(Time.now.next_week.yesterday)]
when "~"
sql = sql + "#{db_table}.#{db_field} LIKE '%#{connection.quote_string(v.first)}%'"
when "!~"
sql = sql + "#{db_table}.#{db_field} NOT LIKE '%#{connection.quote_string(v.first)}%'"
end
sql << ')'
filters_clauses << sql
end if filters and valid?
clause << ' AND ' unless clause.empty?
clause << filters_clauses.join(' AND ') unless filters_clauses.empty?
clause
(filters_clauses << project_statement).join(' AND ')
end
private
# Helper method to generate the WHERE sql for a +field+, +operator+ and a +value+
def sql_for_field(field, operator, value, db_table, db_field, is_custom_filter=false)
sql = ''
case operator
when "="
sql = "#{db_table}.#{db_field} IN (" + value.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
when "!"
sql = "(#{db_table}.#{db_field} IS NULL OR #{db_table}.#{db_field} NOT IN (" + value.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + "))"
when "!*"
sql = "#{db_table}.#{db_field} IS NULL"
sql << " OR #{db_table}.#{db_field} = ''" if is_custom_filter
when "*"
sql = "#{db_table}.#{db_field} IS NOT NULL"
sql << " AND #{db_table}.#{db_field} <> ''" if is_custom_filter
when ">="
sql = "#{db_table}.#{db_field} >= #{value.first.to_i}"
when "<="
sql = "#{db_table}.#{db_field} <= #{value.first.to_i}"
when "o"
sql = "#{IssueStatus.table_name}.is_closed=#{connection.quoted_false}" if field == "status_id"
when "c"
sql = "#{IssueStatus.table_name}.is_closed=#{connection.quoted_true}" if field == "status_id"
when ">t-"
sql = date_range_clause(db_table, db_field, - value.first.to_i, 0)
when "<t-"
sql = date_range_clause(db_table, db_field, nil, - value.first.to_i)
when "t-"
sql = date_range_clause(db_table, db_field, - value.first.to_i, - value.first.to_i)
when ">t+"
sql = date_range_clause(db_table, db_field, value.first.to_i, nil)
when "<t+"
sql = date_range_clause(db_table, db_field, 0, value.first.to_i)
when "t+"
sql = date_range_clause(db_table, db_field, value.first.to_i, value.first.to_i)
when "t"
sql = date_range_clause(db_table, db_field, 0, 0)
when "w"
from = l(:general_first_day_of_week) == '7' ?
# week starts on sunday
((Date.today.cwday == 7) ? Time.now.at_beginning_of_day : Time.now.at_beginning_of_week - 1.day) :
# week starts on monday (Rails default)
Time.now.at_beginning_of_week
sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)]
when "~"
sql = "#{db_table}.#{db_field} LIKE '%#{connection.quote_string(value.first)}%'"
when "!~"
sql = "#{db_table}.#{db_field} NOT LIKE '%#{connection.quote_string(value.first)}%'"
end
return sql
end
def add_custom_fields_filters(custom_fields)
@available_filters ||= {}
custom_fields.select(&:is_filter?).each do |field|
case field.field_format
when "text"
options = { :type => :text, :order => 20 }
when "list"
options = { :type => :list_optional, :values => field.possible_values, :order => 20}
when "date"
options = { :type => :date, :order => 20 }
when "bool"
options = { :type => :list, :values => [[l(:general_text_yes), "1"], [l(:general_text_no), "0"]], :order => 20 }
else
options = { :type => :string, :order => 20 }
end
@available_filters["cf_#{field.id}"] = options.merge({ :name => field.name })
end
end
# Returns a SQL clause for a date or datetime field.
def date_range_clause(table, field, from, to)
s = []
if from
s << ("#{table}.#{field} > '%s'" % [connection.quoted_date((Date.yesterday + from).to_time.end_of_day)])
end
if to
s << ("#{table}.#{field} <= '%s'" % [connection.quoted_date((Date.today + to).to_time.end_of_day)])
end
s.join(' AND ')
end
end

View File

@@ -1,3 +1,4 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
@@ -17,11 +18,29 @@
class Repository < ActiveRecord::Base
belongs_to :project
has_many :changesets, :dependent => :destroy, :order => "#{Changeset.table_name}.revision DESC"
has_many :changesets, :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC"
has_many :changes, :through => :changesets
# Raw SQL to delete changesets and changes in the database
# has_many :changesets, :dependent => :destroy is too slow for big repositories
before_destroy :clear_changesets
# Checks if the SCM is enabled when creating a repository
validate_on_create { |r| r.errors.add(:type, :activerecord_error_invalid) unless Setting.enabled_scm.include?(r.class.name.demodulize) }
# Removes leading and trailing whitespace
def url=(arg)
write_attribute(:url, arg ? arg.to_s.strip : nil)
end
# Removes leading and trailing whitespace
def root_url=(arg)
write_attribute(:root_url, arg ? arg.to_s.strip : nil)
end
def scm
@scm ||= self.scm_adapter.new url, root_url, login, password
init_cache if cache_path.blank? and respond_to?(:init_cache)
@scm ||= self.scm_adapter.new(url, root_url, login, password, cache_path)
update_attribute(:root_url, @scm.root_url) if root_url.blank?
@scm
end
@@ -38,20 +57,38 @@ class Repository < ActiveRecord::Base
scm.supports_annotate?
end
def entry(path=nil, identifier=nil)
scm.entry(path, identifier)
end
def entries(path=nil, identifier=nil)
scm.entries(path, identifier)
end
def diff(path, rev, rev_to, type)
scm.diff(path, rev, rev_to, type)
def properties(path, identifier=nil)
scm.properties(path, identifier)
end
def cat(path, identifier=nil)
scm.cat(path, identifier)
end
def diff(path, rev, rev_to)
scm.diff(path, rev, rev_to)
end
# Default behaviour: we search in cached changesets
def changesets_for_path(path)
def changesets_for_path(path, options={})
path = "/#{path}" unless path.starts_with?('/')
Change.find(:all, :include => :changeset,
:conditions => ["repository_id = ? AND path = ?", id, path],
:order => "committed_on DESC, #{Changeset.table_name}.revision DESC").collect(&:changeset)
Change.find(:all, :include => {:changeset => :user},
:conditions => ["repository_id = ? AND path = ?", id, path],
:order => "committed_on DESC, #{Changeset.table_name}.id DESC",
:limit => options[:limit]).collect(&:changeset)
end
# Returns a path relative to the url of the repository
def relative_path(path)
path
end
def latest_changeset
@@ -62,6 +99,45 @@ class Repository < ActiveRecord::Base
self.changesets.each(&:scan_comment_for_issue_ids)
end
# Returns an array of committers usernames and associated user_id
def committers
@committers ||= Changeset.connection.select_rows("SELECT DISTINCT committer, user_id FROM #{Changeset.table_name} WHERE repository_id = #{id}")
end
# Maps committers username to a user ids
def committer_ids=(h)
if h.is_a?(Hash)
committers.each do |committer, user_id|
new_user_id = h[committer]
if new_user_id && (new_user_id.to_i != user_id.to_i)
new_user_id = (new_user_id.to_i > 0 ? new_user_id.to_i : nil)
Changeset.update_all("user_id = #{ new_user_id.nil? ? 'NULL' : new_user_id }", ["repository_id = ? AND committer = ?", id, committer])
end
end
@committers = nil
true
else
false
end
end
# Returns the Redmine User corresponding to the given +committer+
# It will return nil if the committer is not yet mapped and if no User
# with the same username or email was found
def find_committer_user(committer)
if committer
c = changesets.find(:first, :conditions => {:committer => committer}, :include => :user)
if c && c.user
c.user
elsif committer.strip =~ /^([^<]+)(<(.*)>)?$/
username, email = $1.strip, $3
u = User.find_by_login(username)
u ||= User.find_by_mail(email) unless email.blank?
u
end
end
end
# fetch new changesets for all repositories
# can be called periodically by an external script
# eg. ruby script/runner "Repository.fetch_changesets"
@@ -88,4 +164,41 @@ class Repository < ActiveRecord::Base
rescue
nil
end
def remove_cache
scm.remove_cache if cache
end
def create_or_sync_cache
begin
scm.create_cache
rescue => e
# clean if problem in creation
scm.remove_cache
end
scm.synchronize
end
private
def repositories_cache_directory
unless @cache_directory
@cache_directory = Setting.repositories_cache_directory.gsub(/^([^#{File::SEPARATOR}].*)/, RAILS_ROOT + '/\1/')
Dir.mkdir(@cache_directory, File.umask(0077)) unless File.directory?(@cache_directory)
end
@cache_directory
end
def before_save
# Strips url and root_url
url.strip!
root_url.strip!
true
end
def clear_changesets
connection.delete("DELETE FROM changes WHERE changes.changeset_id IN (SELECT changesets.id FROM changesets WHERE changesets.repository_id = #{id})")
connection.delete("DELETE FROM changesets_issues WHERE changesets_issues.changeset_id IN (SELECT changesets.id FROM changesets WHERE changesets.repository_id = #{id})")
connection.delete("DELETE FROM changesets WHERE changesets.repository_id = #{id}")
end
end

View File

@@ -34,6 +34,11 @@ class Repository::Bazaar < Repository
if entries
entries.each do |e|
next if e.lastrev.revision.blank?
# Set the filesize unless browsing a specific revision
if identifier.nil? && e.is_file?
full_path = File.join(root_url, e.path)
e.size = File.stat(full_path).size if File.file?(full_path)
end
c = Change.find(:first,
:include => :changeset,
:conditions => ["#{Change.table_name}.revision = ? and #{Changeset.table_name}.repository_id = ?", e.lastrev.revision, id],
@@ -51,7 +56,7 @@ class Repository::Bazaar < Repository
scm_info = scm.info
if scm_info
# latest revision found in database
db_revision = latest_changeset ? latest_changeset.revision : 0
db_revision = latest_changeset ? latest_changeset.revision.to_i : 0
# latest revision in the repository
scm_revision = scm_info.lastrev.identifier.to_i
if db_revision < scm_revision

View File

@@ -29,13 +29,14 @@ class Repository::Cvs < Repository
'CVS'
end
def entry(path, identifier)
e = entries(path, identifier)
e ? e.first : nil
def entry(path=nil, identifier=nil)
rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
scm.entry(path, rev.nil? ? nil : rev.committed_on)
end
def entries(path=nil, identifier=nil)
entries=scm.entries(path, identifier)
rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
entries = scm.entries(path, rev.nil? ? nil : rev.committed_on)
if entries
entries.each() do |entry|
unless entry.lastrev.nil? || entry.lastrev.identifier
@@ -52,7 +53,12 @@ class Repository::Cvs < Repository
entries
end
def diff(path, rev, rev_to, type)
def cat(path, identifier=nil)
rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
scm.cat(path, rev.nil? ? nil : rev.committed_on)
end
def diff(path, rev, rev_to)
#convert rev to revision. CVS can't handle changesets here
diff=[]
changeset_from=changesets.find_by_revision(rev)
@@ -75,16 +81,14 @@ class Repository::Cvs < Repository
unless revision_to
revision_to=scm.get_previous_revision(revision_from)
end
diff=diff+scm.diff(change_from.path, revision_from, revision_to, type)
file_diff = scm.diff(change_from.path, revision_from, revision_to)
diff = diff + file_diff unless file_diff.nil?
end
end
return diff
end
def fetch_changesets
#not the preferred way with CVS. maybe we should introduce always a cron-job for this
last_commit = changesets.maximum(:committed_on)
# some nifty bits to introduce a commit-id with cvs
# natively cvs doesn't provide any kind of changesets, there is only a revision per file.
# we now take a guess using the author, the commitlog and the commit-date.
@@ -94,8 +98,10 @@ class Repository::Cvs < Repository
# we use a small delta here, to merge all changes belonging to _one_ changeset
time_delta=10.seconds
fetch_since = latest_changeset ? latest_changeset.committed_on : nil
transaction do
scm.revisions('', last_commit, nil, :with_paths => true) do |revision|
tmp_rev_num = 1
scm.revisions('', fetch_since, nil, :with_paths => true) do |revision|
# only add the change to the database, if it doen't exists. the cvs log
# is not exclusive at all.
unless changes.find_by_path_and_revision(scm.with_leading_slash(revision.paths[0][:path]), revision.paths[0][:revision])
@@ -103,22 +109,20 @@ class Repository::Cvs < Repository
cs = changesets.find(:first, :conditions=>{
:committed_on=>revision.time-time_delta..revision.time+time_delta,
:committer=>revision.author,
:comments=>revision.message
:comments=>Changeset.normalize_comments(revision.message)
})
# create a new changeset....
unless cs
# we use a negative changeset-number here (just for inserting)
unless cs
# we use a temporaray revision number here (just for inserting)
# later on, we calculate a continous positive number
next_rev = changesets.minimum(:revision)
next_rev = 0 if next_rev.nil? or next_rev > 0
next_rev = next_rev - 1
cs=Changeset.create(:repository => self,
:revision => next_rev,
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
latest = changesets.find(:first, :order => 'id DESC')
cs = Changeset.create(:repository => self,
:revision => "_#{tmp_rev_num}",
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
tmp_rev_num += 1
end
#convert CVS-File-States to internal Action-abbrevations
@@ -139,12 +143,19 @@ class Repository::Cvs < Repository
end
end
next_rev = [changesets.maximum(:revision) || 0, 0].max
changesets.find(:all, :conditions=>["revision < 0"], :order=>"committed_on ASC").each() do |changeset|
next_rev = next_rev + 1
changeset.revision = next_rev
changeset.save!
# Renumber new changesets in chronological order
changesets.find(:all, :order => 'committed_on ASC, id ASC', :conditions => "revision LIKE '_%'").each do |changeset|
changeset.update_attribute :revision, next_revision_number
end
end
end # transaction
end
private
# Returns the next revision number to assign to a CVS changeset
def next_revision_number
# Need to retrieve existing revision numbers to sort them as integers
@current_revision_number ||= (connection.select_values("SELECT revision FROM #{Changeset.table_name} WHERE repository_id = #{id} AND revision NOT LIKE '_%'").collect(&:to_i).max || 0)
@current_revision_number += 1
end
end

View File

@@ -28,8 +28,14 @@ class Repository::Darcs < Repository
'Darcs'
end
def entry(path=nil, identifier=nil)
patch = identifier.nil? ? nil : changesets.find_by_revision(identifier)
scm.entry(path, patch.nil? ? nil : patch.scmid)
end
def entries(path=nil, identifier=nil)
entries=scm.entries(path, identifier)
patch = identifier.nil? ? nil : changesets.find_by_revision(identifier)
entries = scm.entries(path, patch.nil? ? nil : patch.scmid)
if entries
entries.each do |entry|
# Search the DB for the entry's last change
@@ -45,20 +51,26 @@ class Repository::Darcs < Repository
entries
end
def diff(path, rev, rev_to, type)
def cat(path, identifier=nil)
patch = identifier.nil? ? nil : changesets.find_by_revision(identifier.to_s)
scm.cat(path, patch.nil? ? nil : patch.scmid)
end
def diff(path, rev, rev_to)
patch_from = changesets.find_by_revision(rev)
return nil if patch_from.nil?
patch_to = changesets.find_by_revision(rev_to) if rev_to
if path.blank?
path = patch_from.changes.collect{|change| change.path}.join(' ')
end
scm.diff(path, patch_from.scmid, patch_to.scmid, type)
patch_from ? scm.diff(path, patch_from.scmid, patch_to ? patch_to.scmid : nil) : nil
end
def fetch_changesets
scm_info = scm.info
if scm_info
db_last_id = latest_changeset ? latest_changeset.scmid : nil
next_rev = latest_changeset ? latest_changeset.revision + 1 : 1
next_rev = latest_changeset ? latest_changeset.revision.to_i + 1 : 1
# latest revision in the repository
scm_revision = scm_info.lastrev.scmid
unless changesets.find_by_scmid(scm_revision)
@@ -71,9 +83,7 @@ class Repository::Darcs < Repository
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
next if changeset.new_record?
revision.paths.each do |change|
Change.create(:changeset => changeset,
:action => change[:action],

View File

@@ -1,6 +1,9 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
# FileSystem adapter
# File written by Paul Rivier, at Demotera.
#
# 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
@@ -15,20 +18,26 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class VersionSweeper < ActionController::Caching::Sweeper
observe Version
require 'redmine/scm/adapters/filesystem_adapter'
def after_save(version)
expire_cache_for(version)
class Repository::Filesystem < Repository
attr_protected :root_url
validates_presence_of :url
def scm_adapter
Redmine::Scm::Adapters::FilesystemAdapter
end
def after_destroy(version)
expire_cache_for(version)
def self.scm_name
'Filesystem'
end
private
def expire_cache_for(version)
# calendar and gantt fragments of the project
expire_fragment(Regexp.new("projects/(calendar|gantt)/#{version.project_id}\\."))
def entries(path=nil, identifier=nil)
scm.entries(path, identifier)
end
def fetch_changesets
nil
end
end

View File

@@ -0,0 +1,84 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Copyright (C) 2007 Patrick Aljord patcito@ŋmail.com
# 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.
require 'redmine/scm/adapters/git_adapter'
class Repository::Git < Repository
attr_protected :root_url
validates_presence_of :url
before_destroy :remove_cache
def init_cache
return unless dir = repositories_cache_directory
# we need to use a cache only if repository isn't local and dir exists
if url[/^(rsync|https?|git|ssh):\/\//]
update_attribute(:cache_path, dir + project.identifier)
update_attribute(:cache, true)
end
end
def scm_adapter
Redmine::Scm::Adapters::GitAdapter
end
def self.scm_name
'Git'
end
def changesets_for_path(path, options={})
Change.find(:all, :include => {:changeset => :user},
:conditions => ["repository_id = ? AND path = ?", id, path],
:order => "committed_on DESC, #{Changeset.table_name}.revision DESC",
:limit => options[:limit]).collect(&:changeset)
end
def fetch_changesets
create_or_sync_cache if cache
scm_info = scm.info
if scm_info
# latest revision found in database
db_revision = latest_changeset ? latest_changeset.revision : nil
# latest revision in the repository
scm_revision = scm_info.lastrev.scmid
unless changesets.find_by_scmid(scm_revision)
scm.revisions('', db_revision, nil, :reverse => true) do |revision|
if changesets.find_by_scmid(revision.scmid.to_s).nil?
transaction do
changeset = Changeset.create!(:repository => self,
:revision => revision.identifier,
:scmid => revision.scmid,
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
revision.paths.each do |change|
Change.create!(:changeset => changeset,
:action => change[:action],
:path => change[:path],
:from_path => change[:from_path],
:from_revision => change[:from_revision])
end
end
end
end
end
end
end
end

View File

@@ -21,6 +21,15 @@ class Repository::Mercurial < Repository
attr_protected :root_url
validates_presence_of :url
def init_cache
return unless dir = repositories_cache_directory
# we need to use a cache only if repository isn't local and dir exists
if url[/^(|https?|ssh):\/\//]
update_attribute(:cache_path, dir + project.identifier)
update_attribute(:cache, true)
end
end
def scm_adapter
Redmine::Scm::Adapters::MercurialAdapter
end
@@ -34,6 +43,11 @@ class Repository::Mercurial < Repository
if entries
entries.each do |entry|
next unless entry.is_file?
# Set the filesize unless browsing a specific revision
if identifier.nil?
full_path = File.join(root_url, entry.path)
entry.size = File.stat(full_path).size if File.file?(full_path)
end
# Search the DB for the entry's last change
change = changes.find(:first, :conditions => ["path = ?", scm.with_leading_slash(entry.path)], :order => "#{Changeset.table_name}.committed_on DESC")
if change
@@ -48,32 +62,42 @@ class Repository::Mercurial < Repository
end
def fetch_changesets
create_or_sync_cache if cache
scm_info = scm.info
if scm_info
# latest revision found in database
db_revision = latest_changeset ? latest_changeset.revision : nil
db_revision = latest_changeset ? latest_changeset.revision.to_i : -1
# latest revision in the repository
scm_revision = scm_info.lastrev.identifier.to_i
unless changesets.find_by_revision(scm_revision)
revisions = scm.revisions('', db_revision, nil)
transaction do
revisions.reverse_each do |revision|
changeset = Changeset.create(:repository => self,
:revision => revision.identifier,
:scmid => revision.scmid,
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
revision.paths.each do |change|
Change.create(:changeset => changeset,
:action => change[:action],
:path => change[:path],
:from_path => change[:from_path],
:from_revision => change[:from_revision])
latest_revision = scm_info.lastrev
return if latest_revision.nil?
scm_revision = latest_revision.identifier.to_i
if db_revision < scm_revision
logger.debug "Fetching changesets for repository #{url}" if logger && logger.debug?
identifier_from = db_revision + 1
while (identifier_from <= scm_revision)
# loads changesets by batches of 100
identifier_to = [identifier_from + 99, scm_revision].min
revisions = scm.revisions('', identifier_from, identifier_to, :with_paths => true)
transaction do
revisions.each do |revision|
changeset = Changeset.create(:repository => self,
:revision => revision.identifier,
:scmid => revision.scmid,
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
revision.paths.each do |change|
Change.create(:changeset => changeset,
:action => change[:action],
:path => change[:path],
:from_path => change[:from_path],
:from_revision => change[:from_revision])
end
end
end
end unless revisions.nil?
identifier_from = identifier_to + 1
end
end
end

View File

@@ -22,6 +22,16 @@ class Repository::Subversion < Repository
validates_presence_of :url
validates_format_of :url, :with => /^(http|https|svn|svn\+ssh|file):\/\/.+/i
before_destroy :remove_cache
def init_cache
return unless dir = repositories_cache_directory
# we need to use a cache only if repository isn't local and dir exists
if cache and url[/^(svn|https?|svn\+ssh):\/\//]
update_attribute(:cache_path, dir + project.identifier)
end
end
def scm_adapter
Redmine::Scm::Adapters::SubversionAdapter
end
@@ -30,16 +40,23 @@ class Repository::Subversion < Repository
'Subversion'
end
def changesets_for_path(path)
revisions = scm.revisions(path)
revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC") : []
def changesets_for_path(path, options={})
revisions = scm.revisions(path, nil, nil, :limit => options[:limit])
revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC", :include => :user) : []
end
# Returns a path relative to the url of the repository
def relative_path(path)
path.gsub(Regexp.new("^\/?#{Regexp.escape(relative_url)}"), '')
end
def fetch_changesets
create_or_sync_cache if cache
scm_info = scm.info
if scm_info
# latest revision found in database
db_revision = latest_changeset ? latest_changeset.revision : 0
db_revision = latest_changeset ? latest_changeset.revision.to_i : 0
# latest revision in the repository
scm_revision = scm_info.lastrev.identifier.to_i
if db_revision < scm_revision
@@ -71,4 +88,14 @@ class Repository::Subversion < Repository
end
end
end
private
# Returns the relative url of the repository
# Eg: root_url = file:///var/svn/foo
# url = file:///var/svn/foo/bar
# => returns /bar
def relative_url
@relative_url ||= url.gsub(Regexp.new("^#{Regexp.escape(root_url)}"), '')
end
end

View File

@@ -19,13 +19,29 @@ class Role < ActiveRecord::Base
# Built-in roles
BUILTIN_NON_MEMBER = 1
BUILTIN_ANONYMOUS = 2
named_scope :builtin, lambda { |*args|
compare = 'not' if args.first == true
{ :conditions => "#{compare} builtin = 0" }
}
before_destroy :check_deletable
has_many :workflows, :dependent => :delete_all
has_many :workflows, :dependent => :delete_all do
def copy(role)
raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role)
raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record?
clear
connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
" SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" +
" FROM #{Workflow.table_name}" +
" WHERE role_id = #{role.id}"
end
end
has_many :members
acts_as_list
serialize :permissions
serialize :permissions, Array
attr_protected :builtin
validates_presence_of :name
@@ -38,9 +54,32 @@ class Role < ActiveRecord::Base
end
def permissions=(perms)
perms = perms.collect {|p| p.to_sym unless p.blank? }.compact if perms
perms = perms.collect {|p| p.to_sym unless p.blank? }.compact.uniq if perms
write_attribute(:permissions, perms)
end
def add_permission!(*perms)
self.permissions = [] unless permissions.is_a?(Array)
permissions_will_change!
perms.each do |p|
p = p.to_sym
permissions << p unless permissions.include?(p)
end
save!
end
def remove_permission!(*perms)
return unless permissions.is_a?(Array)
permissions_will_change!
perms.each { |p| permissions.delete(p.to_sym) }
save!
end
# Returns true if the role has the given permission
def has_permission?(perm)
!permissions.nil? && permissions.include?(perm.to_sym)
end
def <=>(role)
position <=> role.position

View File

@@ -33,12 +33,51 @@ class Setting < ActiveRecord::Base
'%H:%M',
'%I:%M %p'
]
ENCODINGS = %w(US-ASCII
windows-1250
windows-1251
windows-1252
windows-1253
windows-1254
windows-1255
windows-1256
windows-1257
windows-1258
windows-31j
ISO-2022-JP
ISO-2022-KR
ISO-8859-1
ISO-8859-2
ISO-8859-3
ISO-8859-4
ISO-8859-5
ISO-8859-6
ISO-8859-7
ISO-8859-8
ISO-8859-9
ISO-8859-13
ISO-8859-15
KOI8-R
UTF-8
UTF-16
UTF-16BE
UTF-16LE
EUC-JP
Shift_JIS
GB18030
GBK
ISCII91
EUC-KR
Big5
Big5-HKSCS
TIS-620)
cattr_accessor :available_settings
@@available_settings = YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml"))
Redmine::Plugin.registered_plugins.each do |id, plugin|
Redmine::Plugin.all.each do |plugin|
next unless plugin.settings
@@available_settings["plugin_#{id}"] = {'default' => plugin.settings[:default], 'serialized' => true}
@@available_settings["plugin_#{plugin.id}"] = {'default' => plugin.settings[:default], 'serialized' => true}
end
validates_uniqueness_of :name
@@ -53,12 +92,13 @@ class Setting < ActiveRecord::Base
v = read_attribute(:value)
# Unserialize serialized settings
v = YAML::load(v) if @@available_settings[name]['serialized'] && v.is_a?(String)
v = v.to_sym if @@available_settings[name]['format'] == 'symbol' && !v.blank?
v
end
def value=(v)
v = v.to_yaml if v && @@available_settings[name]['serialized']
write_attribute(:value, v)
write_attribute(:value, v.to_s)
end
# Returns the value of the setting named name
@@ -95,6 +135,15 @@ class Setting < ActiveRecord::Base
class_eval src, __FILE__, __LINE__
end
# Helper that returns an array based on per_page_options setting
def self.per_page_options_array
per_page_options.split(%r{[\s,]}).collect(&:to_i).select {|n| n > 0}.sort
end
def self.openid?
Object.const_defined?(:OpenID) && self['openid'].to_s == '1'
end
# Checks if settings have changed since the values were read
# and clears the cache hash if it's the case
# Called once per request
@@ -116,4 +165,14 @@ private
setting = find_by_name(name)
setting ||= new(:name => name, :value => @@available_settings[name]['default']) if @@available_settings.has_key? name
end
protected
def validate
if self.name.to_s == "repositories_cache_directory" and not File.directory?(self.value.to_s)
logger.error("Le repertoire #{self.value.to_s} n'existe pas")
errors.add("Le repertoire #{self.value.to_s} n'existe pas")
end
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Copyright (C) 2006-2008 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,11 +24,25 @@ class TimeEntry < ActiveRecord::Base
belongs_to :activity, :class_name => 'Enumeration', :foreign_key => :activity_id
attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek
acts_as_customizable
acts_as_event :title => Proc.new {|o| "#{o.user}: #{lwr(:label_f_hour, o.hours)} (#{(o.issue || o.project).event_title})"},
:url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project}},
:author => :user,
:description => :comments
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
validates_numericality_of :hours, :allow_nil => true
validates_length_of :comments, :maximum => 255
validates_numericality_of :hours, :allow_nil => true, :message => :activerecord_error_invalid
validates_length_of :comments, :maximum => 255, :allow_nil => true
def after_initialize
if new_record? && self.activity.nil?
if default_activity = Enumeration.default('ACTI')
self.activity_id = default_activity.id
end
end
end
def before_validation
self.project = issue.project if issue && project.nil?
end
@@ -39,6 +53,10 @@ class TimeEntry < ActiveRecord::Base
errors.add :issue_id, :activerecord_error_invalid if (issue_id && !issue) || (issue && project!=issue.project)
end
def hours=(h)
write_attribute :hours, (h.is_a?(String) ? (h.to_hours || h) : h)
end
# tyear, tmonth, tweek assigned where setting spent_on attributes
# these attributes make time aggregations easier
def spent_on=(date)
@@ -46,5 +64,16 @@ class TimeEntry < ActiveRecord::Base
self.tyear = spent_on ? spent_on.year : nil
self.tmonth = spent_on ? spent_on.month : nil
self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil
end
end
# Returns true if the time entry can be edited by usr, otherwise false
def editable_by?(usr)
(usr == user && usr.allowed_to?(:edit_own_time_entries, project)) || usr.allowed_to?(:edit_time_entries, project)
end
def self.visible_by(usr)
with_scope(:find => { :conditions => Project.allowed_to_condition(usr, :view_time_entries) }) do
yield
end
end
end

View File

@@ -0,0 +1,23 @@
# redMine - project management software
# Copyright (C) 2008 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.
class TimeEntryCustomField < CustomField
def type_name
:label_spent_time
end
end

View File

@@ -18,7 +18,19 @@
class Tracker < ActiveRecord::Base
before_destroy :check_integrity
has_many :issues
has_many :workflows, :dependent => :delete_all
has_many :workflows, :dependent => :delete_all do
def copy(tracker)
raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
clear
connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
" SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
" FROM #{Workflow.table_name}" +
" WHERE tracker_id = #{tracker.id}"
end
end
has_and_belongs_to_many :projects
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
acts_as_list

View File

@@ -18,37 +18,52 @@
require "digest/sha1"
class User < ActiveRecord::Base
# Account statuses
STATUS_ANONYMOUS = 0
STATUS_ACTIVE = 1
STATUS_REGISTERED = 2
STATUS_LOCKED = 3
USER_FORMATS = {
:firstname_lastname => '#{firstname} #{lastname}',
:firstname => '#{firstname}',
:lastname_firstname => '#{lastname} #{firstname}',
:lastname_coma_firstname => '#{lastname}, #{firstname}',
:username => '#{login}'
}
has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name", :dependent => :delete_all
has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
has_many :members, :dependent => :delete_all
has_many :projects, :through => :memberships
has_many :custom_values, :dependent => :delete_all, :as => :customized
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
has_many :changesets, :dependent => :nullify
has_one :preference, :dependent => :destroy, :class_name => 'UserPreference'
has_one :rss_token, :dependent => :destroy, :class_name => 'Token', :conditions => "action='feeds'"
belongs_to :auth_source
# Active non-anonymous users scope
named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}"
acts_as_customizable
attr_accessor :password, :password_confirmation
attr_accessor :last_before_login_on
# Prevents unauthorized assignments
attr_protected :login, :admin, :password, :password_confirmation, :hashed_password
validates_presence_of :login, :firstname, :lastname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_uniqueness_of :login, :mail
validates_uniqueness_of :login, :if => Proc.new { |user| !user.login.blank? }
validates_uniqueness_of :mail, :if => Proc.new { |user| !user.mail.blank? }, :case_sensitive => false
# Login must contain lettres, numbers, underscores only
validates_format_of :login, :with => /^[a-z0-9_\-@\.]*$/i
validates_length_of :login, :maximum => 30
validates_format_of :firstname, :lastname, :with => /^[\w\s\'\-]*$/i
validates_format_of :firstname, :lastname, :with => /^[\w\s\'\-\.]*$/i
validates_length_of :firstname, :lastname, :maximum => 30
validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_nil => true
validates_length_of :mail, :maximum => 60, :allow_nil => true
validates_length_of :password, :minimum => 4, :allow_nil => true
validates_confirmation_of :password, :allow_nil => true
validates_associated :custom_values, :on => :update
def before_create
self.mail_notification = false
@@ -59,21 +74,25 @@ class User < ActiveRecord::Base
# update hashed_password if password was set
self.hashed_password = User.hash_password(self.password) if self.password
end
def self.active
with_scope :find => { :conditions => [ "status = ?", STATUS_ACTIVE ] } do
yield
end
def reload(*args)
@name = nil
super
end
def self.find_active(*args)
active do
find(*args)
def identity_url=(url)
begin
self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
rescue InvalidOpenId
# Invlaid url, don't save
end
self.read_attribute(:identity_url)
end
# Returns the user that matches provided login and password, or nil
def self.try_to_login(login, password)
# Make sure no one can sign in with an empty password
return nil if password.to_s.empty?
user = find(:first, :conditions => ["login=?", login])
if user
# user is already in local database
@@ -89,25 +108,28 @@ class User < ActiveRecord::Base
# user is not yet registered, try to authenticate with available sources
attrs = AuthSource.authenticate(login, password)
if attrs
onthefly = new(*attrs)
onthefly.login = login
onthefly.language = Setting.default_language
if onthefly.save
user = find(:first, :conditions => ["login=?", login])
logger.info("User '#{user.login}' created on the fly.") if logger
user = new(*attrs)
user.login = login
user.language = Setting.default_language
if user.save
user.reload
logger.info("User '#{user.login}' created from the LDAP") if logger
end
end
end
user.update_attribute(:last_login_on, Time.now) if user
user.update_attribute(:last_login_on, Time.now) if user && !user.new_record?
user
rescue => text
raise text
rescue => text
raise text
end
# Return user's full name for display
def name
"#{firstname} #{lastname}"
def name(formatter = nil)
if formatter
eval('"' + (USER_FORMATS[formatter] || USER_FORMATS[:firstname_lastname]) + '"')
else
@name ||= eval('"' + (USER_FORMATS[Setting.user_format] || USER_FORMATS[:firstname_lastname]) + '"')
end
end
def active?
@@ -125,13 +147,29 @@ class User < ActiveRecord::Base
def check_password?(clear_password)
User.hash_password(clear_password) == self.hashed_password
end
# Generate and set a random password. Useful for automated user creation
# Based on Token#generate_token_value
#
def random_password
chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
password = ''
40.times { |i| password << chars[rand(chars.size-1)] }
self.password = password
self.password_confirmation = password
self
end
def pref
self.preference ||= UserPreference.new(:user => self)
end
def time_zone
self.pref.time_zone.nil? ? nil : TimeZone[self.pref.time_zone]
@time_zone ||= (self.pref.time_zone.blank? ? nil : ActiveSupport::TimeZone[self.pref.time_zone])
end
def wants_comments_in_reverse_order?
self.pref[:comments_sorting] == 'desc'
end
# Return user's RSS key (a 40 chars long string), used to access feeds
@@ -161,9 +199,15 @@ class User < ActiveRecord::Base
token = Token.find_by_action_and_value('autologin', key)
token && (token.created_on > Setting.autologin.to_i.day.ago) && token.user.active? ? token.user : nil
end
# Makes find_by_mail case-insensitive
def self.find_by_mail(mail)
find(:first, :conditions => ["LOWER(mail) = ?", mail.to_s.downcase])
end
# Sort users by their display names
def <=>(user)
user.nil? ? -1 : (lastname == user.lastname ? firstname <=> user.firstname : lastname <=> user.lastname)
self.to_s.downcase <=> user.to_s.downcase
end
def to_s
@@ -174,6 +218,10 @@ class User < ActiveRecord::Base
true
end
def anonymous?
!logged?
end
# Return user's role for project
def role_for_project(project)
# No role on archived projects
@@ -200,17 +248,26 @@ class User < ActiveRecord::Base
# action can be:
# * a parameter-like Hash (eg. :controller => 'projects', :action => 'edit')
# * a permission Symbol (eg. :edit_project)
def allowed_to?(action, project)
# No action allowed on archived projects
return false unless project.active?
# No action allowed on disabled modules
return false unless project.allows_to?(action)
# Admin users are authorized for anything else
return true if admin?
role = role_for_project(project)
return false unless role
role.allowed_to?(action) && (project.is_public? || role.member?)
def allowed_to?(action, project, options={})
if project
# No action allowed on archived projects
return false unless project.active?
# No action allowed on disabled modules
return false unless project.allows_to?(action)
# Admin users are authorized for anything else
return true if admin?
role = role_for_project(project)
return false unless role
role.allowed_to?(action) && (project.is_public? || role.member?)
elsif options[:global]
# authorize if user has at least one role that has this permission
roles = memberships.collect {|m| m.role}.uniq
roles.detect {|r| r.allowed_to?(action)} || (self.logged? ? Role.non_member.allowed_to?(action) : Role.anonymous.allowed_to?(action))
else
false
end
end
def self.current=(user)
@@ -222,13 +279,12 @@ class User < ActiveRecord::Base
end
def self.anonymous
return @anonymous_user if @anonymous_user
anonymous_user = AnonymousUser.find(:first)
if anonymous_user.nil?
anonymous_user = AnonymousUser.create(:lastname => 'Anonymous', :firstname => '', :mail => '', :login => '', :status => 0)
raise 'Unable to create the anonymous user.' if anonymous_user.new_record?
end
@anonymous_user = anonymous_user
anonymous_user
end
private
@@ -245,6 +301,10 @@ class AnonymousUser < User
errors.add_to_base 'An anonymous user already exists.' if AnonymousUser.find(:first)
end
def available_custom_fields
[]
end
# Overrides a few properties
def logged?; false end
def admin; false end

View File

@@ -42,8 +42,13 @@ class UserPreference < ActiveRecord::Base
if attribute_present? attr_name
super
else
self.others ||= {}
self.others.store attr_name, value
h = read_attribute(:others).dup || {}
h.update(attr_name => value)
write_attribute(:others, h)
value
end
end
def comments_sorting; self[:comments_sorting] end
def comments_sorting=(order); self[:comments_sorting]=order end
end

View File

@@ -19,12 +19,13 @@ class Version < ActiveRecord::Base
before_destroy :check_integrity
belongs_to :project
has_many :fixed_issues, :class_name => 'Issue', :foreign_key => 'fixed_version_id'
has_many :attachments, :as => :container, :dependent => :destroy
acts_as_attachable :view_permission => :view_files,
:delete_permission => :manage_files
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:project_id]
validates_length_of :name, :maximum => 30
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :activerecord_error_not_a_date, :allow_nil => true
validates_length_of :name, :maximum => 60
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => 'activerecord_error_not_a_date', :allow_nil => true
def start_date
effective_date
@@ -34,26 +35,36 @@ class Version < ActiveRecord::Base
effective_date
end
# Returns the total estimated time for this version
def estimated_hours
@estimated_hours ||= fixed_issues.sum(:estimated_hours).to_f
end
# Returns the total reported time for this version
def spent_hours
@spent_hours ||= TimeEntry.sum(:hours, :include => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f
end
# Returns true if the version is completed: due date reached and no open issues
def completed?
effective_date && (effective_date <= Date.today) && (open_issues_count == 0)
end
def completed_pourcent
if fixed_issues.count == 0
if issues_count == 0
0
elsif open_issues_count == 0
100
else
(closed_issues_count * 100 + Issue.sum('done_ratio', :include => 'status', :conditions => ["fixed_version_id = ? AND is_closed = ?", id, false]).to_f) / fixed_issues.count
issues_progress(false) + issues_progress(true)
end
end
def closed_pourcent
if fixed_issues.count == 0
if issues_count == 0
0
else
closed_issues_count * 100.0 / fixed_issues.count
issues_progress(false)
end
end
@@ -62,6 +73,11 @@ class Version < ActiveRecord::Base
effective_date && (effective_date < Date.today) && (open_issues_count > 0)
end
# Returns assigned issues count
def issues_count
@issue_count ||= fixed_issues.count
end
def open_issues_count
@open_issues_count ||= Issue.count(:all, :conditions => ["fixed_version_id = ? AND is_closed = ?", self.id, false], :include => :status)
end
@@ -79,11 +95,11 @@ class Version < ActiveRecord::Base
def to_s; name end
# Versions are sorted by effective_date
# Versions are sorted by effective_date and name
# Those with no effective_date are at the end, sorted by name
def <=>(version)
if self.effective_date
version.effective_date ? (self.effective_date <=> version.effective_date) : -1
version.effective_date ? (self.effective_date == version.effective_date ? self.name <=> version.name : self.effective_date <=> version.effective_date) : -1
else
version.effective_date ? 1 : (self.name <=> version.name)
end
@@ -93,4 +109,35 @@ private
def check_integrity
raise "Can't delete version" if self.fixed_issues.find(:first)
end
# Returns the average estimated time of assigned issues
# or 1 if no issue has an estimated time
# Used to weigth unestimated issues in progress calculation
def estimated_average
if @estimated_average.nil?
average = fixed_issues.average(:estimated_hours).to_f
if average == 0
average = 1
end
@estimated_average = average
end
@estimated_average
end
# Returns the total progress of open or closed issues
def issues_progress(open)
@issues_progress ||= {}
@issues_progress[open] ||= begin
progress = 0
if issues_count > 0
ratio = open ? 'done_ratio' : 100
done = fixed_issues.sum("COALESCE(estimated_hours, #{estimated_average}) * #{ratio}",
:include => :status,
:conditions => ["is_closed = ?", !open]).to_f
progress = done / (estimated_average * issues_count)
end
progress
end
end
end

View File

@@ -19,5 +19,12 @@ class Watcher < ActiveRecord::Base
belongs_to :watchable, :polymorphic => true
belongs_to :user
validates_presence_of :user
validates_uniqueness_of :user_id, :scope => [:watchable_type, :watchable_id]
protected
def validate
errors.add :user_id, :activerecord_error_invalid unless user.nil? || user.active?
end
end

View File

@@ -17,7 +17,7 @@
class Wiki < ActiveRecord::Base
belongs_to :project
has_many :pages, :class_name => 'WikiPage', :dependent => :destroy
has_many :pages, :class_name => 'WikiPage', :dependent => :destroy, :order => 'title'
has_many :redirects, :class_name => 'WikiRedirect', :dependent => :delete_all
validates_presence_of :start_page
@@ -43,6 +43,25 @@ class Wiki < ActiveRecord::Base
page
end
# Finds a page by title
# The given string can be of one of the forms: "title" or "project:title"
# Examples:
# Wiki.find_page("bar", project => foo)
# Wiki.find_page("foo:bar")
def self.find_page(title, options = {})
project = options[:project]
if title.to_s =~ %r{^([^\:]+)\:(.*)$}
project_identifier, title = $1, $2
project = Project.find_by_identifier(project_identifier) || Project.find_by_name(project_identifier)
end
if project && project.wiki
page = project.wiki.find_page(title)
if page && page.content
page
end
end
end
# turn a string into a valid page title
def self.titleize(title)
# replace spaces with _ and remove unwanted caracters

View File

@@ -32,8 +32,21 @@ class WikiContent < ActiveRecord::Base
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"},
:description => :comments,
:datetime => :updated_on,
:type => 'wiki-page',
:url => Proc.new {|o| {:controller => 'wiki', :id => o.page.wiki.project_id, :page => o.page.title, :version => o.version}}
acts_as_activity_provider :type => 'wiki_edits',
:timestamp => "#{WikiContent.versioned_table_name}.updated_on",
:author_key => "#{WikiContent.versioned_table_name}.author_id",
:permission => :view_wiki_edits,
:find_options => {:select => "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
"#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title, " +
"#{WikiContent.versioned_table_name}.page_id, #{WikiContent.versioned_table_name}.author_id, " +
"#{WikiContent.versioned_table_name}.id",
:joins => "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
"LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " +
"LEFT JOIN #{Project.table_name} ON #{Project.table_name}.id = #{Wiki.table_name}.project_id"}
def text=(plain)
case Setting.wiki_compression
when 'gzip'
@@ -60,6 +73,18 @@ class WikiContent < ActiveRecord::Base
data
end
end
def project
page.project
end
# Returns the previous version or nil
def previous
@previous ||= WikiContent::Version.find(:first,
:order => 'version DESC',
:include => :author,
:conditions => ["wiki_content_id = ? AND version < ?", wiki_content_id, version])
end
end
end

View File

@@ -16,19 +16,21 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'diff'
require 'enumerator'
class WikiPage < ActiveRecord::Base
belongs_to :wiki
has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id', :dependent => :destroy
has_many :attachments, :as => :container, :dependent => :destroy
acts_as_attachable :delete_permission => :delete_wiki_pages_attachments
acts_as_tree :order => 'title'
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"},
:description => :text,
:datetime => :created_on,
:url => Proc.new {|o| {:controller => 'wiki', :id => o.wiki.project_id, :page => o.title}}
acts_as_searchable :columns => ['title', 'text'],
:include => [:wiki, :content],
:include => [{:wiki => :project}, :content],
:project_key => "#{Wiki.table_name}.project_id"
attr_accessor :redirect_existing_links
@@ -87,6 +89,12 @@ class WikiPage < ActiveRecord::Base
(content_to && content_from) ? WikiDiff.new(content_to, content_from) : nil
end
def annotate(version=nil)
version = version ? version.to_i : self.content.version
c = content.versions.find_by_version(version)
c ? WikiAnnotate.new(c) : nil
end
def self.pretty_title(str)
(str && str.is_a?(String)) ? str.tr('_', ' ') : str
end
@@ -98,6 +106,33 @@ class WikiPage < ActiveRecord::Base
def text
content.text if content
end
# Returns true if usr is allowed to edit the page, otherwise false
def editable_by?(usr)
!protected? || usr.allowed_to?(:protect_wiki_pages, wiki.project)
end
def attachments_deletable?(usr=User.current)
editable_by?(usr) && super(usr)
end
def parent_title
@parent_title || (self.parent && self.parent.pretty_title)
end
def parent_title=(t)
@parent_title = t
parent_page = t.blank? ? nil : self.wiki.find_page(t)
self.parent = parent_page
end
protected
def validate
errors.add(:parent_title, :activerecord_error_invalid) if !@parent_title.blank? && parent.nil?
errors.add(:parent_title, :activerecord_error_circular_dependency) if parent && (parent == self || parent.ancestors.include?(self))
errors.add(:parent_title, :activerecord_error_not_same_project) if parent && (parent.wiki_id != wiki_id)
end
end
class WikiDiff
@@ -113,3 +148,41 @@ class WikiDiff
@diff = words_from.diff @words
end
end
class WikiAnnotate
attr_reader :lines, :content
def initialize(content)
@content = content
current = content
current_lines = current.text.split(/\r?\n/)
@lines = current_lines.collect {|t| [nil, nil, t]}
positions = []
current_lines.size.times {|i| positions << i}
while (current.previous)
d = current.previous.text.split(/\r?\n/).diff(current.text.split(/\r?\n/)).diffs.flatten
d.each_slice(3) do |s|
sign, line = s[0], s[1]
if sign == '+' && positions[line] && positions[line] != -1
if @lines[positions[line]][0].nil?
@lines[positions[line]][0] = current.version
@lines[positions[line]][1] = current.author
end
end
end
d.each_slice(3) do |s|
sign, line = s[0], s[1]
if sign == '-'
positions.insert(line, -1)
else
positions[line] = nil
end
end
positions.compact!
# Stop if every line is annotated
break unless @lines.detect { |line| line[0].nil? }
current = current.previous
end
@lines.each { |line| line[0] ||= current.version }
end
end

View File

@@ -21,4 +21,23 @@ class Workflow < ActiveRecord::Base
belongs_to :new_status, :class_name => 'IssueStatus', :foreign_key => 'new_status_id'
validates_presence_of :role, :old_status, :new_status
# Returns workflow transitions count by tracker and role
def self.count_by_tracker_and_role
counts = connection.select_all("SELECT role_id, tracker_id, count(id) AS c FROM #{Workflow.table_name} GROUP BY role_id, tracker_id")
roles = Role.find(:all, :order => 'builtin, position')
trackers = Tracker.find(:all, :order => 'position')
result = []
trackers.each do |tracker|
t = []
roles.each do |role|
row = counts.detect {|c| c['role_id'] == role.id.to_s && c['tracker_id'] == tracker.id.to_s}
t << [role, (row.nil? ? 0 : row['c'].to_i)]
end
result << [tracker, t]
end
result
end
end

View File

@@ -1,14 +1,21 @@
<div id="login-form">
<% form_tag({:action=> "login"}) do %>
<%= back_url_hidden_field_tag %>
<table>
<tr>
<td align="right"><label for="login"><%=l(:field_login)%>:</label></td>
<td align="left"><p><%= text_field_tag 'login', nil, :size => 40 %></p></td>
<td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
<td align="left"><p><%= text_field_tag 'username', nil, :size => 40 %></p></td>
</tr>
<tr>
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
<td align="left"><%= password_field_tag 'password', nil, :size => 40 %></td>
</tr>
<% if Setting.openid? %>
<tr>
<td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td>
<td align="left"><%= text_field_tag "openid_url" %></td>
</tr>
<% end %>
<tr>
<td></td>
<td align="left">
@@ -28,6 +35,6 @@
</td>
</tr>
</table>
<%= javascript_tag "Form.Element.focus('login');" %>
<%= javascript_tag "Form.Element.focus('username');" %>
<% end %>
</div>

View File

@@ -1,12 +1,13 @@
<h2><%=l(:label_register)%></h2>
<h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
<% form_tag({:action => 'register'}, :class => "tabular") do %>
<%= error_messages_for 'user' %>
<div class="box">
<!--[form:user]-->
<% if @user.auth_source_id.nil? %>
<p><label for="user_login"><%=l(:field_login)%> <span class="required">*</span></label>
<%= text_field 'user', 'login', :size => 25 %></p>
<%= text_field 'user', 'login', :size => 25 %></p>
<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label>
<%= password_field_tag 'password', nil, :size => 25 %><br />
@@ -14,6 +15,7 @@
<p><label for="password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
<%= password_field_tag 'password_confirmation', nil, :size => 25 %></p>
<% end %>
<p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label>
<%= text_field 'user', 'firstname' %></p>
@@ -27,18 +29,16 @@
<p><label for="user_language"><%=l(:field_language)%></label>
<%= select("user", "language", lang_options_for_select) %></p>
<% for @custom_value in @custom_values %>
<p><%= custom_field_tag_with_label @custom_value %></p>
<% if Setting.openid? %>
<p><label for="user_identity_url"><%=l(:field_identity_url)%></label>
<%= text_field 'user', 'identity_url' %></p>
<% end %>
<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
<p><%= custom_field_tag_with_label :user, value %></p>
<% end %>
<!--[eoform:user]-->
</div>
<%= submit_tag l(:button_submit) %>
<% end %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'calendar/calendar' %>
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<% end %>

View File

@@ -1,28 +1,68 @@
<h2><%=h @user.name %></h2>
<div class="contextual">
<%= link_to(l(:button_edit), {:controller => 'users', :action => 'edit', :id => @user}, :class => 'icon icon-edit') if User.current.admin? %>
</div>
<p>
<%= mail_to @user.mail unless @user.pref.hide_mail %>
<h2><%= avatar @user %> <%=h @user.name %></h2>
<div class="splitcontentleft">
<ul>
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>
<% for custom_value in @custom_values %>
<% if !custom_value.value.empty? %>
<% unless @user.pref.hide_mail %>
<li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li>
<% end %>
<% for custom_value in @custom_values %>
<% if !custom_value.value.empty? %>
<li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
<% end %>
<% end %>
<% end %>
<% end %>
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>
<% unless @user.last_login_on.nil? %>
<li><%=l(:field_last_login_on)%>: <%= format_date(@user.last_login_on) %></li>
<% end %>
</ul>
</p>
<% unless @memberships.empty? %>
<h3><%=l(:label_project_plural)%></h3>
<ul>
<% for membership in @memberships %>
<li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %>
(<%= membership.role.name %>, <%= format_date(membership.created_on) %>)</li>
<li><%= link_to(h(membership.project.name), :controller => 'projects', :action => 'show', :id => membership.project) %>
(<%=h membership.role.name %>, <%= format_date(membership.created_on) %>)</li>
<% end %>
</ul>
<% end %>
</div>
<div class="splitcontentright">
<% unless @events_by_day.empty? %>
<h3><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :user_id => @user, :from => @events_by_day.keys.first %></h3>
<h3><%=l(:label_activity)%></h3>
<p>
<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %>
</p>
</p>
<div id="activity">
<% @events_by_day.keys.sort.reverse.each do |day| %>
<h4><%= format_activity_day(day) %></h4>
<dl>
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
<dt class="<%= e.event_type %>">
<span class="time"><%= format_time(e.event_datetime, false) %></span>
<%= content_tag('span', h(e.project), :class => 'project') %>
<%= link_to format_activity_title(e.event_title), e.event_url %></dt>
<dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd>
<% end -%>
</dl>
<% end -%>
</div>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => nil, :user_id => @user, :key => User.current.rss_key} %>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :user_id => @user, :format => :atom, :key => User.current.rss_key) %>
<% end %>
<% end %>
</div>
<% html_title @user.name %>

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