ntue email_ers fix and announcement widget filed fix

This commit is contained in:
Spen 2013-09-27 17:06:12 +08:00 committed by Manson Wang
parent 52356d3316
commit 4abe4f5c16
5 changed files with 10 additions and 9 deletions

View File

@ -30,13 +30,13 @@ module Announcement
widgets do
default_widget do
sorting 'desc(:postdate)'
query 'Bulletin.available_for_lang(I18n.locale).any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
query 'Bulletin.can_display.available_for_lang(I18n.locale).any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
enable ["typeA","typeB_style3","typeC"]
image :image
field :postdate
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self,:preview=>true}
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
field :subtitle
link_field :subtitle,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self,:preview=>true}
field :bulletin_create_dept
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
end

View File

@ -126,9 +126,9 @@ class Panel::ErEmail::BackEnd::EmailErsController < OrbitBackendController
respond_to do |format|
if @email_er.save
# if @email_er.is_checked == true and !@email_er.is_rejected
# send_email_data(@email_er)
# end
if @email_er.is_checked == true and !@email_er.is_rejected
send_email_data(@email_er)
end
format.html { redirect_to(panel_er_email_back_end_email_ers_url) }
format.xml { render :xml => @email_er, :status => :created, :location => @email_er }

View File

@ -77,13 +77,14 @@ class EmailEr
if email_group_data.include?(egroup) and (egroup == '0' or egroup == '1' or egroup == '2' or egroup == '3')
group_mail << "#{email_group_data[egroup]["email"]}(#{email_group_data[egroup]["name"]})"
#group_mail << "#{email_group_data[egroup]["email"]}(#{email_group_data[egroup]["name"]})"
group_mail << "#{email_group_data[egroup]["name"]}"
elsif email_group_data.include?(egroup) and egroup == '4'
self.other_mailaddress.split(",").each do |otmail|
group_mail << "#{otmail}(#{email_group_data[egroup]["name"]})"
group_mail << "#{otmail}(#{email_group_data[egroup]["name"]})"
end

View File

@ -15,7 +15,7 @@ class EmailErFile
private
def file_size
if file.file.size > 1.megabytes
if file.file.size > 10.megabytes
errors.add( :file, I18n.t("er_email.email_file_limit"))
end
end

View File

@ -105,7 +105,7 @@
$(document).ready(function() {
$('#add_plugin_file a.add').live('click', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_add_plugin_files", "g");
var old_id = new RegExp("new_email_er_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :email_er_files) %>").replace(old_id, new_id));
});