Re: Detailed Order Management Mod
Same principle for the next block of text below in the same file:
{* genbilim *}
{if $usertype eq "A"}
<a href="javascript:void(0)"
ship_to="{$order.s_title} {$order.s_firstname} {$order.s_lastname}"
ship_address="{$order.s_address}"
ship_address_2="{$customer.s_address_2}"
ship_city="{$order.s_city}"
ship_state="{$order.s_statename}"
ship_country="{$order.s_country}"
ship_zipcode="{$order.s_zipcode}"
onclick="copyAddrToField(this);return false;">
<img src="{$ImagesDir}/copy.gif" border=0 align=absmiddle>Copy To Field</a>
<br>
<textarea cols=40 rows=6 id=ship_addr>
</textarea>
{/if}
{* genbilim-end *}
You may also need to update the copy_addr.js mine has, it's the top bit I changed, highlighted in red:
var attributes = ['to', 'address', 'address_2', 'city', 'state', 'country', 'zipcode'];
var addrFormat =
"{to}\r\n" +
"{address}\r\n" +
"{address_2}\r\n" +
"{city}\r\n" +
"{state}\r\n" +
"{zipcode}";
function findPos(obj)
{
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
function removeInformation()
{
var div = document.getElementById('DIV_CopyInform');
if (! div)
return;
div.style.display = 'none';
div.innerHTML = '';
}
function getAddr(aObj)
{
var str = addrFormat;
for(var i=0; i<attributes.length; i++)
{
var na = 'ship_' + attributes[i];
var val= aObj.getAttribute(na);
if (typeof val != "undefined")
str = str.replace('{' + attributes[i] + '}', aObj.getAttribute(na));
}
return str;
}
function copyAddrToField(aObj)
{
document.getElementById('ship_addr').value = getAddr(aObj);
document.getElementById('ship_addr').focus();
document.getElementById('ship_addr').select();
}
function copyShipAddr(aObj, quickCopy)
{
var str = getAddr(aObj);
if (str.length > 0 )
{
if (! document.getElementById('DIV_CopyInform') )
document.getElementsByTagName('DIV')[0].innerHTML += '<div id="DIV_CopyInform" style="display:none;"></div>';
var div = document.getElementById('DIV_CopyInform');
div.style.position = 'absolute';
div.innerHTML = '';
div.style.left = (findPos(aObj)[0] + aObj.offsetWidth) + 'px';
div.style.top = findPos(aObj)[1] + 'px';
try
{
if (! quickCopy)
// make it throw an exception
genbilim.style = 'dummy';
window.clipboardData.setData("Text", str);
// Inform the user
div.style.width = '75px';
div.style.backgroundColor = 'pink';
div.style.padding = '3px';
div.style.color = 'black';
div.style.border= '1px solid black';
div.innerHTML = 'Copied';
div.style.display = 'inline';
setTimeout('removeInformation()', 1000);
}
catch(e)
{
div.style.left = (findPos(aObj)[0] + aObj.offsetWidth - 300 - 10 ) + 'px';
div.style.top = (findPos(aObj)[1] + aObj.offsetHeight) + 'px';
div.style.backgroundColor = '#DDDDCC';
div.style.padding = '5px';
div.style.color = 'black';
div.style.border= '1px solid black';
div.style.display = 'inline';
div.innerHTML =
'<table width=300 >' +
'<tr><td align=right><a href="javascript:void(0)" onclick="removeInformation()">Close</a></td></tr>' +
'<tr><td>You can copy (Ctrl+C) the adress manually</td></tr> '+
'<tr><td><textarea id=addr_ta rows=8 cols=50 >' + str + '</textarea></td></tr>';
document.getElementById('addr_ta').focus();
document.getElementById('addr_ta').select();
}
}
}
Hope that sorts it for you, responded yesterday in a rush before heading oiut the door to work.
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
|