Subversion Repositories munaweb

Rev

Rev 36 | Rev 150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36 Rev 139
Line 1019... Line 1019...
1019
    xhr.send(xml);
1019
    xhr.send(xml);
1020
 
1020
 
1021
}
1021
}
1022
 
1022
 
1023
function createAddItemXML(xhr, item, callname, itemId, itemXml) {
1023
function createAddItemXML(xhr, item, callname, itemId, itemXml) {
1024
    var n1 = 0, n2 = 0;
1024
    var n1 = 0, n2 = 0, m1, m2;
-
 
1025
    var str;
1025
    var quantity = Number(getJsonValue(item.Quantity));
1026
    var quantity = Number(getJsonValue(item.Quantity));
1026
    var quantitySold = Number(getJsonValue(item.SellingStatus.QuantitySold));
1027
    var quantitySold = Number(getJsonValue(item.SellingStatus.QuantitySold));
1027
 
1028
 
1028
    n1 = itemXml.indexOf('<Quantity>') + 10;
1029
    n1 = itemXml.indexOf('<Quantity>') + 10;
1029
    if (n1 > 0) {
1030
    if (n1 > 0) {
Line 1053... Line 1054...
1053
    if (itemXml.contains('<ShippingPackage>None</ShippingPackage>')) {
1054
    if (itemXml.contains('<ShippingPackage>None</ShippingPackage>')) {
1054
        n1 = itemXml.indexOf('<ShippingPackageDetails>');
1055
        n1 = itemXml.indexOf('<ShippingPackageDetails>');
1055
        if (n1 > 0) {
1056
        if (n1 > 0) {
1056
            n2 = itemXml.indexOf('</ShippingPackageDetails>') + 25;
1057
            n2 = itemXml.indexOf('</ShippingPackageDetails>') + 25;
1057
            str = itemXml.substr(0, n1) + itemXml.substr(n2);
1058
            str = itemXml.substr(0, n1) + itemXml.substr(n2);
-
 
1059
            itemXml = str;
-
 
1060
        }
-
 
1061
    }
-
 
1062
 
-
 
1063
    if (itemXml.contains('Sports Trading Cards') && !itemXml.contains('<Name>Player</Name>')) {
-
 
1064
        n1 = itemXml.indexOf('</ItemSpecifics>');
-
 
1065
        if (n1 > 0) {
-
 
1066
            str = itemXml.substr(0, n1) + '<NameValueList><Name>Player</Name><Value>N/A</Value><Source>ItemSpecific</Source></NameValueList>' + itemXml.substr(n1);
-
 
1067
            itemXml = str;
-
 
1068
        }
-
 
1069
    }
-
 
1070
 
-
 
1071
    if (itemXml.contains('Sports Trading Cards') && !itemXml.contains('<Name>Sport</Name>')) {
-
 
1072
        n1 = itemXml.indexOf('</ItemSpecifics>');
-
 
1073
        if (n1 > 0) {
-
 
1074
            m1 = itemXml.indexOf('Sports Trading Cards:');
-
 
1075
            if (m1 > 0) {
-
 
1076
                m1 += 21;
-
 
1077
                m2 = itemXml.indexOf(' Cards</CategoryName>') - m1;
-
 
1078
                str = itemXml.substr(0, n1) + '<NameValueList><Name>Sport</Name><Value>' + itemXml.substr(m1, m2) + '</Value><Source>ItemSpecific</Source></NameValueList>' + itemXml.substr(n1);
-
 
1079
                itemXml = str;
-
 
1080
            }
-
 
1081
        }
-
 
1082
    }
-
 
1083
 
-
 
1084
    if (itemXml.contains('<Value>Not Autographed</Value>')) {
-
 
1085
        n1 = itemXml.indexOf('<Value>Not Autographed</Value>');
-
 
1086
        if (n1 > 0) {
-
 
1087
            n2 = n1 + 30;
-
 
1088
            str = itemXml.substr(0, n1) + '<Value>-</Value>' + itemXml.substr(n2);
-
 
1089
            itemXml = str;
-
 
1090
        }
-
 
1091
    }
-
 
1092
 
-
 
1093
    if (itemXml.contains('<Value>Not Authenticated</Value>')) {
-
 
1094
        n1 = itemXml.indexOf('<Value>Not Authenticated</Value>');
-
 
1095
        if (n1 > 0) {
-
 
1096
            n2 = n1 + 32;
-
 
1097
            str = itemXml.substr(0, n1) + '<Value>-</Value>' + itemXml.substr(n2);
1058
            itemXml = str;
1098
            itemXml = str;
1059
        }
1099
        }
1060
    }
1100
    }
1061
 
1101
 
1062
    var xml = '<?xml version="1.0" encoding="utf-8"?>';
1102
    var xml = '<?xml version="1.0" encoding="utf-8"?>';