Bugzilla – Attachment 10218 Details for
Bug 6828
Add admin dashboard for staff users
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 6828 follow-up: adapt dashboard to new staff client theme
SIGNED-OFF-Bug-6828-follow-up-adapt-dashboard-to-n.patch (text/plain), 25.43 KB, created by
Kyle M Hall
on 2012-06-11 14:44:29 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 6828 follow-up: adapt dashboard to new staff client theme
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-06-11 14:44:29 UTC
Size:
25.43 KB
patch
obsolete
>From dda42153daf0d26ccd906575ad8193611cea5f71 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Sat, 9 Jun 2012 22:55:37 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 6828 follow-up: adapt dashboard to new staff client theme > >This follow-up makes a few cosmetic changes: >* Moves the dashboard to underneath the "pending" panel >* Switches the layout to CSS-based instead of table-based >* Makes the error message translatable >* Reindents some sections of the added code to make things more readable > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../intranet-tmpl/prog/en/css/staff-global.css | 20 ++ > .../intranet-tmpl/prog/en/modules/intranet-main.tt | 209 ++++++------- > mainpage.pl | 316 ++++++++++---------- > 3 files changed, 275 insertions(+), 270 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >index 555005b..3ac041a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >@@ -2364,3 +2364,23 @@ ul.ui-tabs-nav li { > #header_search .ui-corner-top { > border-radius: 0 0 4px 4px; > } >+ >+#dashboard td { >+ text-align: left; >+} >+ >+.dashboardleftpane { >+ margin-left: 1em; >+ margin-bottom: 1em; >+ float: left; >+} >+ >+.dashboardrightpane { >+ margin-right: 1em; >+ margin-bottom: 1em; >+ float: right; >+} >+ >+.dashboardempty { >+ background-color: #E8E8E8; >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index affb547..36d3b3f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -125,6 +125,105 @@ > </div> > [% END %] > >+ <!-- Dashboard, if on --> >+ [% IF DashBoardDisplayed %] >+ [% UNLESS nofile %] >+ <fieldset id="dashboard" class="rows"> >+ <legend>Koha library dashboard</legend> >+ <div class="dashboardleftpane"> >+ <table id="overview" width="400"> >+ <tr> >+ <th>Overview</th> >+ <th>System</th> >+ <th>My Library</th> >+ </tr> >+ <tr align="left"> >+ <td align="left">Number of Biblios</td> >+ <td>[% number_of_biblios %]</td> >+ <td class="dashboardempty"></td> >+ </tr> >+ <tr> >+ <td>Biblios added in last 7 days</td> >+ <td>[% biblios_7days %]</td> >+ <td class="dashboardempty"></td> >+ </tr> >+ <tr> >+ <td>Number of Items</td> >+ <td>[% items_system %]</td> >+ <td>[% items_library %]</td> >+ </tr> >+ <tr> >+ <td>Number of items added in last 7 days</td> >+ <td> [% items_7days_system %]</td> >+ <td>[% items_7days_system %]</td> >+ </tr> >+ <tr> >+ <td>Registered Borrowers</td> >+ <td>[% borrowers_system %]</td> >+ <td>[% borrowers_library %]</td> >+ </tr> >+ <tr> >+ <td>Expired Borrowers</td> >+ <td>[% expired_borrowers_system %]</td> >+ <td>[% expired_borrowers_library %]</td> >+ </tr> >+ <tr> >+ <td> </td> >+ <td></td> >+ <td></td> >+ </tr> >+ </table> >+ Last updated: [% last_updated %] >+ </div> >+ <div class="dashboardrightpane"> >+ <table id="circulation" width="400"> >+ <tr> >+ <th>Circulation</th> >+ <th>System</th> >+ <th>My Library</th> >+ </tr> >+ <tr> >+ <td>Items on Loan</td> >+ <td>[% issues_system %]</td> >+ <td>[% issues_library %]</td> >+ </tr> >+ <tr> >+ <td>Loan History</td> >+ <td>[% loan_history_system %]</td> >+ <td>[% loan_history_library %]</td> >+ </tr> >+ <tr> >+ <td>Items Overdue</td> >+ <td>[% overdues_system %]</td> >+ <td>[% overdues_library %]</td> >+ </tr> >+ <tr> >+ <td>Overdue within 7 days</td> >+ <td>[% overdues_7days_system %]</td> >+ <td>[% overdues_7days_library %]</td> >+ </tr> >+ <tr> >+ <td>Overdue 8-14 days</td> >+ <td>[% overdues_14days_system %]</td> >+ <td>[% overdues_14days_library %]</td> >+ </tr> >+ <tr> >+ <td>Overdue 15-21 days</td> >+ <td>[% overdues_21days_system %]</td> >+ <td>[% overdues_21days_library %]</td> >+ </tr> >+ <tr> >+ <td>Very Overdue Items</td> >+ <td>[% very_overdue_system %]</td> >+ <td>[% very_overdue_library %]</td> >+ </tr> >+ </table> >+ </div> >+ </fieldset> >+ [% ELSE %] >+ <b>Dashboard is set to "Show." However there is no XML file to read. Have you run it at least once?</b> >+ [% END %] >+ [% END %] <!-- End dashboard --> > > </div> > [% IF ( IntranetmainUserblock ) %] >@@ -155,117 +254,7 @@ > </div><!-- /koha-news --> > [% END %] > >-<!-- Dashboard, if on --> >-[% IF DashBoardDisplayed %] >-[% UNLESS nofile %] >-<fieldset class="rows"> >-<legend>Koha Library Dashboard</legend> >- <table style="border:0px;" id="dashboard"> >- <tr style="border-bottom: 0px;border-left: 0px;"> >- <td style="border-left: 0px;border-bottom: 0px;"> >- <table id="overview" width="400"> >- <tr> >- <th>Overview</th> >- <th>System</th> >- <th>My Library</th> >- </tr> >- <tr align="left"> >- <td align="left">Number of Biblios >- </td> >- <td>[% number_of_biblios %]</td> >- <td style="background-color:#E8E8E8"></td> >- </tr> >- <tr> >- <td>Biblios added in last 7 days</td> >- <td>[% biblios_7days %]</td> >- <td style="background-color:#E8E8E8"></td> >- </tr> >- <tr> >- <td>Number of Items</td> >- <td>[% items_system %]</td> >- <td>[% items_library %]</td> >- </tr> >- <tr> >- <td>Number of items added in last 7 days</td> >- <td> [% items_7days_system %]</td> >- <td>[% items_7days_system %]</td> >- </tr> >- <tr> >- <td>Registered Borrowers</td> >- <td>[% borrowers_system %]</td> >- <td>[% borrowers_library %]</td> >- </tr> >- <tr> >- <td>Expired Borrowers</td> >- <td>[% expired_borrowers_system %]</td> >- <td>[% expired_borrowers_library %]</td> >- </tr> >- <tr> >- <td> </td> >- <td></td> >- <td></td> >- </tr> >- >- </table> >- Last updated: [% last_updated %] >- </td> >- <td style="border-bottom: 0px;border-left: 0px;"> >- >- <table id="circulation" width="400"> >- <tr> >- <th>Circulation</th> >- <th>System</th> >- <th>My Library</th> >- </tr> >- <tr align="left"> >- <td align="left">Items on Loan >- </td> >- <td>[% issues_system %]</td> >- <td>[% issues_library %]</td> >- </tr> >- <tr> >- <td>Loan History</td> >- <td>[% loan_history_system %]</td> >- <td>[% loan_history_library %]</td> >- </tr> >- <tr> >- <td>Items Overdue</td> >- <td>[% overdues_system %]</td> >- <td>[% overdues_library %]</td> >- </tr> >- <tr> >- <td>Overdue within 7 days</td> >- <td>[% overdues_7days_system %]</td> >- <td>[% overdues_7days_library %]</td> >- </tr> >- <tr> >- <td>Overdue 8-14 days</td> >- <td>[% overdues_14days_system %]</td> >- <td>[% overdues_14days_library %]</td> >- </tr> >- <tr> >- <td>Overdue 15-21 days</td> >- <td>[% overdues_21days_system %]</td> >- <td>[% overdues_21days_library %]</td> >- </tr> >- <tr> >- <td>Very Overdue Items</td> >- <td>[% very_overdue_system %]</td> >- <td>[% very_overdue_library %]</td> >- </tr> >- </table> >- </td> >- </tr> >- </table> >-</fieldset> >-</div> >-</div> > </div> >-[% END %] >-[% END %] >-[% IF nofile %] >-<b>[% nofile %]</b> >-[% END %] > </div> > > <!-- the main div is closed in intranet-bottom.inc --> >diff --git a/mainpage.pl b/mainpage.pl >index 5644542..2154a97 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -61,177 +61,173 @@ $template->param( > ); > > # Dashboard (If on in SysPref) >-my $nofile = "Dashboard is set to \"ON\". However there is no XML file to read. Have you run it at least once?"; > if ( C4::Context->preference('DashBoardDisplayed') ) > { > my $koha_conf = $ENV{'KOHA_CONF'}; > my ($base,$file) = $koha_conf =~ m|^(.*[/\\])([^/\\]+?)$|; > my $xml_read = "dashboard_xml.out"; > my $xml_file = "$base"."$xml_read"; >-if (-e $xml_file) { >- my $xml = new XML::Simple; >- my $dash = $xml->XMLin($xml_file); >- my $login_branch_name = $template->{VARS}{LoginBranchcode}; >- my $number_of_biblios; >- my $biblios_7days; >- my $items_7days_system; >- my $items_7days_library; >- my $borrowers_system; >- my $expired_borrowers_library; >- my $expired_borrowers_system; >- my $loan_history_system; >- my $loan_history_library; >- my $overdues_library; >- my $overdues_system; >- my $overdues_7days_library; >- my $overdues_7days_system; >- my $overdues_14days_library; >- my $overdues_14days_system; >- my $overdues_21days_library; >- my $overdues_21days_system; >- my $very_overdue_library; >- my $very_overdue_system; >- my $borrowers_library; >- my $issues_library; >- my $issues_system; >- my $items_library; >- my $items_system; >- my $last_updated; >- >- $number_of_biblios = $dash->{biblios}->{NumberOfBiblios}; >- $biblios_7days = $dash->{biblio_7days}->{NumberOfBiblio7Days}; >- $items_7days_system = $dash->{items_7days_system}->{NumberOfItems7Days}; >- $borrowers_system = $dash->{number_of_borrowers_system}->{NumberofBorrowersSystem}; >- $loan_history_system = $dash->{loan_history_system}->{NumberOfLoans}; >- $items_system = $dash->{items_system}->{NumberOfItemsSystem}; >- $expired_borrowers_system = $dash->{expired_borrowers_system}->{ExpiredBorrowers}; >- $issues_system = $dash->{issues_system}->{NumberOfIssuesSystem}; >- $overdues_system = $dash->{overdues_system}->{NumberOfOverdues}; >- $overdues_7days_system = $dash->{overdues_7days_system}->{NumberOfOverdues}; >- $overdues_14days_system = $dash->{overdues_14days_system}->{NumberOfOverdues14Days}; >- $overdues_21days_system = $dash->{overdues_21days_system}->{NumberOfOverdues21Days}; >- $very_overdue_system = $dash->{very_overdue_system}->{Overdues}; >- $last_updated = $dash->{last_updated}->{UpdatedTime}; >+ if (-e $xml_file) { >+ my $xml = new XML::Simple; >+ my $dash = $xml->XMLin($xml_file); >+ my $login_branch_name = $template->{VARS}{LoginBranchcode}; >+ my $number_of_biblios; >+ my $biblios_7days; >+ my $items_7days_system; >+ my $items_7days_library; >+ my $borrowers_system; >+ my $expired_borrowers_library; >+ my $expired_borrowers_system; >+ my $loan_history_system; >+ my $loan_history_library; >+ my $overdues_library; >+ my $overdues_system; >+ my $overdues_7days_library; >+ my $overdues_7days_system; >+ my $overdues_14days_library; >+ my $overdues_14days_system; >+ my $overdues_21days_library; >+ my $overdues_21days_system; >+ my $very_overdue_library; >+ my $very_overdue_system; >+ my $borrowers_library; >+ my $issues_library; >+ my $issues_system; >+ my $items_library; >+ my $items_system; >+ my $last_updated; >+ >+ $number_of_biblios = $dash->{biblios}->{NumberOfBiblios}; >+ $biblios_7days = $dash->{biblio_7days}->{NumberOfBiblio7Days}; >+ $items_7days_system = $dash->{items_7days_system}->{NumberOfItems7Days}; >+ $borrowers_system = $dash->{number_of_borrowers_system}->{NumberofBorrowersSystem}; >+ $loan_history_system = $dash->{loan_history_system}->{NumberOfLoans}; >+ $items_system = $dash->{items_system}->{NumberOfItemsSystem}; >+ $expired_borrowers_system = $dash->{expired_borrowers_system}->{ExpiredBorrowers}; >+ $issues_system = $dash->{issues_system}->{NumberOfIssuesSystem}; >+ $overdues_system = $dash->{overdues_system}->{NumberOfOverdues}; >+ $overdues_7days_system = $dash->{overdues_7days_system}->{NumberOfOverdues}; >+ $overdues_14days_system = $dash->{overdues_14days_system}->{NumberOfOverdues14Days}; >+ $overdues_21days_system = $dash->{overdues_21days_system}->{NumberOfOverdues21Days}; >+ $very_overdue_system = $dash->{very_overdue_system}->{Overdues}; >+ $last_updated = $dash->{last_updated}->{UpdatedTime}; > > # Looping for "logged in branch" dependant data >- foreach my $numissl(@{$dash->{issues_library}}) >- { >- if($numissl->{BranchCode} eq $login_branch_name) >- { >- $issues_library = $numissl->{NumberOfIssues} >- } >- } >- foreach my $numitm(@{$dash->{items_library}}) >- { >- if($numitm->{BranchCode} eq $login_branch_name) >- { >- $items_library = $numitm->{NumberOfItems} >- } >- } >- foreach my $numbor(@{$dash->{borrowers_library}}) >- { >- if($numbor->{BranchCode} eq $login_branch_name) >- { >- $borrowers_library = $numbor->{NumberOfBorrowers} >- } >- } >- foreach my $numex(@{$dash->{expired_borrowers_library}}) >- { >- if($numex->{BranchCode} eq $login_branch_name) >- { >- $expired_borrowers_library = $numex->{ExpiredBorrowers} >- } >- } >- >- foreach my $numitm7(@{$dash->{items_7days_library}}) >- { >- if($numitm7->{BranchCode} eq $login_branch_name) >- { >- $items_7days_library = $numitm7->{NumberOfItems7DaysLibrary} >- } >- } >- >- foreach my $oldiss(@{$dash->{loan_history_library}}) >- { >- if($oldiss->{BranchCode} eq $login_branch_name) >- { >- $loan_history_library = $oldiss->{NumberOfLoans} >- } >- } >- >- foreach my $ovdlib(@{$dash->{overdues_library}}) >- { >- if($ovdlib->{BranchCode} eq $login_branch_name) >- { >- $overdues_library = $ovdlib->{NumberOfOverdues} >- } >- } >- >- foreach my $ovd7day(@{$dash->{overdues_7days_library}}) >- { >- if($ovd7day->{BranchCode} eq $login_branch_name) >- { >- $overdues_7days_library = $ovd7day->{NumberOfOverdues7Days} >- } >- } >- >- foreach my $ovd14day(@{$dash->{overdues_14days_library}}) >- { >- if($ovd14day->{BranchCode} eq $login_branch_name) >- { >- $overdues_14days_library = $ovd14day->{NumberOfOverdues14Days} >- } >- } >- >- foreach my $ovd21day(@{$dash->{overdues_21days_library}}) >- { >- if($ovd21day->{BranchCode} eq $login_branch_name) >- { >- $overdues_21days_library = $ovd21day->{NumberOfOverdues21Days} >- } >- } >- >- foreach my $vryod(@{$dash->{very_overdue_library}}) >- { >- if($vryod->{BranchCode} eq $login_branch_name) >- { >- $very_overdue_library = $vryod->{NumberOfVeryOverdue} >- } >- } >- >- $template->param('number_of_biblios' => $number_of_biblios, >- 'biblios_7days' => $biblios_7days, >- 'items_7days_system' => $items_7days_system, >- 'items_7days_library' => $items_7days_library, >- 'borrowers_system' => $borrowers_system, >- 'expired_borrowers_library' => $expired_borrowers_library, >- 'expired_borrowers_system' => $expired_borrowers_system, >- 'overdues_library' => $overdues_library, >- 'overdues_system' => $overdues_system, >- 'overdues_7days_library' => $overdues_7days_library, >- 'overdues_7days_system' => $overdues_7days_system, >- 'overdues_14days_library' => $overdues_14days_library, >- 'overdues_14days_system' => $overdues_14days_system, >- 'overdues_21days_library' => $overdues_21days_library, >- 'overdues_21days_system' => $overdues_21days_system, >- 'very_overdue_library' => $very_overdue_library, >- 'very_overdue_system' => $very_overdue_system, >- 'loan_history_system' => $loan_history_system, >- 'loan_history_library' => $loan_history_library, >- 'issues_library' => $issues_library, >- 'issues_system' => $issues_system, >- 'items_library' => $items_library, >- 'items_system' => $items_system, >- 'borrowers_library' => $borrowers_library, >- 'last_updated' => $last_updated >- >- ); >-} >+ foreach my $numissl(@{$dash->{issues_library}}) >+ { >+ if($numissl->{BranchCode} eq $login_branch_name) >+ { >+ $issues_library = $numissl->{NumberOfIssues} >+ } >+ } >+ foreach my $numitm(@{$dash->{items_library}}) >+ { >+ if($numitm->{BranchCode} eq $login_branch_name) >+ { >+ $items_library = $numitm->{NumberOfItems} >+ } >+ } >+ foreach my $numbor(@{$dash->{borrowers_library}}) >+ { >+ if($numbor->{BranchCode} eq $login_branch_name) >+ { >+ $borrowers_library = $numbor->{NumberOfBorrowers} >+ } >+ } >+ foreach my $numex(@{$dash->{expired_borrowers_library}}) >+ { >+ if($numex->{BranchCode} eq $login_branch_name) >+ { >+ $expired_borrowers_library = $numex->{ExpiredBorrowers} >+ } >+ } > >-elsif(!-e $xml_file) { >- $template->param('nofile' => $nofile,); >+ foreach my $numitm7(@{$dash->{items_7days_library}}) >+ { >+ if($numitm7->{BranchCode} eq $login_branch_name) >+ { >+ $items_7days_library = $numitm7->{NumberOfItems7DaysLibrary} >+ } > } > >+ foreach my $oldiss(@{$dash->{loan_history_library}}) >+ { >+ if($oldiss->{BranchCode} eq $login_branch_name) >+ { >+ $loan_history_library = $oldiss->{NumberOfLoans} >+ } >+ } >+ >+ foreach my $ovdlib(@{$dash->{overdues_library}}) >+ { >+ if($ovdlib->{BranchCode} eq $login_branch_name) >+ { >+ $overdues_library = $ovdlib->{NumberOfOverdues} >+ } >+ } >+ >+ foreach my $ovd7day(@{$dash->{overdues_7days_library}}) >+ { >+ if($ovd7day->{BranchCode} eq $login_branch_name) >+ { >+ $overdues_7days_library = $ovd7day->{NumberOfOverdues7Days} >+ } >+ } >+ >+ foreach my $ovd14day(@{$dash->{overdues_14days_library}}) >+ { >+ if($ovd14day->{BranchCode} eq $login_branch_name) >+ { >+ $overdues_14days_library = $ovd14day->{NumberOfOverdues14Days} >+ } >+ } >+ >+ foreach my $ovd21day(@{$dash->{overdues_21days_library}}) >+ { >+ if($ovd21day->{BranchCode} eq $login_branch_name) >+ { >+ $overdues_21days_library = $ovd21day->{NumberOfOverdues21Days} >+ } >+ } >+ >+ foreach my $vryod(@{$dash->{very_overdue_library}}) >+ { >+ if($vryod->{BranchCode} eq $login_branch_name) >+ { >+ $very_overdue_library = $vryod->{NumberOfVeryOverdue} >+ } >+ } >+ >+ $template->param('number_of_biblios' => $number_of_biblios, >+ 'biblios_7days' => $biblios_7days, >+ 'items_7days_system' => $items_7days_system, >+ 'items_7days_library' => $items_7days_library, >+ 'borrowers_system' => $borrowers_system, >+ 'expired_borrowers_library' => $expired_borrowers_library, >+ 'expired_borrowers_system' => $expired_borrowers_system, >+ 'overdues_library' => $overdues_library, >+ 'overdues_system' => $overdues_system, >+ 'overdues_7days_library' => $overdues_7days_library, >+ 'overdues_7days_system' => $overdues_7days_system, >+ 'overdues_14days_library' => $overdues_14days_library, >+ 'overdues_14days_system' => $overdues_14days_system, >+ 'overdues_21days_library' => $overdues_21days_library, >+ 'overdues_21days_system' => $overdues_21days_system, >+ 'very_overdue_library' => $very_overdue_library, >+ 'very_overdue_system' => $very_overdue_system, >+ 'loan_history_system' => $loan_history_system, >+ 'loan_history_library' => $loan_history_library, >+ 'issues_library' => $issues_library, >+ 'issues_system' => $issues_system, >+ 'items_library' => $items_library, >+ 'items_system' => $items_system, >+ 'borrowers_library' => $borrowers_library, >+ 'last_updated' => $last_updated >+ ); >+ } else { >+ $template->{VARS}->{'nofile'} = 1; >+ } >+ > } > > # Dashboard end >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6828
:
5249
|
6317
|
6389
|
10058
|
10059
|
10217
|
10218
|
60692
|
60693