Bug 22544: Move GetNewsToDisplay to Koha namespace
[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 <body id="main_intranet-main" class="intranet-main">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'home-search.inc' %]
15
16 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
17     <ol>
18         <li>
19             <a href="#" aria-current="page">Home</a>
20         </li>
21     </ol>
22 </nav>
23
24     <div id="container-main" class="container-fluid">
25         <div class="row">
26             <div class="col-sm-3">
27                 [% IF ( koha_news.count ) %]
28                     <div id="area-news">
29                         <h3><span class="news_title">News</span></h3>
30                         [% SET show_author =
31                             Koha.Preference('NewsAuthorDisplay') == 'staff'
32                             || Koha.Preference('NewsAuthorDisplay') == 'both' %]
33                         [% FOREACH koha_new IN koha_news %]
34                             <div class="newsitem" id="news[% koha_new.idnew | html %]"><h4>[% koha_new.title | html %]</h4>
35                                 <div class="newsbody">[% koha_new.content | $raw %]</div>
36                                 <p class="newsfooter"> Posted on [% koha_new.timestamp | $KohaDates %][% IF( show_author && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author.title | html %] </span>[% koha_new.author.firstname | html %] [% koha_new.author.surname | html %]<br />[% END %]
37                                     [% IF ( CAN_user_tools ) %]
38                                         <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% koha_new.idnew | uri %]">Edit</a>
39                                          | <a class="news_delete" href="/cgi-bin/koha/tools/koha-news.pl?op=del&amp;ids=[% koha_new.idnew | html %]">Delete</a>
40                                          | <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form">New</a>
41                                     [% END %]
42                                 </p>
43                             </div>
44                         [% END %]
45                     </div><!-- /koha-news -->
46                 [% END %]
47                 [% IF ( daily_quote ) %]
48                     <div id="area-news">
49                         <h3>Quote of the day</h3>
50                         <div class="newsitem">
51                             <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>
52                         </div>
53                     </div>
54                 [% END %]
55             </div> <!-- /.col-sm-2 -->
56             <div class="col-sm-9">
57                 <div class="row">
58                     <div class="col-xs-6">
59                         <ul class="biglinks-list">
60                             [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
61                             <li>
62                                 <a class="icon_general icon_circulation" href="/cgi-bin/koha/circ/circulation-home.pl"><i class="fa fa-exchange"></i>Circulation</a>
63                             </li>
64                             [% END %]
65
66                             [% IF CAN_user_borrowers_edit_borrowers %]
67                             <li>
68                                 <a class="icon_general icon_patrons" href="/cgi-bin/koha/members/members-home.pl"><i class="fa fa-id-card-o"></i>Patrons</a>
69                             </li>
70                             [% END %]
71
72                             [% IF ( CAN_user_catalogue ) %]
73                             <li>
74                                 <a class="icon_general icon_search" href="/cgi-bin/koha/catalogue/search.pl"><i class="fa fa-search"></i>Advanced search</a>
75                             </li>
76                             [% END %]
77
78                             <li>
79                                 <a class="icon_general icon_lists" href="/cgi-bin/koha/virtualshelves/shelves.pl"><i class="fa fa-list-alt"></i>Lists</a>
80                             </li>
81
82                             [% IF ( UseCourseReserves ) %]
83                                 <li>
84                                     <a class="icon_general icon_course_reserves" href="/cgi-bin/koha/course_reserves/course-reserves.pl"><i class="fa fa-book"></i>Course reserves</a>
85                                 </li>
86                             [% END %]
87
88                             <li>
89                                 <a class="icon_general icon_authorities" href="/cgi-bin/koha/authorities/authorities-home.pl"><i class="fa fa-link"></i>Authorities</a>
90                             </li>
91                             [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
92                             <li>
93                                 <a class="icon_general icon_ill" href="/cgi-bin/koha/ill/ill-requests.pl"><i class="fa fa-retweet"></i>ILL requests</a>
94                             </li>
95                             [% END %]
96                         </ul>
97                     </div> <!-- /.col-xs-6 -->
98                     <div class="col-xs-6">
99                         <ul class="biglinks-list">
100
101                             [% IF ( Koha.Preference('EnablePointOfSale') && Koha.Preference('UseCashRegisters') && CAN_user_cash_management_takepayment ) %]
102                             <li>
103                                 <a class="icon_general icon_pos" href="/cgi-bin/koha/pos/pay.pl"><i class="fa fa-shopping-cart"></i>Point of sale</a>
104                             </li>
105                             [% END %]
106
107                             [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ) %]
108                             <li>
109                                 <a class="icon_general icon_cataloging" href="/cgi-bin/koha/cataloguing/addbooks.pl"><i class="fa fa-tag"></i>Cataloging</a>
110                             </li>
111                             [% END %]
112
113                             [% IF ( CAN_user_serials ) %]
114                             <li>
115                                 <a class="icon_general icon_serials" href="/cgi-bin/koha/serials/serials-home.pl"><i class="fa fa-newspaper-o"></i>Serials</a>
116                                 <span class="biglink"></span>
117                             </li>
118                             [% END %]
119
120                             [% IF ( CAN_user_acquisition ) %]
121                             <li>
122                                 <a class="icon_general icon_acquisitions" href="/cgi-bin/koha/acqui/acqui-home.pl"><i class="fa fa-gift"></i>Acquisitions</a>
123                                 <span class="biglink"></span>
124                             </li>
125                             [% END %]
126
127                             [% IF ( CAN_user_reports ) %]
128                             <li>
129                                 <a class="icon_general icon_reports" href="/cgi-bin/koha/reports/reports-home.pl"><i class="fa fa-pie-chart"></i>Reports</a>
130                             </li>
131                             [% END %]
132
133
134                             [% IF ( CAN_user_tools ) %]
135                             <li>
136                                 <a class="icon_general icon_tools" href="/cgi-bin/koha/tools/tools-home.pl"><i class="fa fa-wrench"></i>Tools</a>
137                             </li>
138                             [% END %]
139
140                             [% IF ( CAN_user_parameters ) %]
141                             <li>
142                                 <a class="icon_general icon_administration" href="/cgi-bin/koha/admin/admin-home.pl"><i class="fa fa-cogs"></i>Koha administration</a>
143                             </li>
144                             [% END %]
145                             <li>
146                                 <a class="icon_general icon_koha" href="/cgi-bin/koha/about.pl">About Koha<img src="[% interface | html %]/[% theme | html %]/img/koha-egg.svg" alt="Koha Logo SVG"/></a>
147                             </li>
148                         </ul>
149                     </div> <!-- /.col-sm-6 -->
150
151                 </div> <!-- /.row -->
152                 <div class="row">
153                     <div class="col-sm-12">
154                         [%# Following statement must be in one line for translatability %]
155                         [% 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 ) || ( 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('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) %]
156                             <div id="area-pending">
157                                 [% IF pending_article_requests %]
158                                 <div class="pending-info" id="article_requests_pending">
159
160                                     <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>:
161                                     <span class="pending-number-link">[% pending_article_requests | html %]</span>
162                                 </div>
163                                 [% END %]
164
165                                 [% IF ( CAN_user_suggestions_suggestions_manage && pendingsuggestions ) %]
166                                 <div class="pending-info" id="suggestions_pending">
167
168                                     Suggestions pending approval:
169                                     <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
170                                     <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pendingsuggestions | html %]</span>
171                                     </a>
172                                     [% IF (all_pendingsuggestions > 0) %]
173                                         /
174                                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
175                                             <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
176                                         </a>
177                                     [% END %]
178                                 </div>
179                                 [% END %]
180
181                                 [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) %]
182                                 <div class="pending-info" id="comments_pending">
183                                     <a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>:
184                                     <span class="pending-number-link">[% pendingcomments | html %]</span>
185                                 </div>
186                                 [% END %]
187
188                                 [% IF ( CAN_user_tools_moderate_tags && pendingtags ) %]
189                                 <div class="pending-info" id="tags_pending">
190                                     <a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>:
191                                     <span class="pending-number-link">[% pendingtags | html %]</span>
192                                 </div>
193                                 [% END %]
194
195
196                                 [% IF ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) %]
197                                 <div class="pending-info" id="patron_updates_pending">
198                                     <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
199                                     <span class="pending-number-link">[% pending_borrower_modifications | html %]</span>
200                                 </div>
201                                 [% END %]
202
203                                 [% IF CAN_user_borrowers_edit_borrowers && pending_discharge_requests %]
204                                 <div class="pending-info" id="patron_discharges_pending">
205                                     <a href="/cgi-bin/koha/members/discharges.pl">Discharge requests pending</a>:
206                                     <span class="pending-number-link">[% pending_discharge_requests | html %]</span>
207                                 </div>
208                                 [% END %]
209
210                                 [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count %]
211                                     <div class="pending-info" id="checkout_notes_pending">
212                                         <a href="/cgi-bin/koha/circ/checkout-notes.pl">Checkout notes pending</a>:
213                                         <span class="pending-number-link">[% pending_checkout_notes.count | html %]</span>
214                                     </div>
215                                 [% END %]
216
217                                 [% IF ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) %]
218                                     <div class="pending-info" id="problem_reports_pending">
219                                         <a href="/cgi-bin/koha/tools/problem-reports.pl">OPAC problem reports pending</a>:
220                                         <span class="pending-number-link">[% pending_problem_reports.count | html %]</span>
221                                     </div>
222                                 [% END %]
223
224                             </div>
225
226                         [% END %]
227
228                     </div> <!-- /.col-sm-12 -->
229                 </div> <!-- /.row -->
230
231                 [% IF ( IntranetmainUserblock ) %]
232                     <div class="row">
233                         <div class="col-sm-12">
234                             <div id="area-userblock">
235                                 <div class="user-info">
236                                     [% IntranetmainUserblock | $raw %]
237                                 </div>
238                             </div>
239                         </div>
240                     </div>
241                 [% END %]
242             </div> <!-- /.col-sm-9 -->
243
244         </div> <!-- /.row -->
245     </div> <!-- /.container-fluid -->
246
247 [% MACRO jsinclude BLOCK %]
248     <script>
249     //<![CDATA[
250     var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This cannot be undone.");
251         $(document).ready(function(){
252             $(".news_delete").on("click", function(){
253                 return confirmDelete(MSG_CONFIRM_DELETE);
254             });
255         });
256     //]]>
257     </script>
258 [% END %]
259 <!-- the main div is closed in intranet-bottom.inc -->
260 [% INCLUDE 'intranet-bottom.inc' %]