View | Details | Raw Unified | Return to bug 12740
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (+1 lines)
Lines 60-65 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
60
	<div class="yui-b">
60
	<div class="yui-b">
61
61
62
[% UNLESS ( add_form ) %]
62
[% UNLESS ( add_form ) %]
63
    [% IF (error_message) %]<p>[% error_message %]</p>[% END %]
63
<div id="toolbar" class="btn-toolbar">
64
<div id="toolbar" class="btn-toolbar">
64
    <a class="btn btn-small" id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;lang=[% lang %]"><i class="icon-plus"></i> New entry</a>
65
    <a class="btn btn-small" id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;lang=[% lang %]"><i class="icon-plus"></i> New entry</a>
65
</div>
66
</div>
(-)a/tools/koha-news.pl (-13 / +22 lines)
Lines 45-50 my $timestamp = format_date_in_iso($cgi->param('timestamp')); Link Here
45
my $number         = $cgi->param('number');
45
my $number         = $cgi->param('number');
46
my $lang           = $cgi->param('lang');
46
my $lang           = $cgi->param('lang');
47
my $branchcode     = $cgi->param('branch');
47
my $branchcode     = $cgi->param('branch');
48
my $error_message  = $cgi->param('error_message');
49
48
# Foreign Key constraints work with NULL, not ''
50
# Foreign Key constraints work with NULL, not ''
49
# NULL = All branches.
51
# NULL = All branches.
50
$branchcode = undef if (defined($branchcode) && $branchcode eq '');
52
$branchcode = undef if (defined($branchcode) && $branchcode eq '');
Lines 62-67 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
62
    }
64
    }
63
);
65
);
64
66
67
# Pass error message if there is one.
68
$template->param( error_message => $error_message ) if $error_message;
69
65
# get lang list
70
# get lang list
66
my @lang_list;
71
my @lang_list;
67
my $tlangs = getTranslatedLanguages() ;
72
my $tlangs = getTranslatedLanguages() ;
Lines 99-116 if ( $op eq 'add_form' ) { Link Here
99
    }
104
    }
100
}
105
}
101
elsif ( $op eq 'add' ) {
106
elsif ( $op eq 'add' ) {
102
    add_opac_new(
107
    if ($title) {
103
        {
108
        add_opac_new(
104
            title          => $title,
109
            {
105
            new            => $new,
110
                title          => $title,
106
            lang           => $lang,
111
                new            => $new,
107
            expirationdate => $expirationdate,
112
                lang           => $lang,
108
            timestamp      => $timestamp,
113
                expirationdate => $expirationdate,
109
            number         => $number,
114
                timestamp      => $timestamp,
110
            branchcode     => $branchcode,
115
                number         => $number,
111
        }
116
                branchcode     => $branchcode,
112
    );
117
            }
113
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
118
        );
119
        print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
120
    }
121
    else {
122
        print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl?error_message=ERROR:+Required+news+title+missing!");
123
    }
114
}
124
}
115
elsif ( $op eq 'edit' ) {
125
elsif ( $op eq 'edit' ) {
116
    upd_opac_new(
126
    upd_opac_new(
117
- 

Return to bug 12740