[freeside-commits] freeside/httemplate/elements popup_link-cust_main.html, 1.2, 1.3 tr-select-reason.html, 1.9, 1.10

Ivan,,, ivan at wavetail.420.am
Sat Mar 29 01:15:47 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv661/httemplate/elements

Modified Files:
	popup_link-cust_main.html tr-select-reason.html 
Log Message:
okay.  and thank goodness its on 1.9.  really fix error reporting on quick package order this time.  have to change cust cancel popup slightly too, but its for the better (easier custnum parsing).  and lastly make it easier for reason selection to be reused without stickiness-on-errors being a big pain in the ass

Index: popup_link-cust_main.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/popup_link-cust_main.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- popup_link-cust_main.html	16 Mar 2008 23:05:25 -0000	1.2
+++ popup_link-cust_main.html	29 Mar 2008 08:15:45 -0000	1.3
@@ -41,7 +41,8 @@
   ($action, $label, $actionlabel, $color, $cust_main) = @_;
 }
 
-$action .= '?'. $cust_main->custnum;
+$action .= ( $action =~ /\?/ ) ? ';' : '?';
+$action .= 'custnum='. $cust_main->custnum;
 
 </%init>
 <% $cust_main 

Index: tr-select-reason.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-reason.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- tr-select-reason.html	13 Jan 2008 20:50:19 -0000	1.9
+++ tr-select-reason.html	29 Mar 2008 08:15:45 -0000	1.10
@@ -1,3 +1,34 @@
+<%doc>
+
+Example:
+
+  include( '/elements/tr-select-reason.html',
+
+    #required 
+    'field'         => 'reasonnum',
+    'reason_class'  => 'C', # currently 'C', 'R',  or 'S'
+                           # for cancel, credit, or suspend
+
+    #recommended
+    'cgi' => $cgi, #easiest way for things to be properly "sticky" on errors
+
+    #optional
+    'control_button' => 'element_name', #button to be enabled when a reason is
+                                        #selected
+    'id'             => 'element_id',
+
+    #deprecated ways to keep things "sticky" on errors
+    # (requires duplicate code in each using file to parse cgi params)
+    'curr_value'     => $curr_value,
+    'curr_value'     => {
+                          'typenum' => $typenum,
+                          'reason'  => $reason,
+                        },
+
+  )
+
+</%doc>
+
 <SCRIPT TYPE="text/javascript">
   function sh_add<% $func_suffix %>()
   {
@@ -36,7 +67,7 @@
   <TD ALIGN="right">Reason</TD>
   <TD>
     <SELECT id="<% $id %>" name="<% $name %>" onFocus="sh_add<% $func_suffix %>()" onChange="sh_add<% $func_suffix %>()">
-      <OPTION VALUE="" <% ($init_reason eq "") ? 'SELECTED' : '' %>>Select Reason...</OPTION>
+      <OPTION VALUE="" <% ($init_reason eq '') ? 'SELECTED' : '' %>>Select Reason...</OPTION>
 %    foreach my $reason (@reasons) {
       <OPTION VALUE="<% $reason->reasonnum %>" <% ($init_reason == $reason->reasonnum) ? 'SELECTED' : '' %>><% $reason->reasontype->type %> : <% $reason->reason %></OPTION>
 %    }
@@ -95,7 +126,13 @@
 
 my $name = $opt{'field'};
 my $class = $opt{'reason_class'};
-my $init_reason = $opt{'curr_value'};
+
+my $init_reason;
+if ( $opt{'cgi'} ) {
+  $init_reason = $opt{'cgi'}->param($name);
+} else {
+  $init_reason = $opt{'curr_value'};
+}
 
 my $controlledbutton = $opt{'control_button'};
 
@@ -128,6 +165,9 @@
     $init_type      = $init_reason->{'typenum'};
     $init_newreason = $init_reason->{'reason'};
     $init_reason = -1;
+  } elsif ( $opt{'cgi'} ) {
+    $init_type      = $opt{'cgi'}->param( "new${name}T" );
+    $init_newreason = $opt{'cgi'}->param( "new$name"    );
   }
 
 }



More information about the freeside-commits mailing list