Koha/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc
Owen Leonard 20b68731e3 Bug 7668 - Improve navigation and toolbar options in guided reports
Creating new include, reports-toolbar.inc for presenting "action"
options to the user, in contrast with "view" options in the left-
hand navigation menu.

In the toolbar: New (guided report, SQL report), Edit, Run.

The presence of the toolbar allows the user to access functions
more flexibly: Getting directly to 'edit' or 'run' from the 'view'
page for instance.

Modifications to guided_reports.pl pass report id and name to
the template for clarity and for the purpose of enabling the
edit/run buttons.

To test: Apply the patch and go through the process of creating
a new saved SQL report. Note that the toolbar is present and
the buttons are functional at appropriate times.

New and Edit options should only be displayed if the user has
permission to create reports. Test with a user who does not
have create permission to confirm.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-19 18:00:15 +01:00

44 lines
No EOL
1.7 KiB
HTML

[% UNLESS ( no_add ) %]
<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$("#newmenuc").empty();
$("#newsql").remove();
yuiToolbar();
});
// YUI Toolbar Functions
function yuiToolbar() {
[% IF ( CAN_user_reports_create_reports ) %]
var newmenu = [
{ text: _("Guided report"), url: "/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new" },
{ text: _("SQL report"), url: "/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL" }
]
new YAHOO.widget.Button({
type: "menu",
label: _("New"),
name: "newmenubutton",
menu: newmenu,
container: "newmenuc"
});
new YAHOO.widget.Button("editreport");[% END %]
new YAHOO.widget.Button("runreport");
}
//]]>
</script>
<ul class="toolbar">
[% IF ( CAN_user_reports_create_reports ) %]<li id="newmenuc"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">New guided report</a> </li>[% END %]
<li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
[% IF ( showsql || execute || editsql || save_successful ) %]
[% UNLESS ( errors ) %][%# Unless there are errors saving a report %]
[% UNLESS ( editsql ) %][%# Do not show edit button on edit page %]
[% IF ( CAN_user_reports_create_reports ) %]<li><a id="editreport" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Edit%20SQL">Edit</a></li>[% END %]
[% END %]
<li><a id="runreport" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Run%20this%20report">Run report</a></li>
[% END %]
[% END %]
</ul>
</div>
[% END %]