Permalink
Browse files

merged dev back into master

  • Loading branch information...
2 parents fbb33ee + 619d741 commit fd04f136081f8ff0a69c279656292a12c5840066 @adambray adambray committed Jul 22, 2011
Showing 645 changed files with 634,560 additions and 58,283 deletions.
View
@@ -1,5 +1,5 @@
source :rubygems
-gem "rails", "2.3.11"
+gem "rails", "2.3.12"
gem "ruby-net-ldap", :require => "net/ldap"
gem "fastercsv"
gem "icalendar"
@@ -10,4 +10,6 @@ gem "authlogic"
gem "ar_mailer", :require => "action_mailer/ar_mailer"
gem "whenever"
gem "hoptoad_notifier"
-gem "mysql"
+gem "mysql"
+gem "vestal_versions"
+gem "rdoc", "~> 3.6.1"
View
@@ -1,48 +1,51 @@
GEM
remote: http://rubygems.org/
specs:
+ Ascii85 (1.0.1)
aaronh-chronic (0.3.9)
- actionmailer (2.3.11)
- actionpack (= 2.3.11)
- actionpack (2.3.11)
- activesupport (= 2.3.11)
+ actionmailer (2.3.12)
+ actionpack (= 2.3.12)
+ actionpack (2.3.12)
+ activesupport (= 2.3.12)
rack (~> 1.1.0)
- activerecord (2.3.11)
- activesupport (= 2.3.11)
- activeresource (2.3.11)
- activesupport (= 2.3.11)
- activesupport (2.3.11)
+ activerecord (2.3.12)
+ activesupport (= 2.3.12)
+ activeresource (2.3.12)
+ activesupport (= 2.3.12)
+ activesupport (2.3.12)
ar_mailer (1.5.1)
authlogic (2.1.6)
activesupport
builder (3.0.0)
- chronic (0.3.0)
+ chronic (0.5.0)
fastercsv (1.5.4)
has_many_polymorphs (2.13)
activerecord
- hoptoad_notifier (2.4.9)
+ hoptoad_notifier (2.4.11)
activesupport
builder
icalendar (1.1.6)
mysql (2.8.1)
- prawn (0.8.4)
- prawn-core (< 0.9, >= 0.8.4)
- prawn-layout (< 0.9, >= 0.8.4)
- prawn-security (< 0.9, >= 0.8.4)
- prawn-core (0.8.4)
- prawn-layout (0.8.4)
- prawn-security (0.8.4)
+ pdf-reader (0.10.0)
+ Ascii85 (~> 1.0.0)
+ prawn (0.11.1)
+ pdf-reader (>= 0.9.0)
+ ttfunk (~> 1.0.0)
rack (1.1.2)
- rails (2.3.11)
- actionmailer (= 2.3.11)
- actionpack (= 2.3.11)
- activerecord (= 2.3.11)
- activeresource (= 2.3.11)
- activesupport (= 2.3.11)
+ rails (2.3.12)
+ actionmailer (= 2.3.12)
+ actionpack (= 2.3.12)
+ activerecord (= 2.3.12)
+ activeresource (= 2.3.12)
+ activesupport (= 2.3.12)
rake (>= 0.8.3)
- rake (0.8.7)
+ rake (0.9.2)
+ rdoc (3.6.1)
ruby-net-ldap (0.0.4)
- whenever (0.6.7)
+ ttfunk (1.0.1)
+ vestal_versions (1.0.2)
+ activerecord (>= 2.1.0)
+ whenever (0.6.8)
aaronh-chronic (>= 0.3.9)
activesupport (>= 2.3.4)
@@ -59,6 +62,8 @@ DEPENDENCIES
icalendar
mysql
prawn
- rails (= 2.3.11)
+ rails (= 2.3.12)
+ rdoc (~> 3.6.1)
ruby-net-ldap
+ vestal_versions
whenever
View
@@ -3,8 +3,9 @@
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+require 'rake/dsl_definition'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
require 'tasks/rails'
@@ -0,0 +1,86 @@
+class AnnouncementsController < NoticesController
+ before_filter :require_any_loc_group_admin, :except => [:index, :show]
+
+ def index
+ redirect_to(notices_path)
+ end
+
+ def show
+ redirect_to(notices_path)
+ end
+
+ def new
+ @current_shift_location = current_user.current_shift.location if current_user.current_shift
+ @disable_locations = false
+ @announcement = Announcement.new
+ layout_check
+ end
+
+ def edit
+ @disable_locations = true
+ @announcement = Announcement.find(params[:id])
+ layout_check
+ end
+
+ def create
+ @announcement = Announcement.new(params[:announcement])
+ set_author_dept_and_time
+ begin
+ Announcement.transaction do
+ @announcement.save(false)
+ set_sources(@announcement)
+ @announcement.save!
+ end
+ rescue Exception
+ respond_to do |format|
+ format.html { render :action => "new" }
+ format.js #create.js.rjs
+ end
+ else
+ flash[:notice] = 'Announcement was successfully created.'
+ respond_to do |format|
+ format.html {
+ redirect_to announcements_path
+ }
+ format.js #create.js.rjs
+ end
+ end
+ end
+
+ def update
+ @announcement = Announcement.find_by_id(params[:id]) || Announcement.new
+ @announcement.update_attributes(params[:announcement])
+ set_author_dept_and_time
+ begin
+ Announcement.transaction do
+ @announcement.save(false)
+ set_sources(@announcement)
+ @announcement.save!
+ end
+ rescue Exception
+ respond_to do |format|
+ format.html { render :action => "new" }
+ format.js
+ end
+ else
+ respond_to do |format|
+ format.html {
+ flash[:notice] = 'Announcement was successfully saved.'
+ redirect_to :action => "index"
+ }
+ format.js
+ end
+ end
+ end
+
+ private
+ def set_author_dept_and_time
+ @announcement.author = current_user
+ @announcement.department = current_department
+ @announcement.start = Time.now if params[:start_time_choice] == "now"
+ if params[:end_time_choice] == "indefinite"
+ @announcement.end = nil
+ @announcement.indefinite = true
+ end
+ end
+end
Oops, something went wrong.

0 comments on commit fd04f13

Please sign in to comment.