aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorMichel Etienne2012-07-09 23:02:20 +0200
committerMichel Etienne2012-07-09 23:02:20 +0200
commit3cf46d6cbe8f490ad1338ae40bf4d1ec8fcbd2d4 (patch)
treecf8415ac4f8816be35c9768cd6c9eadd0504036d /app/controllers
parentea483438db92d2d8c46717e2fc20ea1417e2c4b6 (diff)
downloadchouette-core-3cf46d6cbe8f490ad1338ae40bf4d1ec8fcbd2d4.tar.bz2
add clean up process
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/clean_ups_controller.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/controllers/clean_ups_controller.rb b/app/controllers/clean_ups_controller.rb
new file mode 100644
index 000000000..2d270c178
--- /dev/null
+++ b/app/controllers/clean_ups_controller.rb
@@ -0,0 +1,24 @@
+class CleanUpsController < ChouetteController
+ respond_to :html, :only => [:create]
+
+ belongs_to :referential
+
+ def create
+ begin
+ clean_up = CleanUp.new( params[:clean_up])
+ clean_up.clean
+ #flash[:notice] = "Message 1<br />"
+ #flash[:notice] << "Message 2"
+ notice = t('clean_ups.success_tm', :tm_count => clean_up.time_table_count.to_s)
+ if (clean_up.vehicle_journey_count > 0)
+ notice += t('clean_ups.success_vj', :vj_count => clean_up.vehicle_journey_count.to_s)
+ end
+ flash[:notice] = notice
+ rescue
+ flash[:alert] = t('clean_ups.failure')
+ end
+ redirect_to referential_path(@referential)
+
+ end
+
+end