Index: openacs-4/packages/news/www/item-create-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/Attic/item-create-oracle.xql,v diff -u -r1.1 -r1.1.20.1 --- openacs-4/packages/news/www/item-create-oracle.xql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/www/item-create-oracle.xql 30 Jul 2008 12:38:50 -0000 1.1.20.1 @@ -3,11 +3,12 @@ oracle8.1.6 - - - select sysdate + [ad_parameter ActiveDays "news" 14] from dual - - + + + select to_char(sysdate + [ad_parameter ActiveDays "news" 14], 'YYYY-MM-DD') as date_proj, + to_char(sysdate, 'YYYY-MM-DD') as date_today + from dual + + - Index: openacs-4/packages/news/www/item-create-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/Attic/item-create-postgresql.xql,v diff -u -r1.2 -r1.2.14.1 --- openacs-4/packages/news/www/item-create-postgresql.xql 18 Aug 2003 10:40:55 -0000 1.2 +++ openacs-4/packages/news/www/item-create-postgresql.xql 30 Jul 2008 12:38:50 -0000 1.2.14.1 @@ -3,11 +3,12 @@ postgresql7.1 - - - select to_char(current_timestamp + interval '[ad_parameter ActiveDays "news" 14] days', 'YYYY-MM-DD') - - + + + select + to_char(current_timestamp + interval '[ad_parameter ActiveDays "news" 14] days', 'YYYY-MM-DD') as date_proj, + to_char(current_timestamp, 'YYYY-MM-DD') as date_today + + - Index: openacs-4/packages/news/www/item-create.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item-create.adp,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/news/www/item-create.adp 29 Jul 2008 17:22:17 -0000 1.10.2.1 +++ openacs-4/packages/news/www/item-create.adp 30 Jul 2008 12:38:50 -0000 1.10.2.2 @@ -5,50 +5,4 @@

@title;noquote@

-

Use the following form to define your news item.Note that the fields marked with * are required. -When you're done click 'Preview' to see how the news item will look and to choose an image for the article.

- - -
- -

*

-

- -

-

- -

*

-


-
-


-#news.The_text_is_formatted_as#   - checked>   - checked> -

- - -

-

@publish_date_select;noquote@

- -

-

@archive_date_select;noquote@
- checked> #news.show_it_permanently#

-

-
- -

- - -

-
- - - - - - - - - - - + Index: openacs-4/packages/news/www/item-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item-create.tcl,v diff -u -r1.4 -r1.4.8.1 --- openacs-4/packages/news/www/item-create.tcl 24 Feb 2005 18:03:05 -0000 1.4 +++ openacs-4/packages/news/www/item-create.tcl 30 Jul 2008 12:38:50 -0000 1.4.8.1 @@ -41,18 +41,56 @@ set title "[_ news.Create_News_Item]" set context [list $title] -if { ![empty_string_p $archive_date_ansi] } { - set proj_archival_date $archive_date_ansi -} else { - set proj_archival_date [db_string week "select sysdate + [ad_parameter ActiveDays news 14] from dual"] -} +set lc_format [lc_get formbuilder_date_format] -set publish_date_select [dt_widget_datetime -default $publish_date_ansi publish_date days] -set archive_date_select [dt_widget_datetime -default $proj_archival_date archive_date days] +db_1row get_dates {} -ad_return_template +if { $publish_date_ansi eq "" || $publish_date_ansi eq "now"} { + set publish_date_ansi $date_today +} +if { $archive_date_ansi eq "" } { + set archive_date_ansi $date_proj +} +ad_form -name "news" -action "preview" -html {enctype "multipart/form-data"} -form { + {action:text(hidden) + {value "News Item"}} + {publish_title:text(text) + {label "[_ news.Title]"} + {html {maxlength 400 size 61}} + {value $publish_title}} + {publish_lead:text(textarea),optional + {label "[_ news.Lead]"} + {html {cols 60 rows 3}} + {value $publish_lead}} + {publish_body:text(textarea),optional + {label "[_ news.Body]"} + {html {cols 60 rows 20}} + {value $publish_body}} + {text_file:text(file),optional + {label "[_ news.or_upload_text_file]"}} + {html_p:text(radio) + {label "[_ news.The_text_is_formatted_as]"} + {options {{"#news.Plain_text#" f} {"#news.HTML#" t}}} + {value $html_p}} +} +if { $immediate_approve_p } { + ad_form -extend -name "news" -form { + {publish_date:date,optional + {label "[_ news.Release_Date]"} + {value "[split $publish_date_ansi -]"} + {format {$lc_format}} + } + {archive_date:date,optional + {label "[_ news.Archive_Date]"} + {value "[split $archive_date_ansi -]"} + {format {$lc_format}} + } + {Permanent_p:text(checkbox) + {label "[_ news.never]"} + {options {{"#news.show_it_permanently#" t}}}} + } +} - - +ad_return_template Index: openacs-4/packages/news/www/preview.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.adp,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/news/www/preview.adp 15 May 2007 20:14:50 -0000 1.10 +++ openacs-4/packages/news/www/preview.adp 30 Jul 2008 12:38:50 -0000 1.10.2.1 @@ -29,16 +29,18 @@ creator_link = @creator_link;noquote@> -

+

@form_action;noquote@ - @hidden_vars;noquote@ - - +
@hidden_vars;noquote@
+
+ - @edit_action;noquote@ @image_vars;noquote@ - + @edit_action;noquote@ +
@image_vars;noquote@
+
+
-

+
Index: openacs-4/packages/news/www/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.tcl,v diff -u -r1.18 -r1.18.2.1 --- openacs-4/packages/news/www/preview.tcl 4 Mar 2008 13:08:38 -0000 1.18 +++ openacs-4/packages/news/www/preview.tcl 30 Jul 2008 12:38:50 -0000 1.18.2.1 @@ -171,10 +171,10 @@ } if { ![template::util::date::validate $publish_date_ansi ""] } { - set publish_date_pretty [lc_time_fmt $publish_date_ansi "%x"] + set publish_date_pretty [lc_time_fmt $publish_date_ansi "%Q"] } if { ![template::util::date::validate $archive_date_ansi ""] } { - set archive_date_pretty [lc_time_fmt $archive_date_ansi "%x"] + set archive_date_pretty [lc_time_fmt $archive_date_ansi "%Q"] } if { [dt_interval_check $archive_date_ansi $publish_date_ansi] >= 0 } { @@ -212,8 +212,8 @@ set image_vars [export_form_vars publish_title publish_lead publish_body \ publish_date_ansi archive_date_ansi html_p \ permanent_p action] - set form_action "
" - set edit_action "" + set form_action "" + set edit_action "" } else { @@ -223,8 +223,8 @@ set image_vars [export_form_vars publish_title publish_lead publish_body \ publish_date_ansi archive_date_ansi html_p \ permanent_p action item_id revision_log] - set form_action "" - set edit_action "" + set form_action "" + set edit_action "" } # creator link