Bug 22544: Refactor searching of news items
[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 = 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.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 %]
35                                     [% IF ( CAN_user_tools ) %]
36                                         <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% koha_new.idnew | uri %]">Edit</a>
37                                          | <a class="news_delete" href="/cgi-bin/koha/tools/koha-news.pl?op=del&amp;ids=[% koha_new.idnew | html %]">Delete</a>
38                                          | <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form">New</a>
39                                     [% END %]
40                                 </p>
41                             </div>
42                         [% END %]
43                     </div><!-- /koha-news -->
44                 [% END %]
45                 [% IF ( daily_quote ) %]
46                     <div id="area-news">
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">
55                 <div class="row">
56                     <div class="col-xs-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-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-id-card-o"></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"><i class="fa fa-search"></i>Advanced search</a>
73                             </li>
74                             [% END %]
75
76                             <li>
77                                 <a class="icon_general icon_lists" href="/cgi-bin/koha/virtualshelves/shelves.pl"><i class="fa fa-list-alt"></i>Lists</a>
78                             </li>
79
80                             [% IF ( UseCourseReserves ) %]
81                                 <li>
82                                     <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>
83                                 </li>
84                             [% END %]
85
86                             <li>
87                                 <a class="icon_general icon_authorities" href="/cgi-bin/koha/authorities/authorities-home.pl"><i class="fa fa-link"></i>Authorities</a>
88                             </li>
89                             [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
90                             <li>
91                                 <a class="icon_general icon_ill" href="/cgi-bin/koha/ill/ill-requests.pl"><i class="fa fa-retweet"></i>ILL requests</a>
92                             </li>
93                             [% END %]
94                         </ul>
95                     </div> <!-- /.col-xs-6 -->
96                     <div class="col-xs-6">
97                         <ul class="biglinks-list">
98
99                             [% IF ( Koha.Preference('EnablePointOfSale') && Koha.Preference('UseCashRegisters') && CAN_user_cash_management_takepayment ) %]
100                             <li>
101                                 <a class="icon_general icon_pos" href="/cgi-bin/koha/pos/pay.pl"><i class="fa fa-shopping-cart"></i>Point of sale</a>
102                             </li>
103                             [% END %]
104
105                             [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ) %]
106                             <li>
107                                 <a class="icon_general icon_cataloging" href="/cgi-bin/koha/cataloguing/addbooks.pl"><i class="fa fa-tag"></i>Cataloging</a>
108                             </li>
109                             [% END %]
110
111                             [% IF ( CAN_user_serials ) %]
112                             <li>
113                                 <a class="icon_general icon_serials" href="/cgi-bin/koha/serials/serials-home.pl"><i class="fa fa-newspaper-o"></i>Serials</a>
114                                 <span class="biglink"></span>
115                             </li>
116                             [% END %]
117
118                             [% IF ( CAN_user_acquisition ) %]
119                             <li>
120                                 <a class="icon_general icon_acquisitions" href="/cgi-bin/koha/acqui/acqui-home.pl"><i class="fa fa-gift"></i>Acquisitions</a>
121                                 <span class="biglink"></span>
122                             </li>
123                             [% END %]
124
125                             [% IF ( CAN_user_reports ) %]
126                             <li>
127                                 <a class="icon_general icon_reports" href="/cgi-bin/koha/reports/reports-home.pl"><i class="fa fa-pie-chart"></i>Reports</a>
128                             </li>
129                             [% END %]
130
131
132                             [% IF ( CAN_user_tools ) %]
133                             <li>
134                                 <a class="icon_general icon_tools" href="/cgi-bin/koha/tools/tools-home.pl"><i class="fa fa-wrench"></i>Tools</a>
135                             </li>
136                             [% END %]
137
138                             [% IF ( CAN_user_parameters ) %]
139                             <li>
140                                 <a class="icon_general icon_administration" href="/cgi-bin/koha/admin/admin-home.pl"><i class="fa fa-cogs"></i>Koha administration</a>
141                             </li>
142                             [% END %]
143                             <li>
144                                 <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>
145                             </li>
146                         </ul>
147                     </div> <!-- /.col-sm-6 -->
148
149                 </div> <!-- /.row -->
150                 <div class="row">
151                     <div class="col-sm-12">
152                         [%# Following statement must be in one line for translatability %]
153                         [% 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 ) %]
154                             <div id="area-pending">
155                                 [% IF pending_article_requests %]
156                                 <div class="pending-info" id="article_requests_pending">
157
158                                     <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>:
159                                     <span class="pending-number-link">[% pending_article_requests | html %]</span>
160                                 </div>
161                                 [% END %]
162
163                                 [% IF ( CAN_user_suggestions_suggestions_manage && pendingsuggestions ) %]
164                                 <div class="pending-info" id="suggestions_pending">
165
166                                     Suggestions pending approval:
167                                     <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
168                                     <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pendingsuggestions | html %]</span>
169                                     </a>
170                                     [% IF (all_pendingsuggestions > 0) %]
171                                         /
172                                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
173                                             <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
174                                         </a>
175                                     [% END %]
176                                 </div>
177                                 [% END %]
178
179                                 [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) %]
180                                 <div class="pending-info" id="comments_pending">
181                                     <a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>:
182                                     <span class="pending-number-link">[% pendingcomments | html %]</span>
183                                 </div>
184                                 [% END %]
185
186                                 [% IF ( CAN_user_tools_moderate_tags && pendingtags ) %]
187                                 <div class="pending-info" id="tags_pending">
188                                     <a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>:
189                                     <span class="pending-number-link">[% pendingtags | html %]</span>
190                                 </div>
191                                 [% END %]
192
193
194                                 [% IF ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) %]
195                                 <div class="pending-info" id="patron_updates_pending">
196                                     <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
197                                     <span class="pending-number-link">[% pending_borrower_modifications | html %]</span>
198                                 </div>
199                                 [% END %]
200
201                                 [% IF CAN_user_borrowers_edit_borrowers && pending_discharge_requests %]
202                                 <div class="pending-info" id="patron_discharges_pending">
203                                     <a href="/cgi-bin/koha/members/discharges.pl">Discharge requests pending</a>:
204                                     <span class="pending-number-link">[% pending_discharge_requests | html %]</span>
205                                 </div>
206                                 [% END %]
207
208                                 [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count %]
209                                     <div class="pending-info" id="checkout_notes_pending">
210                                         <a href="/cgi-bin/koha/circ/checkout-notes.pl">Checkout notes pending</a>:
211                                         <span class="pending-number-link">[% pending_checkout_notes.count | html %]</span>
212                                     </div>
213                                 [% END %]
214
215                                 [% IF ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) %]
216                                     <div class="pending-info" id="problem_reports_pending">
217                                         <a href="/cgi-bin/koha/tools/problem-reports.pl">OPAC problem reports pending</a>:
218                                         <span class="pending-number-link">[% pending_problem_reports.count | html %]</span>
219                                     </div>
220                                 [% END %]
221
222                             </div>
223
224                         [% END %]
225
226                     </div> <!-- /.col-sm-12 -->
227                 </div> <!-- /.row -->
228
229                 [% IF ( IntranetmainUserblock ) %]
230                     <div class="row">
231                         <div class="col-sm-12">
232                             <div id="area-userblock">
233                                 <div class="user-info">
234                                     [% IntranetmainUserblock | $raw %]
235                                 </div>
236                             </div>
237                         </div>
238                     </div>
239                 [% END %]
240             </div> <!-- /.col-sm-9 -->
241
242         </div> <!-- /.row -->
243     </div> <!-- /.container-fluid -->
244
245 [% MACRO jsinclude BLOCK %]
246     <script>
247     //<![CDATA[
248     var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This cannot be undone.");
249         $(document).ready(function(){
250             $(".news_delete").on("click", function(){
251                 return confirmDelete(MSG_CONFIRM_DELETE);
252             });
253         });
254     //]]>
255     </script>
256 [% END %]
257 <!-- the main div is closed in intranet-bottom.inc -->
258 [% INCLUDE 'intranet-bottom.inc' %]