ntue email_ers fix and announcement widget filed fix
This commit is contained in:
parent
52356d3316
commit
4abe4f5c16
|
@ -30,13 +30,13 @@ module Announcement
|
||||||
widgets do
|
widgets do
|
||||||
default_widget do
|
default_widget do
|
||||||
sorting 'desc(:postdate)'
|
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"]
|
enable ["typeA","typeB_style3","typeC"]
|
||||||
image :image
|
image :image
|
||||||
field :postdate
|
field :postdate
|
||||||
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self,:preview=>true}
|
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]}}
|
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
|
field :bulletin_create_dept
|
||||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||||
end
|
end
|
||||||
|
|
|
@ -126,9 +126,9 @@ class Panel::ErEmail::BackEnd::EmailErsController < OrbitBackendController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @email_er.save
|
if @email_er.save
|
||||||
|
|
||||||
# if @email_er.is_checked == true and !@email_er.is_rejected
|
if @email_er.is_checked == true and !@email_er.is_rejected
|
||||||
# send_email_data(@email_er)
|
send_email_data(@email_er)
|
||||||
# end
|
end
|
||||||
|
|
||||||
format.html { redirect_to(panel_er_email_back_end_email_ers_url) }
|
format.html { redirect_to(panel_er_email_back_end_email_ers_url) }
|
||||||
format.xml { render :xml => @email_er, :status => :created, :location => @email_er }
|
format.xml { render :xml => @email_er, :status => :created, :location => @email_er }
|
||||||
|
|
|
@ -77,13 +77,14 @@ class EmailEr
|
||||||
|
|
||||||
if email_group_data.include?(egroup) and (egroup == '0' or egroup == '1' or egroup == '2' or egroup == '3')
|
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'
|
elsif email_group_data.include?(egroup) and egroup == '4'
|
||||||
|
|
||||||
self.other_mailaddress.split(",").each do |otmail|
|
self.other_mailaddress.split(",").each do |otmail|
|
||||||
|
|
||||||
group_mail << "#{otmail}(#{email_group_data[egroup]["name"]})"
|
group_mail << "#{otmail}(#{email_group_data[egroup]["name"]})"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ class EmailErFile
|
||||||
private
|
private
|
||||||
|
|
||||||
def file_size
|
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"))
|
errors.add( :file, I18n.t("er_email.email_file_limit"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#add_plugin_file a.add').live('click', function(){
|
$('#add_plugin_file a.add').live('click', function(){
|
||||||
var new_id = $(this).prev().attr('value');
|
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).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));
|
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :email_er_files) %>").replace(old_id, new_id));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue