Corrections to ensure message list appears in the proper box (Bug 3668).
The patch sets a "flagged" variable for displaying the messages correctly, bringing it in line with the way other messages are displayed. The patch also includes some markup tweaks and a change to make display of the "add message" link javascript-dependent. Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
parent
318fd2d57d
commit
75423b3010
|
|
@ -653,10 +653,17 @@ if ( C4::Context->preference("memberofinstitution") ) {
|
|||
);
|
||||
}
|
||||
|
||||
my $lib_messages_loop = GetMessages( $borrowernumber, 'L', $branch );
|
||||
if($lib_messages_loop){ $template->param(flagged => 1 ); }
|
||||
|
||||
my $bor_messages_loop = GetMessages( $borrowernumber, 'B', $branch );
|
||||
if($bor_messages_loop){ $template->param(flagged => 1 ); }
|
||||
|
||||
|
||||
$template->param(
|
||||
issued_itemtypes_count_loop => \@issued_itemtypes_count_loop,
|
||||
lib_messages_loop => GetMessages( $borrowernumber, 'L', $branch ),
|
||||
bor_messages_loop => GetMessages( $borrowernumber, 'B', $branch ),
|
||||
lib_messages_loop => $lib_messages_loop,
|
||||
bor_messages_loop => $bor_messages_loop,
|
||||
all_messages_del => C4::Context->preference('AllowAllMessageDeletion'),
|
||||
findborrower => $findborrower,
|
||||
borrower => $borrower,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$.tablesorter.addParser({
|
||||
id: 'articles',
|
||||
|
|
@ -89,8 +89,16 @@ var allcheckboxes = $(".checkboxed");
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+_("Add a new message")+"</a>");
|
||||
$("#borrower_messages .cancel").click(function(){
|
||||
$("#add_message_form").hide();
|
||||
$("#addmessage").show();
|
||||
});
|
||||
$("#addmessage").click(function (){
|
||||
$(this).hide();
|
||||
$("#add_message_form").show();
|
||||
});
|
||||
});
|
||||
function uncheck_sibling(me){
|
||||
nodename=me.getAttribute("name");
|
||||
if (nodename =="barcodes[]"){
|
||||
|
|
@ -129,19 +137,6 @@ function refocus(calendar) {
|
|||
//]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function showhide(id){
|
||||
if (document.getElementById){
|
||||
obj = document.getElementById(id);
|
||||
if (obj.style.display == "none"){
|
||||
obj.style.display = "";
|
||||
} else {
|
||||
obj.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -171,34 +166,36 @@ function showhide(id){
|
|||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- INITIAL BLOC : PARAMETERS & BORROWER INFO -->
|
||||
<div style="display: none;" id="add_message">
|
||||
<div style="display: none;" id="add_message_form">
|
||||
<form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
|
||||
<fieldset id="borrower_messages">
|
||||
<legend>Leave A Message</legend>
|
||||
<p>
|
||||
<label for="message_type">Add A Message For</label>
|
||||
<fieldset id="borrower_messages" class="brief">
|
||||
<legend>Leave a message</legend>
|
||||
<ol>
|
||||
<li>
|
||||
<label for="message_type">Add a message for:</label>
|
||||
<select name="message_type" id="message_type">
|
||||
<option value="L">Other Librarians</option>
|
||||
<option value="B"><!-- TMPL_VAR name="firstname" --></option>
|
||||
</select>
|
||||
</p>
|
||||
</li>
|
||||
<!-- TMPL_IF NAME="canned_bor_notes_loop" -->
|
||||
<p>
|
||||
<label for="canned_notes">Canned Notes: </label>
|
||||
<li>
|
||||
<label for="canned_notes">Predefined notes: </label>
|
||||
<select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
|
||||
<option value=''>Select Note</option>
|
||||
<option value="">Select Note</option>
|
||||
<!-- TMPL_LOOP NAME="canned_bor_notes_loop" -->
|
||||
<option value="<!-- TMPL_VAR NAME="lib" -->"><!--TMPL_VAR NAME="authorised_value" --></option>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</select>
|
||||
</p>
|
||||
</li>
|
||||
<!-- /TMPL_IF -->
|
||||
<p>
|
||||
<li>
|
||||
<textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Save Message" />
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Save" /> <a href="#" class="cancel">Cancel</a>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="borrowernumber" id="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
|
||||
<input type="hidden" name="branchcode" value="<!-- TMPL_VAR NAME="branch" -->" />
|
||||
|
|
@ -547,7 +544,6 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
|
|||
|
||||
|
||||
<!-- /If notes --><!-- /TMPL_IF -->
|
||||
<!-- /If flagged --><!-- /TMPL_IF -->
|
||||
|
||||
<div id="messages" class="circmessage">
|
||||
<h4>Messages:</h4>
|
||||
|
|
@ -560,21 +556,24 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
|
|||
<i>"<!--TMPL_VAR NAME="message"-->"</i>
|
||||
</span>
|
||||
<!-- TMPL_IF NAME="can_delete" -->
|
||||
<a href='/cgi-bin/koha/circ/del_message.pl?message_id=<!--TMPL_VAR NAME="message_id" -->&borrowernumber=<!--TMPL_VAR NAME="borrowernumber" -->'>[Delete]</a>
|
||||
<a href="/cgi-bin/koha/circ/del_message.pl?message_id=<!--TMPL_VAR NAME="message_id" -->&borrowernumber=<!--TMPL_VAR NAME="borrowernumber" -->">[Delete]</a>
|
||||
<!-- TMPL_ELSE -->
|
||||
<!-- TMPL_IF NAME="all_messages_del" -->
|
||||
<a href='/cgi-bin/koha/circ/del_message.pl?message_id=<!--TMPL_VAR NAME="message_id" -->&borrowernumber=<!--TMPL_VAR NAME="borrowernumber" -->'>[Delete]</a>
|
||||
<a href="/cgi-bin/koha/circ/del_message.pl?message_id=<!--TMPL_VAR NAME="message_id" -->&borrowernumber=<!--TMPL_VAR NAME="borrowernumber" -->">[Delete]</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_IF -->
|
||||
</li>
|
||||
<!-- /TMPL_LOOP -->
|
||||
<!--TMPL_LOOP NAME="bor_messages_loop" -->
|
||||
<li><span class=""><!--TMPL_VAR NAME="message_date_formatted"--> <!--TMPL_VAR NAME="branchcode"--> <i>"<!--TMPL_VAR NAME="message"-->"</i></span> <!-- TMPL_IF NAME="can_delete" --><a href='/cgi-bin/koha/circ/del_message.pl?message_id=<!--TMPL_VAR NAME="message_id" -->&borrowernumber=<!--TMPL_VAR NAME="borrowernumber" -->'>[Delete]</a><!-- /TMPL_IF --></li>
|
||||
<li><span class=""><!--TMPL_VAR NAME="message_date_formatted"--> <!--TMPL_VAR NAME="branchcode"--> <i>"<!--TMPL_VAR NAME="message"-->"</i></span> <!-- TMPL_IF NAME="can_delete" --><a href="/cgi-bin/koha/circ/del_message.pl?message_id=<!--TMPL_VAR NAME="message_id" -->&borrowernumber=<!--TMPL_VAR NAME="borrowernumber" -->">[Delete]</a><!-- /TMPL_IF --></li>
|
||||
<!-- /TMPL_LOOP -->
|
||||
|
||||
<a href="#" onclick="showhide('add_message'); return(false);">Add A New Message</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /If flagged --><!-- /TMPL_IF -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue