X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=tools%2Fkoha-news.pl;h=4dd07a9b2535969b324fc7b09b0c1d29b3e9f9c3;hb=08382876306cfda839637c5f72a107b304458a8e;hp=ff763e08bf292ccb8d48f07be7a4b8741f6d613c;hpb=c7f22f84ada7ad803ce30d253bd95555ad0aab64;p=koha.git diff --git a/tools/koha-news.pl b/tools/koha-news.pl index ff763e08bf..4dd07a9b25 100755 --- a/tools/koha-news.pl +++ b/tools/koha-news.pl @@ -17,11 +17,12 @@ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use strict; +#use warnings; FIXME - Bug 2505 use CGI; use C4::Auth; use C4::Koha; @@ -38,6 +39,7 @@ my $id = $cgi->param('id'); my $title = $cgi->param('title'); my $new = $cgi->param('new'); my $expirationdate = format_date_in_iso($cgi->param('expirationdate')); +my $timestamp = format_date_in_iso($cgi->param('timestamp')); my $number = $cgi->param('number'); my $lang = $cgi->param('lang'); @@ -49,7 +51,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( query => $cgi, type => "intranet", authnotrequired => 0, - flagsrequired => { tools => 1 }, + flagsrequired => { tools => 'edit_news' }, debug => 1, } ); @@ -60,8 +62,8 @@ my $tlangs = getTranslatedLanguages() ; foreach my $language ( @$tlangs ) { push @lang_list, { - language => $language->{'language_code'}, - selected => ( $new_detail->{lang} eq $language->{'language_code'} ? 1 : 0 ), + language => $language->{'rfc4646_subtag'}, + selected => ( $new_detail->{lang} eq $language->{'rfc4646_subtag'} ? 1 : 0 ), }; } @@ -72,22 +74,23 @@ my $op = $cgi->param('op'); if ( $op eq 'add_form' ) { $template->param( add_form => 1 ); if ($id) { + if($new_detail->{lang} eq "slip"){ $template->param( slip => 1); } $template->param( op => 'edit', id => $new_detail->{'idnew'} ); - $template->param($new_detail); + $template->{VARS}->{'new_detail'} = $new_detail; } else { $template->param( op => 'add' ); } } elsif ( $op eq 'add' ) { - add_opac_new( $title, $new, $lang, $expirationdate, $number ); + add_opac_new( $title, $new, $lang, $expirationdate, $timestamp, $number ); print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); } elsif ( $op eq 'edit' ) { - upd_opac_new( $id, $title, $new, $lang, $expirationdate, $number ); + upd_opac_new( $id, $title, $new, $lang, $expirationdate, $timestamp ,$number ); print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); } elsif ( $op eq 'del' ) { @@ -115,7 +118,4 @@ else { opac_news_count => $opac_news_count, ); } -$template->param( - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), - ); output_html_with_http_headers $cgi, $cookie, $template->output;