Merge remote-tracking branch 'origin/ticket/14716-order-mobile'
This commit is contained in:
commit
3a5c74c325
@ -44,7 +44,7 @@ class AdminOrders extends AdminTab
|
||||
os.`color`,
|
||||
IF(
|
||||
(SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1
|
||||
AND (SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer ORDER BY so.date_add ASC LIMIT 1) != a.id_order
|
||||
AND (SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer ORDER BY so.date_add ASC LIMIT 1) != a.id_order
|
||||
, 0, 1) as new,
|
||||
(SELECT COUNT(od.`id_order`) FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number,
|
||||
a.id_order AS `mixed`,
|
||||
@ -72,13 +72,16 @@ class AdminOrders extends AdminTab
|
||||
foreach(Country::getCountries((int) $cookie->id_lang, TRUE) as $country) {
|
||||
$country_array[(int) $country['id_country']] = $country['name'];
|
||||
}
|
||||
$appliArray = array(
|
||||
|
||||
$deviceList = array(
|
||||
0 => 'Site',
|
||||
1 => 'Appli'
|
||||
1 => 'Appli',
|
||||
2 => 'Mobile',
|
||||
);
|
||||
|
||||
foreach ($states AS $state)
|
||||
|
||||
foreach ($states AS $state){
|
||||
$statesArray[$state['id_order_state']] = $state['name'];
|
||||
}
|
||||
|
||||
$carriers = Db::getInstance()->ExecuteS('
|
||||
SELECT c.`id_carrier`, IF(c.`name` = "0", "'.Configuration::get('PS_SHOP_NAME').'", c.`name`) AS `name`'.($this->cursale !== NULL? ', (
|
||||
@ -91,20 +94,22 @@ class AdminOrders extends AdminTab
|
||||
foreach ($carriers as $row) {
|
||||
$carriersArray[(int)$row['id_carrier']] = $row['name'];
|
||||
}
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'new' => array('title' => $this->l('New'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'filter_key' => 'new', 'tmpTableFilter' => true, 'icon' => array(0 => 'blank.gif', 1 => 'news-new.gif'), 'orderby' => false),
|
||||
'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 100, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true),
|
||||
'total_paid' => array('title' => $this->l('Total'), 'width' => 70, 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'price' => true, 'currency' => true),
|
||||
'payment' => array('title' => $this->l('Payment'), 'width' => 80),
|
||||
'osname' => array('title' => $this->l('Status'), 'widthColumn' => 200, 'type' => 'select', 'select' => $statesArray, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'width' => 200),
|
||||
'id_carrier' => array('title' => $this->l('Carrier'), 'align' => 'center', 'width' => 80, 'callback' => 'printCarrier', 'orderby' => false, 'type' => 'select', 'select' => $carriersArray, 'filter_key' => 'a!id_carrier', 'filter_type' => 'int'),
|
||||
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add'),
|
||||
//'mixed' => array('title' => $this->l('Mixed'), 'callback' => 'printMixedSale', 'orderby' => false, 'search' => false),
|
||||
'id_pdf' => array('title' => $this->l('PDF'), 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false),
|
||||
'id_country' => array('title' => $this->l('Pays'), 'callback' => 'printCountry', 'orderby' => false, 'type' => 'select', 'select' => $country_array, 'filter_key' => 'x!id_country', 'filter_type' => 'int', 'width' => 35,),
|
||||
'appli' => array('title' => $this->l('Appli'), 'width' => 25, 'align' => 'center', 'type' => 'select', 'select' => $appliArray, 'filter_key' => 'a!appli', 'callback' => 'printAppliIcons', 'orderby' => false),
|
||||
'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'new' => array('title' => $this->l('New'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'filter_key' => 'new', 'tmpTableFilter' => true, 'icon' => array(0 => 'blank.gif', 1 => 'news-new.gif'), 'orderby' => false),
|
||||
'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 100, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true),
|
||||
'total_paid' => array('title' => $this->l('Total'), 'width' => 70, 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'price' => true, 'currency' => true),
|
||||
'payment' => array('title' => $this->l('Payment'), 'width' => 80),
|
||||
'osname' => array('title' => $this->l('Status'), 'widthColumn' => 200, 'type' => 'select', 'select' => $statesArray, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'width' => 200),
|
||||
'id_carrier' => array('title' => $this->l('Carrier'), 'align' => 'center', 'width' => 80, 'callback' => 'printCarrier', 'orderby' => false, 'type' => 'select', 'select' => $carriersArray, 'filter_key' => 'a!id_carrier', 'filter_type' => 'int'),
|
||||
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add'),
|
||||
//'mixed' => array('title' => $this->l('Mixed'), 'callback' => 'printMixedSale', 'orderby' => false, 'search' => false),
|
||||
'id_pdf' => array('title' => $this->l('PDF'), 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false),
|
||||
'id_country' => array('title' => $this->l('Pays'), 'callback' => 'printCountry', 'orderby' => false, 'type' => 'select', 'select' => $country_array, 'filter_key' => 'x!id_country', 'filter_type' => 'int', 'width' => 35,),
|
||||
'appli' => array('title' => $this->l('Device'), 'width' => 25, 'align' => 'center', 'type' => 'select', 'select' => $deviceList, 'filter_key' => 'a!appli', 'callback' => 'printDeviceIcons', 'orderby' => false),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
|
||||
if(!isset($_POST['submitFilter']) && !isset($_POST['orderFilter_a!date_add'])) {
|
||||
|
@ -3814,3 +3814,7 @@ form.form-forward-message .button:focus{
|
||||
.tab_customer_thread .button:focus{
|
||||
background-color: rgba(86,84,133,0.6);
|
||||
}
|
||||
|
||||
span.anticon {
|
||||
color: #000;
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit b26d6103a62b0eff495b785ec15edf0ad7020ea8
|
@ -1 +0,0 @@
|
||||
Subproject commit b26d6103a62b0eff495b785ec15edf0ad7020ea8
|
@ -1 +0,0 @@
|
||||
Subproject commit b26d6103a62b0eff495b785ec15edf0ad7020ea8
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
class Order extends OrderCore {
|
||||
|
||||
class Order extends OrderCore
|
||||
{
|
||||
/** @var boolean True if the order comes from app */
|
||||
public $appli = 0;
|
||||
|
||||
protected $fieldsValidate = array(
|
||||
protected $fieldsValidate = array(
|
||||
'id_address_delivery' => 'isUnsignedId',
|
||||
'id_address_invoice' => 'isUnsignedId',
|
||||
'id_cart' => 'isUnsignedId',
|
||||
@ -27,7 +27,7 @@ class Order extends OrderCore {
|
||||
'total_wrapping' => 'isPrice',
|
||||
'shipping_number' => 'isUrl',
|
||||
'conversion_rate' => 'isFloat',
|
||||
'appli' => 'isBool'
|
||||
'appli' => 'isBool',
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
@ -62,7 +62,7 @@ class Order extends OrderCore {
|
||||
$fields['invoice_date'] = pSQL($this->invoice_date);
|
||||
$fields['delivery_date'] = pSQL($this->delivery_date);
|
||||
$fields['valid'] = (int)($this->valid) ? 1 : 0;
|
||||
$fields['appli'] = (int)($this->appli) ? 1 : 0;
|
||||
$fields['appli'] = (int)($this->appli);
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
$fields['date_upd'] = pSQL($this->date_upd);
|
||||
|
||||
@ -87,8 +87,29 @@ class Order extends OrderCore {
|
||||
|
||||
public function printAppliIcons($value, $params)
|
||||
{
|
||||
$name = ((int)$value?'mobile':'computer');
|
||||
return '<img src="/img/'.$name.'.png" alt="" width="18px"/>';
|
||||
$name = ((int)$value?'mobile':'computer');
|
||||
return '<img src="/img/'.$name.'.png" alt="" width="18px"/>';
|
||||
}
|
||||
|
||||
public function printDeviceIcons($value, $params)
|
||||
{
|
||||
switch($value) {
|
||||
default:
|
||||
case 0:
|
||||
$name = 'computer';
|
||||
$icon = 'display';
|
||||
break;
|
||||
case 1:
|
||||
$name = 'application';
|
||||
$icon = 'android';
|
||||
break;
|
||||
case 2:
|
||||
$name = 'mobile';
|
||||
$icon = 'mobile';
|
||||
break;
|
||||
}
|
||||
|
||||
return '<span title="'.$name.'" class="anticon anticon-'.$icon.'"></span>';
|
||||
}
|
||||
|
||||
public function printCarrier($value, $params)
|
||||
@ -103,7 +124,6 @@ class Order extends OrderCore {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function getTotalbyDate($date_start, $date_end, $state = 0){
|
||||
if($state == 0){
|
||||
if($date_start == $date_end){
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -129,6 +129,15 @@ class Tools extends ToolsCore {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function isMobile()
|
||||
{
|
||||
if (_PS_MOBILE_ == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function isApi()
|
||||
{
|
||||
$subdomain = substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], '.'));
|
||||
|
Loading…
Reference in New Issue
Block a user