# Copyright (c) 2001-2009 bivio Software, Inc. All rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: order-confirmation.bview,v 2.3 2009/11/28 02:59:15 nagler Exp $ # # Order review prior to commit # view_parent('menu'); view_put(header_title => 'Confirm Shipping Data'); # Looks up the specified OrderForm field in the OrderConfirmationForm's # context. my($order_field) = sub { my($req, $field) = @_; return ($req->get('Model.OrderConfirmationForm') ->unsafe_get_context_field($field))[0]; }; # Returns a widget which render the specified address fields. my($address_widget) = sub { my($name_prefix, $address) = @_; $address ||= ''; return Join([ '
',
String([$order_field, 'Order.' . $name_prefix . '_name']),
'
',
String([$order_field, 'Address' . $address . '.street1']),
'
',
If([$order_field, 'Address' . $address . '.street2'],
Join([
String([$order_field, 'Address' . $address . '.street2']),
'
',
]),
),
String([$order_field, 'Address' . $address . '.city']),
', ',
String([$order_field, 'Address' . $address . '.state']),
vs_blank_cell(2),
String([$order_field, 'Address' . $address . '.zip']),
'