Compare commits

...

204 Commits

Author SHA1 Message Date
Felix Schäfer dfb77852cf Split up Travis tests to avoid hitting the hard Travis timeout 2013-03-19 23:40:33 +01:00
Holger Just 93de0ba668 Bump version to 3.8.0 2013-03-19 22:36:48 +01:00
Holger Just fdc9c245ac Update changelog for 3.8.0 2013-03-19 22:36:06 +01:00
Holger Just d7b23acea0 Don't test Darcs on Travis. It breaks there :( 2013-03-19 22:24:22 +01:00
Holger Just f9babbbbc3 Use RubyGems 1.8.25 on Travis as 2.0.x fails with Rails 2.3 2013-03-19 22:23:56 +01:00
Toshi MARUYAMA 90a05668a0 fix db migrate #1164 2013-03-19 21:30:48 +01:00
Holger Just e4b814e167 Bump Rails to 2.3.18 #1252 2013-03-19 21:30:48 +01:00
Felix Schäfer 304155122d Use SSL communications to rubygems.org 2013-03-19 21:24:55 +01:00
Felix Schäfer 1e2a029099 Explicitely set js calendar until complete switch to jQuery #1121 2013-03-19 21:19:33 +01:00
Holger Just 68e6d171b1 Manually apply basic before_filters in case of routing error #1248 2013-03-15 15:15:10 +01:00
Gregor Schmidt d6e5c9e1fa Fixing HTML in groups index view 2013-03-12 16:57:59 +01:00
Holger Just 63976e6522 Bump the version to v3.7.0 2013-02-13 16:03:00 +01:00
Holger Just 31ad2ef6c3 Update changelog for 3.7.0 release 2013-02-13 16:02:54 +01:00
Holger Just 595e60fb9c Fix stupidity in last filter of liquid #1235 2013-02-13 15:46:08 +01:00
Holger Just 8b357a118d Remove monkey patch which is already included in Rails 2.3.17 #1233 2013-02-13 15:18:17 +01:00
Holger Just 6d3dc6e619 Bump json gem to a safe version for CVE-2013-0269, CVE-2013-0333 2013-02-13 15:18:17 +01:00
Holger Just 0b567641bc Don't set YAML on serialized fields #1233 2013-02-13 15:18:17 +01:00
Holger Just fd306095c6 Bump Rails to 2.3.17 #1233 2013-02-13 15:18:17 +01:00
Holger Just 430b6bb442 Improve on broken MySQL handling of login tokens #1234 2013-02-13 15:18:09 +01:00
Felix Schäfer 3f9007b909 Merge branch 'release-v3.6.0' into stable 2013-01-29 22:37:23 +01:00
Felix Schäfer 6bef9c26ab Bump version to v3.6.0 2013-01-29 22:33:42 +01:00
Felix Schäfer 6744e23ed2 Update Changelog for v3.6.0 2013-01-29 21:46:27 +01:00
Felix Schäfer 065542c7d1 Remove Rails patches which are already included in Rails 2.3.16 #1219 2013-01-29 21:44:15 +01:00
Felix Schäfer dc66e8f831 Bump Rails version to 2.3.16 #1219 2013-01-29 21:24:25 +01:00
Felix Schäfer 6e30b3d3fc Get notified about other watched things than issues #1216
When I select "only for things I watch or am involved in" as my Email
notifications setting, I want to get notified about everyhing I watch,
not just issues. The previous setting would only notify me about issues
I'm involved in, now I will additionally be notified about everything I watch.
2013-01-25 15:30:32 +01:00
Holger Just 2854524ba9 Merge branch 'release-v3.5.1' into stable 2013-01-16 23:26:41 +01:00
Holger Just eb41df17d2 Bump version to v3.5.1 2013-01-16 23:26:13 +01:00
Holger Just 7f7a06706f Update Changelog for v3.5.1 2013-01-16 23:25:47 +01:00
Holger Just db3087b318 Fix for CVE-2013-0155 in Rails 2013-01-16 23:24:15 +01:00
Holger Just d8536ced55 Merge branch 'release-v3.5.0' into stable 2013-01-09 14:06:00 +01:00
Holger Just 908391d54e Bump version to v3.5.0 2013-01-09 14:05:02 +01:00
Holger Just 93b2a1daf9 Update Changelog for v3.5.0 2013-01-09 14:04:56 +01:00
Holger Just c69a005353 Remove Rails patches which are already included in Rails 2.3.15 #1200 2013-01-09 13:56:52 +01:00
Holger Just bf4ed9b37b Bump Rails version to 2.3.15 #1200 2013-01-09 13:56:43 +01:00
Holger Just 90a94d75c3 Merge branch 'release-v3.4.0' into stable 2013-01-06 23:47:42 +01:00
Holger Just 2243c8dfd0 Bump version to v3.4.0 2013-01-06 23:43:44 +01:00
Holger Just cee98d306b Update Changelog for v3.4.0 2013-01-06 23:43:04 +01:00
Holger Just 0dac4ecb53 Ensure UTF-8 source encoding 2013-01-06 23:42:41 +01:00
Holger Just c65779bbc1 Update Copyright for 2013
We programmers have a nice new years tradition: We revisit all of
our projects and add 1 to a small number near a "(c)".

-- Volker Dusch
https://twitter.com/__edorian/status/153801913442373633
2013-01-06 23:42:27 +01:00
Holger Just 0261b16b3e Update locales 2013-01-06 23:20:08 +01:00
Holger Just c80591fe57 Adapt tests for escaping of ' introduced in 8e417fd 2013-01-06 21:17:19 +01:00
Felix Schäfer cdad6f752a Links to new/not existing wikipages are italic #1197 2013-01-06 21:13:34 +01:00
Felix Schäfer 335da86b55 Correctly save the subprojects setting when editing queries #1188 2013-01-06 20:32:53 +01:00
Holger Just 8e417fd5c4 Fix XSS vulnerabilities in Rails (CVE-2012-3464, CVE-2012-3465) #1113 #1114 2013-01-06 20:32:53 +01:00
Holger Just 07e54eda9e SQL Injection Vulnerability in Ruby on Rails (CVE-2012-5664) #1195 2013-01-06 20:32:53 +01:00
Holger Just a93a3af895 Consider HEAD a readonly method in Redmine.pm #1134 2013-01-06 20:32:53 +01:00
Holger Just 5156fbbfc4 Make the WikiContentJournal class available during migration #1194 2013-01-06 20:32:53 +01:00
Felix Schäfer 4d4efa482e Use capybara < 2 as capybara 2 drops ruby 1.8 support 2013-01-02 16:36:49 +01:00
Holger Just c734c6506d Install Darcs 2.3 on Travis CI #1142
Our tests break on Darcs >=2.5 as Darcs changed the repository
format and the command API.
2013-01-02 16:16:39 +01:00
Toshi MARUYAMA e7ef06a926 add travis build status to README.rdoc 2012-12-09 18:24:13 +01:00
Felix Schäfer 0dfa793abc Add a CONTRIBUTING guide. #1192 2012-12-09 18:10:11 +01:00
C-Moreira ce5524ba4d Add localized translation for Time entry menu. #1118 2012-11-22 11:54:11 +01:00
Holger Just 003fc93b15 Make the commented configuration.yml.example more approachable #1144 2012-09-14 22:27:49 +02:00
Holger Just da4641442f Update package list before installing packages on Travis 2012-09-12 21:39:09 +02:00
Web Siduction 0e1a622a6a wiki-text monospaced 11px 2012-08-20 20:18:17 +02:00
Holger Just d63d2d2e81 Display sidebar queries outside of a project #1090 2012-08-20 18:48:28 +02:00
Holger Just 7a4b664577 Set default category_id instead of the object #1087
Rails 2.3 still has issues with synchronizing the association_id
and association attributes of an object. That means, if you set the
association with an object first and then just set the id afterwards, the object wins and the setting of the id gets lost.

This is not an issue in Rails >= 3.1 anymore.
2012-08-20 18:26:32 +02:00
Felix Schäfer d24d4ce6b6 Stick with a working version of mocha
mocha 0.12.2 is known not to work with test/unit:
https://github.com/freerange/mocha/issues/94

Pinning the version of mocha until this is resolved
2012-08-06 10:34:41 +02:00
jplang a2f8557f23 Correctly copy advanced workflow settings #904
Original commit message:
Fixed: Workflow copy does not copy advanced workflow settings

git-svn-id: svn://rubyforge.org/var/svn/redmine/trunk@6148 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-08-06 08:20:58 +02:00
Holger Just 080c5b63ca Merge branch 'release-v3.3.0' into stable 2012-07-15 20:26:01 +02:00
Holger Just 22204d588d Merge branch 'master' into stable 2012-07-15 18:46:48 +02:00
Holger Just 19dd488298 Bump version to 3.3.0 2012-07-15 18:45:49 +02:00
Holger Just 12cedb1e91 Update Changelog for v3.3.0 2012-07-15 18:44:41 +02:00
Holger Just 27f24a78db Add copyright statement 2012-07-15 18:43:00 +02:00
Andrew Smith 4838c4ede8 Replace the progress bars with a copied jQuery version. Fixes #1056 2012-07-15 18:28:23 +02:00
Holger Just f2e4c71b27 Add gravatar no-op library.
This helps to not break on plugins having require "gravatar"
in their init.rb. This statement is not needed anymore in any
supported version of ChiliProject (or Redmine for that matter) and
should thus be removed from all plugins.
2012-07-15 17:48:43 +02:00
Andrew Smith ff94716791 Replace the JS calendar with a jQueryUI version. 2012-07-15 15:25:13 +02:00
Felix Schäfer cb9ac281d9 Add date_field and date_field_tag form helpers #817 2012-07-15 15:19:02 +02:00
Felix Schäfer a642a1fdc4 Bump net-ldap #1078 2012-07-14 21:16:16 +02:00
Holger Just f89c003847 Make list style for ul and ol elements more specific. #1075 2012-07-13 23:27:53 +02:00
Andrew Smith d6eb87508c Update jQuery/UI to 1.7.2/1.8.21. Fixes #1076 2012-07-11 14:41:56 +02:00
Romano Licker 1e96ac9e06 [#935] Setting improperly set up for default values
having a fixed call order resolves a problem where
'value=' was called before 'name=' resulting in no
serialization
2012-07-11 12:56:58 +02:00
Holger Just 9fde11f950 Load rake tasks from plugins in chiliproject_plugins #1074 2012-07-10 14:39:32 +02:00
Felix Schäfer d41c7f1e8c Fix migrating from Redmine 1.4 #1067
Contributed by Steffen Schüssler
2012-07-09 20:41:17 +02:00
Andrew Smith e3dc444b9c Losslessly recompress all the image files. Fixes #1070 2012-07-09 18:28:14 +02:00
Felix Schäfer 37385642fa Don't show the search field when it's not needed #979
Contributed by Harald Klimach
2012-07-09 18:11:04 +02:00
Felix Schäfer 12b2d3c182 Show the register link everywhere it's needed #979
Contributed by Harald Klimach
2012-07-09 18:06:32 +02:00
Andrew Smith 37c762b997 Force the hover colour so that even rows highlight. Fixes #1063 2012-07-06 20:06:03 +02:00
Holger Just 17793c87e3 Format date in user's prefered format by default 2012-07-02 21:10:55 +02:00
Holger Just eea550e639 Fix the Strainer patch to enforce a filter array
Up until now, the patch used to be a no-op. While the filters class
attribute was set correctly, the methods using it were not actually
overridden as they are only included above the existing methods in
the module chain.

This resulted in an arbitrary load order of filters on Ruby 1.8. As
such, our overridden standard filters might not have actually
overridden anything.

Still, the patch can be completely removed once we either require
Ruby 1.9 (as we have ordered ahshes by default then) or once
https://github.com/Shopify/liquid/pull/87 was merged and released
upstream.
2012-07-02 21:10:55 +02:00
Holger Just 760df0ae35 Define today variable for liquid #1055 2012-07-02 21:10:55 +02:00
Andrew Smith a4fbb15f6c Include a minimal Modernizr JS build. Fixes #1054 2012-07-02 20:28:00 +02:00
Andrew Smith 6fa46e5136 Set the users language on the HTML tag. Fixes #1051 2012-06-28 10:03:08 +02:00
Andrew Smith cf83e274d7 Change to an HTML5 doctype #1018 2012-06-26 22:19:37 +02:00
Jan Vlnas 29af3ec964 Correct engine tests to work on Ruby 1.9 #952 #944 2012-06-23 21:23:50 +02:00
Holger Just 6932070752 Require bundler 1.0.14 to use the rbx platform in Gemfile 2012-06-22 17:34:28 +02:00
Holger Just cd4efd2e0d Set $KCODE to UTF-8 on Ruby 1.8 to mimic Rails 3 behavior 2012-06-22 17:31:51 +02:00
Felix Schäfer 2f21522458 Enable project-specific css #1017 2012-06-21 10:28:44 +02:00
Holger Just d3d6a93a45 Fix failing tests for Ruby 1.9 #1046 2012-06-20 18:00:34 +02:00
Holger Just e4386f61da Add "me" to user custom fields filters #1046
Adapted from
28f9605fe2
by Jean-Philippe Lang
2012-06-20 16:07:09 +02:00
Holger Just 59e2a2fdde Merge branch 'release-v3.2.2' into stable 2012-06-13 11:04:48 +02:00
Holger Just 5c7a3a53c2 Bump version to 3.2.2 2012-06-13 10:26:48 +02:00
Holger Just 4d9060964f Update changelog for v3.2.2 2012-06-13 10:25:18 +02:00
Holger Just 16e266e7e5 Fix SQL injection via nested hashes in conditions. CVE-2012-2695 #1037 2012-06-13 10:12:10 +02:00
Holger Just d629209364 Fix SQL injection via nested hashes in conditions (CVE-2012-2694) #1036 2012-06-13 10:10:03 +02:00
Holger Just 221a2e73ce Merge branch 'release-v3.2.1' into stable 2012-06-10 20:38:18 +02:00
Holger Just c9d141061d Bump version to v3.2.1 2012-06-10 20:36:34 +02:00
Holger Just 8e41daf92a Update changelog for v3.2.1 2012-06-10 20:36:34 +02:00
Felix Schäfer caceb58947 Restore the default class for gravatars #1034 2012-06-10 20:34:23 +02:00
Felix Schäfer 5ef63ec4bb Fix option parsing for gravatars #1034
In addition to that:
* the default size was 50px in the old lib, this has been restored
* some tests to test the default and option parsing
2012-06-10 19:54:46 +02:00
Holger Just e6e057d10d Merge branch 'release-v3.2.0' into stable 2012-06-09 19:07:06 +02:00
Felix Schäfer f8ec89b999 Test stable- and release- branches on Travis too 2012-06-09 19:02:18 +02:00
Holger Just bd132c5607 Bump version to 3.2.0 2012-06-09 17:59:06 +02:00
Holger Just bcb02a4634 Update Changelog for v3.2.0 2012-06-09 17:56:21 +02:00
Holger Just d11e074748 Fix trailing whitespace 2012-06-09 17:52:37 +02:00
Felix Schäfer 1f91054244 Switch from vendored gravatar lib to gravatarify gem #1033 2012-06-09 17:39:22 +02:00
Felix Schäfer 32e1cc2dee Don't test transaction-based features on SQLite
SQLite doesn't support nested transactions, thus we can't test
transaction-based features inside a test wrapped in a transaction.
2012-06-09 17:35:49 +02:00
Felix Schäfer 3997220a45 Add IRC notifications to the Travis config 2012-06-09 12:02:54 +02:00
Felix Schäfer 69656422a1 Test ChiliProject on rubinius on Travis
rubinius 1.9-mode won't load liquid currently:
https://github.com/Shopify/liquid/pull/107
2012-06-07 14:30:45 +02:00
Felix Schäfer d6ad07ee97 Refine some apt-get commands in Travis
* Remove the update, the Travis VMs should be up-to-date enough for us
* Remove the quiets so we can see errors if needed
2012-06-05 16:00:09 +02:00
Justin Geibel 1722e96bb0 Change default branch behaviour for git repos #749
If git repository HEAD points to a branch, use that as the default branch.
Otherwise fall back to previous method.
2012-06-05 15:33:04 +02:00
Andrew Smith 4956e9ca93 Limit the size of the projects dropdown menu. #1016 2012-06-05 15:15:48 +02:00
Andrew Smith 7c1b17509f Clear the document selection when selecting multiple rows. 2012-06-05 15:05:35 +02:00
Andrew Smith c8be011a93 Correct major logic issues when selecting multiple rows.
The rows were being incorrectly selected (because the class name had a
missing '.').

jQuery items can't be directly compared to each other so we need to get
the HTML element to test if they are the same.
2012-06-05 15:05:35 +02:00
Holger Just 8ab42473d9 [#1025] Fix Rails vulnerability (CVE-2012-2660) 2012-06-01 20:56:09 +02:00
Felix Schäfer a43c06ff77 Don't depend on DB ordering in journal_test
And add all fixtures needed to run the test on its own.
2012-05-25 13:37:11 +02:00
Andrew Smith f983b451ad Reformat CSS to use the coding standard. #947
Formatting was done mostly by hand using the following as a guide
http://gnuvince.wordpress.com/2007/02/26/reformatting-a-css-file-with-vim/

" Replace all sequences of white spaces with one space
:%s/[ \t\n]\+/ /g

" Go to the end of the command, then forward one character and insert
" a newline
]/lr^M

" Make sure there is a semi-colon before each closing bracket
:%s/\([^; ]\) *}/\1;}/g

" Add a newline after every semi-colon
:%s/;/;^M/g

" Add a newline after every opening brace and make put one space
" between it and the preceeding text
:%s/\([^ ]*\) *{/\1 {^M/g

" Add two newlines after every closing brace
:%s/}/}^M^M/g

" Remove 'trailing' spaces in front of the semi-colons
:%s/ *;/;/g

" Make sure there is only one space after a colon
:%s/: */: /g

" Make the text before the colon lowercase
:%s/\(.\{-}\):/\L\1:/g

" Remove all trailing spaces at the beginning of lines
:%s/^ \+/g

" Indent the whole file
gg=G

" Split each rule onto its own line (This also matched some
" property/value combos so needed confirming
:%s/\([a-z0-9]\+\), \+/\1,^M/gc
2012-05-21 13:45:39 +02:00
Andrew Smith 61c00779d0 Set the X-CSRF-Token header for AJAX requests with jQuery. #950 2012-05-20 20:41:02 +02:00
Dereckson 375045a82b Improving French translation #967 2012-05-20 20:35:33 +02:00
Felix Schäfer 2e18840f12 Disable autocomplete on registragion form #844 2012-05-20 10:30:34 +02:00
Felix Schäfer 20448c7efb Load all required fixtures on issue unit test #863
Contributed by Toshi MARUYAMA
2012-05-20 10:18:00 +02:00
Andrew Smith 9cd14ca152 Fix a typo when calculating the menu X position. #1007 2012-05-19 11:52:51 +02:00
Felix Schäfer 87f68e58ad Recalculate last reply of thread on message deletion #968 2012-05-19 11:38:40 +02:00
Andrew Smith 43723385c6 Handle the '(Un)Check all' link. #994 2012-05-19 10:37:17 +02:00
Felix Schäfer 93abdcf487 Fix comments missing in wiki add/update mails #986 2012-05-19 00:00:16 +02:00
Felix Schäfer 1d3cdf1fa9 Correct email sending on attachment to document #1008 2012-05-18 22:45:52 +02:00
Felix Schäfer 3e84c4817b Updated czech localization by Radek Tříška 2012-05-18 22:02:40 +02:00
Felix Schäfer 7930e8fa66 Also test stable and unstable branches on TravisCI 2012-05-14 14:18:52 +02:00
Felix Schäfer d4f0542e74 Don't rely on ordering in news_test
The tests would fail because not all storage backends have a default
ordering
2012-05-14 12:39:17 +02:00
tmaruyama 6a26543887 scm: mercurial: fix unit adapter annotate test fails on Windows Mercurial 1.8.4+29-e597ef52a7c2.
git-svn-id: svn://rubyforge.org/var/svn/redmine/trunk@6042 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-05-14 10:54:17 +02:00
Felix Schäfer 03dfae0529 ChiliProject on Travis <3 <3 <3 2012-05-14 10:45:50 +02:00
Eric Davis 75bb38df08 Require WikiContent directly so WikiContentJournal is loaded before it's patched.
Error: uninitialized constant MergeWikiVersionsWithJournals::WikiContentJournal
2012-04-16 09:25:35 -07:00
Jean-Philippe Lang 16947dc016 [984] Allow to change locked and sticky status and the board of messages 2012-04-14 15:02:07 +02:00
unknown e7d96825b2 [#988] Improving Swedish translation 2012-04-13 16:07:42 +02:00
Holger Just 2bcd8787d3 Remove cookie cleaning method as it is not required anymore 2012-04-13 13:44:16 +02:00
jwalkerbg 6a4559e6af [#983] Translated several keys to Bulgarian language. 2012-04-13 09:45:08 +02:00
Gabriel Mazetto 859a9cb9d2 Some translation fixes and more missing translations for pt-BR 2012-04-12 08:20:02 +02:00
Holger Just 33260d885d Ensure array order for repeatable success of tests 2012-04-11 23:15:33 +02:00
Holger Just 277815ec96 Don't render cusom queries in the sidebar anymore
The queries are now part of the issues menu and are thus redundant in the
sidebar.
2012-04-11 20:50:42 +02:00
Holger Just 01c386b3c6 [#970] Cap too long menu entries with an ellipsis 2012-04-11 20:48:30 +02:00
Holger Just a6071c75ec [#975] Add test for editing version start date 2012-04-11 00:07:42 +02:00
Spenser Jones e6c79ddef4 [#975] Validate and enable editing of Version start date 2012-04-11 00:07:32 +02:00
Holger Just c3fc106355 [#974] Force the issue new link in the sidebar to the new action 2012-04-10 23:35:12 +02:00
Holger Just b169f02377 REMEMBER: ALWAYS RUN THE TESTS! 2012-04-09 15:46:06 +02:00
Holger Just 1f4baaa27b Take the password salt into account when checking for admin account change 2012-04-09 15:43:51 +02:00
Felix Schäfer 8f06b77ccb correct 'edit own issue notes' permission #966 2012-04-07 15:59:51 +02:00
Holger Just b8a29c288b Add the project_id to board URLs in the menu to generate valid URLs 2012-04-05 20:49:47 +02:00
Holger Just aca166271b Update German translation 2012-04-05 16:18:32 +02:00
Holger Just d61ad01308 Merge branch 'release-v3.1.0' into stable 2012-04-04 14:26:46 +02:00
Holger Just f681ed8c13 Bump version to 3.1.0 2012-04-04 14:21:43 +02:00
Holger Just eb62f4f7ec Update changelog for v3.1.0 2012-04-04 14:21:42 +02:00
Holger Just 4aed677908 Fix trailing whitespace 2012-04-04 14:21:42 +02:00
Holger Just 6f055664f1 Add copyright statement 2012-04-04 14:21:42 +02:00
Holger Just bb4340eb6d Update locales with new keys 2012-04-04 14:21:42 +02:00
Jean-Philippe Lang 3183aa55ed Set user_id as a protected attribute (#922). 2012-04-04 14:21:41 +02:00
Jean-Philippe Lang 275163ead2 Prevent mass-assignment vulnerability when adding/updating a wiki (#922). 2012-04-04 14:21:41 +02:00
Jean-Philippe Lang fc5dfd5813 Prevent mass-assignment vulnerability when adding/updating a version (#922). 2012-04-04 14:21:41 +02:00
Jean-Philippe Lang a3f6b30e99 Prevent mass-assignment vulnerability when adding/updating a time entry (#922). 2012-04-04 14:21:41 +02:00
Jean-Philippe Lang 5de377c5ee Use safe_attributes= just like in #create. (#922) 2012-04-04 14:21:41 +02:00
Jean-Philippe Lang 305df19ab7 Prevent mass-assignment vulnerability when adding/updating a news (#922). 2012-04-04 14:21:40 +02:00
Jean-Philippe Lang c3ca5813d5 Prevent mass-assignment vulnerability when adding/updating a forum message (#922). 2012-04-04 14:21:40 +02:00
Jean-Philippe Lang 384890c5ad Prevent mass-assignment vulnerability when adding a project member (#922). 2012-04-04 14:21:40 +02:00
Jean-Philippe Lang e77cb6133d Prevent mass-assignment vulnerability when adding/updating an issue category (#922). 2012-04-04 14:21:39 +02:00
Jean-Philippe Lang 7505cb2ff0 Prevent mass-assignment vulnerability when adding/updating a document (#922). 2012-04-04 14:21:39 +02:00
Jean-Philippe Lang 2eeb4b13a6 Prevent mass-assignment vulnerability when adding a news comment (#922). 2012-04-04 14:21:39 +02:00
Felix Schäfer 0a7c6e6774 Correct handling of @Rational#to_s@ on ruby 1.9 #887
Contributed by Martin S
2012-04-04 09:36:58 +02:00
Felix Schäfer 6f064d3856 Activity: use default filter only on first request #861 2012-03-28 20:31:20 +02:00
Robert Mitwicki c6af5c7982 Correct error message on group name #873 2012-03-28 08:56:06 +02:00
Jean-Philippe Lang 20a79124f7 Set format for activeresource client in reposman.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7955 e93f8b46-1217-0410-a6f0-8f06a7374b81
2012-03-27 12:51:43 +02:00
Felix Schäfer e6ec8ab30c Remove length limits on some user fields #928 2012-03-25 09:40:56 +02:00
Felix Schäfer dafe09ee32 Adapt test to new jQuery context menu
jQuery context menu introduced in 1b7ddb3cd7
2012-03-23 12:34:53 +01:00
Andrew Smith 7b3280e5ad Replace tables that were using the 'width' attribute with inline styles (should be replaced with an ID/class). 2012-03-23 11:22:58 +01:00
Andrew Smith fd250726ce Remove some inline styling and some depreciated table cell attributes and replace them with proper class names. 2012-03-23 11:22:57 +01:00
Andrew Smith 1cfd20e7e7 Fix missing cells and incorrect close order 2012-03-23 11:22:57 +01:00
Andrew Smith b15e6d8305 Fix duplicated 'back_url' IDs
Various hidden input fields are used to hold a URL to send the user back
to the correct page after submitting a form, however, they all use the
same ID which isn't allowed in HTML. Passing in 'id' as nil stops the
'hidden_field_tag' from adding an ID attribute to the tag.
2012-03-23 11:22:57 +01:00
Andrew Smith 2a70e2704f HTML corrections 2012-03-23 11:22:57 +01:00
Andrew Smith 23a857bf75 Remove hard-coded div on issue page 2012-03-21 21:07:21 +01:00
Andrew Smith a510f0a85f Updates the plugin so that it can support multiple instances.
Multiple instances need to be applied to different elements in the DOM
otherwise multiple menus will be called for each click/right click.

e.g.

jQuery(document).ContextMenu(url);

would work for any form on a page. Using this would mean that multiple
instances couldn't be used though

jQuery('#content form').eq(0).ContextMenu(url);
jQuery('#content form').eq(3).ContextMenu(url);

Using the above 2 menus will be created for the first and 4th forms on
the page. Any of forms won't response to menu clicks.

jQuery(docuemnt).ContextMenu(url);
jQuery('#content form').eq(0).ContextMenu(url);

With the above any form on the page will respond to menu clicks but the
first form will send 2 requests for the context menu.
2012-03-21 21:07:21 +01:00
Andrew Smith 2b640f76ec Simple wrapper for backwards compatibility 2012-03-21 21:06:58 +01:00
Andrew Smith 1b7ddb3cd7 jQuery version of the issue context menu 2012-03-21 21:06:58 +01:00
Andrew Smith 27160b76f5 The jQuery ajaxStart/Stop functions are being called at the wrong time.
The ajaxStart/ajaxStop functions were being called before the document
was ready and the 'ajax-indicator' element existed. This meant that they
would never be called when an ajax event happened.
2012-03-20 22:54:20 +01:00
Gregor Schmidt c9a403a4b5 [#939] Update documentation for GMail setup
It now matches the current guide in ChiliProject Wiki at https://www.chiliproject.org/projects/chiliproject/wiki/Email_Delivery#SMTP-server-using-TLS-GMail
2012-03-20 22:49:37 +01:00
Felix Schäfer 565aeabc79 Issue hierarchy on issue show view #906 2012-03-20 09:25:54 +01:00
Holger Just 68efc3de32 [#903] Require updated tzinfo with fix for Ruby 1.9.3 2012-03-18 18:15:08 +01:00
Felix Schäfer efac256a6b Design fix
The lower would only show if you have the permission to see/add related issues
2012-03-17 15:31:26 +01:00
Felix Schäfer f01194856f Use the news description as event description #933 2012-03-17 13:55:36 +01:00
Felix Schäfer df66e9b915 aaj: default to don't force notes as event descriptions #933 2012-03-17 13:53:29 +01:00
Felix Schäfer 20eed68421 [#739] Convert relative links to full links in textile
Textile doesn't "understand" :only_path => false and thus doesn't convert links of the form

<pre>"foo":/bar</pre>

to full URLs, this is done in a subsequent method akin to the wiki_lins and so on
2012-03-16 00:47:18 +01:00
Felix Schäfer 26c847a4ca More specific CSS #911 2012-03-16 00:30:20 +01:00
Felix Schäfer 1bc182405e Correct truncated styles on journal entries #914 2012-03-09 18:44:04 +01:00
Michaël Rigart 23864d99b5 Fix progress bar css #868 2012-03-09 18:36:32 +01:00
Felix Schäfer ef5dddf4db Switch to GitAdapter for quoting #891
Fixes problems with paths containing quotes (sic)
2012-03-05 18:21:28 +01:00
Felix Schäfer 2c76240544 Fix edit issue notes permission #888 2012-03-05 18:13:59 +01:00
Holger Just 724bd48494 Remove unused code
Since Rails 2.3.11, protect_from_forgery exclusively calls
handle_unverified_request which defaults to resetting the session. The old
code to handle an invalid CSRF token is not used anymore and is thus
removed to un-confuse people.
2012-03-05 12:50:44 +01:00
Felix Schäfer 900eda7a23 Don't require a specific pg gem version #915
pg was locked to ~> 0.9.0 as it was the last version to support ruby 1.8.6, we don't support it officially anymore, thus we can remove the version requirement.

Contributed by Dies Koper.
2012-03-01 12:56:31 +01:00
Felix Schäfer 4b5271f487 Correct quotation #891
The Windows shell doesn't seem to support single quotes…

Contributed by Dies Koper, Luke Carrier
2012-03-01 00:40:23 +01:00
Felix Schäfer 4a3f10317f Correct (wrongly) assumed ordering in test #892
Contributed by Luke Carrier.
2012-02-29 22:28:47 +01:00
Eric Davis b9b2c8c0d7 [#559] Group menus and add some dynamic menus 2012-02-26 22:37:34 -08:00
Felix Schäfer fbc71a80f8 Fix issue option list orientation #869
Contributed by Alf Gaida.
2012-02-24 16:36:04 +01:00
Felix Schäfer f327298f88 Fix missing submenu hint on issue context menu #882
Contributed by Andrew Smith
2012-02-24 15:56:29 +01:00
Michaël Rigart e678612d75 gitignore intellij project files 2012-02-24 15:45:22 +01:00
Michaël Rigart cbcce70400 Fix requiring SCM classes in dev mode #828
Change require to require_dependency so SCM classes get loaded on each request in dev mode
2012-02-24 15:44:02 +01:00
Felix Schäfer fda1dfa96d Merge pull request #153 from dfeyer/master
Fixes for Activity list column alignment
2012-02-22 13:53:13 -08:00
Dominique Feyer f561c54356 Fixes activity list column alignment 2012-02-12 23:08:37 +01:00
1284 changed files with 9537 additions and 12477 deletions

3
.gitignore vendored
View File

@ -29,3 +29,6 @@ doc/app
/Gemfile.lock
/Gemfile.local
/.rvmrc*
/*.iml
/.idea
.rbx

59
.travis.yml Normal file
View File

@ -0,0 +1,59 @@
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- rbx-18mode
env:
- "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- "TEST_SUITE=units RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
- "TEST_SUITE=units RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
- "TEST_SUITE=units RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
- "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- "TEST_SUITE=functionals RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
- "TEST_SUITE=functionals RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
- "TEST_SUITE=functionals RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
- "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- "TEST_SUITE=integration RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
- "TEST_SUITE=integration RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
- "TEST_SUITE=integration RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
matrix:
exclude:
- rvm: 1.9.2
env: "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: 1.9.2
env: "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: 1.9.2
env: "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: 1.9.3
env: "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: 1.9.3
env: "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: 1.9.3
env: "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: rbx-18mode
env: "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: rbx-18mode
env: "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: rbx-18mode
env: "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
allow_failures:
- rvm: rbx-18mode
before_install:
- "sudo apt-get update -qq"
- "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion"
before_script:
- "rvm rubygems 1.8.25" # Rubygems 2.0.x fails with Rails 2.3
- "rake ci:travis:prepare"
- "rm -rf tmp/test/darcs_repository" # Don't test Darcs on Travis. It breaks there :(
script: "bundle exec rake test:$TEST_SUITE"
branches:
only:
- unstable
- master
- stable
- /^stable-.*$/
- /^release-.*$/
notifications:
email: false
irc: "irc.freenode.org#chiliproject"

33
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,33 @@
For the impatient: [report][cpo_new-issue], confirm, claim,
[fork][gh_chiliproject], [branch][cpo_contribute-code-branch],
[write][cpo_code-standards], [test][cpo_code-review], push.
The short version:
* Make sure the issue you are working on is reported and confirmed, add a note
to the issue to claim your intention to work on it.
* Fork [ChiliProject on GitHub][gh_chiliproject]
* Create a new branch from `master` with a descriptive name prefixed by the
issue ID (Example: `123-change_background_from_black_to_blue`).
* Make changes according to our [Code Standards][cpo_code-standards].
1. Be sure to include tests as necessary.
1. Make sure to not break existing tests.
1. Please try to make sure your code is going to pass a [Code
Review][cpo_code-review] prior to submitting the patch. If in doubt, just ask.
* Either upload your branch to GitHub and send a pull request to the
ChiliProject repository, or attach a patch to the issue on ChiliProject. If
you send a pull request on GitHub, remember to link to the pull request in the
issue you create on ChiliProject and to link to the issue on ChiliProject in
the pull request on GitHub.
* Make sure you watch the corresponding issue in case any discussion arises or
improvements are needed.
The long version is on the [Contribute Code][cpo_contribute-code] page.
[cpo_new-issue]: https://www.chiliproject.org/projects/chiliproject/issues/new
[cpo_contribute-code-branch]: https://www.chiliproject.org/projects/chiliproject/wiki/Contribute_Code#Branch
[cpo_contribute-code]: https://www.chiliproject.org/projects/chiliproject/wiki/Contribute_Code
[cpo_code-standards]: https://www.chiliproject.org/projects/chiliproject/wiki/Code_Standards
[cpo_code-review]: https://www.chiliproject.org/projects/chiliproject/wiki/Code_Review
[gh_chiliproject]: https://github.com/chiliproject/chiliproject

22
Gemfile
View File

@ -1,26 +1,32 @@
# -*- coding: utf-8 -*-
source :rubygems
source "https://rubygems.org"
gem "rails", "2.3.14"
gem "rails", "2.3.18"
gem "json", "~> 1.7.7"
gem "coderay", "~> 1.0.0"
gem "i18n", "~> 0.4.2"
gem "rubytree", "~> 0.5.2", :require => 'tree'
gem "rdoc", ">= 2.4.2"
gem "liquid", "~> 2.3.0"
gem "acts-as-taggable-on", "= 2.1.0"
gem 'gravatarify', '~> 3.0.0'
# Needed only on RUBY_VERSION = 1.8, ruby 1.9+ compatible interpreters should bring their csv
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
gem "tzinfo", "~> 0.3.31" # Fixes #903. Not required for Rails >= 3.2
group :test do
gem 'shoulda', '~> 2.10.3'
# Shoulda doesn't work nice on 1.9.3 and seems to need test-unit explicitely…
gem 'test-unit', :platforms => [:mri_19]
gem 'edavis10-object_daddy', :require => 'object_daddy'
gem 'mocha'
gem 'capybara'
gem 'mocha', '0.12.1'
# capybara 2 drops ruby 1.8.7 compatibility
gem 'capybara', '< 2.0.0'
end
group :ldap do
gem "net-ldap", '~> 0.2.2'
gem "net-ldap", '~> 0.3.1'
end
group :openid do
@ -51,13 +57,13 @@ end
# orders of magnitude compared to their native counterparts. You have been
# warned.
platforms :mri, :mingw do
platforms :mri, :mingw, :rbx do
group :mysql2 do
gem "mysql2", "~> 0.2.7"
end
group :postgres do
gem "pg", "~> 0.9.0"
gem "pg"
# gem "postgres-pr"
end
end
@ -73,7 +79,7 @@ platforms :mri_18, :mingw_18 do
end
end
platforms :mri_19, :mingw_19 do
platforms :mri_19, :mingw_19, :rbx do
group :sqlite do
gem "sqlite3"
end

View File

@ -1,4 +1,4 @@
= ChiliProject
= ChiliProject {<img src="https://travis-ci.org/chiliproject/chiliproject.png?branch=master" />}[http://travis-ci.org/chiliproject/chiliproject]
ChiliProject is a web based project management system. It supports your team throughout the complete project life cycle, from setting up and discussing a project plan, over tracking issues and reporting work progress to collaboratively sharing knowledge.

View File

@ -8,3 +8,5 @@ require 'rake/testtask'
require 'rdoc/task'
require 'tasks/rails'
# Load rake tasks from plugins in chiliproject_plugins
Dir["#{RAILS_ROOT}/vendor/chiliproject_plugins/*/lib/tasks/**/*.rake"].sort.each { |ext| load ext }

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -37,7 +37,7 @@ class AccountController < ApplicationController
def lost_password
redirect_to(home_url) && return unless Setting.lost_password?
if params[:token]
@token = Token.find_by_action_and_value("recovery", params[:token])
@token = Token.find_by_action_and_value("recovery", params[:token].to_s)
redirect_to(home_url) && return unless @token and !@token.expired?
@user = @token.user
if request.post?
@ -53,7 +53,7 @@ class AccountController < ApplicationController
return
else
if request.post?
user = User.find_by_mail(params[:mail])
user = User.find_by_mail(params[:mail].to_s)
# user not found in db
(flash.now[:error] = l(:notice_account_unknown_email); return) unless user
# user uses an external authentification
@ -109,7 +109,7 @@ class AccountController < ApplicationController
# Token based account activation
def activate
redirect_to(home_url) && return unless Setting.self_registration? && params[:token]
token = Token.find_by_action_and_value('register', params[:token])
token = Token.find_by_action_and_value('register', params[:token].to_s)
redirect_to(home_url) && return unless token and !token.expired?
user = token.user
redirect_to(home_url) && return unless user.registered?

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -33,7 +33,7 @@ class ActivitiesController < ApplicationController
:with_subprojects => @with_subprojects,
:author => @author)
@activity.scope_select {|t| !params["show_#{t}"].nil?}
@activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
@activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty? unless params[:set_filter]
events = @activity.events(@date_from, @date_to)

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -77,7 +77,7 @@ class AdminController < ApplicationController
def info
@db_adapter_name = ActiveRecord::Base.connection.adapter_name
@checklist = [
[:text_default_administrator_account_changed, User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?],
[:text_default_administrator_account_changed, !User.find_by_login("admin").try(:check_password?, "admin")],
[:text_file_repository_writable, File.writable?(Attachment.storage_path)],
[:text_plugin_assets_writable, File.writable?(Engines.public_directory)],
[:text_rmagick_available, Object.const_defined?(:Magick)]

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -31,18 +31,6 @@ class ApplicationController < ActionController::Base
cookies.delete(:autologin)
end
# Remove broken cookie after upgrade from 0.8.x (#4292)
# See https://rails.lighthouseapp.com/projects/8994/tickets/3360
# TODO: remove it when Rails is fixed
before_filter :delete_broken_cookies
def delete_broken_cookies
if cookies['_chiliproject_session'] && cookies['_chiliproject_session'] !~ /--/
cookies.delete '_chiliproject_session'
redirect_to home_path
return false
end
end
# FIXME: Remove this when all of Rack and Rails have learned how to
# properly use encodings
before_filter :params_filter
@ -64,10 +52,16 @@ class ApplicationController < ActionController::Base
before_filter :user_setup, :check_if_login_required, :set_localization
filter_parameter_logging :password
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
# FIXME: This doesn't work with Rails >= 3.0 anymore
# Possible workaround: https://github.com/rails/rails/issues/671#issuecomment-1780159
rescue_from ActionController::RoutingError, :with => proc{render_404}
rescue_from ActionController::RoutingError, :with => proc{
# manually apply basic before_filters which aren't applied by default here
user_setup
check_if_login_required
set_localization
render_404
}
include Redmine::Search::Controller
include Redmine::MenuManager::MenuController
@ -95,11 +89,11 @@ class ApplicationController < ActionController::Base
user
elsif params[:format] == 'atom' && params[:key] && accept_key_auth_actions.include?(params[:action])
# RSS key authentication does not start a session
User.find_by_rss_key(params[:key])
User.find_by_rss_key(params[:key].to_s)
elsif Setting.rest_api_enabled? && api_request?
if (key = api_key_from_request) && accept_key_auth_actions.include?(params[:action])
# Use API key
User.find_by_api_key(key)
User.find_by_api_key(key.to_s)
else
# HTTP Basic, either username/password or API key/random
authenticate_with_http_basic do |username, password|
@ -336,13 +330,6 @@ class ApplicationController < ActionController::Base
request.xhr? ? false : 'base'
end
def invalid_authenticity_token
if api_request?
logger.error "Form authenticity token is missing or is invalid. API calls must include a proper Content-type header (text/xml or text/json)."
end
render_error "Invalid form authenticity token."
end
def render_feed(items, options={})
@items = items || []
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -21,7 +21,10 @@ class CommentsController < ApplicationController
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
def create
@comment = Comment.new(params[:comment])
raise Unauthorized unless @news.commentable?
@comment = Comment.new
@comment.safe_attributes = params[:comment]
@comment.author = User.current
if @news.comments << @comment
flash[:notice] = l(:label_comment_added)

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -43,7 +43,8 @@ class DocumentsController < ApplicationController
end
def new
@document = @project.documents.build(params[:document])
@document = @project.documents.build
@document.safe_attributes = params[:document]
if request.post?
if User.current.allowed_to?(:add_document_watchers, @project) && params[:document]['watcher_user_ids'].present?
@document.watcher_user_ids = params[:document]['watcher_user_ids']
@ -84,7 +85,7 @@ class DocumentsController < ApplicationController
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
# TODO: refactor
attachments.first.container.recipients.each do |recipient|
@document.recipients.each do |recipient|
Mailer.deliver_attachments_added(attachments[:files], recipient)
end
end

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -23,7 +23,8 @@ class IssueCategoriesController < ApplicationController
verify :method => :post, :only => :destroy
def new
@category = @project.issue_categories.build(params[:category])
@category = @project.issue_categories.build
@category.safe_attributes = params[:category]
if request.post?
if @category.save
respond_to do |format|
@ -50,7 +51,8 @@ class IssueCategoriesController < ApplicationController
end
def edit
if request.post? and @category.update_attributes(params[:category])
@category.safe_attributes = params[:category]
if request.post? and @category.save
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
end

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -21,17 +21,19 @@ class MembersController < ApplicationController
def new
members = []
if params[:member] && request.post?
attrs = params[:member].dup
if (user_ids = attrs.delete(:user_ids))
if params[:member]
if params[:member][:user_ids]
attrs = params[:member].dup
user_ids = attrs.delete(:user_ids)
user_ids.each do |user_id|
members << Member.new(attrs.merge(:user_id => user_id))
members << Member.new(:role_ids => params[:member][:role_ids], :user_id => user_id)
end
else
members << Member.new(attrs)
members << Member.new(:role_ids => params[:member][:role_ids], :user_id => params[:member][:user_id])
end
@project.members << members
end
respond_to do |format|
if members.present? && members.all? {|m| m.valid? }

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -48,26 +48,26 @@ class MessagesController < ApplicationController
# Create a new topic
def new
@message = Message.new(params[:message])
@message = Message.new
@message.author = User.current
@message.board = @board
if params[:message] && User.current.allowed_to?(:edit_messages, @project)
@message.locked = params[:message]['locked']
@message.sticky = params[:message]['sticky']
end
if request.post? && @message.save
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
attachments = Attachment.attach_files(@message, params[:attachments])
render_attachment_warning_if_needed(@message)
redirect_to :action => 'show', :id => @message
@message.safe_attributes = params[:message]
if request.post?
if @message.save
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
attachments = Attachment.attach_files(@message, params[:attachments])
render_attachment_warning_if_needed(@message)
redirect_to :action => 'show', :id => @message
end
end
end
# Reply to a topic
def reply
@reply = Message.new(params[:reply])
@reply = Message.new
@reply.author = User.current
@reply.board = @board
@reply.safe_attributes = params[:reply]
@topic.children << @reply
if !@reply.new_record?
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
@ -80,11 +80,8 @@ class MessagesController < ApplicationController
# Edit a message
def edit
(render_403; return false) unless @message.editable_by?(User.current)
if params[:message]
@message.locked = params[:message]['locked']
@message.sticky = params[:message]['sticky']
end
if request.post? && @message.update_attributes(params[:message])
@message.safe_attributes = params[:message]
if request.post? && @message.save
attachments = Attachment.attach_files(@message, params[:attachments])
render_attachment_warning_if_needed(@message)
flash[:notice] = l(:notice_successful_update)

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -59,14 +59,12 @@ class NewsController < ApplicationController
def create
@news = News.new(:project => @project, :author => User.current)
if request.post?
@news.attributes = params[:news]
if @news.save
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'news', :action => 'index', :project_id => @project
else
render :action => 'new'
end
@news.safe_attributes = params[:news]
if @news.save
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'news', :action => 'index', :project_id => @project
else
render :action => 'new'
end
end
@ -74,7 +72,8 @@ class NewsController < ApplicationController
end
def update
if request.put? and @news.update_attributes(params[:news])
@news.safe_attributes = params[:news]
if @news.save
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @news
else

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -59,7 +59,8 @@ class ProjectsController < ApplicationController
def new
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@trackers = Tracker.all
@project = Project.new(params[:project])
@project = Project.new
@project.safe_attributes = params[:project]
end
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -43,6 +43,7 @@ class QueriesController < ApplicationController
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v]) if params[:fields] || params[:f]
@query.attributes = params[:query]
@query.project = nil if params[:query_is_for_all]
@query.display_subprojects = params[:display_subprojects] if params[:display_subprojects].present?
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.group_by ||= params[:group_by]
@query.column_names = params[:c] if params[:c]

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -97,7 +97,7 @@ class TimelogController < ApplicationController
def new
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
@time_entry.attributes = params[:time_entry]
@time_entry.safe_attributes = params[:time_entry]
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
render :action => 'edit'
@ -106,7 +106,7 @@ class TimelogController < ApplicationController
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
def create
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
@time_entry.attributes = params[:time_entry]
@time_entry.safe_attributes = params[:time_entry]
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
@ -127,14 +127,14 @@ class TimelogController < ApplicationController
end
def edit
@time_entry.attributes = params[:time_entry]
@time_entry.safe_attributes = params[:time_entry]
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
end
verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed }
def update
@time_entry.attributes = params[:time_entry]
@time_entry.safe_attributes = params[:time_entry]
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -56,7 +56,7 @@ class VersionsController < ApplicationController
if params[:version]
attributes = params[:version].dup
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
@version.attributes = attributes
@version.safe_attributes = attributes
end
end
@ -66,7 +66,7 @@ class VersionsController < ApplicationController
if params[:version]
attributes = params[:version].dup
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
@version.attributes = attributes
@version.safe_attributes = attributes
end
if request.post?
@ -101,7 +101,8 @@ class VersionsController < ApplicationController
if request.put? && params[:version]
attributes = params[:version].dup
attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
if @version.update_attributes(attributes)
@version.safe_attributes = attributes
if @version.save
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
else

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -19,7 +19,7 @@ class WikisController < ApplicationController
# Create or update a project's wiki
def edit
@wiki = @project.wiki || Wiki.new(:project => @project)
@wiki.attributes = params[:wiki]
@wiki.safe_attributes = params[:wiki]
@wiki.save if request.post?
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
end

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -17,7 +17,7 @@ require 'cgi'
module ApplicationHelper
include Redmine::I18n
include GravatarHelper::PublicMethods
include Gravatarify::Helper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
@ -436,6 +436,7 @@ module ApplicationHelper
css << 'theme-' + theme.name
end
css << 'project-' + @project.id.to_s if @project.present?
css << 'controller-' + params[:controller] if params[:controller]
css << 'action-' + params[:action] if params[:action]
css.join(' ')
@ -502,7 +503,7 @@ module ApplicationHelper
@parsed_headings = []
text = parse_non_pre_blocks(text) do |text|
[:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links, :parse_headings].each do |method_name|
[:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links, :parse_headings, :parse_relative_urls].each do |method_name|
send method_name, text, project, obj, attr, only_path, options
end
end
@ -543,6 +544,41 @@ module ApplicationHelper
parsed
end
RELATIVE_LINK_RE = %r{
<a
(?:
(\shref=
(?: # the href and link
(?:'(\/[^>]+?)')|
(?:"(\/[^>]+?)")
)
)|
[^>]
)*
>
[^<]*?<\/a> # content and closing link tag.
}x unless const_defined?(:RELATIVE_LINK_RE)
def parse_relative_urls(text, project, obj, attr, only_path, options)
return if only_path
text.gsub!(RELATIVE_LINK_RE) do |m|
href, relative_url = $1, $2 || $3
next m unless href.present?
if defined?(request) && request.present?
# we have a request!
protocol, host_with_port = request.protocol, request.host_with_port
elsif @controller
# use the same methods as url_for in the Mailer
url_opts = @controller.class.default_url_options
next m unless url_opts && url_opts[:protocol] && url_opts[:host]
protocol, host_with_port = "#{url_opts[:protocol]}://", url_opts[:host]
else
next m
end
m.sub href, " href=\"#{protocol}#{host_with_port}#{relative_url}\""
end
end
def parse_inline_attachments(text, project, obj, attr, only_path, options)
# when using an image link, try to use an attachment, if possible
if options[:attachments] || (obj && obj.respond_to?(:attachments))
@ -816,7 +852,7 @@ module ApplicationHelper
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?
hidden_field_tag('back_url', CGI.escape(back_url), :id => nil) unless back_url.blank?
end
def check_all_links(form_name)
@ -832,12 +868,10 @@ module ApplicationHelper
pcts << (100 - pcts[1] - pcts[0])
width = options[:width] || '100px;'
legend = options[:legend] || ''
content_tag('table',
content_tag('tr',
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : '') +
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : '') +
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : '')
), :class => 'progress', :style => "width: #{width};") +
content_tag('div',
content_tag('div', '', :style => "width: #{pcts[0]}%;", :class => 'closed ui-progressbar-value ui-widget-header ui-corner-left') +
content_tag('div', '', :style => "width: #{pcts[1]}%;", :class => 'done ui-progressbar-value ui-widget-header'),
:class => 'progress ui-progressbar ui-widget ui-widget-content ui-corner-all', :style => "width: #{width};") +
content_tag('p', legend, :class => 'pourcent')
end
@ -850,7 +884,7 @@ module ApplicationHelper
def context_menu(url)
unless @context_menu_included
content_for :header_tags do
javascript_include_tag('context_menu') +
javascript_include_tag('context_menu.jquery') +
stylesheet_link_tag('context_menu')
end
if l(:direction) == 'rtl'
@ -860,7 +894,7 @@ module ApplicationHelper
end
@context_menu_included = true
end
javascript_tag "new ContextMenu('#{ url_for(url) }')"
javascript_tag "jQuery(document).ContextMenu('#{ url_for(url) }')"
end
def context_menu_link(name, url, options={})
@ -880,33 +914,25 @@ module ApplicationHelper
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' });")
javascript_tag("jQuery('##{field_id}').datepicker(datepickerSettings)")
end
def include_calendar_headers_tags
unless @calendar_headers_tags_included
@calendar_headers_tags_included = true
content_for :header_tags do
start_of_week = case Setting.start_of_week.to_i
when 1
'Calendar._FD = 1;' # Monday
when 7
'Calendar._FD = 0;' # Sunday
when 6
'Calendar._FD = 6;' # Saturday
else
'' # use language
end
javascript_include_tag('calendar/calendar') +
javascript_include_tag("calendar/lang/calendar-#{current_language.to_s.downcase}.js") +
javascript_tag(start_of_week) +
javascript_include_tag('calendar/calendar-setup') +
stylesheet_link_tag('calendar')
end
def jquery_datepicker_settings
start_of_week = Setting.start_of_week.to_s
start_of_week_string = start_of_week.present? ? "firstDay: '#{start_of_week}', " : ''
script = javascript_tag("var datepickerSettings = {" +
start_of_week_string +
"showOn: 'both', " +
"buttonImage: '" + path_to_image('/images/calendar.png') + "', " +
"buttonImageOnly: true, " +
"showButtonPanel: true, " +
"dateFormat: 'yy-mm-dd' " +
"}")
unless current_language == :en
jquery_locale = l("jquery.ui", :default => current_language.to_s)
script << javascript_include_tag("libs/ui/i18n/jquery.ui.datepicker-#{jquery_locale}.js")
end
script
end
def content_for(name, content = nil, &block)
@ -919,6 +945,19 @@ module ApplicationHelper
(@has_content && @has_content[name]) || false
end
# Returns the gravatar image tag for the given email
# +email+ is a string with an email address
def gravatar(email, options={})
gravatarify_options = {}
gravatarify_options[:secure] = options.delete :ssl
[:default, :size, :rating, :filetype].each {|key| gravatarify_options[key] = options.delete key}
# Default size is 50x50 px
gravatarify_options[:size] ||= 50
options[:class] ||= 'gravatar'
gravatarify_options[:html] = options
gravatar_tag email, gravatarify_options
end
# 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 = { })
@ -948,6 +987,7 @@ module ApplicationHelper
unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n" + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });")
end
tags << jquery_datepicker_settings
tags
end

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -36,8 +36,7 @@ module CustomFieldsHelper
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
case field_format.try(:edit_as)
when "date"
text_field_tag(field_name, custom_value.value, :id => field_id, :size => 10) +
calendar_for(field_id)
date_field_tag(field_name, custom_value.value, :id => field_id, :size => 10)
when "text"
text_area_tag(field_name, custom_value.value, :id => field_id, :rows => 3, :style => 'width:90%')
when "bool"
@ -71,8 +70,7 @@ module CustomFieldsHelper
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
case field_format.try(:edit_as)
when "date"
text_field_tag(field_name, '', :id => field_id, :size => 10) +
calendar_for(field_id)
date_field_tag(field_name, '', :id => field_id, :size => 10)
when "text"
text_area_tag(field_name, '', :id => field_id, :rows => 3, :style => 'width:90%')
when "bool"

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -79,6 +79,22 @@ module IssuesHelper
s
end
def render_parents_and_subtree(issue)
return if issue.leaf? && !issue.parent
s = '<form><table id="issue_tree" class="list">'
issue_list(issue.self_and_ancestors.sort_by(&:lft) + issue.descendants.sort_by(&:lft)) do |el, level|
s << content_tag('tr',
content_tag('td', check_box_tag("ids[]", el.id, false, :id => nil), :class => 'checkbox') +
content_tag('td', link_to_issue(el, :truncate => 60), :class => 'subject') +
content_tag('td', h(el.status)) +
content_tag('td', link_to_user(el.assigned_to)) +
content_tag('td', progress_bar(el.done_ratio, :width => '80px')),
:class => "issue issue-#{el.id} #{"self" if el == issue} hascontextmenu #{level > 0 ? "idnt idnt-#{level}" : nil}")
end
s << '</table></form>'
s
end
def render_custom_fields_rows(issue)
return if issue.custom_field_values.empty?
ordered_values = []

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2012 the ChiliProject Team
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

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