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

(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (-1 / +10 lines)
Lines 886-892 fieldset.rows .inputnote { Link Here
886
	background-repeat : no-repeat;
886
	background-repeat : no-repeat;
887
}
887
}
888
888
889
#editpatron a, #editmenuc .first-child, #editshelf a, #edit a, #editsupplier a, #managelabel a, #managetemplate a, #managelabelbatch a, #manageprofile a {
889
#editpatron a,
890
#editreport a,
891
#editmenuc .first-child,
892
#editshelf a,
893
#edit a,
894
#editsupplier a,
895
#managelabel a,
896
#managetemplate a,
897
#managelabelbatch a,
898
#manageprofile a {
890
	padding-left : 34px;
899
	padding-left : 34px;
891
	background-image: url("../../img/toolbar-edit.gif");
900
	background-image: url("../../img/toolbar-edit.gif");
892
	background-position : center left;
901
	background-position : center left;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc (-4 / +2 lines)
Lines 1-8 Link Here
1
<h5>Build and Run Reports</h5>
1
<h5>Run Reports</h5>
2
<ul>
2
<ul>
3
	[% IF ( CAN_user_reports_create_reports ) %]<li><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build New</a></li>[% END %]
3
	[% IF ( CAN_user_reports_execute_reports ) %]<li><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a></li>[% END %]
4
	[% IF ( CAN_user_reports_execute_reports ) %]<li><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Use Saved</a></li>[% END %]
5
	[% IF ( CAN_user_reports_create_reports ) %]<li><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">Create from SQL</a></li>[% END %]
6
</ul>
4
</ul>
7
<h5>Reports Dictionary</h5>
5
<h5>Reports Dictionary</h5>
8
<ul>
6
<ul>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc (+44 lines)
Line 0 Link Here
1
[% UNLESS ( no_add ) %]
2
<div id="toolbar">
3
	<script type="text/javascript">
4
	//<![CDATA[
5
	 $(document).ready(function() {
6
		$("#newmenuc").empty();
7
		$("#newsql").remove();
8
		yuiToolbar();
9
	 });
10
11
	// YUI Toolbar Functions
12
	function yuiToolbar() {
13
	[% IF ( CAN_user_reports_create_reports ) %]
14
		var newmenu = [
15
			{ text: _("Guided report"),  url: "/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new" },
16
			{ text: _("SQL report"),  url: "/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL" }
17
		]
18
	    new YAHOO.widget.Button({
19
	        type: "menu",
20
	        label: _("New"),
21
	        name: "newmenubutton",
22
	        menu: newmenu,
23
	        container: "newmenuc"
24
	    });
25
	    new YAHOO.widget.Button("editreport");[% END %]
26
	    new YAHOO.widget.Button("runreport");
27
	}
28
	//]]>
29
	</script>
30
31
	<ul class="toolbar">
32
		[% 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 %]
33
		<li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
34
		[% IF ( showsql || execute || editsql || save_successful ) %]
35
			[% UNLESS ( errors ) %][%# Unless there are errors saving a report %]
36
				[% UNLESS ( editsql ) %][%# Do not show edit button on edit page %]
37
					[% 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 %]
38
				[% END %]
39
				<li><a id="runreport" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Run%20this%20report">Run report</a></li>
40
			[% END %]
41
		[% END %]
42
	</ul>
43
</div>
44
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-6 / +15 lines)
Lines 87-92 $(document).ready(function(){ Link Here
87
<div id="bd">
87
<div id="bd">
88
<div id="yui-main">
88
<div id="yui-main">
89
    <div class="yui-b">
89
    <div class="yui-b">
90
    [% INCLUDE "reports-toolbar.inc" %]
90
91
91
[% IF ( start ) %]
92
[% IF ( start ) %]
92
    <h2>Guided Reports</h2>
93
    <h2>Guided Reports</h2>
Lines 548-554 canned reports and writing custom SQL reports.</p> Link Here
548
</fieldset>
549
</fieldset>
549
550
550
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
551
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
551
<input type="submit" name="submit" value="Save Report" /></fieldset>
552
<input type="submit" name="submit" value="Save Report" /> <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved" class="cancel">Cancel</a>
553
</fieldset>
552
</form>
554
</form>
553
[% END %]
555
[% END %]
554
556
Lines 589-595 Sub report:<select name="subreport"> Link Here
589
[% END %]
591
[% END %]
590
592
591
[% IF ( showsql ) %]
593
[% IF ( showsql ) %]
592
<textarea id="sql">[% sql %]</textarea>
594
<fieldset class="rows">
595
    <legend>[% reportname %]</legend>
596
    <ol>
597
        [% IF ( notes ) %]<li><span class="label">Notes:</span> [% notes %]</li>[% ELSE %][% END %]
598
        <li><textarea id="sql">[% sql %]</textarea></li>
599
    </ol>
600
</fieldset>
593
[% END %]
601
[% END %]
594
602
595
[% IF ( editsql ) %]
603
[% IF ( editsql ) %]
Lines 597-612 Sub report:<select name="subreport"> Link Here
597
<input type="hidden" name="phase" value="Update SQL" />
605
<input type="hidden" name="phase" value="Update SQL" />
598
<input type="hidden" name="id" value="[% id %]"/>
606
<input type="hidden" name="id" value="[% id %]"/>
599
<fieldset class="rows">
607
<fieldset class="rows">
600
<legend>Edit SQL</legend>
608
<legend>Edit SQL report</legend>
601
<ol>
609
<ol>
602
<li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" /></li>
610
<li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li>
603
<li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li>
611
<li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li>
604
<li><textarea id="sql" name="sql" rows="10" cols="60">[% sql %]</textarea></li>
612
<li><textarea id="sql" name="sql" rows="10" cols="60">[% sql %]</textarea></li>
605
</ol>
613
</ol>
606
</fieldset>
614
</fieldset>
607
615
608
<fieldset class="action">
616
<fieldset class="action">
609
<input type="submit" name="submit" value="Update SQL" /></fieldset>
617
<input type="submit" name="submit" value="Update SQL" /> <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved" class="cancel">Cancel</a>
618
</fieldset>
610
</form>
619
</form>
611
620
612
621
Lines 615-621 Sub report:<select name="subreport"> Link Here
615
[% IF ( save_successful ) %]
624
[% IF ( save_successful ) %]
616
[% UNLESS ( errors ) %]
625
[% UNLESS ( errors ) %]
617
<h2>Your report has been saved</h2>
626
<h2>Your report has been saved</h2>
618
<p>The report you have created has now been saved. You can now</p>
627
<h4>[% reportname %]</h4>
619
<ul>
628
<ul>
620
    [% IF ( id ) %]
629
    [% IF ( id ) %]
621
    <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Run%20this%20report">Run this report</a></li>
630
    <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Run%20this%20report">Run this report</a></li>
(-)a/reports/guided_reports.pl (-3 / +8 lines)
Lines 112-120 elsif ( $phase eq 'Delete Saved') { Link Here
112
elsif ( $phase eq 'Show SQL'){
112
elsif ( $phase eq 'Show SQL'){
113
	
113
	
114
	my $id = $input->param('reports');
114
	my $id = $input->param('reports');
115
	my $sql = get_sql($id);
115
    my ($sql,$type,$reportname,$notes) = get_saved_report($id);
116
	$template->param(
116
	$template->param(
117
		'sql' => $sql,
117
        'id'      => $id,
118
        'reportname' => $reportname,
119
        'notes'      => $notes,
120
		'sql'     => $sql,
118
		'showsql' => 1,
121
		'showsql' => 1,
119
    );
122
    );
120
}
123
}
Lines 154-159 elsif ( $phase eq 'Update SQL'){ Link Here
154
        update_sql( $id, $sql, $reportname, $notes );
157
        update_sql( $id, $sql, $reportname, $notes );
155
        $template->param(
158
        $template->param(
156
            'save_successful'       => 1,
159
            'save_successful'       => 1,
160
            'reportname'            => $reportname,
157
            'id'                    => $id,
161
            'id'                    => $id,
158
        );
162
        );
159
    }
163
    }
Lines 392-397 elsif ( $phase eq 'Save Report' ) { Link Here
392
        my $id = save_report( $borrowernumber, $sql, $name, $type, $notes );
396
        my $id = save_report( $borrowernumber, $sql, $name, $type, $notes );
393
        $template->param(
397
        $template->param(
394
            'save_successful'       => 1,
398
            'save_successful'       => 1,
399
            'reportname'            => $name,
395
            'id'                    => $id,
400
            'id'                    => $id,
396
        );
401
        );
397
    }
402
    }
Lines 528-533 elsif ($phase eq 'Run this report'){ Link Here
528
        $template->param(
533
        $template->param(
529
            'results' => \@rows,
534
            'results' => \@rows,
530
            'sql'     => $sql,
535
            'sql'     => $sql,
536
            'id'      => $report,
531
            'execute' => 1,
537
            'execute' => 1,
532
            'name'    => $name,
538
            'name'    => $name,
533
            'notes'   => $notes,
539
            'notes'   => $notes,
534
- 

Return to bug 7668