[LON-CAPA-cvs] cvs: modules /raeburn/register registrations.pm

raeburn raeburn at source.lon-capa.org
Fri Mar 10 12:16:54 EST 2017


raeburn		Fri Mar 10 17:16:54 2017 EDT

  Modified files:              
    /modules/raeburn/register	registrations.pm 
  Log:
  - switch to Apache2/mod_perl2 calls.
  - use » entity as item separator in breadcrumbs
  - support use of 'condition' as column name in mariadb database.
  
  
-------------- next part --------------
Index: modules/raeburn/register/registrations.pm
diff -u modules/raeburn/register/registrations.pm:1.11 modules/raeburn/register/registrations.pm:1.12
--- modules/raeburn/register/registrations.pm:1.11	Fri Apr  8 20:56:02 2011
+++ modules/raeburn/register/registrations.pm	Fri Mar 10 17:16:54 2017
@@ -6,7 +6,7 @@
 # privilege for an event can edit the contents of the registration 
 # form. 
 #
-# $Id: registrations.pm,v 1.11 2011/04/08 20:56:02 raeburn Exp $
+# $Id: registrations.pm,v 1.12 2017/03/10 17:16:54 raeburn Exp $
 #
 # Stuart P Raeburn
 #
@@ -15,8 +15,12 @@
 package Apache::LON::registrations;
 
 use strict;
-use Apache::RequestRec();
-use Apache::Const qw(OK SERVER_ERROR);
+use Apache2::RequestRec();
+use Apache2::RequestIO();
+use Apache2::Response();
+use Apache2::Access();
+use Apache2::Connection ();
+use Apache2::Const qw(OK SERVER_ERROR);
 use HTML::Entities;
 use DBI;
 use LWP;
@@ -76,7 +80,6 @@
     }
 
     $r->content_type('text/html');
-    $r->send_http_header;
 
     my $exitpage = "http://support.loncapa.org/";
     my %form_elements = ();
@@ -376,7 +379,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <b>Choose an event</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <b>Choose an event</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -455,9 +458,9 @@
     ');
     my ($sth,$event_item);
     if ($displaycount > 0 || $editcount > 0) {
-        $sth=$dbh->prepare("SELECT ec.event,ec.year,ec.eventstart,ec.eventend,ec.location,ec.webpath,ea.edit,ea.display FROM event_config ec, event_admin ea WHERE (ea.user_id = $quoted_user AND ea.event_id = ec.event_id AND (ea.edit = 'Y' || ea.display = 'Y')) ORDER BY ec.eventstart");
+        $sth=$dbh->prepare("SELECT ec.event,ec.year,ec.eventstart,ec.eventend,ec.location,ec.webpath,ea.edit,ea.display FROM event_config ec, event_admin ea WHERE (ea.user_id = $quoted_user AND ea.event_id = ec.event_id AND (ea.edit = 'Y' || ea.display = 'Y')) ORDER BY ec.eventstart desc");
     } else {
-        $sth=$dbh->prepare("SELECT event,year,eventstart,eventend,location,webpath FROM event_config ORDER BY eventstart");
+        $sth=$dbh->prepare("SELECT event,year,eventstart,eventend,location,webpath FROM event_config ORDER BY eventstart desc");
     }
     $sth->execute;
     my $count = 0;
@@ -513,7 +516,7 @@
     <table border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr>
       <td align="left">
-       <img border='0' src="/images/login/tmcc.jpg" width="420" height="60">
+       <img border='0' src="/images/login/tmcc.jpg" width="420" height="60" alt="participants - TMCC">
       </td>
       <td class="LC_boxtitle"><b>LON-CAPA</b><br /><span class="nobreak"><b>$event $year</b></span></td>
      </tr>
@@ -655,7 +658,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="$portal">Choose an Event</a> --> <b>Choose data to display or export to Excel</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="$portal">Choose an Event</a> » <b>Choose data to display or export to Excel</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -1210,7 +1213,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="$portal">Choose an Event</a> --> <a href="javascript:changePage(document.adminForm,'','','','')">Choose data to display/export</a> --> <b>Result</b></font></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="$portal">Choose an Event</a> » <a href="javascript:changePage(document.adminForm,'','','','')">Choose data to display/export</a> » <b>Result</b></font></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -1292,7 +1295,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="$portal">Choose an Event</a> --> <b>Choose edit action</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="$portal">Choose an Event</a> » <b>Choose edit action</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -1587,7 +1590,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="/registrations">Choose an event</a> --> <a href="javascript:changePage(document.pickeditaction,'edit','','','')">Choose edit action</a> --> <b>Edit form</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="/registrations">Choose an event</a> » <a href="javascript:changePage(document.pickeditaction,'edit','','','')">Choose edit action</a> » <b>Edit form</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -2039,7 +2042,7 @@
     <form name="processedit" method="post" action="/registrations">
     <table class="LC_breadcrumb">
      <tr>      <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="$portal">Choose an Event</a> --> <a href="javascript:changePage(document.processedit,'edit','','','')">Choose action</a> --> <a href="javascript:changePage(document.processedit,'edit','formfields','','')">Edit Form</a> --> <b>Modify fields</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="$portal">Choose an Event</a> » <a href="javascript:changePage(document.processedit,'edit','','','')">Choose action</a> » <a href="javascript:changePage(document.processedit,'edit','formfields','','')">Edit Form</a> » <b>Modify fields</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -2621,7 +2624,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="/registrations">Choose an event</a> --> <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> --> <b>Configure Event</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="/registrations">Choose an event</a> » <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> » <b>Configure Event</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -2808,7 +2811,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="/registrations">Choose an event</a> --> <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> --> <b>Configure Fees</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="/registrations">Choose an event</a> » <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> » <b>Configure Fees</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -2903,7 +2906,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="/registrations">Choose an event</a> --> <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> --> <a href="javascript:changePage(document.$formname,'edit','fees','','')">Configure Fees</a> --> <b>Display/Set conditions</b></span></td>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="/registrations">Choose an event</a> » <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> » <a href="javascript:changePage(document.$formname,'edit','fees','','')">Configure Fees</a> » <b>Display/Set conditions</b></span></td>
       <td> </td>
       <td align="right" valign="top">
        <img border="0" src="/images/login/logout_red.gif" width="90" height="23" align="right" usemap="#event_header">
@@ -2931,7 +2934,7 @@
     }
     my ($maxnum,%condfee,%conditions_by_num);
     $maxnum = 0;
-    my @conditions = ('did','name','tablename','value','condition','num');
+    my @conditions = ('did','name','tablename','value','`condition`','num');
     my $conditionstr = join(',', at conditions);
     my $statement = "SELECT $conditionstr from product_dependencies WHERE (event_id = $eventid_quoted AND iid = $iid_quoted) ORDER BY did";
     my $sth = $dbh->prepare($statement); 
@@ -3251,7 +3254,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="/registrations">Choose an event</a> --> <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> --> <b>Email Configuration</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="/registrations">Choose an event</a> » <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> » <b>Email Configuration</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -3301,7 +3304,7 @@
     <table class="LC_breadcrumb">
      <tr>
       <td>
-       <span class="nobreak"><a href="http://loncapa.org/">Home</a> --> <a href="$exitpage">Support</a> --> <a href="/registrations">Choose an event</a> --> <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> --> <b>Sponsors Information</b></span>
+       <span class="nobreak"><a href="http://loncapa.org/">Home</a> » <a href="$exitpage">Support</a> » <a href="/registrations">Choose an event</a> » <a href="javascript:changePage(document.$formname,'edit','','','')">Choose edit action</a> » <b>Sponsors Information</b></span>
       </td>
       <td> </td>
       <td align="right" valign="top">
@@ -3493,7 +3496,7 @@
                 }
             }
             my %changes;
-            my @conditions = ('did','name','tablename','value','condition','num');
+            my @conditions = ('did','name','tablename','value','`condition`','num');
             my $conditionstr = join(',', at conditions);
             my $statement = "SELECT $conditionstr from product_dependencies WHERE (event_id = $eventid_quoted AND iid = $iid_quoted) ORDER BY did";
             my $sth = $dbh->prepare($statement);


More information about the LON-CAPA-cvs mailing list