Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ordershipmentstatus.php
1<?php
2
4
10
11Loc::loadMessages(__FILE__);
12
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}
static loadMessages($file)
Definition loc.php:64
static getAllStatusesNames($lang=null)
static getAllowedUserStatuses($userId, $fromStatus)