Ticket #66: tracking.patch
| File tracking.patch, 5.2 KB (added by Andreas Tangemann <a.tangemann@…>, 3 years ago) |
|---|
-
modules/bms/include/invoices.php
272 272 273 273 function showShippingSelect($uuid,$shippingMethods){ 274 274 275 ?><select name="shippingmethodid" id="shippingmethodid" onchange="changeShipping() ">275 ?><select name="shippingmethodid" id="shippingmethodid" onchange="changeShipping();changeTracking();"> 276 276 <option value="" <?php if($uuid=="") echo "selected=\"selected\""?>><none></option> 277 277 <?php foreach($shippingMethods as $method){?> 278 278 <option value="<?php echo $method["uuid"]?>" <?php if($uuid==$method["uuid"]) echo "selected=\"selected\""?>><?php echo $method["name"]?></option> … … 293 293 `uuid`, 294 294 `name`, 295 295 `canestimate`, 296 `estimationscript` 296 `estimationscript`, 297 `trackingscript` 297 298 FROM 298 299 `shippingmethods` 299 300 WHERE … … 322 323 $phpbms->topJS[] = 'shippingMethods["'.$uuid.'"]["name"]="'.htmlQuotes($therecord["name"]).'";'; 323 324 $phpbms->topJS[] = 'shippingMethods["'.$uuid.'"]["canestimate"]='.((int) $therecord["canestimate"]).';'; 324 325 $phpbms->topJS[] = 'shippingMethods["'.$uuid.'"]["estimationscript"]="'.htmlQuotes($therecord["estimationscript"]).'";'; 326 $phpbms->topJS[] = 'shippingMethods["'.$uuid.'"]["trackingscript"]="'.htmlQuotes($therecord["trackingscript"]).'";'; 325 327 } 326 328 327 329 return $thereturn; -
modules/bms/install/createtables.sql
321 321 `creationdate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', 322 322 `modifiedby` INTEGER UNSIGNED, 323 323 `modifieddate` TIMESTAMP, 324 `trackingscript` VARCHAR(128), 324 325 `custom1` DOUBLE, 325 326 `custom2` DOUBLE, 326 327 `custom3` DATETIME, -
modules/bms/invoices_addedit.php
542 542 543 543 <p> 544 544 <label for="trackingno">tracking number</label><br /> 545 <input id="trackingno" name="trackingno" type="text" value="<?php echo htmlQuotes($therecord["trackingno"]) ?>" size="50" maxlength="64" /> 545 <?php $trackingButtonDisable=""; 546 if($therecord["trackingno"]=="") $trackingButtonDisable="Disabled"; 547 ?> 548 <input id="trackingno" name="trackingno" type="text" value="<?php echo htmlQuotes($therecord["trackingno"]) ?>" size="50" maxlength="64" onchange="changeTracking()" /> 549 <button id="trackingButton" type="button" onclick="startTracking()" class="graphicButtons buttonShip<?php echo $trackingButtonDisable?>" title="Tracking"><span>Tracking</span></button> 546 550 </p> 547 551 </fieldset> 548 552 </div> -
modules/bms/javascript/invoice.js
1193 1193 estimateShippingButton.className = newClass; 1194 1194 } 1195 1195 1196 function changeTracking(){ 1197 var trackingno = getObjectFromID("trackingno"); 1198 var TrackingButton=getObjectFromID("trackingButton"); 1199 var newClass="graphicButtons buttonShipDisabled"; 1200 var currentShipping = getObjectFromID("shippingmethodid").value; 1196 1201 1202 if(trackingno.value!='' && shippingMethods[currentShipping]["trackingscript"]!='') 1203 newClass="graphicButtons buttonShip"; 1204 1205 TrackingButton.className = newClass; 1206 } 1207 1197 1208 shippingNotice=""; 1198 1209 function startEstimateShipping(){ 1199 1210 … … 1216 1227 1217 1228 }//end function 1218 1229 1230 function startTracking(){ 1219 1231 1232 var thebutton = getObjectFromID("trackingButton"); 1233 var currentShipping = getObjectFromID("shippingmethodid").value; 1234 var trackingno = getObjectFromID("trackingno").value; 1235 var theURL = shippingMethods[currentShipping]["trackingscript"]; 1236 1237 if(thebutton.className.indexOf("Disabled") == -1 && shippingMethods[currentShipping]["trackingscript"]!=''){ 1238 position = theURL.indexOf('%s'); 1239 theURL = theURL.substring(0,position)+trackingno+theURL.substring(position+2); 1240 window.open(theURL,'phpBMS'); 1241 }//end if 1242 1243 }//end function 1244 1220 1245 function performShippingEstimate(base){ 1221 1246 1222 1247 var resultsArea = getObjectFromID("shippingNoticeResults"); -
modules/bms/shippingmethods_addedit.php
102 102 <input id="estimationscript" name="estimationscript" type="text" value="<?php echo htmlQuotes($therecord["estimationscript"])?>" size="64" maxlength="128"/> 103 103 </p> 104 104 </fieldset> 105 <fieldset> 106 <legend>track shipment</legend> 107 <p><br /> 108 <label for="trackingscript">tracking script</label><br /> 109 <input id="trackingscript" name="trackingscript" type="text" value="<?php echo htmlQuotes($therecord["trackingscript"])?>" size="64" maxlength="128"/> 110 </p> 111 </fieldset> 105 112 106 113 <?php $theform->showCustomFields($db, $thetable->customFieldsQueryResult) ?> 107 114