WEFC_Toronto pos > install Printer Port fix "other"

Preserve the text-input value for the Printer Port "other" choice.
<tr><td><b>Printer port</b>:
</td><td><?php
// If values entered on the form are being saved, set CORE_LOCAL
//  and flag type of port choice: "other" or not.
if (isset($_REQUEST['PPORT'])) {
    if ($_REQUEST['PPORT'] == 'other' &&
        isset($_REQUEST['otherpport']) &&
        $_REQUEST['otherpport'] != '') {
        $CORE_LOCAL->set('printerPort',trim($_REQUEST['otherpport']));
        $otherpport = True;
        $otherpportValue = trim($_REQUEST['otherpport']);
    } else {
        $CORE_LOCAL->set('printerPort',$_REQUEST['PPORT']);
        $otherpport = False;
        $otherpportValue = "";
    }
} else {
    $pport = $CORE_LOCAL->get('printerPort');
    if (isset($pport) && $pport !== False && $pport != "") {
        $pports =
array("/dev/lp0","/dev/usb/lp0","LPT1:","fakereceipt.txt");
        if (in_array($pport,$pports)) {
            $otherpport = False;
            $otherpportValue = "";
        } else {
            $otherpport = True;
            $otherpportValue = "$pport";
        }
    } else {
        $otherpport = False;
        $otherpportValue = "";
    }
}
?>
<input type="radio" name=PPORT value="/dev/lp0" id="div-lp0"
    <?php if (!$otherpport &&
$CORE_LOCAL->get('printerPort')=="/dev/lp0")
            echo "checked";
    ?> /><label for="div-lp0">/dev/lp0 (*nix)</label><br />
<input type="radio" name=PPORT value="/dev/usb/lp0" id="div-usb-lp0"
    <?php if (!$otherpport &&
$CORE_LOCAL->get('printerPort')=="/dev/usb/lp0")
            echo "checked"; ?> /><label for="div-usb-lp0">/dev/usb/lp0
(*nix)</label><br />
<input type="radio" name=PPORT value="LPT1:" id="lpt1-"
    <?php if (!$otherpport && $CORE_LOCAL->get('printerPort')=="LPT:")
                echo "checked"; ?> /><label for="lpt1-">LPT1:
(windows)</label><br />
<input type="radio" name=PPORT value="fakereceipt.txt" id="fakercpt"
    <?php if (!$otherpport &&
$CORE_LOCAL->get('printerPort')=="fakereceipt.txt")
                echo "checked";
    ?> /><label for="fakercpt">fakereceipt.txt</label><br />
<input type="radio" name=PPORT value="other"
    <?php if ($otherpport)
                echo "checked";
?> /> <input type=text name="otherpport"
    value="<?php echo "$otherpportValue"; ?>"><br />
<span class='noteTxt' style="top:-110px;"> <?php printf("<p>Current
value: <span
class='pre'>%s</span></p>",$CORE_LOCAL->get('printerPort')); ?>
Path to the printer. Select from common values, or enter a custom path.
Some ubuntu distros might put your USB printer at /dev/usblp0</span>
</td></tr>
<?php
// Write to database.
InstallUtilities::paramSave('printerPort',$CORE_LOCAL->get('printerPort'));
?>