[interchange-cvs] interchange - heins modified code/UI_Tag/update_order_status.tag
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Mon Jan 13 19:23:00 2003
User: heins
Date: 2003-01-14 00:20:17 GMT
Modified: code/UI_Tag update_order_status.tag
Log:
* Update the order_status update time if database is *not* MySQL.
Revision Changes Path
1.6 +13 -1 interchange/code/UI_Tag/update_order_status.tag
rev 1.6, prev_rev 1.5
Index: update_order_status.tag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/update_order_status.tag,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- update_order_status.tag 4 Nov 2002 16:16:30 -0000 1.5
+++ update_order_status.tag 14 Jan 2003 00:20:17 -0000 1.6
@@ -1,6 +1,6 @@
UserTag update-order-status Order order_number
UserTag update-order-status addAttr
-UserTag update-order-status Version $Id: update_order_status.tag,v 1.5 2002/11/04 16:16:30 mheins Exp $
+UserTag update-order-status Version $Id: update_order_status.tag,v 1.6 2003/01/14 00:20:17 mheins Exp $
UserTag update-order-status Routine <<EOR
sub {
my ($on, $opt) = @_;
@@ -243,6 +243,11 @@
? "Email copy sent to $::Scratch->{ship_notice_email}."
: "No email copy sent as per user preference.";
+ my $dotime = $odb->config('DSN');
+ my $update_date;
+ $dotime = $dotime =~ /dbi:mysql:/ ? 0 : 1;
+ $update_date = POSIX::strftime('%Y-%m-%d %H:%M:%S %z', localtime());
+
# Actually update the orderline database
for(@$lines_ary) {
my $code = $_->[$odb_keypos];
@@ -255,6 +260,13 @@
$::Scratch->{ui_message} = "Orderline $code ship status update failed.";
return;
};
+ if($dotime) {
+ $odb->set_field($code, 'update_date', $update_date)
+ or do {
+ $::Scratch->{ui_message} = "Orderline $code ship date update failed.";
+ return;
+ };
+ }
}