Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ordershipmentstatus.php
1
<?php
2
3
namespace
Bitrix\Sale\Helpers\Admin\Blocks
;
4
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\Localization\Loc
;
7
use
Bitrix\Sale\DeliveryStatus
;
8
use
Bitrix\Sale\Internals\StatusTable
;
9
use
Bitrix\Sale\Order
;
10
11
Loc::loadMessages
(__FILE__);
12
13
class
OrderShipmentStatus
14
{
15
public
static
function
getEdit
($shipment, $index = 0)
16
{
17
$data =
self::prepareData
($shipment);
18
19
return
self::getEditTemplate
($data, ++$index);
20
}
21
22
public
static
function
getEditTemplate
($data, $index)
23
{
24
return
'
25
<div class="adm-bus-pay">
26
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
27
<tbody>
28
<tr>
29
<td class="adm-detail-content-cell-l" width="40%">'
.Loc::getMessage(
'SALE_ORDER_SHIPMENT_STATUS'
).
':</td>
30
<td class="adm-detail-content-cell-r">'
.
31
\Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml(
32
"SHIPMENT["
.$index.
"][STATUS_ID]"
,
33
self::getShipmentStatusList($data[
'STATUS_ID'
]),
34
$data[
'STATUS_ID'
],
35
false
,
36
array(
37
"class"
=>
"adm-bus-select"
,
38
"id"
=>
"SHIPMENT_STATUS_ID"
39
)
40
)
41
.
'</td>
42
</tr>
43
</tbody>
44
</table>
45
</div>'
;
46
}
47
54
public
static
function
getShipmentStatusList
($status)
55
{
56
global $USER;
57
58
$shipmentStatuses = array();
59
60
$allStatusList =
DeliveryStatus::getAllStatusesNames
();
61
if
(array_key_exists($status, $allStatusList))
62
{
63
$shipmentStatuses[$status] = $allStatusList[$status] .
" ["
. $status .
"]"
;
64
}
65
66
$statusList =
DeliveryStatus::getAllowedUserStatuses
($USER->GetID(), $status);
67
if
(!empty($statusList) && is_array($statusList))
68
{
69
foreach
($statusList as $code => $title)
70
{
71
$shipmentStatuses[$code] = $title .
" ["
. $code .
"]"
;
72
}
73
}
74
return
$shipmentStatuses;
75
}
76
77
public
static
function
getView
(
Order
$order)
78
{
79
return
__METHOD__;
80
}
81
86
protected
static
function
prepareData
($shipment)
87
{
88
$data[
'STATUS_ID'
] = $shipment->getField(
'STATUS_ID'
);
89
return
$data;
90
}
91
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Sale\DeliveryStatus
Definition
deliverystatus.php:13
Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus
Definition
ordershipmentstatus.php:14
Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus\getEditTemplate
static getEditTemplate($data, $index)
Definition
ordershipmentstatus.php:22
Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus\getShipmentStatusList
static getShipmentStatusList($status)
Definition
ordershipmentstatus.php:54
Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus\getView
static getView(Order $order)
Definition
ordershipmentstatus.php:77
Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus\prepareData
static prepareData($shipment)
Definition
ordershipmentstatus.php:86
Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus\getEdit
static getEdit($shipment, $index=0)
Definition
ordershipmentstatus.php:15
Bitrix\Sale\Helpers\Order
Definition
order.php:10
Bitrix\Sale\Internals\StatusTable
Definition
status.php:30
Bitrix\Sale\StatusBase\getAllStatusesNames
static getAllStatusesNames($lang=null)
Definition
statusbase.php:285
Bitrix\Sale\StatusBase\getAllowedUserStatuses
static getAllowedUserStatuses($userId, $fromStatus)
Definition
statusbase.php:148
Bitrix\Sale\Helpers\Admin\Blocks
modules
sale
lib
helpers
admin
blocks
ordershipmentstatus.php
Создано системой
1.10.0