popup.phtml 9.58 KB
Newer Older
John Punzalan's avatar
John Punzalan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php /** @var $this Mage_Shipping_Block_Tracking_Popup */ ?>
<?php $_results = $this->getTrackingInfo(); ?>
<div class="page-title title-buttons">
    <h1><?php echo $this->__('Tracking Information'); ?></h1>
    <button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
</div>
<?php if(sizeof($_results)>0): ?>
<?php foreach($_results as $shipid => $_result): ?>
    <?php if($shipid): ?>
    <h2 class="sub-title"><?php echo $this->__('Shipment #').$shipid; ?></h2>
    <?php endif; ?>
    <?php if(sizeof($_result)>0): ?>
        <?php $rowCount = sizeof($_result); $counter = 1; ?>
        <?php $_id = 0; foreach($_result as $track): ?>
            <table class="tracking-table-popup data-table" id="tracking-table-popup-<?php echo $_id ?>">
                <col width="15%" />
                <col />
                <tbody>
                <?php if(is_object($track)): ?>
                    <tr>
                        <th class="label"><?php echo $this->__('Tracking Number:'); ?></th>
                        <td class="value"><?php echo $this->escapeHtml($track->getTracking()); ?></td>
                    </tr>
                    <?php if ($track->getCarrierTitle()): ?>
                    <tr>
                        <th class="label"><?php echo $this->__('Carrier:'); ?></th>
                        <td class="value"><?php echo $this->escapeHtml($track->getCarrierTitle()); ?></td>
                    </tr>
                    <?php endif; ?>
                    <?php if($track->getErrorMessage()): ?>
                    <tr>
                        <th class="label"><?php echo $this->__('Error:'); ?></th>
                        <td class="error"><?php echo $this->__('Tracking information is currently not available. Please '); if ($this->getContactUsEnabled()) : ?><a href="<?php echo $this->getContactUs() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('contact us')) ?>" onclick="this.target='_blank'"><?php echo $this->__('contact us') ?></a><?php echo $this->__(' for more information or '); endif; echo $this->__('email us at '); ?><a href="mailto:<?php echo $this->getStoreSupportEmail() ?>"><?php echo $this->getStoreSupportEmail() ?></a></td>
                    </tr>
                    <?php elseif($track->getTrackSummary()): ?>
                    <tr>
                        <th class="label"><?php echo $this->__('Info:'); ?></th>
                        <td class="value"><?php echo $track->getTrackSummary(); ?></td>
                    </tr>
                    <?php elseif($track->getUrl()): ?>
                    <tr>
                        <th class="label"><?php echo $this->__('Track:'); ?></th>
                        <td class="value"><a href="<?php echo $this->escapeHtml($track->getUrl()); ?>" onclick="this.target='_blank'"><?php echo $this->escapeHtml($track->getUrl()); ?></a></td>
                    </tr>
                    <?php else: ?>
                        <?php if ($track->getStatus()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Status:'); ?></th>
                            <td class="value"><?php echo $track->getStatus(); ?></td>
                        </tr>
                        <?php endif; ?>

                        <?php if ($track->getDeliverydate()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Delivered on:'); ?></th>
                            <td class="value"><?php echo $this->formatDeliveryDateTime($track->getDeliverydate(),$track->getDeliverytime()); ?></td>
                        </tr>
                        <?php endif; ?>

                        <?php if ($track->getSignedby()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Signed by:'); ?></th>
                            <td class="value"><?php echo $track->getSignedby(); ?></td>
                        </tr>
                        <?php endif; ?>

                        <?php if ($track->getDeliveryLocation()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Delivered to:'); ?></th>
                            <td class="value"><?php echo $track->getDeliveryLocation(); ?></td>
                        </tr>
                        <?php endif; ?>

                        <?php if ($track->getShippedDate()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Shipped or billed on:'); ?></th>
                            <td class="value"><?php echo $track->getShippedDate(); ?></td>
                        </tr>
                        <?php endif; ?>

                        <?php if ($track->getService()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Service Type:'); ?></th>
                            <td class="value"><?php echo $track->getService(); ?></td>
                        </tr>
                        <?php endif; ?>

                        <?php if ($track->getWeight()): ?>
                        <tr>
                            <th class="label"><?php echo $this->__('Weight:'); ?></th>
                            <td class="value"><?php echo $track->getWeight(); ?></td>
                        </tr>
                        <?php endif; ?>
                    <?php endif; ?>
                <?php elseif(isset($track['title']) && isset($track['number']) && $track['number']): ?>
                    <!--if the tracking is custom value-->
                    <tr>
                        <th class="label"><?php echo ($track['title'] ? $this->escapeHtml($track['title']) : $this->__('N/A')); ?>:</th>
                        <td class="value"><?php echo (isset($track['number']) ? $this->escapeHtml($track['number']) : ''); ?></td>
                    </tr>
                <?php endif; ?>
                </tbody>
            </table>
            <script type="text/javascript">decorateTable('tracking-table-popup-<?php echo $_id++ ?>');</script>
            <?php if (is_object($track) && sizeof($track->getProgressdetail())>0): ?>
                <br />
                <table class="data-table" id="track-history-table-<?php echo $track->getTracking(); ?>">
                    <col />
                    <col width="1" />
                    <col width="1" />
                    <col />
                    <thead>
                        <tr>
                            <th><?php echo $this->__('Location') ?></th>
                            <th><?php echo $this->__('Date') ?></th>
                            <th><?php echo $this->__('Local Time') ?></th>
                            <th><?php echo $this->__('Description') ?></th>
                        </tr>
                   </thead>
                   <tbody>
                   <?php foreach($track->getProgressdetail() as $_detail): ?>
                    <?php $_detailDate = (isset($_detail['deliverydate']) ? $this->formatDeliveryDate($_detail['deliverydate']) : '') ?>
                    <?php $_detailTime = (isset($_detail['deliverytime']) ? $this->formatDeliveryTime($_detail['deliverytime'], $_detail['deliverydate']) : '') ?>
                        <tr>
                            <td><?php echo (isset($_detail['deliverylocation']) ? $_detail['deliverylocation'] : ''); ?></td>
                            <td><span class="nobr"><?php echo $_detailDate ?></span></td>
                            <td><span class="nobr"><?php echo $_detailTime ?></span></td>
                            <td><?php echo (isset($_detail['activity']) ? $_detail['activity'] : '') ?></td>
                        </tr>
                   <?php endforeach; ?>
                   </tbody>
                </table>
                <script type="text/javascript">decorateTable('track-history-table-<?php echo $track->getTracking(); ?>');</script>
            <?php endif; ?>
            <div class="divider"></div>
            <?php if($counter!=$rowCount): ?>
            <?php endif; ?>
            <?php $counter++; ?>
        <!--end for each tracking information-->
        <?php endforeach; ?>
    <?php else: ?>
        <p><?php echo $this->__('There is no tracking available for this shipment.'); ?></p>
    <?php endif; ?>

<?php endforeach; ?>
<?php else: ?>
    <p><?php echo $this->__('There is no tracking available.'); ?></p>
<?php endif; ?>
<div class="buttons-set">
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Close Window')) ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
</div>