} if ($id > 0) { $APPLICATION->SetTitle(str_replace("#ID#", $id, GetMessage("COMPANY_TITLE_UPDATE"))); } else { $APPLICATION->SetTitle(GetMessage("COMPANY_TITLE_ADD")); } require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php"; if ($id > 0) { $select = array('*', 'CREATED', 'MODIFIED'); $filter = array('ID' => $id); $fields = $USER_FIELD_MANAGER->GetUserFields(CompanyTable::getUfId()); foreach ($fields as $field) { $select[] = $field['FIELD_NAME']; } $params = array('select' => $select, 'filter' => $filter); $res = CompanyTable::getList($params); $company = $res->fetch(); } if (!empty($errorMessage)) { CAdminMessage::ShowMessage($errorMessage); } $aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("COMPANY_TAB"), "ICON" => "catalog", "TITLE" => GetMessage("COMPANY_TAB_DESCR"))); $tabControl = new CAdminForm("company_edit", $aTabs); $tabControl->BeginPrologContent(); echo $USER_FIELD_MANAGER->ShowScript(); $tabControl->EndPrologContent(); $tabControl->BeginEpilogContent(); echo bitrix_sessid_post(); ?> <input type="hidden" name="update" value="Y"> <input type="hidden" name="lang" value="<?php
private static function getViewTemplate($data, $index, $form) { $psData = self::getPaySystemParams($data['PAY_SYSTEM_ID'], $data['PERSON_TYPE_ID']); if (isset($psData["LOGOTIP_PATH"])) { $data['PAY_SYSTEM_LOGOTIP'] = $psData["LOGOTIP_PATH"]; } $psResult = ''; if ($psData['HAVE_RESULT'] == 'Y' && $form != 'edit') { $psResult .= ' <span style="border-bottom: 1px dashed #658d0f; color: #658d0f; cursor: pointer" id="ps_update">Получить</span>'; } $lang = Main\Application::getInstance()->getContext()->getLanguage(); $paidString = $data['PAID'] == 'Y' ? 'YES' : 'NO'; $isActive = $form != 'edit'; $triangle = $isActive ? '<span class="triangle"> ▾</span>' : ''; if ($data['PAID'] == 'Y') { $class = !$isActive ? 'class="not_active"' : ''; } else { $class = !$isActive ? 'class="notpay not_active"' : 'class="notpay"'; } $paymentStatus = '<span><span id="BUTTON_PAID_' . $index . '" ' . $class . '>' . Loc::getMessage('SALE_ORDER_PAYMENT_STATUS_' . $paidString) . '</span>' . $triangle . '</span>'; $res = CompanyTable::getList(array('select' => array('NAME'), 'filter' => array('ID' => $data['COMPANY_ID']))); $company = $res->fetch(); $paymentStatusBlockVoucherNum = ''; if (strlen($data['PAY_VOUCHER_NUM']) > 0) { $paymentStatusBlockVoucherNum = '<tr> <td class="adm-detail-content-cell-l" width="40%"><br>' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_VOUCHER_NUM') . ':</td> <td class="adm-detail-content-cell-r tal"> <br> ' . htmlspecialcharsbx($data['PAY_VOUCHER_NUM']) . ' </td> </tr>'; } $paymentStatusBlockVoucherDate = ''; if (strlen($data['PAY_VOUCHER_DATE']) > 0) { $paymentStatusBlockVoucherDate = '<tr> <td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_VOUCHER_DATE') . ':</td> <td class="adm-detail-content-cell-r tal"> <div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">' . htmlspecialcharsbx($data['PAY_VOUCHER_DATE']) . '</div> </td> </tr>'; } $paymentStatusBlockReturnNum = ''; if (strlen($data['PAY_RETURN_NUM']) > 0) { $paymentStatusBlockReturnNum = '<tr> <td class="adm-detail-content-cell-l" width="40%"><br>' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_NUM') . ':</td> <td class="adm-detail-content-cell-r tal"> <br>' . htmlspecialcharsbx($data['PAY_RETURN_NUM']) . '</td> </tr>'; } $paymentStatusBlockReturnDate = ''; if (strlen($data['PAY_RETURN_DATE']) > 0) { $paymentStatusBlockReturnDate = '<tr> <td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_DATE') . ':</td> <td class="adm-detail-content-cell-r tal"> <div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">' . htmlspecialcharsbx($data['PAY_RETURN_DATE']) . '</div> </td> </tr>'; } $result = ' <div> <div class="adm-bus-pay" id="payment_container_' . $index . '"> <input type="hidden" name="PAYMENT[' . $index . '][PAYMENT_ID]" id="PAYMENT_ID_' . $index . '" value="' . $data['ID'] . '"> <div class="adm-bus-component-content-container"> <div class="adm-bus-pay-section"> <div class="adm-bus-pay-section-title-container"> <div class="adm-bus-pay-section-title">' . Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_EDIT_PAYMENT_TITLE') . ' <span id="payment_' . $data['ID'] . '">#' . $data['ID'] . '</span>' . ($data['PAY_VOUCHER_DATE'] ? ' ' . Loc::getMessage('SALE_ORDER_PAYMENT_FROM') . ' ' . $data['PAY_VOUCHER_DATE'] : '') . '</div> <div class="adm-bus-pay-section-action-block"> <div class="adm-bus-pay-section-action" id="SECTION_' . $index . '_DELETE">' . Loc::getMessage('SALE_ORDER_PAYMENT_DELETE') . '</div> <div class="adm-bus-pay-section-action" id="SECTION_' . $index . '_EDIT"><a href="/bitrix/admin/sale_order_payment_edit.php?order_id=' . $data['ORDER_ID'] . '&payment_id=' . $data['ID'] . '&backurl=' . urlencode($_SERVER['REQUEST_URI']) . '">' . Loc::getMessage('SALE_ORDER_PAYMENT_EDIT') . '</a></div> <div class="adm-bus-pay-section-action" id="SECTION_' . $index . '_TOGGLE">' . Loc::getMessage('SALE_ORDER_PAYMENT_TOGGLE_UP') . '</div> </div> </div> <div class="adm-bus-pay-section-content" id="SECTION_' . $index . '"> <div class="adm-bus-pay-section-sidebar"> <div class="adm-bus-pay-section-sidebar-service-logo"> <img id="LOGOTIP_' . $index . '" src="' . $data['PAY_SYSTEM_LOGOTIP'] . '" alt=""> </div> </div> <div class="adm-bus-pay-section-right"> <div class="adm-bus-table-container caption border"> <div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_METHOD') . '</div> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table "> <tbody> <tr> <td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_SYSTEM') . ':</td> <td class="adm-detail-content-cell-r">' . htmlspecialcharsbx($data['PAY_SYSTEM_NAME']) . ' ' . $psResult . '</td> </tr> </tbody> </table> </div> <div class="adm-bus-table-container caption border"> <div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_SUM') . '</div> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table "> <tbody> <tr> <td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAYABLE_SUM') . ':</td> <td class="adm-detail-content-cell-r tal">' . SaleFormatCurrency($data['SUM'], $data['CURRENCY']) . '<br></td> </tr> </tbody> </table> </div> <div class="adm-bus-table-container caption border" style="padding-top:10px;"> <div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_STATUS') . '</div> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table alternation edit-table" id="PAYMENT_BLOCK_STATUS_' . $index . '"> <tbody> <tr> <td class="adm-detail-content-cell-l vat payment-status" width="40%"> ' . $paymentStatus . ' </td> <td class="adm-detail-content-cell-r tal" id="PAYMENT_CHANGE_USER_INFO_' . $index . '"> ' . $data['DATE_PAID'] . ' <a href="/bitrix/admin/user_edit.php?lang=' . $lang . '&ID=' . $data['EMP_PAID_ID'] . '">' . htmlspecialcharsbx($data['EMP_PAID_ID_NAME']) . ' ' . htmlspecialcharsbx($data['EMP_PAID_ID_LAST_NAME']) . '</a> </td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table"> <tbody> ' . $paymentStatusBlockVoucherNum . $paymentStatusBlockVoucherDate . $paymentStatusBlockReturnNum . $paymentStatusBlockReturnDate . ' </tbody> </table> </div>'; if (isset($data['PS_STATUS']) && !empty($data['PS_STATUS'])) { $result .= '<div class="adm-bus-table-container caption border"> <div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS_TITLE') . '</div> <a href="javascript:void(0);" id="PS_INFO_' . $index . '">' . Loc::getMessage('SALE_ORDER_PAYMENT_TOGGLE_DOWN') . '</a> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table" style="display: none"> <tbody> <tr> <td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS') . ':</td> <td class="adm-detail-content-cell-r tal">' . htmlspecialcharsbx($data['PS_STATUS']) . '</td> </tr> <tr> <td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS_CODE') . ':</td> <td class="adm-detail-content-cell-r tal">' . htmlspecialcharsbx($data['PS_STATUS_CODE']) . '</td> </tr> <tr> <td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS_DESCRIPTION') . ':</td> <td class="adm-detail-content-cell-r tal">' . htmlspecialcharsbx($data['PS_STATUS_DESCRIPTION']) . '</td> </tr> <tr> <td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_CURRENCY') . ':</td> <td class="adm-detail-content-cell-r tal">' . htmlspecialcharsbx($data['PS_CURRENCY']) . '</td> </tr> <tr> <td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_SUM') . ':</td> <td class="adm-detail-content-cell-r tal">' . htmlspecialcharsbx($data['PS_SUM']) . '</td> </tr> <tr> <td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_DATE') . ':</td> <td class="adm-detail-content-cell-r tal">' . htmlspecialcharsbx($data['PS_RESPONSE_DATE']) . '</td> </tr> </tbody> </table> </div>'; } $result .= '<div class="adm-bus-table-container caption border"> <div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_COMPANY') . '</div> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table "> <tbody> <tr> <td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_COMPANY_BY') . ':</td> <td class="adm-detail-content-cell-r">' . (isset($company['NAME']) && !empty($company['NAME']) ? htmlspecialcharsbx($company['NAME']) : Loc::getMessage('SALE_ORDER_PAYMENT_NO_COMPANY')) . '</td> </tr> </tbody> </table> </div> </div> <div class="clb"></div> </div> ' . self::getShortViewTemplate($data, $index, $form) . ' </div> </div> </div> </div>'; $params = array('index' => $index, 'functionOnSave' => 'sendAjax', 'viewForm' => true, 'isPaid' => $data['PAID'] == 'Y', 'isAvailableChangeStatus' => $isActive); $result .= self::initJsPayment($params); return $result; }
<select name="filter_pay_system_id"> <option value="NOT_REF">(<?php echo GetMessage("PAYMENT_ORDER_PAID_ALL"); ?> )</option> <?php foreach ($paySystems as $paySystem) { echo '<option value="' . $paySystem['ID'] . '">' . htmlspecialcharsbx($paySystem['NAME']) . '</option>'; } ?> </select> </td> </tr> <?php $params = array('select' => array('ID', 'NAME')); $res = \Bitrix\Sale\Internals\CompanyTable::getList($params); $companies = $res->fetchAll(); ?> <tr> <td><?php echo GetMessage("PAYMENT_ACCOUNT_NUM"); ?> :</td> <td> <input type="text" name="filter_account_num" value="<?php echo htmlspecialcharsbx($filter_account_num); ?> "> </td> </tr> <tr>
} else { $lAdmin->AddGroupError(Loc::getMessage("SALE_COMPANY_ERROR_DELETE"), $id); } } $conn->commitTransaction(); break; } } } $fields = $USER_FIELD_MANAGER->GetUserFields(CompanyTable::getUfId()); $select = array('*'); foreach ($fields as $field) { $select[] = $field['FIELD_NAME']; } $params = array('select' => $select, 'filter' => $filter, 'order' => array($by => $order)); $company = CompanyTable::getList($params); $dbResultList = new CAdminResult($company, $sTableID); $dbResultList->NavStart(); $lAdmin->NavText($dbResultList->GetNavPrint(Loc::getMessage("SALE_COMPANY"))); $headers = array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "ACTIVE", "content" => Loc::getMessage("SALE_COMPANY_ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "NAME", "content" => Loc::getMessage("SALE_COMPANY_NAME"), "sort" => "NAME", "default" => true), array("id" => "LOCATION_ID", "content" => Loc::getMessage("SALE_COMPANY_LOCATION_ID"), "sort" => "LOCATION_ID", "default" => true), array("id" => "CODE", "content" => Loc::getMessage("SALE_COMPANY_CODE"), "sort" => "CODE", "default" => true)); $USER_FIELD_MANAGER->AdminListAddHeaders(CompanyTable::getUfId(), $headers); $lAdmin->AddHeaders($headers); $allSelectedFields = array("ID" => false, "ACTIVE" => false, "NAME" => false, "LOCATION_ID" => false, "CODE" => false); $selectedFields = $lAdmin->GetVisibleHeaderColumns(); $allSelectedFields = array_merge($allSelectedFields, array_fill_keys($selectedFields, true)); while ($company = $dbResultList->NavNext(true, "f_")) { $res = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($company['LOCATION_ID'], array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => Application::getInstance()->getContext()->getLanguage()))); $path = array(); while ($item = $res->fetch()) { $path[] = $item['CHAIN']; }
public static function getCompanyList() { if (empty(self::$companies)) { $dbRes = CompanyTable::getList(array('select' => array('ID', 'NAME'), 'filter' => array('ACTIVE' => 'Y'))); $result = array(); while ($company = $dbRes->fetch()) { $result[$company["ID"]] = $company["NAME"] . " [" . $company["ID"] . "]"; } self::$companies = $result; } return self::$companies; }