merge with origin
This commit is contained in:
@@ -63,10 +63,12 @@ class Origami::InDutiesController < BaseOrigamiController
|
||||
def create_for_in_duty
|
||||
# this one use for create and update
|
||||
in_duty = in_duty_params
|
||||
in_time = DateTime.new in_duty['in_time(1i)'].to_i, in_duty['in_time(2i)'].to_i, in_duty['in_time(3i)'].to_i, in_duty['in_time(4i)'].to_i, in_duty['in_time(5i)'].to_i
|
||||
in_time = in_time.change(offset: '+06:30')
|
||||
out_time = DateTime.new in_duty['out_time(1i)'].to_i, in_duty['out_time(2i)'].to_i, in_duty['out_time(3i)'].to_i, in_duty['out_time(4i)'].to_i, in_duty['out_time(5i)'].to_i
|
||||
out_time = out_time.change(offset: '+06:30')
|
||||
# in_time = DateTime.new in_duty['in_time(1i)'].to_i, in_duty['in_time(2i)'].to_i, in_duty['in_time(3i)'].to_i, in_duty['in_time(4i)'].to_i, in_duty['in_time(5i)'].to_i
|
||||
# in_time = in_time.change(offset: '+06:30')
|
||||
# out_time = DateTime.new in_duty['out_time(1i)'].to_i, in_duty['out_time(2i)'].to_i, in_duty['out_time(3i)'].to_i, in_duty['out_time(4i)'].to_i, in_duty['out_time(5i)'].to_i
|
||||
# out_time = out_time.change(offset: '+06:30')
|
||||
puts in_duty.to_json
|
||||
puts "sssssssssssssssssss"
|
||||
@in_duty = InDuty.new
|
||||
in_duty_id = in_duty[:id]
|
||||
unless in_duty_id.empty?
|
||||
@@ -75,16 +77,16 @@ class Origami::InDutiesController < BaseOrigamiController
|
||||
|
||||
@in_duty.dinning_id = in_duty_params[:dinning_id]
|
||||
@in_duty.commissioner_ids = in_duty_params[:commissioner_ids]
|
||||
@in_duty.in_time = in_time
|
||||
@in_duty.out_time = out_time
|
||||
@in_duty.in_time = in_duty['in_time']
|
||||
@in_duty.out_time = in_duty['out_time']
|
||||
|
||||
respond_to do |format|
|
||||
if @in_duty.save
|
||||
if in_duty_id.nil?
|
||||
format.html { redirect_to origami_index_in_duty_path(in_duty_params[:dinning_id]), notice: 'In duty was successfully created.' }
|
||||
format.html { redirect_to origami_index_in_duty_path, notice: 'In duty was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @in_duty }
|
||||
else
|
||||
format.html { redirect_to origami_index_in_duty_path(in_duty_params[:dinning_id]), notice: 'In duty was successfully updated.' }
|
||||
format.html { redirect_to origami_index_in_duty_path, notice: 'In duty was successfully updated.' }
|
||||
format.json { render :show, status: :created, location: @in_duty }
|
||||
end
|
||||
else
|
||||
@@ -151,7 +153,7 @@ class Origami::InDutiesController < BaseOrigamiController
|
||||
@in_duty.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to origami_index_in_duty_path(@table_id), notice: 'In duty was successfully removed.' }
|
||||
format.html { redirect_to origami_index_in_duty_path, notice: 'In duty was successfully removed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user