[interchange-cvs] interchange - heins modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Jun 26 12:43:44 UTC 2008


User:      heins
Date:      2008-06-26 12:43:44 GMT
Modified:  code/UI_Tag update_order_status.tag
Modified:  dist/lib/UI/pages/admin order_status.html
Log:
* Someone removed email_copy field from userdb table, which meant that
  email was not sent to customers by default on status updates. Changed
  to default to yes if email_copy field not present in user table.

* Add tracking_number field to order status if field exists in orderline,
  and handle it in update_order_status tag.

Revision  Changes    Path
1.13                 interchange/code/UI_Tag/update_order_status.tag


rev 1.13, prev_rev 1.12
Index: update_order_status.tag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/update_order_status.tag,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- update_order_status.tag	30 Mar 2007 23:40:54 -0000	1.12
+++ update_order_status.tag	26 Jun 2008 12:43:44 -0000	1.13
@@ -1,15 +1,15 @@
-# Copyright 2002-2007 Interchange Development Group and others
+# Copyright 2002-2008 Interchange Development Group and others
 # 
 # This program 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.  See the LICENSE file for details.
 # 
-# $Id: update_order_status.tag,v 1.12 2007-03-30 23:40:54 pajamian Exp $
+# $Id: update_order_status.tag,v 1.13 2008-06-26 12:43:44 mheins Exp $
 
 UserTag update-order-status Order   order_number
 UserTag update-order-status addAttr
-UserTag update-order-status Version $Revision: 1.12 $
+UserTag update-order-status Version $Revision: 1.13 $
 UserTag update-order-status Routine <<EOR
 sub {
 	my ($on, $opt) = @_;
@@ -32,7 +32,13 @@
 	}
 
 	my $user       = $trec->{username};
-	my $wants_copy = $udb->field($user, 'email_copy');
+	my $wants_copy;
+	if($udb->column_exists('email_copy')) {
+		$wants_copy = $udb->field($user, 'email_copy');
+	}
+	else {
+		$wants_copy = 1;
+	}
 
 	for(qw/
 			archive
@@ -51,6 +57,17 @@
 		$opt->{$_} = $CGI::values{$_} if ! defined $opt->{$_};
 	}
 
+	my @track_keys = grep /tracking_number__1$/, keys %CGI::values;
+	my @otracks;
+	for(@track_keys) {
+		if(m{^(\d+)_}) {
+			$otracks[$1] = $CGI::values{$_};
+		}
+		else {
+			$otracks[0] = $CGI::values{$_};
+		}
+	}
+
 	if($opt->{ship_all} == 2 or $opt->{void_transaction} or $opt->{cancel_order}) {
 		$opt->{cancel_order} = 1;
 		$opt->{ship_all} = 2;
@@ -229,9 +246,13 @@
 
 	my $target_status = $opt->{cancel_order} ? 'canceled' : 'shipped';
 
+	my $i = 0;
 	for(@$lines_ary) {
 		my $code = $_->[$odb_keypos];
 		my $status = $odb->field($code, 'status');
+		if (@otracks) {
+			$odb->set_field($code,'tracking_number',$otracks[$i]);
+		}
 		my $line = $code;
 		push @shiplines, $line if $need_shiplines;
 		$line =~ s/.*\D//;
@@ -242,6 +263,7 @@
 		elsif($opt->{ship_all}) {
 			$shipping{$line} = 1;
 		}
+		$i++;
 	}
 
 	my $to_ship = scalar @shiplines;



2.18                 interchange/dist/lib/UI/pages/admin/order_status.html


rev 2.18, prev_rev 2.17
Index: order_status.html
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/order_status.html,v
retrieving revision 2.17
retrieving revision 2.18
diff -u -r2.17 -r2.18
--- order_status.html	13 Apr 2004 15:38:31 -0000	2.17
+++ order_status.html	26 Jun 2008 12:43:44 -0000	2.18
@@ -170,7 +170,7 @@
 	help.order_id='<span style="font-size: larger;font-weight: bold">* = [L]settled[/L], - = [L]voided[/L]</span>'
 	link-table=orderline
 	link-key=order_number
-	link-fields="order_number sku quantity price status"
+	link-fields="order_number sku quantity price tracking_number status"
 	link-before=order_id
 	link-no-blank=1
 	link-label="[L]Ordered Items[/L]"
@@ -190,4 +190,4 @@
 </script>
 
 @_UI_STD_FOOTER_@
-<!-- page: @@MV_PAGE@@ version: $Id: order_status.html,v 2.17 2004-04-13 15:38:31 mheins Exp $ -->
+<!-- page: @@MV_PAGE@@ version: $Id: order_status.html,v 2.18 2008-06-26 12:43:44 mheins Exp $ -->







More information about the interchange-cvs mailing list