The only real "bugs" are a few table errors...so this post is really intended for future code improvement.
Before I add my mods to a page I usually fix any existing table errors and minor validation errors so it's easier to spot my new errors.
I had a lot of tweaks to add into this page but fixing the existing errors was harder than usual given the crazy number of tables in it.
For ZC155 a number of html5 tags were added to many elements but (inexplicably to me) the invalid doctype has remained in place.
I was just going to feed back the <table> errors based in the html5 doctype but then went the whole hog, clearing out the legacy obsolete (border, cellspacing, cellpadding, valign, width) tags which in the main were completely unneeded, and then adding my own fixes for the couple of real errors that still existed.
So, instead of detailing each and every fix I have included the entire page for your comparison pleasure. Differences or comments should be self-explanatory.
My extra code:
1) attribute "maxlength" not allowed on type number.
This is used in a couple of places.
eg.
PHP Code:
<?php
echo zen_draw_input_field('oID', '', 'size="11" maxlength="11" id="orderSearch" class="form-control" placeholder="' . HEADING_TITLE_SEARCH . '"', '', 'number');
Both maxlength and size get ignored for type number!
I removed them and had a go at using the min and max tags which works as expected.
PHP Code:
//steve added to set input limits for form search
$orders_limits = $db->Execute("SELECT min(orders_id) AS orders_min, max(orders_id) AS orders_max FROM " . TABLE_ORDERS);
if ($orders_limits->RecordCount()) {
$param_orders_min = ' min="' . $orders_limits->fields['orders_min'] . '"';
$param_orders_max = ' max="' . $orders_limits->fields['orders_max'] . '"';
}
echo zen_draw_input_field('oID', '', 'class="form-control" placeholder="' . SELECT_ORDER_LIST . '"' . $param_orders_min . $param_orders_max, '', 'number');//steve maxlength and size removed
--------------------------
2) tel: anchor attribute is used "as is". This should be cleaned/spaces removed at least: invalid to have spaces.
PHP Code:
<td class="main"><a href="tel:<?php echo $order->customer['telephone']; ?>"><?php echo $order->customer['telephone']; ?></a></td>
this works for me, turns "+ 123 456#sss" into "tel:+123456"
PHP Code:
<td class="main"><a href="tel:<?php echo filter_var($order->customer['telephone'],FILTER_SANITIZE_NUMBER_INT); ?>"><?php echo $order->customer['telephone']; ?></a></td>
4) the ip lookup does not produce a result, just the front page of dnsstuff
PHP Code:
<td class="main"><a href="http://www.dnsstuff.com/tools#whois¦type=ipv4&value=<?php echo $lookup_ip; ?>" target="_blank"><?php echo $order->info['ip_address']; //steve pipe replaced with html entity and extra space before target removed ?></a></td>
5) The other 80+ html5 errors all were due to obsolete tags on the <table>s. Some tables still required width=100% so some css has been added in the page which of course could be put in the main css as this stuff will need to be done on all the admin pages.
6) The rhs infoBox on the orders listing page seemed to take up more space than necessary so I have compacted that somewhat.
7) a common admin trait is
<tr>
<form....
which is invalid
So, this has gone to
<tr>
<td><form....><table> etc.
My personal mods not included in this file:
a) Quick Status Update in the infoBox: allows status change/send email and shows language mismatch/prevents order update if admin lang!=order lang. This of course requires the shop lang in use to be stored with the order details at order completion time.
Similarly, language info on the details page.
I intend to submit this at some point as a plugin.
b) A tooltip popup showing the products orders when hovering over the order total on the listing page.
c) Email and Country column added to orders listing.
d) Shipping telephone number to order details
Enjoy.
Bookmarks