koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha koha-tmpl/opac-tmpl/npl/en/includes/userme... [dev_week]


From: Kyle Hall
Subject: [Koha-cvs] koha koha-tmpl/opac-tmpl/npl/en/includes/userme... [dev_week]
Date: Tue, 24 Apr 2007 18:04:34 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Kyle Hall <kylemhall>   07/04/24 18:04:34

Modified files:
        koha-tmpl/opac-tmpl/npl/en/includes: usermenu.inc 
Added files:
        koha-tmpl/opac-tmpl/npl/en: opac-clubsAndServices-enroll.tmpl 
                                    opac-clubsAndServices.tmpl 
        opac           : opac-clubsAndServices-enroll.pl 
                         opac-clubsAndServices.pl 

Log message:
        Added Clubs & Services stuff for OPAC interface

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices-enroll.tmpl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices.tmpl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/includes/usermenu.inc?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.3&r2=1.1.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-clubsAndServices-enroll.pl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-clubsAndServices.pl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1

Patches:
Index: koha-tmpl/opac-tmpl/npl/en/includes/usermenu.inc
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/opac-tmpl/npl/en/includes/Attic/usermenu.inc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- koha-tmpl/opac-tmpl/npl/en/includes/usermenu.inc    7 Oct 2006 18:56:01 
-0000       1.1.2.3
+++ koha-tmpl/opac-tmpl/npl/en/includes/usermenu.inc    24 Apr 2007 18:04:34 
-0000      1.1.2.4
@@ -1 +1,28 @@
-<div id="usermenu"><ul><li><a href="/cgi-bin/koha/opac-account.pl">your 
fines</a></li><li><a href="/cgi-bin/koha/opac-userdetails.pl">your personal 
details</a></li><!-- TMPL_IF name="OpacPasswordChange" --><li><a 
href="/cgi-bin/koha/opac-passwd.pl">change your password</a></li><!-- /TMPL_IF 
--><!-- TMPL_IF NAME="opacreadinghistory" --><li><a 
href="/cgi-bin/koha/opac-readingrecord.pl">your reading history</a></li><!-- 
/TMPL_IF --><!-- TMPL_IF name="suggestion" --><li><a 
href="/cgi-bin/koha/opac-suggestions.pl">purchase suggestions</a></li><!-- 
/TMPL_IF --></ul></div>
\ No newline at end of file
+<div id="usermenu">
+  <ul>
+    <li>
+      <a href="/cgi-bin/koha/opac-account.pl">your fines</a>
+    </li>
+    <li>
+      <a href="/cgi-bin/koha/opac-userdetails.pl">your personal details</a>
+    </li>
+    <li>
+      <a href="/cgi-bin/koha/opac-clubsAndServices.pl">your clubs & 
services</a>
+    </li>
+    <!-- TMPL_IF name="OpacPasswordChange" -->
+      <li>
+        <a href="/cgi-bin/koha/opac-passwd.pl">change your password</a>
+      </li>
+    <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="opacreadinghistory" -->
+      <li>
+        <a href="/cgi-bin/koha/opac-readingrecord.pl">your reading history</a>
+      </li>
+    <!-- /TMPL_IF -->
+    <!-- TMPL_IF name="suggestion" -->
+      <li>
+        <a href="/cgi-bin/koha/opac-suggestions.pl">purchase suggestions</a>
+      </li>
+    <!-- /TMPL_IF -->
+  </ul>
+</div>
\ No newline at end of file

Index: koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices-enroll.tmpl
===================================================================
RCS file: koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices-enroll.tmpl
diff -N koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices-enroll.tmpl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices-enroll.tmpl        24 Apr 
2007 18:04:34 -0000      1.1.2.1
@@ -0,0 +1,76 @@
+<!-- TMPL_INCLUDE name="doc-head-open.inc" --><!-- TMPL_VAR NAME="LibraryName" 
--> Catalog -- Account for <!-- TMPL_LOOP name="BORROWER_INFO" --><!-- TMPL_VAR 
name="firstname" --> <!-- TMPL_VAR name="surname" --><!-- /TMPL_LOOP -->
+<!-- TMPL_INCLUDE name="doc-head-close.inc" -->
+<body<!-- TMPL_IF NAME="OpacNav" --> id="withnav"<!-- /TMPL_IF -->>
+<!-- TMPL_INCLUDE name="masthead.inc" -->
+<!-- TMPL_INCLUDE name="usermenu.inc" -->
+
+<!--CONTENT-->
+
+<!-- TMPL_LOOP NAME="BORROWER_INFO" -->
+<div id="main_wrapper">
+<div id="main">
+<div class="content-block">
+
+<h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> 
<!-- TMPL_VAR NAME="surname" -->'s account</a> 
+    <img src="<!-- TMPL_VAR NAME="themelang" -->/images/caret.gif" width="16" 
height="16" alt="&gt;" border="0" /> 
+    <a href="opac-clubsAndServices.pl" >Clubs & Services </a>
+    <img src="<!-- TMPL_VAR NAME="themelang" -->/images/caret.gif" width="16" 
height="16" alt="&gt;" border="0" /> Enroll</h3>
+
+<!-- /TMPL_LOOP -->
+
+
+<!-- TMPL_IF NAME="previousActionEnroll" -->
+  <!-- TMPL_IF NAME="enrollSuccess" -->
+    <div>Enrolled Succesfully!</div>
+  <!-- TMPL_ELSE -->
+    <div>Failed to Enroll!</div>
+    <div>Reason: <strong><!-- TMPL_VAR NAME="failureMessage" --></strong></div>
+  <!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="caseData1Title" -->
+  <div>
+    <h4>Please Enter The Following Information</h4>
+    <form action="opac-clubsAndServices-enroll.pl" method="post">
+    <table>
+      <!-- TMPL_IF NAME="caseData1Title" -->
+        <tr>
+          <td><label for="data1"><!-- TMPL_VAR NAME="caseData1Title" -->: 
</label></td>
+          <td><input type="text" id="data1" name="data1" /></td>
+          <td><i><!-- TMPL_VAR NAME="caseData1Desc" --></i></td>
+        </tr>
+      <!-- /TMPL_IF -->
+  
+      <!-- TMPL_IF NAME="caseData2Title" -->
+        <tr>
+          <td><label for="data2"><!-- TMPL_VAR NAME="caseData2Title" -->: 
</label></td>
+          <td><input type="text" id="data2" name="data2" /></td>
+          <td><i><!-- TMPL_VAR NAME="caseData2Desc" --></i></td>
+        </tr>
+      <!-- /TMPL_IF -->
+  
+      <!-- TMPL_IF NAME="caseData3Title" -->
+        <tr>
+          <td><label for="data3"><!-- TMPL_VAR NAME="caseData3Title" -->: 
</label></td>
+          <td><input type="text" id="data3" name="data3" /></td>
+          <td><i><!-- TMPL_VAR NAME="caseData3Desc" --></i></td>
+        </tr>
+      <!-- /TMPL_IF -->
+  
+      <input type="hidden" id="casId" name="casId" value="<!-- TMPL_VAR 
NAME="casId" -->" />
+      <input type="hidden" id="casaId" name="casaId" value="<!-- TMPL_VAR 
NAME="casaId" -->" />
+      <input type="hidden" id="borrowernumber" name="borrowernumber" 
value="<!-- TMPL_VAR NAME="borrowernumber -->" />
+      <input type="hidden" name="action" value="enroll" />
+      <tr><td colspan="3"><input type="submit" value="Enroll" /></td></tr>
+    </table>
+    </form>
+  </div>
+<!-- /TMPL_IF -->
+
+
+
+</div>
+</div>
+</div>
+<!-- TMPL_INCLUDE name="navigation.inc" -->
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
\ No newline at end of file

Index: koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices.tmpl
===================================================================
RCS file: koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices.tmpl
diff -N koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices.tmpl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ koha-tmpl/opac-tmpl/npl/en/opac-clubsAndServices.tmpl       24 Apr 2007 
18:04:34 -0000      1.1.2.1
@@ -0,0 +1,86 @@
+<!-- TMPL_INCLUDE name="doc-head-open.inc" --><!-- TMPL_VAR NAME="LibraryName" 
--> Catalog -- Account for <!-- TMPL_LOOP name="BORROWER_INFO" --><!-- TMPL_VAR 
name="firstname" --> <!-- TMPL_VAR name="surname" --><!-- /TMPL_LOOP -->
+<!-- TMPL_INCLUDE name="doc-head-close.inc" -->
+<body<!-- TMPL_IF NAME="OpacNav" --> id="withnav"<!-- /TMPL_IF -->>
+<!-- TMPL_INCLUDE name="masthead.inc" -->
+<!-- TMPL_INCLUDE name="usermenu.inc" -->
+
+<!--CONTENT-->
+
+<!-- TMPL_LOOP NAME="BORROWER_INFO" -->
+<div id="main_wrapper">
+<div id="main">
+<div class="content-block">
+
+<h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> 
<!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR 
NAME="themelang" -->/images/caret.gif" width="16" height="16" alt="&gt;" 
border="0" /> Clubs & Services</h3>
+
+<!-- /TMPL_LOOP -->
+
+<!-- TMPL_IF NAME="enrolledClubsAndServicesLoop" -->
+  <table>
+  <thead>
+  <tr><th colspan="5">My Clubs & Services</th></tr>
+  <tr>
+    <th>Title</th>
+    <th>Description</th>
+    <th>Library</th>
+    <th>Type</th>
+    <th></th>
+  </tr>
+  </thead>
+  
+  <tbody>
+    <!-- TMPL_LOOP NAME="enrolledClubsAndServicesLoop" -->
+      <!-- TMPL_IF NAME="odd" --><tr class="highlight"><!-- TMPL_ELSE 
--><tr><!-- /TMPL_IF -->
+        <td><!-- TMPL_VAR NAME="title" --></td>
+        <td><!-- TMPL_VAR NAME="description" --></td>
+        <td><!-- TMPL_VAR NAME="branchcode" --></td>
+        <td><!-- TMPL_VAR NAME="type" --></td>
+        <td>
+            <!-- TMPL_IF NAME="publicEnrollment" -->
+              <a href="opac-clubsAndServices.pl?action=cancel&caseId=<!-- 
TMPL_VAR NAME="caseId" -->">Cancel</a>
+            <!-- /TMPL_IF -->
+        </td>
+      </tr>
+    <!-- /TMPL_LOOP -->
+  </tbody>
+
+  </table>
+<!-- TMPL_ELSE -->
+  <h4>You Are Not Enrolled In Any Clubs Or Services</h4>
+<!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="enrollableClubsAndServicesLoop" -->
+  <table>
+  <thead>
+  <tr><th colspan="5">Enroll In Clubs & Services</th></tr>
+  <tr>
+    <th>Title</th>
+    <th>Description</th>
+    <th>Library</th>
+    <th>Type</th>
+    <th></th>
+  </tr>
+  </thead>
+  
+  <tbody>
+    <!-- TMPL_LOOP NAME="enrollableClubsAndServicesLoop" -->
+      <!-- TMPL_IF NAME="odd" --><tr class="highlight"><!-- TMPL_ELSE 
--><tr><!-- /TMPL_IF -->
+        <td><!-- TMPL_VAR NAME="title" --></td>
+        <td><!-- TMPL_VAR NAME="description" --></td>
+        <td><!-- TMPL_VAR NAME="branchcode" --></td>
+        <td><!-- TMPL_VAR NAME="type" --></td>
+        <td><a href="opac-clubsAndServices-enroll.pl?casId=<!-- TMPL_VAR 
NAME="casId" -->&casaId=<!-- TMPL_VAR NAME="casaId" -->">Enroll</a></td>
+      </tr>
+    <!-- /TMPL_LOOP -->
+  </tbody>
+
+  </table>
+<!-- TMPL_ELSE -->
+  <h4>There Are No New Clubs Or Services To Enroll In</h4>
+<!-- /TMPL_IF -->
+
+</div>
+</div>
+</div>
+<!-- TMPL_INCLUDE name="navigation.inc" -->
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
\ No newline at end of file

Index: opac/opac-clubsAndServices-enroll.pl
===================================================================
RCS file: opac/opac-clubsAndServices-enroll.pl
diff -N opac/opac-clubsAndServices-enroll.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ opac/opac-clubsAndServices-enroll.pl        24 Apr 2007 18:04:34 -0000      
1.1.2.1
@@ -0,0 +1,133 @@
+#!/usr/bin/perl
+
+# wrriten 15/10/2002 by address@hidden
+# script to display borrowers account details in the opac
+use strict;
+
+use CGI;
+use HTML::Template;
+
+use C4::Output;
+use C4::Search;
+use C4::Circulation::Circ2;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Date;
+use C4::Koha;
+use C4::ClubsAndServices;
+
+my $query = new CGI;
+
+my ($template, $borrowernumber, $cookie)
+    = get_template_and_user({template_name => 
"opac-clubsAndServices-enroll.tmpl",
+                            query => $query,
+                            type => "opac",
+                            authnotrequired => 0,
+                            flagsrequired => {borrow => 1},
+                            debug => 1,
+                            });
+
+# load languages
+my @languages_options = displayLanguages($query);
+my $languages_count = @languages_options;
+if($languages_count > 1){
+        $template->param(languages => address@hidden);
+}
+# get borrower information ....
+my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
+
+my @bordat;
+$bordat[0] = $borr;
+
+$template->param( BORROWER_INFO => address@hidden );
+
+if ( $query->param('action') eq 'enroll' ) { ## We were passed the necessary 
fields from the enrollment page.
+  my $casId = $query->param('casId');
+  my $casaId = $query->param('casaId');
+  my $data1 = $query->param('data1');
+  my $data2 = $query->param('data2');
+  my $data3 = $query->param('data3');
+            
+  my $dateEnrolled; # Will default to Today
+              
+  my ( $success, $errorCode, $errorMessage ) = EnrollInClubOrService( $casaId, 
$casId, '', $dateEnrolled, $data1, $data2, $data3, '', $borrowernumber  );
+                
+  $template->param(
+    previousActionEnroll => 1,
+  );
+                            
+  if ( $success ) {
+    $template->param( enrollSuccess => 1 );
+  } else {
+    $template->param( enrollFailure => 1 );
+    $template->param( failureMessage => $errorMessage );
+  }
+                                              
+} elsif ( DoesEnrollmentRequireData( $query->param('casaId') ) ) { ## We were 
not passed any data, and the service requires extra data
+  my ( $casId, $casaId, $casTitle, $casDescription, $casStartDate, 
$casEndDate, $casTimestamp ) = GetClubOrService( $query->param('casId') );
+  my ( $casaId, $casaType, $casaTitle, $casaDescription, $casaPublicEnrollment,
+       $casData1Title, $casData2Title, $casData3Title,
+       $caseData1Title, $caseData2Title, $caseData3Title,
+       $casData1Desc, $casData2Desc, $casData3Desc,
+       $caseData1Desc, $caseData2Desc, $caseData3Desc,
+       $timestamp )= GetClubOrServiceArchetype( $casaId );
+  $template->param(
+                  casId => $casId,
+                  casTitle => $casTitle,
+                  casDescription => $casDescription,
+                  casStartDate => $casStartDate,
+                  casEndDate => $casEndDate,
+                  casTimeStamp => $casTimestamp,
+                  casaId => $casaId,
+                  casaType => $casaType,
+                  casaTitle => $casaTitle,
+                  casaDescription => $casaDescription,
+                  casaPublicEnrollment => $casaPublicEnrollment,
+
+                  borrowernumber => $borrowernumber,
+                  );
+
+  if ( $caseData1Title ) {
+    $template->param( caseData1Title => $caseData1Title );
+  }
+  if ( $caseData2Title ) {
+    $template->param( caseData2Title => $caseData2Title );
+  }
+  if ( $caseData3Title ) {
+    $template->param( caseData3Title => $caseData3Title );
+  }
+  
+  if ( $caseData1Desc ) {
+    $template->param( caseData1Desc => $caseData1Desc );
+  }
+  if ( $caseData2Desc ) {
+    $template->param( caseData2Desc => $caseData2Desc );
+  }
+  if ( $caseData3Desc ) {
+    $template->param( caseData3Desc => $caseData3Desc );
+  }
+      
+} else { ## We were not passed any data, but the enrollment does not require 
any
+
+  my $casId = $query->param('casId');
+  my $casaId = $query->param('casaId');
+            
+  my $dateEnrolled; # Will default to Today
+              
+  my ( $success, $errorCode, $errorMessage ) = EnrollInClubOrService( $casaId, 
$casId, '', $dateEnrolled, '', '', '', '', $borrowernumber  );
+                
+  $template->param(
+    previousActionEnroll => 1,
+  );
+                            
+  if ( $success ) {
+    $template->param( enrollSuccess => 1 );
+  } else {
+    $template->param( enrollFailure => 1 );
+    $template->param( failureMessage => $errorMessage );
+  }
+
+
+}
+output_html_with_http_headers $query, $cookie, $template->output;
+

Index: opac/opac-clubsAndServices.pl
===================================================================
RCS file: opac/opac-clubsAndServices.pl
diff -N opac/opac-clubsAndServices.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ opac/opac-clubsAndServices.pl       24 Apr 2007 18:04:34 -0000      1.1.2.1
@@ -0,0 +1,57 @@
+#!/usr/bin/perl
+
+# wrriten 15/10/2002 by address@hidden
+# script to display borrowers account details in the opac
+use strict;
+
+use CGI;
+use HTML::Template;
+
+use C4::Output;
+use C4::Search;
+use C4::Circulation::Circ2;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Date;
+use C4::Koha;
+use C4::ClubsAndServices;
+
+my $query = new CGI;
+
+my ($template, $borrowernumber, $cookie)
+    = get_template_and_user({template_name => "opac-clubsAndServices.tmpl",
+                            query => $query,
+                            type => "opac",
+                            authnotrequired => 0,
+                            flagsrequired => {borrow => 1},
+                            debug => 1,
+                            });
+
+# load languages
+my @languages_options = displayLanguages($query);
+my $languages_count = @languages_options;
+if($languages_count > 1){
+        $template->param(languages => address@hidden);
+}
+# get borrower information ....
+my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
+
+my @bordat;
+$bordat[0] = $borr;
+
+$template->param( BORROWER_INFO => address@hidden );
+
+if ( $query->param('action') eq 'cancel' ) { ## Cancel the enrollment in the 
passed club or service
+  CancelClubOrServiceEnrollment( $query->param('caseId') );
+}
+
+## Get the borrowers current clubs & services
+my $enrolledClubsAndServices = GetEnrolledClubsAndServices( $borrowernumber );
+$template->param( enrolledClubsAndServicesLoop => $enrolledClubsAndServices );
+
+## Get clubs & services the borrower can enroll in from the OPAC
+my $enrollableClubsAndServices = GetPubliclyEnrollableClubsAndServices( 
$borrowernumber );
+$template->param( enrollableClubsAndServicesLoop => 
$enrollableClubsAndServices );
+
+output_html_with_http_headers $query, $cookie, $template->output;
+




reply via email to

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