dev_SaaS
cxt 6 years ago
parent c579ede792
commit d23e266f58

@ -3120,12 +3120,12 @@ end
def update_notice def update_notice
@menu_type = 12 @menu_type = 12
@sub_type = 8 @sub_type = 8
@notice = SystemUpdateNotice.first @notice = SystemUpdateNotice.last
end end
def edit_update_notice def edit_update_notice
notice = SystemUpdateNotice.first notice = SystemUpdateNotice.last
if notice.present? if notice.present? && notice.end_time > Time.now
notice.update_attributes(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes]) notice.update_attributes(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes])
else else
notice_type = UserSystemNotice.find_by_sql("select max(notice_type) as max_notice_type from user_system_notices").first.try(:max_notice_type).to_i + 1 notice_type = UserSystemNotice.find_by_sql("select max(notice_type) as max_notice_type from user_system_notices").first.try(:max_notice_type).to_i + 1

@ -122,8 +122,8 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'account/user_update_notice', :locals => {:notice => notice})%>"; var htmlvalue = "<%= escape_javascript(render :partial => 'account/user_update_notice', :locals => {:notice => notice})%>";
pop_box_new(htmlvalue, 500, 380); pop_box_new(htmlvalue, 500, 380);
<% UserSystemNotice.create(:user_id => User.current.id, :notice_type => notice.notice_type) %> <% UserSystemNotice.create(:user_id => User.current.id, :notice_type => notice.notice_type) %>
<% elsif notice.present? && notice.end_time < Time.now %> <%# elsif notice.present? && notice.end_time < Time.now %>
<% notice.destroy %> <%# notice.destroy %>
<% end %> <% end %>
}); });

@ -38,7 +38,8 @@
format:'Y-m-d H:i', format:'Y-m-d H:i',
formatTime:'H:i', formatTime:'H:i',
formatDate:'Y-m-d', formatDate:'Y-m-d',
validateOnBlur:false validateOnBlur:false,
step:30
}); });
$('#notice_end_time').datetimepicker({ $('#notice_end_time').datetimepicker({
allowBlank:true, allowBlank:true,
@ -46,7 +47,8 @@
format:'Y-m-d H:i', format:'Y-m-d H:i',
formatTime:'H:i', formatTime:'H:i',
formatDate:'Y-m-d', formatDate:'Y-m-d',
validateOnBlur:false validateOnBlur:false,
step:30
}); });
}); });

Loading…
Cancel
Save