Bug 30708: Koha controller script and template changes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / intranet-main.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha staff interface</title>
9 [% Asset.css("css/mainpage.css") | $raw %]
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="main_intranet-main" class="intranet-main">
14     [% WRAPPER 'header.inc' %]
15         [% INCLUDE 'home-search.inc' %]
16     [% END %]
17
18     [% WRAPPER 'sub-header.inc' %]
19         [% WRAPPER breadcrumbs %]
20         [% END #/ WRAPPER breadcrumbs %]
21     [% END %]
22
23     <div id="container-main" class="container-fluid">
24         <div class="row">
25             <h1 class="sr-only">Koha home</h1>
26             <div class="col-sm-3">
27                 [% IF ( koha_news.count ) %]
28                     <div id="area-news" class="page-section">
29                         <h3><span class="news_title">News</span></h3>
30                         [% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'staff' || Koha.Preference('NewsAuthorDisplay') == 'both' %]
31                         [% FOREACH koha_new IN koha_news %]
32                             <div class="newsitem" id="news[% koha_new.idnew | html %]"><h4>[% koha_new.title | html %]</h4>
33                                 <div class="newsbody">[% koha_new.content | $raw %]</div>
34                                 <p class="newsfooter"> Posted on [% koha_new.published_on | $KohaDates %][% IF( show_author && koha_new.author ) %] by <span class="newsauthor">[% INCLUDE 'patron-title.inc' patron=koha_new.author %]<br />[% END %]
35                                     [% IF ( CAN_user_tools_edit_additional_contents ) %]
36                                         <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% koha_new.idnew | uri %]">Edit</a>
37                                          | <a class="news_delete" href="/cgi-bin/koha/tools/additional-contents.pl?op=delete_confirmed&amp;ids=[% koha_new.idnew | html %]">Delete</a>
38                                          | <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form">New</a>
39                                     [% END %]
40                                 </p>
41                             </div>
42                         [% END %]
43                     </div><!-- /additional-contents -->
44                 [% END %]
45                 [% IF ( daily_quote ) %]
46                     <div id="area-quote" class="page-section">
47                         <h3>Quote of the day</h3>
48                         <div class="newsitem">
49                             <span id="daily-quote-text">[% daily_quote.text | html %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source | html %]</span>
50                         </div>
51                     </div>
52                 [% END %]
53             </div> <!-- /.col-sm-2 -->
54             <div class="col-sm-9 col-lg-6">
55                 <div class="row">
56                     <div class="col-sm-6">
57                         <ul class="biglinks-list">
58                             [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
59                             <li>
60                                 <a class="icon_general icon_circulation" href="/cgi-bin/koha/circ/circulation-home.pl"><i class="fa fa-fw fa-exchange"></i>Circulation</a>
61                             </li>
62                             [% END %]
63
64                             [% IF CAN_user_borrowers_edit_borrowers %]
65                             <li>
66                                 <a class="icon_general icon_patrons" href="/cgi-bin/koha/members/members-home.pl"><i class="fa fa-fw fa-id-card"></i>Patrons</a>
67                             </li>
68                             [% END %]
69
70                             [% IF ( CAN_user_catalogue ) %]
71                             <li>
72                                 <a class="icon_general icon_search" href="/cgi-bin/koha/catalogue/search.pl">
73                                     <span class="fa-stack">
74                                         <i class="fa fa-fw fa-book fa-stack-1x"></i>
75                                         <i class="fa fa-fw fa-search fa-stack-2x"></i>
76                                     </span>
77                                     Advanced search
78                                 </a>
79                             </li>
80                             <li>
81                                 <a class="icon_general icon_search" href="/cgi-bin/koha/catalogue/itemsearch.pl">
82                                     <span class="fa-stack">
83                                         <i class="fa fa-fw fa-list fa-stack-1x"></i>
84                                         <i class="fa fa-fw fa-search fa-stack-2x"></i>
85                                     </span>
86                                     Item search
87                                 </a>
88                             </li>
89                             [% END %]
90
91                             <li>
92                                 <a class="icon_general icon_lists" href="/cgi-bin/koha/virtualshelves/shelves.pl"><i class="fa fa-fw fa-list-alt"></i>Lists</a>
93                             </li>
94
95                             [% IF ( UseCourseReserves ) %]
96                                 <li>
97                                     <a class="icon_general icon_course_reserves" href="/cgi-bin/koha/course_reserves/course-reserves.pl"><i class="fa fa-fw fa-book"></i>Course reserves</a>
98                                 </li>
99                             [% END %]
100
101                             <li>
102                                 <a class="icon_general icon_authorities" href="/cgi-bin/koha/authorities/authorities-home.pl"><i class="fa fa-fw fa-link"></i>Authorities</a>
103                             </li>
104                             [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
105                             <li>
106                                 <a class="icon_general icon_ill" href="/cgi-bin/koha/ill/ill-requests.pl"><i class="fa fa-fw fa-retweet"></i>ILL requests</a>
107                             </li>
108                             [% END %]
109
110                             [% IF Koha.Preference('ERMModule') && CAN_user_erm %]
111                             <li>
112                                 <a class="icon_general icon_erm" href="/cgi-bin/koha/erm/erm.pl"><i class="fa fa-fw fa-external-link-square"></i>E-resource management</a>
113                             </li>
114                             [% END %]
115
116                         </ul>
117                     </div> <!-- /.col-sm-6 -->
118                     <div class="col-sm-6">
119                         <ul class="biglinks-list">
120
121                             [% IF ( Koha.Preference('EnablePointOfSale') && Koha.Preference('UseCashRegisters') && CAN_user_cash_management_takepayment ) %]
122                             <li>
123                                 <a class="icon_general icon_pos" href="/cgi-bin/koha/pos/pay.pl"><i class="fa fa-fw fa-shopping-cart"></i>Point of sale</a>
124                             </li>
125                             [% END %]
126
127                             [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || ( fast_cataloging && CAN_user_editcatalogue_fast_cataloging || can_see_cataloguing_module ) ) %]
128                             <li>
129                                 <a class="icon_general icon_cataloging" href="/cgi-bin/koha/cataloguing/cataloging-home.pl"><i class="fa fa-fw fa-tag"></i>Cataloging</a>
130                             </li>
131                             [% END %]
132
133                             [% IF ( CAN_user_serials ) %]
134                             <li>
135                                 <a class="icon_general icon_serials" href="/cgi-bin/koha/serials/serials-home.pl"><i class="fa fa-fw fa-newspaper"></i>Serials</a>
136                                 <span class="biglink"></span>
137                             </li>
138                             [% END %]
139
140                             [% IF ( CAN_user_acquisition ) %]
141                             <li>
142                                 <a class="icon_general icon_acquisitions" href="/cgi-bin/koha/acqui/acqui-home.pl"><i class="fa fa-fw fa-gift"></i>Acquisitions</a>
143                                 <span class="biglink"></span>
144                             </li>
145                             [% END %]
146
147                             [% IF ( CAN_user_reports ) %]
148                             <li>
149                                 <a class="icon_general icon_reports" href="/cgi-bin/koha/reports/reports-home.pl"><i class="fa fa-fw fa-pie-chart"></i>Reports</a>
150                             </li>
151                             [% END %]
152
153                             [% IF Koha.Preference('PreservationModule') && CAN_user_preservation%]
154                             <li>
155                                 <a class="icon_general icon_preservation" href="/cgi-bin/koha/preservation/home.pl"><i class="fa fa-fw fa-book"></i>Preservation</a>
156                             </li>
157                             [% END %]
158
159
160                             [% IF ( CAN_user_tools || CAN_user_clubs ) %]
161                             <li>
162                                 <a class="icon_general icon_tools" href="/cgi-bin/koha/tools/tools-home.pl"><i class="fa fa-fw fa-wrench"></i>Tools</a>
163                             </li>
164                             [% END %]
165
166                             [% IF ( CAN_user_parameters ) %]
167                             <li>
168                                 <a class="icon_general icon_administration" href="/cgi-bin/koha/admin/admin-home.pl"><i class="fa fa-fw fa-gears"></i>Koha administration</a>
169                             </li>
170                             [% END %]
171                             <li>
172                                 <a class="icon_general icon_koha" href="/cgi-bin/koha/about.pl"><img src="[% interface | html %]/[% theme | html %]/img/koha-egg.svg" alt="Koha Logo SVG"/> About Koha</a>
173                             </li>
174                         </ul>
175                     </div> <!-- /.col-sm-6 -->
176
177                 </div> <!-- /.row -->
178                 <div class="row">
179                     <div class="col-sm-12">
180                         [%# Following statement must be in one line for translatability %]
181                         [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %]
182                             <div id="area-pending" class="page-section">
183                                 [% IF pending_article_requests %]
184                                 <div class="pending-info" id="article_requests_pending">
185
186                                     <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>:
187                                     <span class="pending-number-link">[% pending_article_requests | html %]</span>
188                                 </div>
189                                 [% END %]
190
191                                 [% IF CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions ) %]
192                                 <div class="pending-info" id="suggestions_pending">
193
194                                     Suggestions pending approval:
195                                     <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
196                                     <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pendingsuggestions | html %]</span>
197                                     </a>
198                                     [% IF (all_pendingsuggestions > 0) %]
199                                         /
200                                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
201                                             <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
202                                         </a>
203                                     [% END %]
204                                 </div>
205                                 [% END %]
206
207                                 [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) %]
208                                 <div class="pending-info" id="comments_pending">
209                                     <a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>:
210                                     <span class="pending-number-link">[% pendingcomments | html %]</span>
211                                 </div>
212                                 [% END %]
213
214                                 [% IF ( CAN_user_tools_moderate_tags && pendingtags ) %]
215                                 <div class="pending-info" id="tags_pending">
216                                     <a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>:
217                                     <span class="pending-number-link">[% pendingtags | html %]</span>
218                                 </div>
219                                 [% END %]
220
221
222                                 [% IF ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) %]
223                                 <div class="pending-info" id="patron_updates_pending">
224                                     <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
225                                     <span class="pending-number-link">[% pending_borrower_modifications | html %]</span>
226                                 </div>
227                                 [% END %]
228
229                                 [% IF CAN_user_borrowers_edit_borrowers && pending_discharge_requests %]
230                                 <div class="pending-info" id="patron_discharges_pending">
231                                     <a href="/cgi-bin/koha/members/discharges.pl">Discharge requests pending</a>:
232                                     <span class="pending-number-link">[% pending_discharge_requests | html %]</span>
233                                 </div>
234                                 [% END %]
235
236                                 [% IF ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) %]
237                                 <div class="pending-info" id="catalog_concerns_pending">
238                                     <a href="/cgi-bin/koha/cataloguing/concerns.pl">Catalog concerns pending</a>:
239                                     <span class="pending-number-link">[% pending_biblio_tickets | html %]</span>
240                                 </div>
241                                 [% END %]
242
243                                 [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count %]
244                                     <div class="pending-info" id="checkout_notes_pending">
245                                         <a href="/cgi-bin/koha/circ/checkout-notes.pl">Checkout notes pending</a>:
246                                         <span class="pending-number-link">[% pending_checkout_notes.count | html %]</span>
247                                     </div>
248                                 [% END %]
249
250                                 [% IF ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) %]
251                                     <div class="pending-info" id="problem_reports_pending">
252                                         <a href="/cgi-bin/koha/tools/problem-reports.pl">OPAC problem reports pending</a>:
253                                         <span class="pending-number-link">[% pending_problem_reports.count | html %]</span>
254                                     </div>
255                                 [% END %]
256
257                                 [% IF already_ran_jobs %]
258                                     <div class="pending-info" id="background_jobs">
259                                         <a href="/cgi-bin/koha/admin/background_jobs.pl">Access your background jobs</a>
260                                     </div>
261                                 [% END %]
262
263                                 [% IF new_curbside_pickups.count %]
264                                     <div class="pending-info" id="new_curbside_pickups">
265                                         <a href="/cgi-bin/koha/circ/curbside_pickups.pl">New curbside pickups</a>:
266                                         <span class="pending-number-link">[% new_curbside_pickups.count | html %]</span>
267                                     </div>
268                                 [% END %]
269
270                             </div>
271
272                         [% END %]
273
274                     </div> <!-- /.col-sm-12 -->
275                 </div> <!-- /.row -->
276
277                 [% IF ( IntranetmainUserblock ) %]
278                     <div class="row">
279                         <div class="col-sm-12">
280                             <div id="area-userblock" class="page-section">
281                                 <div class="user-info">
282                                     [% IntranetmainUserblock | $raw %]
283                                 </div>
284                             </div>
285                         </div>
286                     </div>
287                 [% END %]
288
289                 <div class="row">
290                     <div class="col-sm-12">
291                         <div id="koha_version"><a href="https://koha-community.org">Koha [% Koha.Version.maintenance | html %]</a></div>
292                     </div>
293                 </div>
294
295             </div> <!-- /.col-sm-9 -->
296
297         </div> <!-- /.row -->
298     </div> <!-- /.container-fluid -->
299
300 [% MACRO jsinclude BLOCK %]
301     <script>
302     //<![CDATA[
303     var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This cannot be undone.");
304         $(document).ready(function(){
305             $(".news_delete").on("click", function(){
306                 return confirmDelete(MSG_CONFIRM_DELETE);
307             });
308         });
309     //]]>
310     </script>
311 [% END %]
312 <!-- the main div is closed in intranet-bottom.inc -->
313 [% INCLUDE 'intranet-bottom.inc' %]