[Koha-patches] [PATCH 65/78] suggestions changes (probably useless)
paul.poulain at biblibre.com
paul.poulain at biblibre.com
Thu May 28 18:33:15 CEST 2009
From: Paul Poulain <paul.poulain at biblibre.com>
and incompatible with hdl stuff
---
.../prog/en/modules/suggestion/acceptorreject.tmpl | 80 ++--
.../en/modules/suggestion/acceptorrejectpd.tmpl | 442 +++++++++++++++
.../en/modules/suggestion/suggestiondetails.tmpl | 580 ++++++++++++++++++++
.../en/modules/suggestion/suggestiondetailspd.tmpl | 551 +++++++++++++++++++
.../prog/en/modules/opac-suggestions.tmpl | 9 +-
opac/opac-suggestions.pl | 32 +-
suggestion/acceptorreject.pl | 21 +
suggestion/acceptorrejectpd.pl | 267 +++++++++
suggestion/suggestiondetails.pl | 451 +++++++++++++++
suggestion/suggestiondetailspd.pl | 428 +++++++++++++++
10 files changed, 2801 insertions(+), 60 deletions(-)
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorrejectpd.tmpl
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetails.tmpl
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetailspd.tmpl
create mode 100755 suggestion/acceptorrejectpd.pl
create mode 100755 suggestion/suggestiondetails.pl
create mode 100755 suggestion/suggestiondetailspd.pl
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl
index ca54409..03f9387 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl
@@ -27,7 +27,7 @@
$.tablesorter.defaults.widgets = ['zebra'];
$("#acceptedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
- headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
+ headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false}}
});
$("#acceptedt").bind("sortStart",function() {
$("#sorting").show();
@@ -36,7 +36,7 @@
});
$("#pendingt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
- headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
+ headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false}}
});
$("#pendingt").bind("sortStart",function() {
$("#sorting").show();
@@ -45,13 +45,22 @@
});
$("#rejectedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
- headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
+ headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false}}
});
$("#rejectedt").bind("sortStart",function() {
$("#sorting").show();
}).bind("sortEnd",function() {
$("#sorting").hide();
});
+ $("#checkedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
+ dateFormat: 'uk',<!-- /TMPL_IF -->
+ headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false}}
+ });
+ $("#checkedt").bind("sortStart",function() {
+ $("#sorting").show();
+ }).bind("sortEnd",function() {
+ $("#sorting").hide();
+ });
$("div[id*=other-reason]").hide();
$("input[name*=other-reason]").focus(function(){ $(this).val(""); });
@@ -112,8 +121,9 @@
<div id="loadingtab" class="overlay">Loading tab...</div>
<div id="suggestiontabs" class="toptabs">
<ul class="ui-tabs-nav">
- <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#accepted">Accepted</a></li>
<li class="ui-tabs-selected"><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#pending">Pending</a></li>
+ <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#checked">Checked</a></li>
+ <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#accepted">Accepted</a></li>
<li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#rejected">Rejected</a></li>
</ul>
@@ -123,14 +133,8 @@
<input type="hidden" name="op" value="aorr_confirm" />
<input type="hidden" name="suggestiontype" value="<!--TMPL_VAR Name="suggestiontype"-->" />
- <!-- TMPL_IF NAME="suggestions_loop" -->
- <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
- <table id="acceptedt">
- <!-- TMPL_ELSIF EXPR="suggestiontype eq 'pending'" -->
- <table id="pendingt">
- <!-- TMPL_ELSE -->
- <table id="rejectedt">
- <!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="suggestions_loop" -->
+ <table id="<!--TMPL_VAR Name="suggestiontype"-->t">
<thead><tr>
<th>Suggestion</th>
<th>Suggested by</th>
@@ -139,6 +143,7 @@
<!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
<th>Reason Update</th>
<!--/TMPL_IF -->
+ <th>Checked</th>
<th>Accept</th>
<th>Reject</th>
<th>Delete</th>
@@ -158,18 +163,18 @@
(<!-- TMPL_VAR name="branchcodesuggestedby" -->)
</td>
<td>
- <!-- TMPL_VAR name="date" -->
+ <!-- TMPL_VAR name="suggestioncreatedon" -->
</td>
<!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
<td>
<!--TMPL_VAR Name="reason"-->
- <input type="hidden" name="initial-reason<!-- TMPL_VAR name="suggestionid" -->" value="<!--TMPL_VAR Name="reason" ESCAPE="HTML"-->" />
+ <input type="hidden" name="initial-reason<!-- TMPL_VAR name="ordernumber" -->" value="<!--TMPL_VAR Name="reason" ESCAPE="HTML"-->" />
</td>
<!--/TMPL_IF -->
<td>
- <div id="select-reason<!-- TMPL_VAR NAME="suggestionid" -->" class="select<!-- TMPL_VAR NAME="suggestiontype" -->">
- <!-- TMPL_IF NAME="reasonsloop" --><select id="reason<!-- TMPL_VAR NAME="suggestionid" -->" name="reason<!-- TMPL_VAR NAME="suggestionid" -->">
+ <div id="select-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="select<!-- TMPL_VAR NAME="suggestiontype" -->">
+ <!-- TMPL_IF NAME="reasonsloop" --><select id="reason<!-- TMPL_VAR NAME="ordernumber" -->" name="reason<!-- TMPL_VAR NAME="ordernumber" -->">
<option value=""> -- Choose a reason -- </option>
<!-- TMPL_LOOP NAME="reasonsloop" -->
<option value="<!-- TMPL_VAR NAME="lib" -->"><!-- TMPL_VAR NAME="lib" --></option>
@@ -177,30 +182,35 @@
<option value="other">Others...</option>
</select><!-- TMPL_ELSE --><span class="problem">No reasons defined in <a href="/cgi-bin/koha/admin/authorised_values.pl">authorized values</a></span><!-- /TMPL_IF -->
</div>
- <div id="other-reason<!-- TMPL_VAR NAME="suggestionid" -->">
- <input type="text" size="31" name="other-reason<!-- TMPL_VAR name="suggestionid" -->" value="please note your reason here..." />
- <p><a href="#back<!-- TMPL_VAR NAME="suggestionid" -->">back to list</a></p>
+ <div id="other-reason<!-- TMPL_VAR NAME="ordernumber" -->">
+ <input type="text" size="31" name="other-reason<!-- TMPL_VAR name="ordernumber" -->" value="please note your reason here..." />
+ <p><a href="#back<!-- TMPL_VAR NAME="ordernumber" -->">back to list</a></p>
</div>
</td>
<td>
- <!-- These EXPR are NOT doing what the author thinks they are -->
- <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
- <input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" readonly="readonly" checked="checked" />
+ <!--TMPL_IF Name="CHECKED"-->
+ <input id="c<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="CHECKED" readonly="readonly" checked="checked" />
+ <!--TMPL_ELSE-->
+ <input id="c<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="CHECKED" />
+ <!--/TMPL_IF-->
+ </td>
+ <td>
+ <!--TMPL_IF Name="ACCEPTED"-->
+ <input id="a<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="ACCEPTED" readonly="readonly" checked="checked" />
<!--TMPL_ELSE-->
- <input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" />
+ <input id="a<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="ACCEPTED" />
<!--/TMPL_IF-->
</td>
<td>
- <!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
- <input id="r<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" readonly="readonly" checked="checked" />
+ <!--TMPL_IF Name="REJECTED"-->
+ <input id="r<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="REJECTED" readonly="readonly" checked="checked" />
<!--TMPL_ELSE-->
- <input id="r<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" />
+ <input id="r<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="REJECTED" />
<!--/TMPL_IF-->
-
</td>
<td>
- <input id="d<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="delete" />
+ <input id="d<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="delete" />
</td>
</tr>
<!-- /TMPL_LOOP --></tbody>
@@ -218,23 +228,13 @@
<div id="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
<label for="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">Enter a reason for all marked entries:</label>
<input type="text" size="31" id="select-other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all" name="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all" value="please note your reason here..." /> <a href="#markall" id="markalltext<!-- TMPL_VAR NAME="suggestiontype" -->">Mark all with this reason</a> <a href="#back<!-- TMPL_VAR NAME="suggestiontype" -->all">Cancel</a>
- </div>
+<!--Add feature : choose librarian Choose supplier if accepted and allow order, Choose Budget Choose Branchcode--> </div>
</fieldset>
<fieldset class="action"><input type="submit" value="Change Status" /></fieldset>
</form>
<!-- TMPL_ELSE -->
- <!--TMPL_IF EXPR="suggestiontype eq 'pending'"-->
- <b>No pending suggestions.</b>
- <!--/TMPL_IF-->
- <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
- <b>No accepted suggestions.</b>
- <!--/TMPL_IF-->
- <!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
- <b>No rejected suggestions.</b>
- <!--/TMPL_IF-->
-</form>
+ <b>No <!--TMPL_VAR Name="suggestiontype"--> suggestions.</b>
<!-- /TMPL_IF -->
-
</div>
<!--/TMPL_LOOP-->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorrejectpd.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorrejectpd.tmpl
new file mode 100644
index 0000000..77a626c
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorrejectpd.tmpl
@@ -0,0 +1,442 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+
+<title>Koha › Suggestions Management</title>
+
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+
+
+<script type="text/JavaScript">
+
+// #################################################################################
+// Javascript
+// #################################################################################
+
+ // <![CDATA[
+
+ /**
+ * displayOther.
+ * This function display the select or an textaera to write a reason.
+ */
+ function displayOther(id) {
+ var spanselect = document.getElementById("span-select-reason"+id);
+ var spanother = document.getElementById("span-other-reason"+id);
+ var select = spanselect.firstChild.nextSibling;
+
+ if(select.value != "other"){
+ return;
+ }
+ if(spanother.getAttribute('class')=='content_visible'){
+ spanother.removeAttribute('class');
+ spanselect.removeAttribute('class');
+ spanother.setAttribute('class','content_hidden');
+ spanselect.setAttribute('class','content_visible');
+ }
+ else{
+ spanother.removeAttribute('class');
+ spanselect.removeAttribute('class');
+ spanselect.setAttribute('class','content_hidden');
+ spanother.setAttribute('class','content_visible');
+ }
+ }
+// ]]>
+
+</script>
+</head>
+
+
+<body>
+
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
+
+<!-- ################################################################################# -->
+<!-- BREADCRUMBS -->
+<!-- ################################################################################# -->
+
+
+<div id="breadcrumbs">
+
+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
+ <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> ›
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">Suggestions Management (PD) </a>
+
+ <!-- TMPL_IF NAME="op_accepted"-->› Accepted<!-- /TMPL_IF -->
+
+ <!-- TMPL_IF NAME="op_rejected"-->› Rejected<!-- /TMPL_IF -->
+
+
+</div>
+
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+<!-- unique screen -->
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+
+<div id="doc" class="yui-t7">
+
+<div id="bd">
+<div id="yui-main">
+<div class="yui-b">
+
+
+<h1>Suggestions (Purchase Department - <!-- TMPL_VAR name="bookfundgroupname"-->)</h1>
+
+<!-- ################################################################################# -->
+<!-- 'accepted', 'pending', rejected' titles -->
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+
+<!-- TMPL_IF NAME="suggestions_loop" -->
+ <div class="toptabs">
+ <ul class="tabs-nav">
+
+ <!-- TMPL_IF NAME="op_accepted"-->
+ <li class="tabs-selected">
+
+ <!-- TMPL_ELSE -->
+ <li>
+
+ <!-- /TMPL_IF -->
+
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?op=accepted&bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">Accepted</a>
+ </li>
+
+
+ <!-- TMPL_IF NAME="op_else" -->
+ <li class="tabs-selected">
+
+ <!-- TMPL_ELSE -->
+ <li>
+
+ <!-- /TMPL_IF -->
+
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?op=aorr_confirm&bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">Pending</a>
+ </li>
+
+
+ <!-- TMPL_IF NAME="op_rejected"-->
+ <li class="tabs-selected">
+ <!-- TMPL_ELSE -->
+ <li>
+ <!-- /TMPL_IF -->
+
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?op=rejected&bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">Rejected</a>
+ </li>
+
+ </ul>
+
+<!-- /TMPL_IF -->
+
+
+<!-- TMPL_IF name="op_else" -->
+
+<!-- ################################################################################# -->
+<!-- list of pending suggestions -->
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+
+<div class="tabs-container">
+
+
+ <!-- TMPL_IF NAME="suggestions_loop" -->
+
+ <!-- The list of pending suggestions is not empty
+ ################################################################################## -->
+
+ <form name="f" method="post" action="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">
+
+ <input type="hidden" name="op" value="aorr_confirm" />
+ <input type="hidden" name="bookfundgroupnumber" value="<!-- TMPL_VAR name="bookfundgroupnumber"-->" />
+
+ <table>
+ <tr>
+ <th>Status</th>
+ <th>Reason</th>
+ <th>Book fund</th>
+ <th>Suggestion</th>
+ <th>Suggested by<br/>on</th>
+ <th></th>
+ </tr>
+
+ <!-- TMPL_LOOP NAME="suggestions_loop" -->
+
+ <input type="hidden" name="step<!-- TMPL_VAR NAME="ordernumber" -->" value="<!-- TMPL_VAR NAME="step" -->" />
+
+ <!-- TMPL_IF name="even" -->
+ <tr class="highlight">
+
+ <!-- TMPL_ELSE -->
+ <tr>
+ <!-- /TMPL_IF -->
+
+
+<!-- set a status -->
+<!-- ################################################################################# -->
+
+ <td>
+ <select name="aorr">
+ <option value=""> -- Choose Action -- </option>
+ <option value="R<!--TMPL_VAR name="ordernumber" -->">Reject</option>
+ <option value="A<!--TMPL_VAR name="ordernumber" -->">Accept</option>
+ </select>
+ </td>
+
+
+<!-- reasons loop-->
+<!-- ################################################################################# -->
+
+ <td>
+ <span id="span-select-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="content_visible">
+
+ <!-- TMPL_IF NAME="reasonsloop" -->
+ <select name="reason<!-- TMPL_VAR name="ordernumber" -->" onchange="displayOther('<!-- TMPL_VAR NAME="ordernumber" -->');">
+ <option value=""> -- Choose a reason -- </option>
+
+ <!-- TMPL_LOOP NAME="reasonsloop" -->
+ <option value="<!-- TMPL_VAR NAME="lib" -->"><!-- TMPL_VAR NAME="lib" --></option>
+ <!-- /TMPL_LOOP -->
+
+ <option value="other">Others...</option>
+
+ </select>
+
+ <!-- TMPL_ELSE -->
+ <span class="problem">No reasons defined in <a href="/cgi-bin/koha/admin/authorised_values.pl">authorised values</a></span>
+ <!-- /TMPL_IF -->
+
+ </span>
+
+ <span id="span-other-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="content_hidden">
+
+ <input type="text" name="other-reason<!-- TMPL_VAR name="ordernumber" -->" value="please note your reason here..." onclick="if(this.value === 'please note your reason here...'){this.value=''}" />
+
+ <small><a href="#" onclick="displayOther('<!-- TMPL_VAR NAME="ordernumber" -->'); return false;">back to list</a></small>
+
+ </span>
+
+ </td>
+
+
+<!-- choose the Book fund group related to the document -->
+<!-- ################################################################################# -->
+
+ <td>
+ <select name="bookfunds_loop<!-- TMPL_VAR NAME="ordernumber" -->">
+ <option value="">choose a book fund</option>
+
+ <!-- TMPL_LOOP NAME="bookfunds_loop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR name="bookfundnumber" -->" selected="selected"><!-- TMPL_VAR NAME="bookfundname"--></option>
+
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR name="bookfundnumber" -->"><!-- TMPL_VAR NAME="bookfundname"--></option>
+
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+
+ </td>
+
+<!-- description ot the document -->
+<!-- ################################################################################# -->
+
+ <td>
+ <!-- TMPL_VAR NAME="title" --><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><br />
+
+ <!-- TMPL_IF name="copyrightdate" -->© <!-- TMPL_VAR name="copyrightdate" --> <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="volumedesc" -->; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i> <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="isbn" -->; ISBN :<i><!-- TMPL_VAR name="isbn" --></i><br /> <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="publishercode" -->; Published by <!-- TMPL_VAR name="publishercode" --> <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="publicationyear" --> in <i><!-- TMPL_VAR name="publicationyear" --></i> <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="place" --> in <i><!-- TMPL_VAR name="place" --></i><!-- /TMPL_IF --><br />
+
+ <!-- TMPL_IF name="rrp" --><!-- TMPL_VAR name="rrp" --><!-- /TMPL_IF --><br />
+
+ <!-- TMPL_IF name="note" --><!-- TMPL VAR NAME="note" --><!-- /TMPL_IF -->
+ </td>
+
+
+<!-- name of the person who 1st wrote the suggestion -->
+<!-- ################################################################################# -->
+
+ <td>
+ <!-- TMPL_VAR name="surnamesuggestedby" -->
+ <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamesuggestedby" --><br/>
+ <!-- TMPL_VAR name="suggestioncreatedon" -->
+ </td>
+
+<!-- link to get more details about the suggestion -->
+<!-- ################################################################################# -->
+ <td>
+ <a href="/cgi-bin/koha/suggestion/suggestiondetailspd.pl?ordernumber=<!-- TMPL_VAR name="ordernumber" -->">details</a>
+ </td>
+
+ </tr>
+
+ <!-- /TMPL_LOOP --> <!-- ## fin de la boucle associée aux suggestions -->
+
+ </table>
+
+ <fieldset class="action"><input type="submit" value="Change Status" /></fieldset>
+
+ </form>
+
+ <!-- TMPL_ELSE -->
+
+ <!-- The list of pending suggestions is empty -->
+ <!-- ################################################################################# -->
+ <!-- ################################################################################# -->
+
+ <b>No pending suggestions</b>
+ <br><br>
+
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?op=accepted&bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">See accepted suggestions</a>
+ <br><br>
+
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?op=rejected&bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber"-->">See rejected suggestions</a>
+
+ <!-- /TMPL_IF -->
+
+<!-- /TMPL_IF -->
+
+
+
+<!-- TMPL_IF NAME="done" -->
+
+<!-- ################################################################################# -->
+<!-- List of managed suggestions -->
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+
+ <!-- TMPL_IF NAME="suggestions_loop" -->
+
+ <!-- The list of managed suggestions is not empty -->
+ <!-- ################################################################################# -->
+ <!-- ################################################################################# -->
+
+ <table>
+
+ <tr>
+ <th>Managed by (GPD)<br/>on</th>
+ <th>Managed by (PD)<br/>on</th>
+ <th><!-- TMPL_IF NAME="op_rejected"-->Reason
+ <!-- /TMPL_IF --><br/>Book fund</th>
+ <th>Suggestion</th>
+ <th>Suggested by<br/>on</th>
+ <th></th>
+ </tr>
+
+ <!-- TMPL_LOOP NAME="suggestions_loop" -->
+ <tr>
+
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedingpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedingpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedingpdby" --><br/>
+ <!-- TMPL_VAR name="suggestionmanagedingpdon" -->
+ </td>
+
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedinpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedinpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedinpdby" --><br/>
+ <!-- TMPL_VAR name="suggestionmanagedinpdon" -->
+ </td>
+
+ <td>
+ <!-- TMPL_VAR NAME="reason" --><br/>
+ <!-- TMPL_VAR NAME="bookfundname" -->
+ </td>
+
+ <td>
+ <!-- TMPL_VAR NAME="title" -->
+ <!-- TMPL_IF NAME="author" -->
+ , by <!-- TMPL_VAR NAME="author" -->
+ <!-- /TMPL_IF -->
+ <br />
+
+ <!-- TMPL_IF name="copyrightdate" -->
+ © <!-- TMPL_VAR name="copyrightdate" -->
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="volumedesc" -->
+ ; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i>
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="isbn" -->
+ ; ISBN :<i><!-- TMPL_VAR name="isbn" --></i><br />
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="publishercode" -->
+ Published by <!-- TMPL_VAR name="publishercode" -->
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="publicationyear" -->
+ in <i><!-- TMPL_VAR name="publicationyear" --></i>
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF name="place" -->
+ in <i><!-- TMPL_VAR name="place" --></i>
+ <!-- /TMPL_IF -->
+ <br />
+
+ <!-- TMPL_IF name="rrp" -->unit price : <!-- TMPL_VAR name="rrp" --><!-- /TMPL_IF --><br />
+
+ <!-- TMPL_IF name="note" -->
+ <!-- TMPL VAR NAME="note" -->
+ <!-- /TMPL_IF -->
+ </td>
+
+ <td>
+ <!-- TMPL_VAR name="surnamesuggestedby" -->
+ <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamesuggestedby" --><br/>
+ <!-- TMPL_VAR name="suggestioncreatedon" -->
+ </td>
+
+ <td>
+ <a href="/cgi-bin/koha/suggestion/suggestiondetailspd.pl?ordernumber=<!-- TMPL_VAR name="ordernumber" -->">details</a>
+ </td>
+
+ </tr>
+ <!-- /TMPL_LOOP -->
+
+ </table>
+
+
+ <!-- TMPL_ELSE -->
+
+ <!-- The list of managed suggestions is empty -->
+ <!-- ################################################################################# -->
+ <!-- ################################################################################# -->
+
+ <h4>No suggestions have been
+
+ <!-- TMPL_IF NAME="op_accepted"-->
+ accepted.
+ <!-- TMPL_ELSE -->
+ rejected.
+ <!-- /TMPL_IF -->
+
+ </h4>
+
+ <!-- /TMPL_IF -->
+
+<!-- /TMPL_IF -->
+
+
+</div>
+</div>
+
+</div>
+</div>
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetails.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetails.tmpl
new file mode 100644
index 0000000..f05338e
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetails.tmpl
@@ -0,0 +1,580 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+
+
+<title>
+
+ Koha › Acquisitions › Suggestion management › Suggestion details
+
+</title>
+
+
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+
+
+<script type="text/javascript">
+// #################################################################################
+// Javascript
+// #################################################################################
+
+ function isNotNull(f,noalert) {
+ if (f.value.length ==0) {
+ return false;
+ }
+ return true;
+ }
+
+
+ function toUC(f) {
+ var x=f.value.toUpperCase();
+ f.value=x;
+ return true;
+ }
+
+
+ function isNum(v,maybenull) {
+ var n = new Number(v.value);
+ if (isNaN(n)) {
+ return false;
+ }
+ if (maybenull==0 && v.value=='') {
+ return false;
+ }
+ return true;
+ }
+
+
+ function isDate(f) {
+ var t = Date.parse(f.value);
+ if (isNaN(t)) {
+ return false;
+ }
+ }
+
+
+ function Check(f) {
+ var ok=1;
+ var _alertString="";
+ var alertString2;
+
+ if (!(isNotNull(window.document.Aform.budgetperiodstartdate,1))) {
+ _alertString += "\n- " + _("budget period start date missing");
+ }
+
+ if (!(isNotNull(window.document.Aform.budgetperiodenddate,1))) {
+ _alertString += "\n- " + _("budget period end date missing");
+ }
+
+ if (!(isNotNull(window.document.Aform.budgetperiodref,1))) {
+ _alertString += "\n- " + _("reference period indicator missing");
+ }
+
+ if (!(isNotNull(window.document.Aform.budgetperioddescription,1))) {
+ _alertString += "\n- " + _("Description missing");
+ }
+
+ if (_alertString.length==0) {
+ document.Aform.submit();
+ } else {
+ alertString2 = _("Form not submitted because of the following problem(s)");
+ alertString2 += "\n------------------------------------------------------------------------------------\n";
+ alertString2 += _alertString;
+ alert(alertString2);
+ }
+ }
+
+</script>
+
+</head>
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+<!-- BODY -->
+<!-- ################################################################################# -->
+<!-- ################################################################################# -->
+
+<body>
+
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
+
+
+<!-- ################################################################################# -->
+<!-- BREADCRUMBS -->
+<!-- ################################################################################# -->
+
+
+<div id="breadcrumbs">
+
+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
+ <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> ›
+ <a href="/cgi-bin/koha/suggestion/acceptorreject.pl">Suggestions Management (GPD)</a> ›
+ suggestion details
+
+</div>
+
+
+<!--<div id="doc3" class="yui-t2">
+<div id="bd">
+<div id="yui-main">
+<div class="yui-b">-->
+<!-- TMPL_INCLUDE NAME="acquisitions-toolbar.inc" -->
+
+
+
+
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+<!-- display the suggestion details -->
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+
+ <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
+
+ <h1>Suggestion details (General Purchase Department)</h1>
+ <br/><br/>
+
+
+
+<!-- TMPL_IF NAME="step2ormore" -->
+
+<!-- ###################################################################### -->
+<!-- The user cannot edit the fields -->
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+
+ <ol>
+ <li>
+ <h2>Document</h2>
+ </li>
+ <li>
+ <label for="title">Title :</label> <!-- TMPL_VAR name="title" -->
+ </li>
+ <li>
+ <label for="author">Author:</label> <!-- TMPL_VAR name="author" -->
+ </li>
+ <li>
+ <label for="copyrightdate">Copyright date:</label> <!-- TMPL_VAR name="copyrightdate" -->
+ </li>
+ <li>
+ <label for="isbn">ISBN : </label> <!-- TMPL_VAR name="isbn" -->
+ </li>
+ <li>
+ <label for="rrp">unit price : </label> <!-- TMPL_VAR name="rrp" -->
+ </li>
+ <li>
+ <label for="publishercode">Publisher:</label> <!-- TMPL_VAR name="publishercode" -->
+ </li>
+ <li>
+ <label for="seriestitle">Series:</label> <!-- TMPL_VAR name="seriestitle" -->
+ </li>
+ <li>
+ <label for="note">Notes:</label> <!-- TMPL_VAR name="note" -->
+ </li>
+
+ <li>
+ <label for="itemtype">Item type :</label> <!-- TMPL_VAR NAME="itemtypedescription" -->
+ </li>
+
+ <li>
+ <h2>Branch, book fund group, book fund, audience</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- 'Branch, book fund group, book fund, audience' -->
+<!-- ############################################################# -->
+
+ <li>
+ <label for="branch_loop">Branch :</label> <!-- TMPL_VAR NAME="branchname" -->
+ </li>
+
+ <li>
+ <label for="bookfundgroup_loop">book fund group :</label> <!-- TMPL_VAR NAME="bookfundgroupname"-->
+ </li>
+
+ <li>
+ <label for="bookfund_loop">book fund :</label> <!-- TMPL_VAR NAME="bookfundname"-->
+ </li>
+
+ <li>
+ <label for="audience_loop">audience :</label> <!-- TMPL_VAR NAME="audiencename"-->
+ </li>
+
+ <li>
+ <h2>Suggestion management</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- suggestion management -->
+<!-- ############################################################# -->
+
+ <li>
+
+ <table>
+ <tr>
+ <th>Action</th>
+ <th>Author</th>
+ <th>Date</th>
+ <th>Status</th>
+ <th>Reason</th>
+ </tr>
+
+ <tr>
+ <td>suggestion made by</td>
+ <td>
+ <!-- TMPL_VAR name="surnamesuggestedby" -->
+ <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamesuggestedby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestioncreatedon" --></td>
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+ </tr>
+
+
+ <tr>
+ <td>suggestion managed by (GPD)</td>
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedingpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedingpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedingpdby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestionmanagedingpdon" --></td>
+
+ <td>
+ <!-- TMPL_IF name="rejected2" -->
+ REJECTED
+ <!-- TMPL_ELSE -->
+ ACCEPTED
+ <!-- /TMPL_IF -->
+ </td>
+
+ <td>
+ <!-- TMPL_IF name="rejected2" -->
+ <!-- TMPL_VAR NAME="reason" -->
+ <!-- TMPL_ELSE -->
+ - - - - -
+ <!-- /TMPL_IF -->
+ </td>
+
+ </tr>
+
+ <!-- "suggestion managed by (PD) " -->
+ <!-- ################################################### -->
+
+ <tr>
+ <td>suggestion managed by (PD)</td>
+
+ <!-- TMPL_IF name="rejected2" -->
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+
+ <!-- TMPL_ELSE -->
+
+ <!-- TMPL_IF name="accepted2" -->
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+
+ <!-- TMPL_ELSE -->
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedinpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedinpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedinpdby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestionmanagedinpdon" --></td>
+ <td><!-- TMPL_VAR NAME="status" --></td>
+ <td><!-- TMPL_VAR NAME="reason" --></td>
+
+ <!-- /TMPL_IF -->
+
+ <!-- /TMPL_IF -->
+ </tr>
+ </li>
+
+ </ol>
+
+
+
+<!-- TMPL_ELSE -->
+
+<!-- ###################################################################### -->
+<!-- ## the user can edit the fields (step=1) -->
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+
+
+<!-- ###################################################################### -->
+<!-- description of the item -->
+<!-- ###################################################################### -->
+
+
+ <form action="/cgi-bin/koha/suggestion/suggestiondetails.pl" method="post">
+
+ <input type="hidden" name="ordernumber" value=<!-- TMPL_VAR name="ordernumber" --> />
+
+ <fieldset class="rows">
+ <ol>
+ <li>
+ <h2>Document</h2>
+ </li>
+ <li>
+ <label for="title">Title: *</label>
+ <input type="text" id="title" name="title" size="50" maxlentgh="80" value="<!-- TMPL_VAR name="title" -->"/>
+ </li>
+ <li>
+ <label for="author">Author: *</label>
+ <input type="text" id="author" name="author" size="50" maxlength="80" value="<!-- TMPL_VAR name="author" -->" />
+ </li>
+ <li>
+ <label for="copyrightdate">Copyright date: </label>
+ <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="<!-- TMPL_VAR name="copyrightdate" -->"/>
+ </li>
+ <li>
+ <label for="isbn">ISBN: *</label>
+ <input type="text" id="isbn" name="isbn" size="13" maxlength="13" value="<!-- TMPL_VAR name="isbn" -->"/>
+ </li>
+ <li>
+ <label for="rrp">unit price: </label>
+ <input type="text" id="rrp" name="rrp" size="15" maxlength="15" value="<!-- TMPL_VAR name="rrp" -->"/>
+ </li>
+ <li>
+ <label for="publishercode">Publisher: *</label>
+ <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="<!-- TMPL_VAR name="publishercode" -->"/>
+ </li>
+ <li>
+ <label for="seriestitle">Series:</label>
+ <input type="text" id="seriestitle" name="seriestitle" size="50" maxlength="50" value="<!-- TMPL_VAR name="seriestitle" -->"/>
+ </li>
+ <li>
+ <label for="note">Notes:</label>
+ <textarea name="note" id="note" rows="5" cols="40" value="<!-- TMPL_VAR name="note" -->"><!-- TMPL_VAR name="note" --></textarea>
+ </li>
+
+ <li>
+ <label for="itemtype">Item type: *</label>
+ <select id="itemtype" name="itemtype">
+
+ <!-- TMPL_LOOP NAME="itemtypeloop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+
+ <option value="<!-- TMPL_VAR NAME="itemtype" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
+
+ <!-- TMPL_ELSE -->
+
+ <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
+
+ <!-- /TMPL_IF -->
+
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+
+ <li>
+ <h2>Branch, book fund group, book fund, audience</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- 'Branch, book fund group, book fund, audience' -->
+<!-- ############################################################# -->
+
+ <li>
+ <label for="branch_loop">Branch: *</label>
+ <select id="branch_loop" name="branch_loop">
+ <!-- TMPL_LOOP NAME="branch_loop" -->
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+ <li>
+ <label for="bookfundgroup_loop">book fund group: *</label>
+ <select name="bookfundgroup_loop">
+ <option value="">choose a book fund group</option>
+
+ <!-- TMPL_LOOP NAME="bookfundgroup_loop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR name="bookfundgroupnumber" -->" selected="selected"><!-- TMPL_VAR NAME="bookfundgroupname"--></option>
+
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR name="bookfundgroupnumber" -->" ><!-- TMPL_VAR NAME="bookfundgroupname"--></option>
+
+ <!-- /TMPL_IF -->
+
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+ <li>
+ <label for="bookfund_loop">book fund :</label>
+ <select name="bookfund_loop">
+
+ <!-- TMPL_IF NAME="chooseabookfund" -->
+ <option value"">choose a book fund</option>
+ <!-- TMPL_ELSE -->
+ <option value"">please 1st specify a book fund group</option>
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_LOOP NAME="bookfund_loop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR name="bookfundnumber" -->" selected="selected"><!-- TMPL_VAR NAME="bookfundname"--></option>
+
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR name="bookfundnumber" -->" ><!-- TMPL_VAR NAME="bookfundname"--></option>
+
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+ <li>
+ <label for="audience_loop">audience :</label>
+ <select name="audience_loop">
+
+ <!-- TMPL_IF NAME="chooseanaudience" -->
+ <option value"">choose an audience</option>
+ <!-- TMPL_ELSE -->
+ <option value"">please 1st specify a book fund group</option>
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_LOOP NAME="audience_loop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR name="audiencenumber" -->" selected="selected"><!-- TMPL_VAR NAME="audiencename"--></option>
+
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR name="audiencenumber" -->" ><!-- TMPL_VAR NAME="audiencename"--></option>
+
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+
+ </li>
+
+
+ <li>
+ <h2>Suggestion management</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- suggestion management -->
+<!-- ############################################################# -->
+
+ <li>
+
+ <table>
+ <tr>
+ <th>Action</th>
+ <th>Author</th>
+ <th>Date</th>
+ <th>Status</th>
+ <th>Reason</th>
+ </tr>
+
+ <tr>
+ <td>suggestion made by</td>
+ <td>
+ <!-- TMPL_VAR name="surnamesuggestedby" -->
+ <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamesuggestedby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestioncreatedon" --></td>
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+ </tr>
+
+
+ <tr>
+ <td>suggestion managed by (GPD)</td>
+ <td></td>
+ <td></td>
+ <td>
+ <select name="aorr">
+ <option value=""> -- Choose Action -- </option>
+ <option value="REJECTED" <!-- TMPL_IF name="rejected1" -->selected="selected"<!-- /TMPL_IF -->>Reject</option>
+ <option value="ACCEPTED" <!-- TMPL_IF name="accepted1" -->selected="selected"<!-- /TMPL_IF -->>Accept</option>
+ </select>
+ </td>
+
+ <td>
+
+ <span id="span-select-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="content_visible">
+
+
+ <!-- TMPL_IF NAME="reasons_loop" -->
+ <select name="reason" onchange="displayOther('<!-- TMPL_VAR NAME="ordernumber" -->');">
+ <option value=""> -- Choose a reason -- </option>
+
+ <!-- TMPL_LOOP NAME="reasons_loop" -->
+
+ <option value="<!-- TMPL_VAR NAME="lib" -->" <!-- TMPL_IF name="selected" -->selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="lib" --></option>
+
+ <!-- /TMPL_LOOP -->
+
+ <option value="other" <!-- TMPL_IF name="selected" -->selected="selected"<!-- /TMPL_IF -->>Others...</option>
+
+ </select>
+
+ <!-- TMPL_ELSE -->
+ <span class="problem">No reasons defined in <a href="/cgi-bin/koha/admin/authorised_values.pl">authorised values</a></span>
+ <!-- /TMPL_IF -->
+
+ </span>
+
+ <span id="span-other-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="content_hidden">
+
+ <input type="text" name="other-reason<!-- TMPL_VAR name="ordernumber" -->" value="please note your reason here..." onclick="if(this.value === 'please note your reason here...'){this.value=''}" />
+
+ <small><a href="#" onclick="displayOther('<!-- TMPL_VAR NAME="ordernumber" -->'); return false;">back to list</a></small>
+
+ </span>
+
+ </td>
+
+ </tr>
+
+ <tr>
+ <td>suggestion managed by (PD)</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+
+ </li>
+
+ </ol>
+
+ </fieldset>
+
+ <fieldset class="action">
+ <input type="hidden" name="op" value="add_confirm" />
+ <input type="submit" value="Submit Your Suggestion" />
+ <a class="action" href="/cgi-bin/koha/suggestion/acceptorreject.pl">Cancel</a>
+ </fieldset>
+
+ </form>
+
+<!-- /TMPL_IF -->
+
+ <br><br>
+ <a href="/cgi-bin/koha/suggestion/acceptorreject.pl">Suggestions Management</a>
+
+
+<!--</div>
+</div>-->
+<div class="yui-b">
+<!--<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->-->
+<!--</div>
+</div>-->
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
+</div>
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetailspd.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetailspd.tmpl
new file mode 100644
index 0000000..24be4eb
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestiondetailspd.tmpl
@@ -0,0 +1,551 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+
+
+<title>
+
+ Koha › Acquisitions › Suggestion management › Suggestion details
+
+</title>
+
+
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+
+
+<script type="text/javascript">
+// #################################################################################
+// Javascript
+// #################################################################################
+
+ function isNotNull(f,noalert) {
+ if (f.value.length ==0) {
+ return false;
+ }
+ return true;
+ }
+
+
+ function toUC(f) {
+ var x=f.value.toUpperCase();
+ f.value=x;
+ return true;
+ }
+
+
+ function isNum(v,maybenull) {
+ var n = new Number(v.value);
+ if (isNaN(n)) {
+ return false;
+ }
+ if (maybenull==0 && v.value=='') {
+ return false;
+ }
+ return true;
+ }
+
+
+ function isDate(f) {
+ var t = Date.parse(f.value);
+ if (isNaN(t)) {
+ return false;
+ }
+ }
+
+
+ function Check(f) {
+ var ok=1;
+ var _alertString="";
+ var alertString2;
+
+ if (!(isNotNull(window.document.Aform.budgetperiodstartdate,1))) {
+ _alertString += "\n- " + _("budget period start date missing");
+ }
+
+ if (!(isNotNull(window.document.Aform.budgetperiodenddate,1))) {
+ _alertString += "\n- " + _("budget period end date missing");
+ }
+
+ if (!(isNotNull(window.document.Aform.budgetperiodref,1))) {
+ _alertString += "\n- " + _("reference period indicator missing");
+ }
+
+ if (!(isNotNull(window.document.Aform.budgetperioddescription,1))) {
+ _alertString += "\n- " + _("Description missing");
+ }
+
+ if (_alertString.length==0) {
+ document.Aform.submit();
+ } else {
+ alertString2 = _("Form not submitted because of the following problem(s)");
+ alertString2 += "\n------------------------------------------------------------------------------------\n";
+ alertString2 += _alertString;
+ alert(alertString2);
+ }
+ }
+
+</script>
+
+</head>
+
+<!-- ################################################################################# -->
+<!-- BODY -->
+<!-- ################################################################################# -->
+
+<body>
+
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
+
+
+<!-- ################################################################################# -->
+<!-- BREADCRUMBS -->
+<!-- ################################################################################# -->
+
+
+<div id="breadcrumbs">
+
+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
+ <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> ›
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber" -->">Suggestions Management (PD)</a> ›
+ suggestion details
+
+
+<!-- ################################################################################# -->
+<!-- (fin) BREADCRUMBS -->
+<!-- ################################################################################# -->
+
+</div>
+
+
+<!--<div id="doc3" class="yui-t2">
+<div id="bd">
+<div id="yui-main">
+<div class="yui-b">-->
+
+<!--</div>-->
+
+
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+<!-- unique screen -->
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+
+
+ <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
+
+ <h1>Suggestion details (Purchase Department)</h1>
+ <br/><br/>
+
+
+<!-- TMPL_IF NAME="step3ormore" -->
+
+<!-- ######################################################################## -->
+<!-- The user cannot edit the fields (step > = 3) -->
+<!-- ######################################################################## -->
+<!-- ######################################################################## -->
+
+
+ <ol>
+ <li>
+ <h2>Document</h2>
+ </li>
+ <li>
+ <label for="title">Title :</label> <!-- TMPL_VAR name="title" -->
+ </li>
+ <li>
+ <label for="author">Author:</label> <!-- TMPL_VAR name="author" -->
+ </li>
+ <li>
+ <label for="copyrightdate">Copyright date:</label> <!-- TMPL_VAR name="copyrightdate" -->
+ </li>
+ <li>
+ <label for="isbn">ISBN : </label> <!-- TMPL_VAR name="isbn" -->
+ </li>
+ <li>
+ <label for="rrp">unit price : </label> <!-- TMPL_VAR name="rrp" -->
+ </li>
+ <li>
+ <label for="publishercode">Publisher:</label> <!-- TMPL_VAR name="publishercode" -->
+ </li>
+ <li>
+ <label for="seriestitle">Series:</label> <!-- TMPL_VAR name="seriestitle" -->
+ </li>
+ <li>
+ <label for="note">Notes:</label> <!-- TMPL_VAR name="note" -->
+ </li>
+
+ <li>
+ <label for="itemtype">Item type :</label> <!-- TMPL_VAR NAME="itemtypedescription" -->
+ </li>
+
+ <li>
+ <h2>Branch, book fund group, book fund, audience</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- 'Branch, book fund group, book fund, audience' -->
+<!-- ############################################################# -->
+
+ <li>
+ <label for="branch_loop">Branch :</label> <!-- TMPL_VAR NAME="branchname" -->
+ </li>
+
+ <li>
+ <label>book fund group :</label> <!-- TMPL_VAR NAME="bookfundgroupname"-->
+ </li>
+
+ <li>
+ <label for="bookfund_loop">book fund :</label> <!-- TMPL_VAR NAME="bookfundname"-->
+ </li>
+
+ <li>
+ <label for="audience_loop">audience :</label> <!-- TMPL_VAR NAME="audiencename"-->
+ </li>
+
+ <li>
+ <h2>Suggestion management</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- suggestion management -->
+<!-- ############################################################# -->
+
+ <li>
+
+ <table>
+ <tr>
+ <th>Action</th>
+ <th>Author</th>
+ <th>Date</th>
+ <th>Status</th>
+ <th>Reason</th>
+ </tr>
+
+ <tr>
+ <td>suggestion made by</td>
+ <td>
+ <!-- TMPL_VAR name="surnamesuggestedby" -->
+ <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamesuggestedby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestioncreatedon" --></td>
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+ </tr>
+
+
+ <tr>
+ <td>suggestion managed by (GPD)</td>
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedingpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedingpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedingpdby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestionmanagedingpdon" --></td>
+
+ <td>
+ ACCEPTED
+ </td>
+
+ <td>
+ - - - - -
+ </td>
+
+ </tr>
+
+
+ <tr>
+ <td>suggestion managed by (PD)</td>
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedinpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedinpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedinpdby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestionmanagedinpdon" --></td>
+ <td><!-- TMPL_VAR NAME="status" --></td>
+ <td><!-- TMPL_IF name="rejected3" --><!-- TMPL_VAR NAME="reason" --><!-- TMPL_ELSE -->- - - - -<!-- /TMPL_IF --></td>
+ </tr>
+
+ </table>
+
+ </li>
+
+ </ol>
+
+<!-- TMPL_ELSE -->
+
+<!-- ###################################################################### -->
+<!-- ## The user can edit the fields (step=2) -->
+<!-- ###################################################################### -->
+<!-- ###################################################################### -->
+
+
+<!-- ######################################################################## -->
+<!-- description of the document -->
+<!-- ######################################################################## -->
+
+ <form action="/cgi-bin/koha/suggestion/suggestiondetailspd.pl" method="post">
+
+ <input type="hidden" name="ordernumber" value="<!-- TMPL_VAR name="ordernumber" -->" />
+
+ <input type="hidden" name="bookfundgroupnumber" value="<!-- TMPL_VAR name="bookfundgroupnumber" -->"/>
+
+ <input type="hidden" name="bookfundgroup_loop" value="<!-- TMPL_VAR name="bookfundgroup_loop" -->"/>
+
+ <fieldset class="rows">
+
+ <ol>
+ <li>
+ <h2>Document</h2>
+ </li>
+ <li>
+ <label for="title">Title: *</label>
+ <input type="text" id="title" name="title" size="50" maxlentgh="80" value="<!-- TMPL_VAR name="title" -->"/>
+ </li>
+ <li>
+ <label for="author">Author: *</label>
+ <input type="text" id="author" name="author" size="50" maxlength="80" value="<!-- TMPL_VAR name="author" -->" />
+ </li>
+ <li>
+ <label for="copyrightdate">Copyright date: </label>
+ <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="<!-- TMPL_VAR name="copyrightdate" -->"/>
+ </li>
+ <li>
+ <label for="isbn">ISBN: *</label>
+ <input type="text" id="isbn" name="isbn" size="13" maxlength="13" value="<!-- TMPL_VAR name="isbn" -->"/>
+ </li>
+ <li>
+ <label for="rrp">unit price: </label>
+ <input type="text" id="rrp" name="rrp" size="15" maxlength="15" value="<!-- TMPL_VAR name="rrp" -->"/>
+ </li>
+ <li>
+ <label for="publishercode">Publisher: *</label>
+ <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="<!-- TMPL_VAR name="publishercode" -->"/>
+ </li>
+ <li>
+ <label for="seriestitle">Series:</label>
+ <input type="text" id="seriestitle" name="seriestitle" size="50" maxlength="50" value="<!-- TMPL_VAR name="seriestitle" -->"/>
+ </li>
+ <li>
+ <label for="note">Notes:</label>
+ <textarea name="note" id="note" rows="5" cols="40" value="<!-- TMPL_VAR name="note" -->"><!-- TMPL_VAR name="note" --></textarea>
+ </li>
+
+ <li>
+ <label for="itemtype">Item type: *</label>
+ <select id="itemtype" name="itemtype">
+
+ <!-- TMPL_LOOP NAME="itemtypeloop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+
+ <option value="<!-- TMPL_VAR NAME="itemtype" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
+
+ <!-- TMPL_ELSE -->
+
+ <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
+
+ <!-- /TMPL_IF -->
+
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+ <li>
+ <h2>Branch, book fund group, book fund, audience</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- 'Branch, book fund group, book fund, audience' -->
+<!-- ############################################################# -->
+
+ <li>
+ <label for="branch_loop">Branch:</label>
+ <select id="branch_loop" name="branch_loop">
+ <!-- TMPL_LOOP NAME="branch_loop" -->
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+ <li>
+ <label>Book fund group:</label>
+ <!-- TMPL_VAR NAME="bookfundgroupname"--></li>
+
+ <li>
+ <label for="bookfund_loop">book fund :</label>
+ <select name="bookfund_loop">
+
+ <!-- TMPL_IF NAME="chooseabookfund" -->
+ <option value"">choose a book fund</option>
+ <!-- TMPL_ELSE -->
+ <option value"">please 1st specify a book fund group</option>
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_LOOP NAME="bookfund_loop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR name="bookfundnumber" -->" selected="selected"><!-- TMPL_VAR NAME="bookfundname"--></option>
+
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR name="bookfundnumber" -->" ><!-- TMPL_VAR NAME="bookfundname"--></option>
+
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+ </li>
+
+ <li>
+ <label for="audience_loop">audience:</label>
+ <select name="audience_loop">
+
+ <!-- TMPL_IF NAME="chooseanaudience" -->
+ <option value"">choose an audience</option>
+ <!-- TMPL_ELSE -->
+ <option value"">please 1st specify a book fund group</option>
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_LOOP NAME="audience_loop" -->
+
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR name="audiencenumber" -->" selected="selected"><!-- TMPL_VAR NAME="audiencename"--></option>
+
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR name="audiencenumber" -->" ><!-- TMPL_VAR NAME="audiencename"--></option>
+
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
+
+ </li>
+
+
+ <li>
+ <h2>Suggestion management</h2>
+ </li>
+
+<!-- ############################################################# -->
+<!-- suggestion management -->
+<!-- ############################################################# -->
+
+ <li>
+
+ <table>
+ <tr>
+ <th>Action</th>
+ <th>Author</th>
+ <th>Date</th>
+ <th>Status</th>
+ <th>Reason</th>
+ </tr>
+
+ <tr>
+ <td>suggestion made by</td>
+ <td>
+ <!-- TMPL_VAR name="surnamesuggestedby" -->
+ <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamesuggestedby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestioncreatedon" --></td>
+ <td> - - - - - </td>
+ <td> - - - - - </td>
+ </tr>
+
+
+ <tr>
+ <td>suggestion managed by (GPD)</td>
+ <td>
+ <!-- TMPL_VAR name="surnamemanagedingpdby" -->
+ <!-- TMPL_IF name="firstnamemanagedingpdby" -->,<!-- /TMPL_IF -->
+ <!-- TMPL_VAR name="firstnamemanagedingpdby" -->
+ </td>
+ <td><!-- TMPL_VAR name="suggestionmanagedingpdon" --></td>
+
+ <td>
+ ACCEPTED
+ </td>
+
+ <td>
+ - - - - -
+ </td>
+
+ </tr>
+
+ <tr>
+ <td>suggestion managed by (PD)</td>
+ <td></td>
+ <td></td>
+ <td>
+ <select name="aorr">
+ <option value=""> -- Choose Action -- </option>
+ <option value="REJECTED">Reject</option>
+ <option value="ACCEPTED">Accept</option>
+ </select>
+ </td>
+
+ <td>
+ <span id="span-select-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="content_visible">
+
+ <!-- TMPL_IF NAME="reasons_loop" -->
+ <select name="reason" onchange="displayOther('<!-- TMPL_VAR NAME="ordernumber" -->');">
+ <option value=""> -- Choose a reason -- </option>
+
+ <!-- TMPL_LOOP NAME="reasons_loop" -->
+
+ <option value="<!-- TMPL_VAR NAME="lib" -->" <!-- TMPL_IF name="selected" -->selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="lib" --></option>
+
+ <!-- /TMPL_LOOP -->
+
+ <option value="other" <!-- TMPL_IF name="selected" -->selected="selected"<!-- /TMPL_IF -->>Others...</option>
+
+ </select>
+
+ <!-- TMPL_ELSE -->
+ <span class="problem">No reasons defined in <a href="/cgi-bin/koha/admin/authorised_values.pl">authorised values</a></span>
+ <!-- /TMPL_IF -->
+
+ </span>
+
+ <span id="span-other-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="content_hidden">
+
+ <input type="text" name="other-reason<!-- TMPL_VAR name="ordernumber" -->" value="please note your reason here..." onclick="if(this.value === 'please note your reason here...'){this.value=''}" />
+
+ <small><a href="#" onclick="displayOther('<!-- TMPL_VAR NAME="ordernumber" -->'); return false;">back to list</a></small>
+
+ </span>
+
+ </td>
+
+ </tr>
+ </table>
+
+ </li>
+
+ </ol>
+
+ </fieldset>
+
+ <fieldset class="action">
+ <input type="hidden" name="op" value="add_confirm" />
+ <input type="submit" value="Submit Your Suggestion" />
+ <a class="action" href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber" -->">Cancel</a>
+ </fieldset>
+
+ </form>
+
+<!-- /TMPL_IF --> <!-- ## case : "step=2" (end) ## -->
+
+ <br><br>
+ <a href="/cgi-bin/koha/suggestion/acceptorrejectpd.pl?bookfundgroupnumber=<!-- TMPL_VAR name="bookfundgroupnumber" -->">Suggestions Management</a>
+
+<!--</div>
+</div>-->
+<div class="yui-b">
+<!-- <!-- TMPL_INCLUDE NAME="admin-menu.inc" --> -->
+<!-- </div> -->
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl
index 6a52b99..c82bed5 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl
@@ -63,8 +63,14 @@ $.tablesorter.addParser({
<li><label for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlentgh="80" /></li>
<li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" /></li>
<li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" /></li>
+ <li><label for="isbn">ISBN or ISSN or other standard number:</label></label><input type="text" id="isbn" name="isbn" size="50" maxlength="80" /></li>
<li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
+ <li><label for="seriestitle">Series Title :</label></label><input type="text" id="seriestitle" name="seriestitle" size="50" maxlength="80" /></li>
<li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li>
+ <li><label for="itemtype">Document Type :</label><select name="itemtype" >
+ <!--TMPL_LOOP Name="itemtypeloop"--><option value="<!--TMPL_VAR Name="code" -->"><!-- TMPL_IF name="imageurl"--><img border="0" src="<!--TMPL_VAR Name="imageurl" -->" alt="<!--TMPL_VAR Name="description" -->" /><!-- /TMPL_IF --><!--TMPL_VAR Name="description" --></option>
+ <!--/TMPL_LOOP-->
+ </select></li>
</ol></fieldset>
<fieldset class="action"><input type="hidden" name="op" value="add_confirm" /><input type="submit" value="Submit Your Suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a></fieldset>
</form>
@@ -116,7 +122,7 @@ $.tablesorter.addParser({
<tbody><!-- TMPL_LOOP NAME="suggestions_loop" -->
<!-- TMPL_IF name="even" --><tr><!-- TMPL_ELSE --><tr class="highlight"><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="loggedinusername" --><td>
- <input type="checkbox" name="delete_field" value="<!--TMPL_VAR name="suggestionid" -->" />
+ <input type="checkbox" name="delete_field" value="<!--TMPL_VAR name="ordernumber" -->" />
</td><!-- /TMPL_IF -->
<td>
<p><strong><!-- TMPL_VAR NAME="title" escape="html" --></strong></p>
@@ -136,6 +142,7 @@ $.tablesorter.addParser({
</td>
<td>
<!-- TMPL_IF name="ASKED" -->Requested<!-- /TMPL_IF -->
+ <!-- TMPL_IF name="CHECKED" -->Checked by the library<!-- /TMPL_IF -->
<!-- TMPL_IF name="ACCEPTED" -->Accepted by the library<!-- /TMPL_IF -->
<!-- TMPL_IF name="ORDERED" -->Ordered by the library<!-- /TMPL_IF -->
<!-- TMPL_IF name="REJECTED" -->Suggestion declined <!-- /TMPL_IF -->
diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl
index 12aefb1..6df6593 100755
--- a/opac/opac-suggestions.pl
+++ b/opac/opac-suggestions.pl
@@ -23,6 +23,8 @@ use C4::Auth; # get_template_and_user
use C4::Branch;
use C4::Output;
use C4::Suggestions;
+use C4::Koha;
+use C4::Dates;
my $input = new CGI;
my $title = $input->param('title');
@@ -66,23 +68,18 @@ else {
}
);
}
+$suggestion{'suggestedby'}=$borrowernumber;
if ( $op eq "add_confirm" ) {
- &NewSuggestion(
- $borrowernumber, $title, $author, $publishercode,
- $note, $copyrightdate, $volumedesc, $publicationyear,
- $place, $isbn, ''
- );
+ ## Adding some informations related to suggestion
+ if (my $userenv=C4::Context->userenv){
+ $suggestion{'branchcode'}=$userenv->{'branch'};
+ }
+ $suggestion{'suggestioncreatedon'}=C4::Dates->today;
+ &NewSuggestion(%suggestion);
# empty fields, to avoid filter in "SearchSuggestion"
- $title = '';
- $author = '';
- $publishercode = '';
- $copyrightdate = '';
- $volumedesc = '';
- $publicationyear = '';
- $place = '';
- $isbn = '';
+ map{$suggestion{$_}=''} keys %suggestion;
$op = 'else';
}
@@ -93,20 +90,17 @@ if ( $op eq "delete_confirm" ) {
}
$op = 'else';
}
-
my $suggestions_loop =
&SearchSuggestion( $borrowernumber, $author, $title, $publishercode, $status,
$suggestedbyme );
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
$template->param(
suggestions_loop => $suggestions_loop,
- title => $title,
- author => $author,
- publishercode => $publishercode,
- status => $status,
+ %suggestion,
suggestedbyme => $suggestedbyme,
"op_$op" => 1,
- suggestionsview => 1
+ suggestionsview => 1
);
+
output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/suggestion/acceptorreject.pl b/suggestion/acceptorreject.pl
index 12e2f13..d4615a1 100755
--- a/suggestion/acceptorreject.pl
+++ b/suggestion/acceptorreject.pl
@@ -186,3 +186,24 @@ $template->param(
);
output_html_with_http_headers $input, $cookie, $template->output;
+my @allsuggestions;
+foreach my $status ('ASKED','CHECKED','REJECTED','ACCEPTED'){
+ my $suggestions = &GetSuggestionByStatus( $status, $branchcode );
+ map{
+ $_->{$status}=1 unless ($status eq 'ASKED' ||$status eq 'PENDING');
+ $_->{'reasonsloop'}=$reasonsloop;
+ $_->{'suggestioncreatedon'}=format_date($_->{'suggestioncreatedon'})
+ } @$suggestions;
+
+ push @allsuggestions,{"suggestiontype"=>($status eq 'ASKED'?"pending":lc $status),
+ 'suggestions_loop'=>$suggestions,
+ 'reasonsloop' => $reasonsloop};
+}
+>>>>>>> suggestions changes (probably useless):suggestion/acceptorreject.pl
+$template->param(
+ suggestions => \@allsuggestions,
+ "op_$op" => 1,
+ dateformat => C4::Context->preference("dateformat"),
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/suggestion/acceptorrejectpd.pl b/suggestion/acceptorrejectpd.pl
new file mode 100755
index 0000000..5cdf8ca
--- /dev/null
+++ b/suggestion/acceptorrejectpd.pl
@@ -0,0 +1,267 @@
+#!/usr/bin/perl
+
+# Copyright 2008 BibLibre, Olivier SAURY
+# SAN Ouest Provence
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+
+=head1 NAME
+
+acceptorreject.pl
+
+=head1 DESCRIPTION
+
+this script modify the status of a subscription to ACCEPTED or to REJECTED
+
+=head1 PARAMETERS
+
+=over 4
+
+=item op
+
+op can be :
+ * aorr_confirm : to confirm accept or reject
+ * accepted : to display only accepted.
+ * rejected : to display only rejected.
+
+=back
+
+
+=cut
+
+## modules
+###################################################################################
+
+use strict;
+require Exporter;
+use CGI;
+
+use C4::Auth; # get_template_and_user
+use C4::Output;
+use C4::Suggestions;
+use C4::Koha; # GetAuthorisedValue
+use C4::Dates qw/format_date format_date_in_iso/;
+
+
+## variables
+###################################################################################
+
+## input variables
+my $input = new CGI;
+my $bookfundgroupnumber = $input->param('bookfundgroupnumber');
+my $op = $input->param('op') || "aorr_confirm";
+
+## other variables
+my $bookfundgroupname;
+my @suggestions_loop;
+
+my $dbh = C4::Context->dbh;
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "suggestion/acceptorrejectpd.tmpl",
+ type => "intranet",
+ query => $input,
+ authnotrequired => 1,
+ flagsrequired => { catalogue => 1 },
+ }
+);
+
+my $suggestion_loop0;
+
+
+###################################################################################
+###################################################################################
+## modify suggestions'status. Choose a list of suggestions
+###################################################################################
+###################################################################################
+
+
+if ( $op eq "aorr_confirm" ) {
+
+## modify suggestions'status
+###################################################################################
+
+ my @suggestionlist = $input->param("aorr");
+
+ foreach my $suggestion (@suggestionlist) {
+ if ( $suggestion =~ /(A|R)(.*)/ ) {
+
+ my ( $newstatus, $ordernumber ) = ( $1, $2 );
+ $newstatus = "REJECTED" if $newstatus eq "R";
+ $newstatus = "ACCEPTED" if $newstatus eq "A";
+ my $reason = $input->param( "reason" . $ordernumber );
+ if ( $reason eq "other" ) {
+ $reason = $input->param( "other-reason" . $ordernumber );
+ }
+
+ my $bookfundnumber = $input->param( "bookfunds_loop".$ordernumber);
+ my $step = $input->param( "step".$ordernumber);
+
+ ModStatus(
+ $ordernumber,
+ $newstatus,
+ $reason,
+ $bookfundgroupnumber,
+ $bookfundnumber,
+ $loggedinuser,
+ $step,
+ '',
+ $input,
+ );
+ }
+ }
+ $op = "else";
+ $suggestion_loop0 = &SearchSuggestion("", "", "", "", 'ASKED', "","",2,$bookfundgroupnumber);
+}
+
+
+if ( $op eq "accepted" ) {
+
+## accepted suggestions
+###################################################################################
+
+ $suggestion_loop0 = &GetSuggestionByStatus('ACCEPTED',3,$bookfundgroupnumber);
+ $template->param(done => 1);
+}
+
+
+if ( $op eq "rejected" ) {
+
+## rejected suggestions
+###################################################################################
+
+ $suggestion_loop0 = &GetSuggestionByStatus('REJECTED',3,$bookfundgroupnumber);
+ $template->param(done => 1);
+}
+
+
+## book fund group name
+#########################################################################################
+my $dbh = C4::Context->dbh;
+my $sth = $dbh->prepare("
+SELECT bookfundgroupname
+FROM aq2bookfundgroups
+WHERE bookfundgroupnumber=?
+");
+$sth->execute($bookfundgroupnumber);
+my $data = $sth->fetchrow_hashref;
+$bookfundgroupname = $data->{'bookfundgroupname'};
+$sth->finish;
+
+
+
+foreach my $suggestion (@$suggestion_loop0) {
+
+###################################################################################
+###################################################################################
+## get more information about suggestions
+###################################################################################
+###################################################################################
+
+
+ ## reasonsloop
+ $suggestion->{'reasonsloop'} = GetAuthorisedValues("SUGGEST");
+
+ ## dates
+ $suggestion->{'suggestioncreatedon'} = format_date($suggestion->{'suggestioncreatedon'});
+ $suggestion->{'suggestionmanagedingpdon'} = format_date($suggestion->{'suggestionmanagedingpdon'});
+ $suggestion->{'suggestionmanagedinpdon'} =
+ format_date($suggestion->{'suggestionmanagedinpdon'});
+
+
+ ## bookfunds_loop
+ ###############################################################################
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT bookfundnumber, bookfundname
+ FROM aq2bookfunds
+ WHERE bookfundgroupnumber=?
+ ORDER BY bookfundname
+ ");
+ $sth->execute($bookfundgroupnumber);
+
+ my @bookfunds_loop;
+
+ while (my $data = $sth->fetchrow_hashref) {
+
+ ## book fund number of the suggestion
+ $data->{selected}=($data->{'bookfundnumber'} eq $suggestion->{'bookfundnumber'})? 1:0;
+
+ ## book fund name of the suggestion
+ if ($data->{'bookfundnumber'} eq $suggestion->{'bookfundnumber'}) {
+ $suggestion->{'bookfundname'} = $data->{'bookfundname'};
+ }
+
+ push( @bookfunds_loop, $data);
+ }
+ $sth->finish;
+
+ $suggestion->{'bookfunds_loop'} = \@bookfunds_loop;
+
+
+ ## name of the person who managed the suggestion in the General Purchase Department
+ ###################################################################################
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamemanagedingpdby,
+ surname AS surnamemanagedingpdby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestionmanagedingpdby'});
+ my $namemanagedingpdby = $sth->fetchrow_hashref;
+ $sth->finish;
+ $suggestion->{'firstnamemanagedingpdby'} = $namemanagedingpdby->{'firstnamemanagedingpdby'};
+ $suggestion->{'surnamemanagedingpdby'} = $namemanagedingpdby->{'surnamemanagedingpdby'};
+
+
+ ## name of the person who managed the suggestion in a Purchase Department
+ ###################################################################################
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamemanagedinpdby,
+ surname AS surnamemanagedinpdby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestionmanagedinpdby'});
+ my $namemanagedinpdby = $sth->fetchrow_hashref;
+ $sth->finish;
+ $suggestion->{'firstnamemanagedinpdby'} = $namemanagedinpdby->{'firstnamemanagedinpdby'};
+ $suggestion->{'surnamemanagedinpdby'} = $namemanagedinpdby->{'surnamemanagedinpdby'};
+
+
+ ## insert the suggestion into the table of suggestions
+ ################################################################################
+ push @suggestions_loop, $suggestion ;
+
+
+###################################################################################
+## $template
+###################################################################################
+}
+
+$template->param(
+ suggestions_loop => \@suggestions_loop,
+ bookfundgroupnumber => $bookfundgroupnumber,
+ bookfundgroupname => $bookfundgroupname,
+ "op_$op" => 1,
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;
\ No newline at end of file
diff --git a/suggestion/suggestiondetails.pl b/suggestion/suggestiondetails.pl
new file mode 100755
index 0000000..777f189
--- /dev/null
+++ b/suggestion/suggestiondetails.pl
@@ -0,0 +1,451 @@
+#!/usr/bin/perl
+
+# Copyright 2008 BibLibre, Olivier SAURY
+# SAN Ouest Provence
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+
+## modules
+###################################################################################
+
+use strict;
+require Exporter;
+use CGI;
+
+use List::Util qw/min/;
+use C4::Context;
+use C4::Auth; # get_template_and_user
+use C4::Output;
+use C4::Suggestions;
+use C4::Koha; # GetAuthorisedValue
+use C4::Dates qw/format_date format_date_in_iso/;
+use C4::Branch; # GetBranches
+
+## input variables
+###############################################################################
+
+my $input = new CGI;
+
+my $ordernumber = $input->param('ordernumber');
+
+my $op = $input->param('op');
+
+
+## other variables
+###############################################################################
+
+my $dbh = C4::Context->dbh;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name =>
+ "/suggestion/suggestiondetails.tmpl",
+ type => "intranet",
+ query => $input,
+ authnotrequired => 0,
+ flagsrequired => { catalogue => 1 },
+ }
+);
+
+
+
+if ($op eq "add_confirm") {
+
+################################################################################################
+################################################################################################
+## modify a suggestion
+################################################################################################
+################################################################################################
+
+ ## 'bookfundgroupnumber', 'bookfundnumber', 'audiencenumber'
+ my $bookfundgroup_loop = $input->param('bookfundgroup_loop');
+ my $bookfund_loop = $input->param('bookfund_loop');
+ my $audience_loop = $input->param('audience_loop');
+
+ $bookfundgroup_loop = ($bookfundgroup_loop eq "")? undef : $bookfundgroup_loop;
+ $bookfund_loop = ($bookfund_loop eq "")? undef : $bookfund_loop;
+ $audience_loop = ($audience_loop eq "")? undef : $audience_loop;
+
+
+ ## modify the suggestion
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare('
+ UPDATE aq2orders
+ SET title = ?
+ , author = ?
+ , copyrightdate = ?
+ , isbn = ?
+ , publishercode = ?
+ , seriestitle = ?
+ , note = ?
+ , itemtype = ?
+ , rrp = ?
+ , bookfundgroupnumber = ?
+ , bookfundnumber = ?
+ , audiencenumber = ?
+ , branchcode = ?
+ WHERE ordernumber = ?
+ ');
+
+
+ $sth->execute(
+ $input->param('title')?$input->param('title'):"",
+ $input->param('author')?$input->param('author'):"",
+ $input->param('copyrightdate')?$input->param('copyrightdate'):"",
+ $input->param('isbn')?$input->param('isbn'):"",
+ $input->param('publishercode')?$input->param('publishercode'):"",
+ $input->param('seriestitle')?$input->param('seriestitle'):"",
+ $input->param('note')?$input->param('note'):"",
+ $input->param('itemtype')?$input->param('itemtype'):"",
+ $input->param('rrp')?$input->param('rrp'):undef,
+ $bookfundgroup_loop,
+ $bookfundgroup_loop ? $bookfund_loop: undef,
+ $bookfundgroup_loop ? $audience_loop : undef,
+ $input->param('branch_loop')?$input->param('branch_loop'):"",
+ $input->param('ordernumber'),
+ );
+ $sth->finish;
+
+
+ if ($input->param("aorr")) {
+
+ ModStatus(
+ $input->param('ordernumber'),
+ $input->param("aorr"),
+ $input->param('reason'),
+ $bookfundgroup_loop,
+ '',
+ $loggedinuser,
+ 1, ##$step
+ '',
+ $input,
+ );
+ }
+
+
+ print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=acceptorreject.pl\"></html>";
+ exit;
+
+}
+
+else {
+
+################################################################################################
+################################################################################################
+## display the suggestion details
+################################################################################################
+################################################################################################
+
+ my @bookfund_loop;
+ my @audience_loop;
+ my $chooseabookfund=0;
+ my $chooseanaudience=0;
+ my $bookfundgroupname;
+ my $bookfundname;
+ my $audiencename;
+ my $itemtypedescription;
+ my @suggestion_loop1;
+
+ ###################################################################################
+ ## get the suggestion (from 'aq2orders')
+ ###################################################################################
+ my $suggestion;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT *
+ FROM aq2orders
+ WHERE ordernumber=?
+ ");
+
+ $sth->execute($ordernumber);
+ my $suggestion = $sth->fetchrow_hashref;
+ my $bookfundgroupnumber=$suggestion->{'bookfundgroupnumber'};
+ my $bookfundnumber=$suggestion->{'bookfundnumber'};
+ my $branchcode=$suggestion->{'branchcode'};
+ my $itemtype=$suggestion->{'itemtype'};
+ my $audiencenumber=$suggestion->{'audiencenumber'};
+ my $step=$suggestion->{'step'};
+ $sth->finish;
+
+
+ ###################################################################################
+ ## get data from other tables
+ ###################################################################################
+
+ ## get data about book fund groups
+ ###################################################################################
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT bookfundgroupnumber, bookfundgroupname
+ FROM aq2bookfundgroups
+ ORDER BY bookfundgroupname
+ ");
+ $sth->execute();
+
+ my @bookfundgroup_loop;
+
+ while (my $data = $sth->fetchrow_hashref) {
+ if ($data->{'bookfundgroupnumber'} eq $bookfundgroupnumber) {
+ $data->{selected}=1;
+ $bookfundgroupname=$data->{'bookfundgroupname'};
+ }
+ else {$data->{selected}=0;}
+ push(@bookfundgroup_loop, $data);
+ }
+ $sth->finish;
+
+ if ($bookfundgroupnumber) {$chooseabookfund=1;$chooseanaudience=1;}
+
+ ## get data about book funds
+ ###################################################################################
+
+ if ($bookfundgroupnumber) {
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT bookfundnumber, bookfundname
+ FROM aq2bookfunds
+ WHERE bookfundgroupnumber=?
+ ORDER BY bookfundname
+ ");
+
+ $sth->execute($bookfundgroupnumber);
+
+ while (my $data = $sth->fetchrow_hashref) {
+
+ if ($data->{'bookfundnumber'} eq $bookfundnumber) {
+ $data->{selected}=1;
+ $bookfundname=$data->{'bookfundname'};
+ }
+ else {
+ $data->{selected}=0;
+ }
+
+ push(@bookfund_loop, $data);
+ }
+ $sth->finish;
+ }
+
+
+ ## get data about audiences
+ ###################################################################################
+
+ if ($bookfundgroupnumber) {
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT audiencenumber, audiencename
+ FROM aq2audiences
+ WHERE bookfundgroupnumber=?
+ ORDER BY audiencename
+ ");
+
+ $sth->execute($bookfundgroupnumber);
+
+ ## get 'audiencenumber' value (in the table 'aq2orders')
+
+ while (my $data = $sth->fetchrow_hashref) {
+ if ($data->{'audiencenumber'} eq $audiencenumber) {
+ $data->{selected}=1;
+ $audiencename = $data->{'audiencename'};
+ }
+ else {$data->{selected}=0;}
+
+ push(@audience_loop, $data);
+ }
+ $sth->finish;
+ }
+
+
+ ## get branch names
+ ###################################################################################
+ my $branches = GetBranches;
+ my @branch_loop;
+ my $branchname;
+
+ foreach my $thisbranch (keys %$branches) {
+ my %row = (branchcode => $thisbranch,
+ branchname => $branches->{$thisbranch}->{'branchname'},
+ );
+ if ($thisbranch eq $branchcode) {
+ $row{"selected"}=1;
+ $branchname=$branches->{$thisbranch}->{'branchname'};
+ }
+ else {$row{"selected"}=0;}
+
+ push @branch_loop, \%row;
+ }
+
+
+ ## get item types
+ ###################################################################################
+ my $dbh = C4::Context->dbh;
+ my $sth=$dbh->prepare("
+ SELECT description,itemtype
+ FROM itemtypes
+ ORDER BY description");
+ $sth->execute();
+
+ my @itemtypeloop;
+
+ while ( my $data = $sth->fetchrow_hashref ) {
+ if ($data->{'itemtype'} eq $itemtype) {
+ $data->{selected}=1;
+ $itemtypedescription=$data->{'description'};
+ }
+ else { $data->{selected}=0;}
+ push( @itemtypeloop, $data);
+ }
+ $sth->finish;
+
+
+ ### get names
+ ###################################################################################
+
+ ## name of the person who 1st wrote the suggestion
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamesuggestedby,
+ surname AS surnamesuggestedby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestedby'});
+ my $namesuggestedby = $sth->fetchrow_hashref;
+ $sth->finish;
+
+ ## name of the person who managed the suggestion in the General Purchase Department
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamemanagedingpdby,
+ surname AS surnamemanagedingpdby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestionmanagedingpdby'});
+ my $namemanagedingpdby = $sth->fetchrow_hashref;
+ $sth->finish;
+
+
+ ## name of the person who managed the suggestion in a Purchase Department
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamemanagedinpdby,
+ surname AS surnamemanagedinpdby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestionmanagedinpdby'});
+ my $namemanagedinpdby = $sth->fetchrow_hashref;
+ $sth->finish;
+
+ if ($chooseabookfund) {
+ $template->param(chooseabookfund => $chooseabookfund,);
+ }
+
+ if ($chooseanaudience) {
+ $template->param(chooseanaudience => $chooseanaudience,);
+ }
+
+
+ ## list of reasons why a suggestion can be rejected
+ ###################################################################################
+ my $reasons_loop = GetAuthorisedValues("SUGGEST");
+
+
+################################################################################################
+################################################################################################
+### $template
+################################################################################################
+################################################################################################
+
+ $template->param(
+
+ ## ordernumber
+ ordernumber => $ordernumber,
+
+ ## other variables from 'aq2orders'
+ ########################################################################################
+
+ title => $suggestion->{'title'},
+ author => $suggestion->{'author'},
+ copyrightdate => $suggestion->{'copyrightdate'},
+ isbn => $suggestion->{'isbn'},
+ rrp => $suggestion->{'rrp'},
+ publishercode => $suggestion->{'publishercode'},
+ seriestitle => $suggestion->{'seriestitle'},
+ note => $suggestion->{'note'},
+ status => $suggestion->{'status'},
+ reason => $suggestion->{'reason'},
+
+ bookfundgroupnumber => $bookfundgroupnumber,
+
+ ## dates (metric format)
+ suggestioncreatedon => format_date($suggestion->{'suggestioncreatedon'}),
+ suggestionmanagedingpdon => format_date($suggestion->{'suggestionmanagedingpdon'}),
+ suggestionmanagedinpdon => format_date($suggestion->{'suggestionmanagedinpdon'}),
+
+ ## suggestion status
+ step2 => ($step==2)?1:0,
+ step3 => ($step==3)?1:0,
+ step2ormore => ($step>=2)?1:0,
+ accepted1 =>(($suggestion->{'status'} eq 'ACCEPTED') and $step==1)?1:0,
+ accepted2 =>(($suggestion->{'status'} eq 'ACCEPTED') and $step==2)?1:0,
+ rejected1 =>(($suggestion->{'status'} eq 'REJECTED') and $step==1)?1:0,
+ rejected2 => (($suggestion->{'status'} eq 'REJECTED') and $step==2)?1:0,
+
+
+ ## variables from other tables
+ ########################################################################################
+
+ ## "loop variables"
+ bookfundgroup_loop => \@bookfundgroup_loop,
+ bookfund_loop => \@bookfund_loop,
+ audience_loop => \@audience_loop,
+ branch_loop => \@branch_loop,
+ itemtypeloop => \@itemtypeloop,
+ reasons_loop => $reasons_loop,
+
+ ##
+ branchname => $branchname,
+ bookfundgroupname => $bookfundgroupname,
+ bookfundname => $bookfundname,
+ audiencename => $audiencename,
+ itemtypedescription => $itemtypedescription,
+
+ ## names (person who 1st write the suggestion, persons who managed the suggestion)
+ firstnamesuggestedby => $namesuggestedby->{'firstnamesuggestedby'},
+ surnamesuggestedby => $namesuggestedby->{'surnamesuggestedby'},
+
+ firstnamemanagedingpdby =>$namemanagedingpdby->{'firstnamemanagedingpdby'},
+ surnamemanagedingpdby =>$namemanagedingpdby->{'surnamemanagedingpdby'},
+
+ firstnamemanagedinpdby =>$namemanagedinpdby->{'firstnamemanagedinpdby'},
+ surnamemanagedinpdby =>$namemanagedinpdby->{'surnamemanagedinpdby'},
+
+
+ ## other variables
+ ########################################################################################
+
+ template => C4::Context->preference('template'),
+ );
+
+}
+
+
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/suggestion/suggestiondetailspd.pl b/suggestion/suggestiondetailspd.pl
new file mode 100755
index 0000000..ba1f03c
--- /dev/null
+++ b/suggestion/suggestiondetailspd.pl
@@ -0,0 +1,428 @@
+#!/usr/bin/perl
+
+# Copyright 2008 BibLibre, Olivier SAURY
+# SAN Ouest Provence
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+
+## modules
+###################################################################################
+
+use strict;
+require Exporter;
+use CGI;
+
+use List::Util qw/min/;
+use C4::Context;
+use C4::Auth; # get_template_and_user
+use C4::Output;
+use C4::Suggestions;
+use C4::Koha; # GetAuthorisedValue
+use C4::Dates qw/format_date format_date_in_iso/;
+use C4::Branch; # GetBranches
+
+## variables
+###############################################################################
+
+my $input = new CGI;
+
+my $ordernumber = $input->param('ordernumber');
+my $bookfundgroupname = $input->param('bookfundgroupname');
+
+my $op = $input->param('op');
+
+my $bookfundgroupnumber = $input->param('bookfundgroupnumber');
+
+
+my $dbh = C4::Context->dbh;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name =>
+ "/suggestion/suggestiondetailspd.tmpl",
+ type => "intranet",
+ query => $input,
+ authnotrequired => 0,
+ flagsrequired => { catalogue => 1 },
+ }
+);
+
+
+
+if ($op eq "add_confirm") {
+
+################################################################################################
+################################################################################################
+## modify a suggestion
+################################################################################################
+################################################################################################
+
+ ## 'bookfundgroupnumber', 'bookfundnumber', 'audiencenumber'
+ my $bookfund_loop = ($input->param('bookfund_loop') eq "")?undef:$input->param('bookfund_loop');
+ my $audience_loop = ($input->param('audience_loop') eq "")?undef:$input->param('audience_loop');
+
+ ## modify the suggestion
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare('
+ UPDATE aq2orders
+ SET title = ?
+ , author = ?
+ , copyrightdate = ?
+ , isbn = ?
+ , publishercode = ?
+ , seriestitle = ?
+ , note = ?
+ , itemtype = ?
+ , rrp = ?
+ , bookfundgroupnumber = ?
+ , bookfundnumber = ?
+ , audiencenumber = ?
+ , branchcode = ?
+ WHERE ordernumber = ?
+ ');
+
+
+ $sth->execute(
+ $input->param('title')?$input->param('title'):"",
+ $input->param('author')?$input->param('author'):"",
+ $input->param('copyrightdate')?$input->param('copyrightdate'):"",
+ $input->param('isbn')?$input->param('isbn'):"",
+ $input->param('publishercode')?$input->param('publishercode'):"",
+ $input->param('seriestitle')?$input->param('seriestitle'):"",
+ $input->param('note')?$input->param('note'):"",
+ $input->param('itemtype')?$input->param('itemtype'):"",
+ $input->param('rrp')?$input->param('rrp'):undef,
+ $bookfundgroupnumber ? $bookfundgroupnumber : undef,
+ $bookfundgroupnumber ? $bookfund_loop: undef,
+ $bookfundgroupnumber ? $audience_loop : undef,
+ $input->param('branch_loop')?$input->param('branch_loop'):"",
+ $input->param('ordernumber'),
+ );
+ $sth->finish;
+
+
+ if ($input->param("aorr")) {
+
+ ModStatus(
+ $input->param('ordernumber'),
+ $input->param("aorr"),
+ $input->param('reason'),
+ $bookfundgroupnumber,
+ $bookfund_loop,
+ $loggedinuser,
+ 2, ##$step
+ '',
+ $input,
+ );
+ }
+
+
+
+ print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=acceptorrejectpd.pl?bookfundgroupnumber=".$bookfundgroupnumber."\"></html>";
+ exit;
+
+}
+else {
+
+################################################################################################
+################################################################################################
+## display the suggestion details
+################################################################################################
+################################################################################################
+ my @bookfund_loop;
+ my @audience_loop;
+ my $chooseabookfund=0;
+ my $chooseanaudience=0;
+ my $bookfundgroupname;
+ my $bookfundname;
+ my $audiencename;
+ my $itemtypedescription;
+
+ ###################################################################################
+ ## get the suggestion (from 'aq2orders')
+ ###################################################################################
+ my $suggestion;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT *
+ FROM aq2orders
+ WHERE ordernumber=?
+ ");
+
+ $sth->execute($ordernumber);
+ my $suggestion = $sth->fetchrow_hashref;
+ my $bookfundgroupnumber=$suggestion->{'bookfundgroupnumber'};
+ my $bookfundnumber=$suggestion->{'bookfundnumber'};
+ my $branchcode=$suggestion->{'branchcode'};
+ my $itemtype=$suggestion->{'itemtype'};
+ my $audiencenumber=$suggestion->{'audiencenumber'};
+ my $step=$suggestion->{'step'};
+ $sth->finish;
+
+
+ ###################################################################################
+ ## get data from other tables
+ ###################################################################################
+
+ ## get data about book fund groups
+ ###################################################################################
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT bookfundgroupname
+ FROM aq2bookfundgroups
+ WHERE bookfundgroupnumber=?
+ ");
+
+ $sth->execute($bookfundgroupnumber);
+
+ $bookfundgroupname = $sth->fetchrow_hashref->{'bookfundgroupname'};
+ $sth->finish;
+
+
+ ## get data about book funds
+ ###################################################################################
+
+ if ($bookfundgroupnumber) {
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT bookfundnumber, bookfundname
+ FROM aq2bookfunds
+ WHERE bookfundgroupnumber=?
+ ORDER BY bookfundname
+ ");
+
+ $sth->execute($bookfundgroupnumber);
+
+ while (my $data = $sth->fetchrow_hashref) {
+
+ if ($data->{'bookfundnumber'} eq $bookfundnumber) {
+ $data->{selected}=1;
+ $bookfundname=$data->{'bookfundname'};
+ }
+ else {
+ $data->{selected}=0;
+ }
+
+ push(@bookfund_loop, $data);
+ }
+ $sth->finish;
+ }
+
+
+ ## get data about audiences
+ ###################################################################################
+
+ if ($bookfundgroupnumber) {
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT audiencenumber, audiencename
+ FROM aq2audiences
+ WHERE bookfundgroupnumber=?
+ ORDER BY audiencename
+ ");
+
+ $sth->execute($bookfundgroupnumber);
+
+ ## get 'audiencenumber' value (in the table 'aq2orders')
+
+ while (my $data = $sth->fetchrow_hashref) {
+ if ($data->{'audiencenumber'} eq $audiencenumber) {
+ $data->{selected}=1;
+ $audiencename = $data->{'audiencename'};
+ }
+ else {$data->{selected}=0;}
+
+ push(@audience_loop, $data);
+ }
+ $sth->finish;
+ }
+
+
+ ## get branch names
+ ###################################################################################
+ my $branches = GetBranches;
+ my @branch_loop;
+ my $branchname;
+
+ foreach my $thisbranch (keys %$branches) {
+ my %row = (branchcode => $thisbranch,
+ branchname => $branches->{$thisbranch}->{'branchname'},
+ );
+ if ($thisbranch eq $branchcode) {
+ $row{"selected"}=1;
+ $branchname=$branches->{$thisbranch}->{'branchname'};
+ }
+ else {$row{"selected"}=0;}
+
+ push @branch_loop, \%row;
+ }
+
+
+ ## get item types
+ ###################################################################################
+ my $dbh = C4::Context->dbh;
+ my $sth=$dbh->prepare("
+ SELECT description,itemtype
+ FROM itemtypes
+ ORDER BY description");
+ $sth->execute();
+
+ my @itemtypeloop;
+
+ while ( my $data = $sth->fetchrow_hashref ) {
+ if ($data->{'itemtype'} eq $itemtype) {
+ $data->{selected}=1;
+ $itemtypedescription=$data->{'description'};
+ }
+ else { $data->{selected}=0;}
+ push( @itemtypeloop, $data);
+ }
+ $sth->finish;
+
+
+ ### get names
+ ###################################################################################
+
+ ## name of the person who 1st wrote the suggestion
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamesuggestedby,
+ surname AS surnamesuggestedby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestedby'});
+ my $namesuggestedby = $sth->fetchrow_hashref;
+ $sth->finish;
+
+ ## name of the person who managed the suggestion in the General Purchase Department
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamemanagedingpdby,
+ surname AS surnamemanagedingpdby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestionmanagedingpdby'});
+ my $namemanagedingpdby = $sth->fetchrow_hashref;
+ $sth->finish;
+
+
+ ## name of the person who managed the suggestion in a Purchase Department
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("
+ SELECT firstname AS firstnamemanagedinpdby,
+ surname AS surnamemanagedinpdby
+ FROM borrowers
+ WHERE borrowernumber=?
+ ");
+ $sth->execute($suggestion->{'suggestionmanagedinpdby'});
+ my $namemanagedinpdby = $sth->fetchrow_hashref;
+ $sth->finish;
+
+ if ($chooseabookfund) {
+ $template->param(chooseabookfund => $chooseabookfund,);
+ warn "valeur de chooseabookfund = $chooseabookfund";
+ }
+
+ if ($chooseanaudience) {
+ $template->param(chooseanaudience => $chooseanaudience,);
+ warn "valeur de chooseanaudience = $chooseanaudience";
+ }
+
+
+ ## list of reasons why a suggestion can be rejected
+ ###################################################################################
+
+ my $reasons_loop = GetAuthorisedValues("SUGGEST");
+
+
+################################################################################################
+################################################################################################
+### $template
+################################################################################################
+################################################################################################
+
+ $template->param(
+
+ ##argument en entrée du script
+
+ ordernumber => $ordernumber,
+
+ ## other variables from 'aq2orders'
+ ########################################################################################
+
+ title => $suggestion->{'title'},
+ author => $suggestion->{'author'},
+ copyrightdate => $suggestion->{'copyrightdate'},
+ isbn => $suggestion->{'isbn'},
+ rrp => $suggestion->{'rrp'},
+ publishercode => $suggestion->{'publishercode'},
+ seriestitle => $suggestion->{'seriestitle'},
+ note => $suggestion->{'note'},
+ reason => $suggestion->{'reason'},
+ reasons_loop => $reasons_loop,
+ bookfundgroupnumber => $bookfundgroupnumber,
+ bookfundgroup_loop => $bookfundgroupnumber,
+
+ ## dates 'metric format'
+ suggestioncreatedon => format_date($suggestion->{'suggestioncreatedon'}),
+ suggestionmanagedingpdon => format_date($suggestion->{'suggestionmanagedingpdon'}),
+ suggestionmanagedinpdon => format_date($suggestion->{'suggestionmanagedinpdon'}),
+
+ ## suggestions'status
+ status => $suggestion->{'status'},
+ step2 => ($step==2)?1:0,
+ step3 => ($step==3)?1:0,
+ step3ormore => ($step>=3)?1:0,
+ rejected3 => (($suggestion->{'status'} eq "REJECTED") and ($step==3))?1:0,
+
+
+ ## variables from other tables
+ ########################################################################################
+
+ ## loop variables
+ bookfund_loop => \@bookfund_loop,
+ audience_loop => \@audience_loop,
+ branch_loop => \@branch_loop,
+ itemtypeloop => \@itemtypeloop,
+
+ ## names (person who 1st write the suggestion, persons who managed the suggestion)
+ firstnamesuggestedby => $namesuggestedby->{'firstnamesuggestedby'},
+ surnamesuggestedby => $namesuggestedby->{'surnamesuggestedby'},
+
+ firstnamemanagedingpdby =>$namemanagedingpdby->{'firstnamemanagedingpdby'},
+ surnamemanagedingpdby =>$namemanagedingpdby->{'surnamemanagedingpdby'},
+
+ firstnamemanagedinpdby =>$namemanagedinpdby->{'firstnamemanagedinpdby'},
+ surnamemanagedinpdby =>$namemanagedinpdby->{'surnamemanagedinpdby'},
+
+ ## other variables
+ branchname => $branchname,
+ bookfundgroupname => $bookfundgroupname,
+ bookfundname => $bookfundname,
+ audiencename => $audiencename,
+ itemtypedescription => $itemtypedescription,
+
+ template => C4::Context->preference('template'),
+ );
+
+}
+
+
+output_html_with_http_headers $input, $cookie, $template->output;
--
1.6.0.4
More information about the Koha-patches
mailing list