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

(-)a/help.pl (-4 / +56 lines)
Lines 21-27 use strict; Link Here
21
use warnings;
21
use warnings;
22
use C4::Templates;
22
use C4::Templates;
23
use C4::Output;
23
use C4::Output;
24
# use C4::Auth;
24
use C4::NewsChannels; # GetNewsToDisplay
25
use C4::Auth;
25
use C4::Context;
26
use C4::Context;
26
use CGI qw ( -utf8 );
27
use CGI qw ( -utf8 );
27
28
Lines 47-70 C4::Context->interface('intranet'); Link Here
47
our $refer = $query->param('url');
48
our $refer = $query->param('url');
48
$refer = $query->referer()  if !$refer || $refer eq 'undefined';
49
$refer = $query->referer()  if !$refer || $refer eq 'undefined';
49
my $from = _help_template_file_of_url($refer);
50
my $from = _help_template_file_of_url($refer);
51
my $helpkey = substr( $from, 0, rindex( $from, q{.} ) );
50
my $htdocs = C4::Context->config('intrahtdocs');
52
my $htdocs = C4::Context->config('intrahtdocs');
51
53
52
#
54
my $helpsys = C4::Context->preference('HelpSystem');
55
warn "VMVMVM";
56
warn $helpsys;
57
58
my %hs = split( /|/, $helpsys );
59
60
warn "VBVBVB";
61
warn %hs;
62
63
64
#Template for 'classic' Koha help text (filebased) if needed, otherwise no text
65
53
# checking that the help file exist, otherwise, display nohelp.tt page
66
# checking that the help file exist, otherwise, display nohelp.tt page
54
#
55
my ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
67
my ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
68
56
unless ( -e "$htdocs/$theme/$lang/modules/$from" ) {
69
unless ( -e "$htdocs/$theme/$lang/modules/$from" ) {
57
    $from = "help/nohelp.tt";
70
    $from = "help/nohelp.tt";
58
    ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
71
    ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
59
}
72
}
60
73
61
my $template = C4::Templates::gettemplate($from, 'intranet', $query);
74
# Classic Koha help text not used
75
if ( $helpsys eq 'newsbased' ) {
76
    #Template without classic Koha help text
77
    $from = "help/nohelptext.tt";
78
    ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
79
}
80
81
#my $template = C4::Templates::gettemplate($from, 'intranet', $query);
82
83
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
84
    {
85
        template_name   => $from,
86
        query           => $query,
87
        type            => "intranet",
88
        authnotrequired => 0,
89
    }
90
);
91
92
93
94
62
$template->param(
95
$template->param(
63
    referer => $refer,
96
    referer => $refer,
97
    helpkey => $helpkey,
64
    intranetstylesheet => C4::Context->preference("intranetstylesheet"),
98
    intranetstylesheet => C4::Context->preference("intranetstylesheet"),
65
    intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
99
    intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
66
);
100
);
67
101
102
$template->param( helpsystem => $helpsys );
103
$template->param( hs => %hs );
104
105
if ( ($helpsys eq 'newsbased') || ($helpsys eq 'filebased') ) {
106
107
    my $homebranch;
108
    if (C4::Context->userenv) {
109
        $homebranch = C4::Context->userenv->{'branch'};
110
    }
111
    my $help_from_news   = &GetNewsToDisplay('staffhelp', $homebranch);
112
    my $help_from_news_count = scalar @$help_from_news;
113
    $template->param(
114
        help_from_news       => $help_from_news,
115
        help_from_news_count => $help_from_news_count,
116
        homebranch           => $homebranch
117
    );
118
}
119
68
my $help_version = C4::Context->preference("Version");
120
my $help_version = C4::Context->preference("Version");
69
if ( $help_version =~ m|^(\d+)\.(\d{2}).*$| ) {
121
if ( $help_version =~ m|^(\d+)\.(\d{2}).*$| ) {
70
    my $version = $1;
122
    my $version = $1;
(-)a/installer/data/mysql/atomicupdate/bug_18472-Add_system_preference_CustomOnlineHelpStaff.perl (-1 / +1 lines)
Lines 1-7 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
3
    # you can use $dbh here like:
4
    $dbh->do("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('HelpSystem', 'filebased', 'filebased', 'Select online help system.', 'multiple')" );
4
    $dbh->do("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('HelpSystem', 'filebased', 'filebased|newsbased', 'Select online help system.', 'multiple')" );
5
    $dbh->do("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('EnableEditingFilebasedHelp', '1', '', 'Enable editing of file based Koha help.', 'yesno')" );
5
    $dbh->do("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('EnableEditingFilebasedHelp', '1', '', 'Enable editing of file based Koha help.', 'yesno')" );
6
6
7
    # or perform some test and warn
7
    # or perform some test and warn
(-)a/installer/data/mysql/atomicupdate/bug_18483_news-driven-help-system.perl (+17 lines)
Line 0 Link Here
1
$DBversion = 'XXXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    $dbh->do( "UPDATE systempreferences SET VALUE = 'filebased', OPTIONS = 'filebased|newsbased' where variable = 'HelpSystem'" );
5
6
    $dbh->do( "ALTER TABLE opac_news ADD COLUMN helpkey varchar(250) AFTER lang ");
7
    $dbh->do( "INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (13, 'edit_help', 'Edit custom help');" );
8
9
    # or perform some test and warn
10
    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
11
    #    warn "There is something wrong";
12
    # }
13
14
    # Always end with this (adjust the bug info)
15
    SetVersion( $DBversion );
16
    print "Upgrade to $DBversion done (Bug 18483 - Customised help: Enhance staff client with news based, easily editable help system)\n";
17
}
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 114-120 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
114
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
114
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
115
('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'),
115
('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'),
116
('CurrencyFormat','US','US|FR|CH','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice'),
116
('CurrencyFormat','US','US|FR|CH','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice'),
117
('HelpSystem', 'filebased', 'filebased', 'Select online help system.', 'multiple'),
117
('HelpSystem', 'filebased|newsbased', 'filebased', 'Select online help system.', 'multiple'),
118
("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('EnableEditingFilebasedHelp', '1', '', 'Enable editing of file based Koha help.', 'yesno')" ),
118
("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('EnableEditingFilebasedHelp', '1', '', 'Enable editing of file based Koha help.', 'yesno')" ),
119
('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'),
119
('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'),
120
('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'),
120
('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-1 / +2 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% USE Branches %]
2
[% USE Branches %]
2
<div id="header" class="navbar navbar-default">
3
<div id="header" class="navbar navbar-default">
3
    <div class="container-fluid">
4
    <div class="container-fluid">
Lines 97-103 Link Here
97
                    </li>
98
                    </li>
98
                </ul>
99
                </ul>
99
            </li>
100
            </li>
100
                [% IF Koha.Preference('HelpSystem') == 'filebased' %]
101
                [% IF Koha.Preference('HelpSystem').match('filebased|newsbased')  %]
101
                    <li>
102
                    <li>
102
                        <a class="toplinks" href="/cgi-bin/koha/help.pl" id="helper">Help</a>
103
                        <a class="toplinks" href="/cgi-bin/koha/help.pl" id="helper">Help</a>
103
                    </li>
104
                    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/help-bottom.inc (-3 / +4 lines)
Lines 1-10 Link Here
1
<form action="/cgi-bin/koha/edithelp.pl" method="post">
1
<form action="/cgi-bin/koha/edithelp.pl" method="post">
2
    <fieldset class="action"><input type="button" class="close" value="Close help window" />
2
    <fieldset class="action">
3
    [% IF (Koha.Preference('HelpSystem') == 'filebased') && (Koha.Preference('EnableEditingFilebasedHelp') ) %]
3
        <input type="button" class="close" value="Close help window" />
4
    [% IF Koha.Preference('HelpSystem').match('filebased') && (Koha.Preference('EnableEditingFilebasedHelp') && CAN_user_tools_edit_help ) %]
4
        <input type="hidden" name="type" value="modify" />
5
        <input type="hidden" name="type" value="modify" />
5
        <input type="hidden" name="referer" value="[% referer %]" />
6
        <input type="hidden" name="referer" value="[% referer %]" />
6
        <input type="submit" class="submit" value="Edit help" /></fieldset>
7
        <input type="submit" class="submit" value="Edit help" /></fieldset>
7
    [% END %]
8
    [% END %]
8
</form>
9
</div> <!-- /koha-help -->
9
</body>
10
</body>
10
</html>
11
</html>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc (-16 / +39 lines)
Lines 1-21 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Online help</title>
4
<title>Online help</title>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
7
<link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" />
8
[% INCLUDE intranetstylesheet.inc %]
9
[% IF ( bidi ) %]
10
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
11
[% END %]
12
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
13
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
14
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script>
15
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
16
<!-- koha core js -->
17
<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script>
18
19
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/help.css" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/help.css" />
20
</head>
6
[% USE Koha %]
7
[% INCLUDE 'doc-head-close.inc' %]
8
21
<body id="help" class="help">
9
<body id="help" class="help">
10
11
[% IF Koha.Preference('HelpSystem').match('newsbased') %]
12
    <div id="help_from_news">
13
        <h1><span class="help_title">Help for [% Branches.GetName( homebranch ) %]</span></h1>
14
            [% FOREACH helpitem IN help_from_news %]
15
            [% IF (helpitem.helpkey == helpkey) || (helpitem.helpkey == 'all') %]
16
                <div class="help-item-title" id="helpnews[% helpitem.idnew %]">
17
                    <h4>[% helpitem.title %]</h4>
18
                    <div class="help-item-body">[% helpitem.content %]</div>
19
                    <div class="help-item-date">[% helpitem.newdate %]</div>
20
                    <div class="help-item-footer">
21
                        [% IF CAN_user_tools_edit_help %]
22
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% helpitem.idnew %]">
23
                            <i class="fa fa-pencil"></i>Edit</a>
24
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/koha-news.pl?op=del&amp;ids=[% helpitem.idnew %]">
25
                            <i class="fa fa-trash"></i>Delete</a>
26
                        [% END %]
27
                    </div>
28
                </div>
29
            [% END %]
30
        [% END %]
31
        [% IF CAN_user_tools_edit_help %]
32
            <div class="help-item-buttons">
33
                <p><a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;helpkey=[% helpkey %]&amp;lang=staffhelp">
34
                <i class="fa fa-pencil"></i>New custom help for this page</a>
35
                <span class="hint">Key is: [% helpkey %]</span></p>
36
                <p><a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;helpkey=all&amp;lang=staffhelp">
37
                <i class="fa fa-plus"></i>New custom help for all pages</a>
38
                <span class="hint">Key is: all</span></p>
39
            </div>
40
        [% END %]
41
    </div><!-- /help-from-news -->
42
[% END %]
43
44
<div id="koha-help">
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+1 lines)
Lines 56-61 Link Here
56
    [%- CASE 'batch_upload_patron_images' -%]<span>Upload patron images in a batch or one at a time</span>
56
    [%- CASE 'batch_upload_patron_images' -%]<span>Upload patron images in a batch or one at a time</span>
57
    [%- CASE 'delete_anonymize_patrons' -%]<span>Delete old borrowers and anonymize circulation history (deletes borrower reading history)</span>
57
    [%- CASE 'delete_anonymize_patrons' -%]<span>Delete old borrowers and anonymize circulation history (deletes borrower reading history)</span>
58
    [%- CASE 'edit_calendar' -%]<span>Define days when the library is closed</span>
58
    [%- CASE 'edit_calendar' -%]<span>Define days when the library is closed</span>
59
    [%- CASE 'edit_help' -%]<span>Edit custom help</span>
59
    [%- CASE 'edit_news' -%]<span>Write news for the OPAC and staff interfaces</span>
60
    [%- CASE 'edit_news' -%]<span>Write news for the OPAC and staff interfaces</span>
60
    [%- CASE 'edit_notice_status_triggers' -%]<span>Set notice/status triggers for overdue items</span>
61
    [%- CASE 'edit_notice_status_triggers' -%]<span>Set notice/status triggers for overdue items</span>
61
    [%- CASE 'edit_notices' -%]<span>Define notices</span>
62
    [%- CASE 'edit_notices' -%]<span>Define notices</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+1 lines)
Lines 420-425 Administration: Link Here
420
              default: filebased
420
              default: filebased
421
              multiple:
421
              multiple:
422
                  filebased: "File based (staff client)"
422
                  filebased: "File based (staff client)"
423
                  newsbased: "News based"
423
        -
424
        -
424
            - "Enable editing of file based Koha help: "
425
            - "Enable editing of file based Koha help: "
425
            - pref: EnableEditingFilebasedHelp
426
            - pref: EnableEditingFilebasedHelp
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/mainpage.tt (-2 / +3 lines)
Lines 2-8 Link Here
2
[% INCLUDE 'help-top.inc' %]
2
[% INCLUDE 'help-top.inc' %]
3
3
4
<h2>Welcome to Koha</h2>
4
<h2>Welcome to Koha</h2>
5
6
<p>If this is your first time logging into Koha, you should now go to Koha Administration and set up all system preferences, patron categories, item types and libraries. You should also review the other settings found in Administration.</p>
5
<p>If this is your first time logging into Koha, you should now go to Koha Administration and set up all system preferences, patron categories, item types and libraries. You should also review the other settings found in Administration.</p>
7
6
8
<p>Once you have set up patron categories, you should create a new user in the Patrons module with superlibrarian permissions. Once that user is created, you should log in as that user rather than the root user which is set up as part of installation.</p>
7
<p>Once you have set up patron categories, you should create a new user in the Patrons module with superlibrarian permissions. Once that user is created, you should log in as that user rather than the root user which is set up as part of installation.</p>
Lines 18-24 Link Here
18
<li><a href="http://koha-community.org/get-involved/irc/">Chat with Koha users and developers</a></li>
17
<li><a href="http://koha-community.org/get-involved/irc/">Chat with Koha users and developers</a></li>
19
</ul>
18
</ul>
20
19
21
[% IF ( Koha.Preference('HelpSystem') == 'filebased' ) %]
20
[% IF ( Koha.Preference('HelpSystem') == 'filebased' ) && (CAN_user_tools_edit_help) %]
21
22
    <h2>Can I edit the online help?</h2>
22
    <h2>Can I edit the online help?</h2>
23
23
24
    <p>You can edit the online help through the Koha Staff Client by clicking the &quot;Edit Help&quot; button. This feature has been designed so that library workflow and policies can be documented within Koha.</p>
24
    <p>You can edit the online help through the Koha Staff Client by clicking the &quot;Edit Help&quot; button. This feature has been designed so that library workflow and policies can be documented within Koha.</p>
Lines 26-31 Link Here
26
    <p><strong>IMPORTANT:</strong> Your online help will be overwritten by the new Help when there is an upgrade. If you want to keep a copy of your online help, you should instruct your System Administrator to upgrade the Online Help directory in the Koha file tree.</p>
26
    <p><strong>IMPORTANT:</strong> Your online help will be overwritten by the new Help when there is an upgrade. If you want to keep a copy of your online help, you should instruct your System Administrator to upgrade the Online Help directory in the Koha file tree.</p>
27
27
28
    <p>The online help directory is: <pre>[% themelang %]/modules/help</pre></p>
28
    <p>The online help directory is: <pre>[% themelang %]/modules/help</pre></p>
29
29
    <p><strong>Note:</strong> Files in help directory must be writeable to make this feature work. Additionally, system preference 'EnableEditingFilebasedHelp' must be set to 'Yes'.</p>
30
    <p><strong>Note:</strong> Files in help directory must be writeable to make this feature work. Additionally, system preference 'EnableEditingFilebasedHelp' must be set to 'Yes'.</p>
30
[% END %]
31
[% END %]
31
32
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/nohelptext.tt (+2 lines)
Line 0 Link Here
1
[% INCLUDE 'help-top.inc' %]
2
[% INCLUDE 'help-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (+23 lines)
Lines 119-124 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
119
                [% ELSE %]
119
                [% ELSE %]
120
                <option value="slip"                    >Slip</option>
120
                <option value="slip"                    >Slip</option>
121
                [% END %]
121
                [% END %]
122
                [% IF ( default_lang == "staffhelp" ) %]
123
                    <option value="staffhelp" selected="selected">Staff help</option>
124
                [% ELSE %]
125
                    <option value="staffhelp">Staffhelp</option>
126
                [% END %]
122
                [% FOREACH lang_lis IN lang_list %]
127
                [% FOREACH lang_lis IN lang_list %]
123
                [% IF ( lang_lis.language == default_lang ) %]
128
                [% IF ( lang_lis.language == default_lang ) %]
124
                    <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
129
                    <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
Lines 161-166 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
161
                    <input id="number" size="3" name="number" type="text" />
166
                    <input id="number" size="3" name="number" type="text" />
162
                [% END %]
167
                [% END %]
163
            </li>
168
            </li>
169
            <li>
170
                <label for="helpkey">Help key: </label>
171
                [% IF ( new_detail.helpkey ) %]
172
                    <input id="number" size="60" name="helpkey" type="text" value="[% new_detail.helpkey %]" />
173
                [% ELSIF ( helpkey ) %]
174
                    <input id="number" size="60" name="helpkey" type="text" value="[% helpkey %]" />
175
                [% ELSE %]
176
                    <input id="helpkey" size="60" name="helpkey" type="text" />
177
                [% END %]
178
                <span class="hint">Used for news driven custom help system</span>
179
            </li>
164
            <li><label for="content">News: </label>
180
            <li><label for="content">News: </label>
165
            <textarea name="content" id="content"  cols="75" rows="10">[% new_detail.content %]</textarea>
181
            <textarea name="content" id="content"  cols="75" rows="10">[% new_detail.content %]</textarea>
166
            </li>
182
            </li>
Lines 189-194 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
189
            [% ELSE %]
205
            [% ELSE %]
190
            <option value="slip"         >Slip</option>
206
            <option value="slip"         >Slip</option>
191
            [% END %]
207
            [% END %]
208
            [% IF ( lang == "staffhelp" ) %]
209
            <option value="staffhelp" selected="selected">Staff help</option>
210
            [% ELSE %]
211
            <option value="staffhelp"         >Staff help</option>
212
            [% END %]
192
                [% FOREACH lang_lis IN lang_list %]
213
                [% FOREACH lang_lis IN lang_list %]
193
                [% IF ( lang_lis.language == lang ) %]
214
                [% IF ( lang_lis.language == lang ) %]
194
                    <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
215
                    <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
Lines 240-245 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
240
                                    Slip
261
                                    Slip
241
                                [%   CASE "" %]
262
                                [%   CASE "" %]
242
                                    All
263
                                    All
264
                                [% CASE "staffhelp" %]
265
                                    Staff help <span class="hint">[% opac_new.helpkey %]</span>
243
                                [%   CASE %]
266
                                [%   CASE %]
244
                                    OPAC ([% opac_new.lang %])
267
                                    OPAC ([% opac_new.lang %])
245
                                [% END %]
268
                                [% END %]
(-)a/tools/koha-news.pl (-3 / +9 lines)
Lines 45-50 if ( $cgi->param('expirationdate') ) { Link Here
45
}
45
}
46
my $timestamp      = output_pref({ dt => dt_from_string( scalar $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 });
46
my $timestamp      = output_pref({ dt => dt_from_string( scalar $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 });
47
my $number         = $cgi->param('number');
47
my $number         = $cgi->param('number');
48
my $helpkey        = $cgi->param('helpkey');
48
my $lang           = $cgi->param('lang');
49
my $lang           = $cgi->param('lang');
49
my $branchcode     = $cgi->param('branch');
50
my $branchcode     = $cgi->param('branch');
50
my $error_message  = $cgi->param('error_message');
51
my $error_message  = $cgi->param('error_message');
Lines 99-105 if ( $op eq 'add_form' ) { Link Here
99
        $template->{VARS}->{'new_detail'} = $new_detail;
100
        $template->{VARS}->{'new_detail'} = $new_detail;
100
    }
101
    }
101
    else {
102
    else {
102
        $template->param( op => 'add' );
103
        $template->param(
104
            op => 'add',
105
            helpkey => $helpkey
106
        );
107
103
    }
108
    }
104
}
109
}
105
elsif ( $op eq 'add' ) {
110
elsif ( $op eq 'add' ) {
Lines 112-117 elsif ( $op eq 'add' ) { Link Here
112
                expirationdate => $expirationdate,
117
                expirationdate => $expirationdate,
113
                timestamp      => $timestamp,
118
                timestamp      => $timestamp,
114
                number         => $number,
119
                number         => $number,
120
                helpkey        => $helpkey,
115
                branchcode     => $branchcode,
121
                branchcode     => $branchcode,
116
                borrowernumber => $borrowernumber,
122
                borrowernumber => $borrowernumber,
117
            }
123
            }
Lines 131-136 elsif ( $op eq 'edit' ) { Link Here
131
            lang           => $lang,
137
            lang           => $lang,
132
            expirationdate => $expirationdate,
138
            expirationdate => $expirationdate,
133
            timestamp      => $timestamp,
139
            timestamp      => $timestamp,
140
            helpkey        => $helpkey,
134
            number         => $number,
141
            number         => $number,
135
            branchcode     => $branchcode,
142
            branchcode     => $branchcode,
136
        }
143
        }
Lines 145-151 elsif ( $op eq 'del' ) { Link Here
145
152
146
else {
153
else {
147
154
148
    my ( $opac_news_count, $opac_news ) = &get_opac_news( undef, $lang, $branchcode );
155
    my ( $opac_news_count, $opac_news ) = &get_opac_news( undef, 'staffhelp', $branchcode );
149
    
156
    
150
    foreach my $new ( @$opac_news ) {
157
    foreach my $new ( @$opac_news ) {
151
        next unless $new->{'expirationdate'};
158
        next unless $new->{'expirationdate'};
152
- 

Return to bug 18483