koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha koha-tmpl/intranet-tmpl/prog/en/suggestion... [rel_3_0]


From: Antoine Farnault
Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/prog/en/suggestion... [rel_3_0]
Date: Tue, 14 Nov 2006 14:43:41 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Antoine Farnault <toins>        06/11/14 14:43:41

Modified files:
        koha-tmpl/intranet-tmpl/prog/en/suggestion: acceptorreject.tmpl 
        suggestion     : acceptorreject.pl 

Log message:
        new feature:
                it's now possible to add a comment when accepting or not a 
suggestion.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/suggestion/acceptorreject.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/suggestion/acceptorreject.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4&r2=1.4.2.1

Patches:
Index: koha-tmpl/intranet-tmpl/prog/en/suggestion/acceptorreject.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/suggestion/acceptorreject.tmpl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- koha-tmpl/intranet-tmpl/prog/en/suggestion/acceptorreject.tmpl      2 Oct 
2006 15:13:45 -0000       1.1.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/suggestion/acceptorreject.tmpl      14 Nov 
2006 14:43:41 -0000      1.1.2.2
@@ -2,13 +2,15 @@
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!--TMPL_INCLUDE NAME="menus.inc" -->
 <!-- TMPL_INCLUDE NAME="menu-acqui.inc" -->
+
 <!-- TMPL_IF name="op_else" -->
        <h1>Suggestions Management</h1>
-       <form method="post" action="/cgi-bin/koha/suggestion/acceptorreject.pl">
+    <form name="f" method="post" 
action="/cgi-bin/koha/suggestion/acceptorreject.pl">
        <input type="hidden" name="op" value="aorr_confirm">
        <table>
                <tr>
                        <th>Status</th>
+            <th>Reason</th>
                        <th>Suggestion</th>
                        <th>Suggested by</th>
                </tr>
@@ -16,16 +18,35 @@
                        <tr<!-- TMPL_IF name="even" --> class="highlight"<!-- 
/TMPL_IF -->>
                                <td>
                                        <select name="aorr">
-                                               <option value=""> -- Choose 
Action --</option>
+                        <option value=""> -- Choose Action -- </option>
                                                <option value="R<!--TMPL_VAR 
name="suggestionid" -->">Reject</option>
                                                <option value="A<!--TMPL_VAR 
name="suggestionid" -->">Accept</option>
                                        </select>
                                </td>
-                               <td><!-- TMPL_VAR NAME="title" --><!-- TMPL_IF 
NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><br>
+                <td>
+
+                           <span id="span-select-reason<!-- TMPL_VAR 
NAME="suggestionid" -->" class="content_visible">
+                        <select name="reason<!-- TMPL_VAR name="suggestionid" 
-->" onchange="displayOther('<!-- TMPL_VAR NAME="suggestionid" -->');">
+                                       <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_UNLESS NAME="reasonsloop"-->
+                        <span class="problem">No reasons defined on</span> <a 
href="/cgi-bin/koha/admin/authorised_value.pl">authorised value</a>.
+                    <!-- /TMPL_UNLESS -->
+                   </span>
+                   <span id="span-other-reason<!-- TMPL_VAR 
NAME="suggestionid" -->" class="content_hidden">
+                       <input type="text" name="other-reason<!-- TMPL_VAR 
name="suggestionid" -->" value="write your reason here..." 
onclick="if(this.value === 'write your reason here...'){this.value=''}" />
+                       <small><a href="JavaScript:displayOther('<!-- TMPL_VAR 
NAME="suggestionid" -->');">back to list</a></small>
+                   </span>
+                </td>
+                <td>
+               <!-- TMPL_VAR NAME="title" --><!-- TMPL_IF NAME="author" -->, 
by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><br>
                                        <!-- TMPL_IF name="copyrightdate" 
-->&copy <!-- 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> <!-- /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="note" --><!-- TMPL VAR NAME="note" --><!-- /TMPL_IF -->
-
                                </td>
                                <td>
                                        <!-- TMPL_VAR name="surnamesuggestedby" 
--><!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF --> <!-- TMPL_VAR 
name="firstnamesuggestedby" -->
@@ -35,7 +56,45 @@
                </table>
                <input type="submit" value="Change Status">
 </form>
-       
 <!-- /TMPL_IF -->
 
+<script type="text/JavaScript" language="JavaScript">
+ // <![CDATA[
+    /**
+     *  check(form);
+     *  This function check the form before submit it.
+     */
+     /*
+     function check(form){
+        return true;
+     }
+     */
+       /**
+        *  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>
+
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

Index: suggestion/acceptorreject.pl
===================================================================
RCS file: /sources/koha/koha/suggestion/acceptorreject.pl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- suggestion/acceptorreject.pl        12 Jul 2006 17:03:49 -0000      1.4
+++ suggestion/acceptorreject.pl        14 Nov 2006 14:43:41 -0000      1.4.2.1
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: acceptorreject.pl,v 1.4 2006/07/12 17:03:49 toins Exp $
+# $Id: acceptorreject.pl,v 1.4.2.1 2006/11/14 14:43:41 toins Exp $
 
 =head1 NAME
 
@@ -54,6 +54,7 @@
 =item suggestedbyme
 
 =item op
+
 op can be :
  * aorr_confirm : to confirm accept or reject
  * delete_confirm : to confirm the deletion
@@ -71,6 +72,7 @@
 use C4::Auth;       # get_template_and_user
 use C4::Interface::CGI::Output;
 use C4::Suggestions;
+use C4::Koha; # GetAuthorisedValue
 
 my $input = new CGI;
 my $title = $input->param('title');
@@ -97,12 +99,17 @@
                         });
 if ($op eq "aorr_confirm") {
        my @suggestionlist = $input->param("aorr");
+
        foreach my $suggestion (@suggestionlist) {
                if ($suggestion =~ /(A|R)(.*)/) {
                        my ($newstatus,$suggestionid) = ($1,$2);
                        $newstatus="REJECTED" if $newstatus eq "R";
                        $newstatus="ACCEPTED" if $newstatus eq "A";
-                       ModStatus($suggestionid,$newstatus,$loggedinuser);
+                       my $reason = $input->param("reason".$suggestionid);
+                       if($reason eq "other"){
+                           $reason = 
$input->param("other-reason".$suggestionid);
+                       }
+                       
ModStatus($suggestionid,$newstatus,$loggedinuser,'',$reason);
                }
        }
        $op="else";
@@ -116,11 +123,23 @@
        $op='else';
 }
 
-my $suggestions_loop= &SearchSuggestion("","","","",'ASKED',"");
-$template->param(suggestions_loop => $suggestions_loop,
+my $suggestions= &SearchSuggestion("","","","",'ASKED',"");
+my $reasonsloop = GetAuthorisedValues("SUGGEST");
+
+
+my @suggestions_loop;
+
+foreach my $suggestion (@$suggestions){
+    $suggestion->{'reasonsloop'}= $reasonsloop;
+    push @suggestions_loop, $suggestion;
+}
+
+$template->param(
+        suggestions_loop => address@hidden,
                "op_$op" => 1,
                intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
                intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
                IntranetNav => C4::Context->preference("IntranetNav"),
 );
+
 output_html_with_http_headers $input, $cookie, $template->output;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]