예제 #1
0
        if ($selectFieldsMap['ACTIVE']) {
            $row->AddCheckField('ACTIVE', false);
        }
        if ($selectFieldsMap['ACTIVE_FROM']) {
            $row->AddCalendarField('ACTIVE_FROM', false);
        }
        if ($selectFieldsMap['ACTIVE_TO']) {
            $row->AddCalendarField('ACTIVE_TO');
        }
    }
    $actions = array();
    $actions[] = array('ICON' => 'edit', 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_EDIT'), 'ACTION' => "(new BX.CAdminDialog({\n\t\t\t\t'content_url': '" . CUtil::JSEscape($urlEdit) . "',\n\t\t\t\t'content_post': 'bxpublic=Y',\n\t\t\t\t'draggable': true,\n\t\t\t\t'resizable': true,\n\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t})).Show();", 'DEFAULT' => true);
    if (!$couponsReadOnly) {
        $actions[] = array('ICON' => 'copy', 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_COPY'), 'ACTION' => "(new BX.CAdminDialog({\n\t\t\t\t'content_url': '" . CUtil::JSEscape($urlEdit . '&action=copy') . "',\n\t\t\t\t'content_post': 'bxpublic=Y',\n\t\t\t\t'draggable': true,\n\t\t\t\t'resizable': true,\n\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t})).Show();", 'DEFAULT' => false);
        if ($coupon['ACTIVE'] == 'Y') {
            $actions[] = array('ICON' => 'deactivate', 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DEACTIVATE'), 'ACTION' => $adminList->ActionDoGroup($coupon['ID'], 'deactivate'), 'DEFAULT' => false);
        } else {
            $actions[] = array('ICON' => 'activate', 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_ACTIVATE'), 'ACTION' => $adminList->ActionDoGroup($coupon['ID'], 'activate'), 'DEFAULT' => false);
        }
        $actions[] = array('SEPARATOR' => true);
        $actions[] = array('ICON' => 'delete', 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DELETE'), 'ACTION' => "if(confirm('" . Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DELETE_CONFIRM') . "')) " . $adminList->ActionDoGroup($coupon['ID'], 'delete'));
    }
    $row->AddActions($actions);
    unset($actions);
}
if (isset($row)) {
    unset($row);
}
if ($selectFieldsMap['CREATED_BY'] || $selectFieldsMap['MODIFIED_BY'] || $selectFieldsMap['USER_ID']) {
    if (!empty($userIDs)) {
        $userIterator = UserTable::getList(array('select' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'EMAIL'), 'filter' => array('ID' => array_keys($userIDs))));
예제 #2
0
     }
     if ($boolSubCatalog) {
         $row->AddInputField("CATALOG_QUANTITY", false);
         $row->AddSelectField("CATALOG_QUANTITY_TRACE", $arQuantityTrace, false);
         $row->AddInputField("CATALOG_WEIGHT", false);
     }
 }
 $arActions = array();
 if ($boolSubWorkFlow) {
     if (isset($arElementOps[$f_ID]) && isset($arElementOps[$f_ID]["element_edit_any_wf_status"])) {
         $STATUS_PERMISSION = 2;
     } else {
         $STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($row->arRes["WF_STATUS_ID"]);
     }
     $intMinPerm = 2;
     $arUnLock = array("ICON" => "unlock", "TEXT" => GetMessage("IBEL_A_UNLOCK"), "TITLE" => GetMessage("IBLOCK_UNLOCK_ALT"), "ACTION" => "if (confirm('" . GetMessageJS("IBLOCK_UNLOCK_CONFIRM") . "')) " . $lAdmin->ActionDoGroup($row->arRes['orig']['ID'], "unlock", $sThisSectionUrl));
     if ($row->arRes['orig']['LOCK_STATUS'] == "red") {
         if (CWorkflow::IsAdmin()) {
             $arActions[] = $arUnLock;
         }
     } else {
         if (isset($arElementOps[$f_ID]) && isset($arElementOps[$f_ID]["element_edit"]) && 2 <= $STATUS_PERMISSION) {
             if ($row->arRes['orig']['LOCK_STATUS'] == "yellow") {
                 $arActions[] = $arUnLock;
                 $arActions[] = array("SEPARATOR" => true);
             }
             $arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("IBEL_A_CHANGE"), "DEFAULT" => true, "ACTION" => "(new BX.CAdminDialog({\n\t\t\t\t\t\t\t'content_url': '/bitrix/admin/iblock_subelement_edit.php?WF=Y&type=" . CUtil::JSEscape(htmlspecialcharsbx($strSubIBlockType)) . "&IBLOCK_ID=" . $intSubIBlockID . "&lang=" . LANGUAGE_ID . "&PRODUCT_ID=" . $ID . "&ID=" . $row->arRes['orig']['ID'] . "&TMP_ID=" . urlencode($strSubTMP_ID) . $sThisSectionUrl . '&' . bitrix_sessid_get() . "',\n\t\t\t\t\t\t\t'content_post': '" . (!(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) ? '&bxsku=Y' : '') . "&bxpublic=Y',\n\t\t\t\t\t\t\t'draggable': true,\n\t\t\t\t\t\t\t'resizable': true,\n\t\t\t\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t\t\t\t})).Show();");
         }
         if ($boolIBlockElementAdd && 2 <= $STATUS_PERMISSION) {
             $arActions[] = array("ICON" => "copy", "TEXT" => GetMessage("IBEL_A_COPY_ELEMENT"), "ACTION" => "(new BX.CAdminDialog({\n\t\t\t\t\t\t\t'content_url': '/bitrix/admin/iblock_subelement_edit.php?WF=Y&type=" . CUtil::JSEscape(htmlspecialcharsbx($strSubIBlockType)) . "&IBLOCK_ID=" . $intSubIBlockID . "&lang=" . LANGUAGE_ID . "&PRODUCT_ID=" . $ID . "&ID=" . $row->arRes['orig']['ID'] . "&TMP_ID=" . urlencode($strSubTMP_ID) . "&action=copy" . $sThisSectionUrl . '&' . bitrix_sessid_get() . "',\n\t\t\t\t\t\t\t'content_post': '" . (!(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) ? '&bxsku=Y' : '') . "&bxpublic=Y',\n\t\t\t\t\t\t\t'draggable': true,\n\t\t\t\t\t\t\t'resizable': true,\n\t\t\t\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t\t\t\t})).Show();");
         }
         }
         if (array_key_exists('DATE_APPLY', $arSelectFieldsMap)) {
             $row->AddCalendarField("DATE_APPLY", array("size" => "10"));
         }
         if (array_key_exists('ONE_TIME', $arSelectFieldsMap)) {
             $row->AddSelectField("ONE_TIME", $arCouponType);
         }
         if (array_key_exists('DESCRIPTION', $arSelectFieldsMap)) {
             $row->AddInputField("DESCRIPTION");
         }
     }
     $arActions = array();
     $arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("DSC_UPDATE_ALT"), "DEFAULT" => true, "ACTION" => "(new BX.CAdminDialog({\n\t\t\t\t'content_url': '/bitrix/admin/cat_subcoupon_edit.php?ID=" . $arCouponDiscount['ID'] . "&DISCOUNT_ID=" . $intDiscountID . "&lang=" . LANGUAGE_ID . "&TMP_ID=" . $strSubTMP_ID . "',\n\t\t\t\t'content_post': 'bxpublic=Y',\n\t\t\t\t'draggable': true,\n\t\t\t\t'resizable': true,\n\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t})).Show();");
     if (!$boolCouponsReadOnly) {
         $arActions[] = array("SEPARATOR" => true);
         $arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("DSC_DELETE_ALT"), "ACTION" => "if(confirm('" . GetMessage('DSC_DELETE_CONF') . "')) " . $lAdmin->ActionDoGroup($arCouponDiscount['ID'], "delete"));
     }
     $row->AddActions($arActions);
 }
 if (isset($row)) {
     unset($row);
 }
 if (array_key_exists('CREATED_BY', $arSelectFieldsMap) || array_key_exists('MODIFIED_BY', $arSelectFieldsMap)) {
     if (!empty($arUserID)) {
         $rsUsers = CUser::GetList($by2 = 'ID', $order2 = 'ASC', array('ID' => implode(' || ', array_keys($arUserID))), array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME')));
         while ($arOneUser = $rsUsers->Fetch()) {
             $arOneUser['ID'] = intval($arOneUser['ID']);
             $arUserList[$arOneUser['ID']] = CUser::FormatName($strNameFormat, $arOneUser);
         }
     }
     foreach ($arRows as &$row) {
예제 #4
0
					&& isset($arElementOps[$f_ID]["element_edit_any_wf_status"])
			)
			{
				$STATUS_PERMISSION = 2;
			}
			else
			{
				$STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($row->arRes["WF_STATUS_ID"]);
			}
			$intMinPerm = 2;

			$arUnLock = array(
				"ICON" => "unlock",
				"TEXT" => GetMessage("IBEL_A_UNLOCK"),
				"TITLE" => GetMessage("IBLOCK_UNLOCK_ALT"),
				"ACTION" => "if (confirm('".GetMessageJS("IBLOCK_UNLOCK_CONFIRM")."')) ".$lAdmin->ActionDoGroup($row->arRes['orig']['ID'], "unlock", $sThisSectionUrl)
			);

			if ($row->arRes['orig']['LOCK_STATUS'] == "red")
			{
				if (CWorkflow::IsAdmin())
					$arActions[] = $arUnLock;
			}
			else
			{
				if (
					isset($arElementOps[$f_ID])
					&& isset($arElementOps[$f_ID]["element_edit"])
					&& (2 <= $STATUS_PERMISSION)
				)
				{
예제 #5
0
			'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_COPY'),
			'ACTION'=>"(new BX.CAdminDialog({
				'content_url': '".CUtil::JSEscape($urlEdit.'&action=copy')."',
				'content_post': 'bxpublic=Y',
				'draggable': true,
				'resizable': true,
				'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]
			})).Show();",
			'DEFAULT' => false,
		);
		if ($coupon['ACTIVE'] == 'Y')
		{
			$actions[] = array(
				'ICON' => 'deactivate',
				'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DEACTIVATE'),
				'ACTION' => $adminList->ActionDoGroup($coupon['ID'], 'deactivate'),
				'DEFAULT' => false,
			);
		}
		else
		{
			$actions[] = array(
				'ICON' => 'activate',
				'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_ACTIVATE'),
				'ACTION' => $adminList->ActionDoGroup($coupon['ID'], 'activate'),
				'DEFAULT' => false,
			);
		}
		$actions[] = array('SEPARATOR' => true);
		$actions[] = array(
			'ICON' =>'delete',
예제 #6
0
     $row->AddViewField('CATALOG_TYPE', $strProductType);
 }
 if ($bCatalog && isset($arSelectedFieldsMap['CATALOG_MEASURE'])) {
     if (isset($arElementOps[$f_ID]["element_edit_price"]) && $boolCatalogPrice) {
         $row->AddSelectField('CATALOG_MEASURE', $measureList);
     } else {
         $measureTitle = isset($measureList[$row->arRes['CATALOG_MEASURE']]) ? $measureList[$row->arRes['CATALOG_MEASURE']] : $measureList[0];
         $row->AddViewField('CATALOG_MEASURE', $measureTitle);
         unset($measureTitle);
     }
 }
 $arActions = array();
 $actionEdit = $lAdmin->getRowAction(CIBlock::GetAdminSubElementEditLink($intSubIBlockID, $intSubPropValue, $row->arRes['orig']['ID'], array('WF' => 'Y', 'TMP_ID' => $strSubTMP_ID), $sThisSectionUrl, defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1));
 $actionCopy = $lAdmin->getRowAction(CIBlock::GetAdminSubElementEditLink($intSubIBlockID, $intSubPropValue, $row->arRes['orig']['ID'], array('WF' => 'Y', 'TMP_ID' => $strSubTMP_ID, 'action' => 'copy'), $sThisSectionUrl, defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1));
 if ($row->arRes['ACTIVE'] == 'Y') {
     $arActive = array("TEXT" => GetMessage("IBSEL_A_DEACTIVATE"), "ACTION" => $lAdmin->ActionDoGroup($row->arRes['orig']['ID'], "deactivate", $sThisSectionUrl), "ONCLICK" => "");
 } else {
     $arActive = array("TEXT" => GetMessage("IBSEL_A_ACTIVATE"), "ACTION" => $lAdmin->ActionDoGroup($row->arRes['orig']['ID'], "activate", $sThisSectionUrl), "ONCLICK" => "");
 }
 $clearCounter = array("TEXT" => GetMessage('IBSEL_A_CLEAR_COUNTER'), "TITLE" => GetMessage('IBSEL_A_CLEAR_COUNTER_TITLE'), "ACTION" => "if (confirm('" . GetMessageJS("IBSEL_A_CLEAR_COUNTER_CONFIRM") . "')) " . $lAdmin->ActionDoGroup($row->arRes['orig']['ID'], "clear_counter", $sThisSectionUrl), "ONCLICK" => "");
 if ($boolSubWorkFlow) {
     if (isset($arElementOps[$f_ID]) && isset($arElementOps[$f_ID]["element_edit_any_wf_status"])) {
         $STATUS_PERMISSION = 2;
     } else {
         $STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($row->arRes["WF_STATUS_ID"]);
     }
     $intMinPerm = 2;
     $arUnLock = array("ICON" => "unlock", "TEXT" => GetMessage("IBEL_A_UNLOCK"), "TITLE" => GetMessage("IBLOCK_UNLOCK_ALT"), "ACTION" => "if (confirm('" . GetMessageJS("IBLOCK_UNLOCK_CONFIRM") . "')) " . $lAdmin->ActionDoGroup($row->arRes['orig']['ID'], "unlock", $sThisSectionUrl));
     if ($row->arRes['orig']['LOCK_STATUS'] == "red") {
         if (CWorkflow::IsAdmin()) {
             $arActions[] = $arUnLock;