当前位置: 首页>>代码示例>>PHP>>正文


PHP CIBlockElement::Update方法代码示例

本文整理汇总了PHP中CIBlockElement::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::Update方法的具体用法?PHP CIBlockElement::Update怎么用?PHP CIBlockElement::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIBlockElement的用法示例。


在下文中一共展示了CIBlockElement::Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: transformTags

 public function transformTags($aOldTags, $aNewTags, $bSaveOldTags = false, $sOperation = false)
 {
     $aElements = $this->getMaterialsByTags($aOldTags);
     $mResult = array('iTotalElements' => count($aElements), 'iProcessedElements' => 0, 'aErrorElementID' => array());
     if (!empty($aElements)) {
         $oElement = new CIBlockElement();
         foreach ($aElements as $aElement) {
             $aTags = explode(',', $aElement['TAGS']);
             $aNewTags = array_map('trim', array_unique(array_merge($aTags, $aNewTags)));
             if (!$bSaveOldTags) {
                 foreach ($aNewTags as $iKey => &$sTag) {
                     $sTag = trim($sTag);
                     if (in_array($sTag, $aOldTags)) {
                         unset($aNewTags[$iKey]);
                     }
                 }
             }
             //var_dump($aElement['TAGS'],implode( ', ', $aNewTags ) );
             $bResult = $oElement->Update($aElement['ID'], array('TAGS' => implode(', ', $aNewTags)));
             if ($bResult) {
                 $mResult['iProcessedElements']++;
             } else {
                 $mResult['aErrorElementID'][] = array('ID' => $aElement['ID'], 'IBLOCK_ID' => $aElement['IBLOCK_ID'], 'FORMATTED_LINK' => $this->getElementLink($aElement));
             }
         }
     }
     return $mResult;
 }
开发者ID:ASDAFF,项目名称:Bitrix.TagsManager,代码行数:28,代码来源:CTagsManagerDriver_IBlock.class.php

示例2: CIBlockElement

 function WF_Restore($ID)
 {
     $obElement = new CIBlockElement();
     $rsElement = $obElement->GetByID($ID);
     if ($arElement = $rsElement->Fetch()) {
         if (strlen($arElement["WF_PARENT_ELEMENT_ID"]) > 0) {
             $arElement["PROPERTY_VALUES"] = array();
             $rsProperties = $obElement->GetProperty($arElement["IBLOCK_ID"], $arElement["WF_PARENT_ELEMENT_ID"], "sort", "asc", array("PROPERTY_TYPE" => "F"));
             while ($arProperty = $rsProperties->Fetch()) {
                 if (!array_key_exists($arProperty["ID"], $arElement["PROPERTY_VALUES"])) {
                     $arElement["PROPERTY_VALUES"][$arProperty["ID"]] = array();
                 }
                 $arElement["PROPERTY_VALUES"][$arProperty["ID"]][$arProperty["PROPERTY_VALUE_ID"]] = array("del" => "Y");
             }
             $n = 1;
             $rsProperties = $obElement->GetProperty($arElement["IBLOCK_ID"], $arElement["ID"]);
             while ($arProperty = $rsProperties->Fetch()) {
                 if (!array_key_exists($arProperty["ID"], $arElement["PROPERTY_VALUES"])) {
                     $arElement["PROPERTY_VALUES"][$arProperty["ID"]] = array();
                 }
                 if ($arProperty["PROPERTY_TYPE"] == "F") {
                     $arElement["PROPERTY_VALUES"][$arProperty["ID"]]["n" . $n] = array("VALUE" => $arProperty["VALUE"], "DESCRIPTION" => $arProperty["DESCRIPTION"]);
                     $n++;
                 } else {
                     $arElement["PROPERTY_VALUES"][$arProperty["ID"]][$arProperty["PROPERTY_VALUE_ID"]] = array("VALUE" => $arProperty["VALUE"], "DESCRIPTION" => $arProperty["DESCRIPTION"]);
                 }
             }
             return $obElement->Update($arElement["WF_PARENT_ELEMENT_ID"], $arElement, true);
         }
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:32,代码来源:iblockelement.php

示例3: update

 /**
  * Обновляет элемент
  *
  * @param int $id
  * @param array $fields
  * @param array $properties
  *
  * @return bool
  */
 public function update($id, array $fields, array $properties = array())
 {
     if ($this->iBEGateway->Update($id, $fields)) {
         if (!empty($properties)) {
             $item = $this->find($id, array('ID', 'IBLOCK_ID'), false);
             \CIBlockElement::SetPropertyValuesEx($id, $item['IBLOCK_ID'], $properties);
         }
         return true;
     }
     return false;
 }
开发者ID:rocko61rus,项目名称:QuetzalTools,代码行数:20,代码来源:IBlockElementManager.php

示例4: deactivatedProducts

	/**
	 * [deactivatedProducts description]
	 * @param  array $arProducts
	 * @return bool
	 */
	protected function deactivatedProducts($arProducts){
		if (!CModule::IncludeModule("iblock")):
			return false;
		endif;
		$el = new CIBlockElement;
		$arLoadProductArray = Array("ACTIVE" => "N");
		foreach ($arProducts as $key => $prod) :
			if(!$el->Update($prod["ID"], $arLoadProductArray)):
				return false;
			endif;
		endforeach;
		return true;
	}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:18,代码来源:actionProducts.php

示例5: no_active_stock

/**
 * Выключает прошедшие акции
 * User: Tabota Oleg (sForge.ru)
 * Date: 18.11.12 16:20
 * File name: no_active_stock.php
 */
function no_active_stock()
{
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
    CModule::IncludeModule("iblock");
    $sort = array("SORT" => "ASC");
    $filter = array("ACTIVE" => "Y", "IBLOCK_ID" => IB_SUB_STOCK_ID, "<DATE_ACTIVE_TO" => date("d.m.Y"));
    $select = array("ID", "IBLOCK_ID");
    $ob = CIBlockElement::GetList($sort, $filter, FALSE, FALSE, $select);
    while ($row = $ob->Fetch()) {
        $el = new CIBlockElement();
        $el->Update(intval($row['ID']), array("ACTIVE" => "N"));
    }
    return "no_active_stock();";
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:20,代码来源:no_active_stock.php

示例6: RenameLinkOnPages

 /**
  * Renames inner links, and categories on wiki pages
  * alternatively you must do that manualy, after page, or catgory was renamed.
  * @param int $iBlockId (mandatory)- id of iblock witch contain page, or category.
  * @param str $oldName (mandatory)- old page or category name.
  * @param str $newName (mandatory)- new page or category name.
  * @param int $iBlockSectId (optional) - id of iBlock section witch contain page, or category.
  *			if wiki used with socnet groups, this param must be setted, otherwise all pages of all soc. groups
  *			will be changed.
  * @return int the amount of changed pages.
  */
 public function RenameLinkOnPages($iBlockId, $oldName, $newName, $iBlockSectId = false)
 {
     if (!$iBlockId || !$oldName || !$newName) {
         return false;
     }
     $arFilter["IBLOCK_ID"] = $iBlockId;
     $arFilter["CHECK_PERMISSIONS"] = "N";
     if ($iBlockSectId) {
         $arFilter["SECTION_ID"] = $iBlockSectId;
         $arFilter["INCLUDE_SUBSECTIONS"] = "Y";
     }
     $count = 0;
     $sCatName = '';
     $isCategory = CWikiUtils::IsCategoryPage($oldName, $sCatName);
     $catSearch = "[[" . GetMessage('CATEGORY_NAME') . ":" . $sCatName . "]]";
     $arPatterns = array(array("search" => "[[" . $oldName . "|" . $oldName . "]]", "pattern" => "/\\[\\[(" . preg_quote($oldName) . ")\\|(" . preg_quote($oldName) . ")\\]\\]/isU" . BX_UTF_PCRE_MODIFIER, "replacement" => "[[" . $newName . "|" . $newName . "]]"), array("search" => "[[" . $oldName . "|", "pattern" => "/\\[\\[(" . preg_quote($oldName) . ")\\|(.*)\\]\\]/isU" . BX_UTF_PCRE_MODIFIER, "replacement" => "[[" . $newName . "|\$2]]"), array("search" => "[[" . $oldName . "]]", "pattern" => "/\\[\\[" . preg_quote($oldName) . "\\]\\]/isU" . BX_UTF_PCRE_MODIFIER, "replacement" => "[[" . $newName . "]]"));
     $dbRes = CIBlockElement::GetList(array(), $arFilter, false, false, array("ID", "NAME", "DETAIL_TEXT"));
     while ($arElement = $dbRes->GetNext()) {
         $bChanged = false;
         $newText = $arElement["~DETAIL_TEXT"];
         foreach ($arPatterns as $arPattern) {
             if (strpos($newText, $arPattern["search"]) !== false) {
                 $newText = preg_replace($arPattern["pattern"], $arPattern["replacement"], $newText);
                 $bChanged = true;
             }
         }
         if ($isCategory) {
             if (strpos($newText, $catSearch) !== false) {
                 $newText = $this->RenameCategoryOnPage($newText, $sCatName, $newName);
                 $bChanged = true;
             }
         }
         if ($bChanged) {
             $this->CleanCache($arElement["ID"], $arElement["NAME"], $iBlockId);
             $this->cIB_E->Update($arElement["ID"], array("DETAIL_TEXT" => $newText), false, true);
             self::MarkPageAsUpdated($iBlockId, $iBlockSectId, $arElement["NAME"]);
             $count++;
         }
     }
     return $count;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:52,代码来源:wiki.php

示例7: EditAbsence

function EditAbsence($arFields)
{
    global $iblockID;
    if (CModule::IncludeModule('iblock')) {
        $PROP = array();
        $db_absence = CIBlockProperty::GetList(array(), array("CODE" => "ABSENCE_TYPE", "IBLOCK_ID" => $iblockID));
        if ($ar_absence = $db_absence->Fetch()) {
            $PROP[$ar_absence['ID']] = array($arFields["ABSENCE_TYPE"]);
        }
        $db_user = CIBlockProperty::GetList(array(), array("CODE" => "USER", "IBLOCK_ID" => $iblockID));
        if ($ar_user = $db_user->Fetch()) {
            $PROP[$ar_user['ID']] = array($arFields["USER_ID"]);
        }
        $arNewFields = array("NAME" => $arFields["NAME"], "PROPERTY_VALUES" => $PROP, "ACTIVE_FROM" => $arFields["ACTIVE_FROM"], "ACTIVE_TO" => $arFields["ACTIVE_TO"], "IBLOCK_ID" => $iblockID);
        $element = new CIBlockElement();
        $ID = $element->Update(intval($arFields["absence_element_id"]), $arNewFields);
    }
    if (!$ID) {
        $arErrors = preg_split("/<br>/", $element->LAST_ERROR);
        return $arErrors;
    } else {
        return $ID;
    }
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:24,代码来源:absence.php

示例8: seaseon

function seaseon()
{
$tek_date = date("d.m"); //формат текущей даты 01.01
	$tek_day = date("d");
	$tek_month = date("m");
	//Активируем либо дезактивируем элементы по их сезонности
	
	CModule::IncludeModule("iblock");
	$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","CODE","*");
	$arFilter = Array("IBLOCK_ID"=>2);
	$res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
	
	while($ob = $res->GetNextElement()){

		$arProps = $ob->GetProperties();
		$arFields = $ob->GetFields();

		if(isset($arProps['season']['VALUE_XML_ID']))
		{
			$a = 0;
			foreach($arProps['season']['VALUE_XML_ID'] as $season)
			{
				$season = explode("-",$season);

				$sean_start = $season[0];
				//$sean_start_day = explode(".",$sean_start)[0];
				//$sean_start_month = explode(".",$sean_start)[1];				
				
				$sean_finish = $season[1];
				//$sean_finish_day = explode(".",$sean_finish)[0];
				//$sean_finish_month = explode(".",$sean_finish)[1];	

				if(($tek_day >= $sean_start_day && $tek_day <= $sean_finish_day) && ($tek_month >= $sean_start_month && $tek_month <= $sean_finish_month))
				{
						//echo $season;
						$el = new CIBlockElement;
						$arLoadProductArray = Array(
						  "MODIFIED_BY"    => $USER->GetID(), // элемент изменен текущим пользователем
						  "ACTIVE"         => "Y"            // активен
						  );

						$PRODUCT_ID = $arFields['ID'];  // изменяем элемент с кодом (ID) 2
						$result = $el->Update($PRODUCT_ID, $arLoadProductArray);
						$a = 1;
				}
				else
				{
					$el = new CIBlockElement;
						$arLoadProductArray = Array(
						  "MODIFIED_BY"    => $USER->GetID(), // элемент изменен текущим пользователем
						  "ACTIVE"         => "N"            // активен
						  );
						$PRODUCT_ID = $arFields['ID'];  // изменяем элемент с кодом (ID) 2
						$result = $el->Update($PRODUCT_ID, $arLoadProductArray);
				}
				if($a == 1) break;
			}
		}
	}
}
开发者ID:CheBurashka334,项目名称:crado,代码行数:60,代码来源:init.php

示例9: array

				if ($_REQUEST['action'] == 'upload') {
					// Сохраним файл
					$arrFile = $_FILES[$strNameField];
					$arrFile['MODULE_ID'] = 'iblock';

					if (isset($arrAdvert[$arrField[$strNameField]])) {
						$arrFile['old_file'] = $arrAdvert[$arrField[$strNameField]];
						$arrFile['del'] = ${$arrField[$strNameField].'_del'};
					}//\\ if
					$res = CFile::CheckImageFile($arrFile, 20971520, 4000, 4000);
					if (strlen($res)) {
						$arrResult['error'] = $res;
						$arrResult['result'] = 'fail';
					} else {
						$el = new CIBlockElement;
						$res = $el->Update($intAdvertID, array($arrField[$strNameField] => $arrFile));
						if(!$res) {
							$arrResult['error'] = $el->LAST_ERROR;
							$arrResult['result'] = 'fail';
						} else {
							$objE = CIBlockElement::GetList(array(), array('IBLOCK_ID' => $intBlockID, 'ID' => $intAdvertID, 'SECTION_ID' => $intRootSection, 'INCLUDE_SUBSECTIONS' => 'Y', 'ACTIVE' => 'Y'));
							if ($arrAdvert = $objE->GetNext()) {
								$arrPhoto = CFile::ResizeImageGet($arrAdvert[$arrField[$strNameField]], array('width' => 100, 'height' => 100), BX_RESIZE_IMAGE_EXACT, true);
								$arrResult['src'] = $arrPhoto['src'];
							}
						}//\\ if
					}//\\ if
				}//\\ if
			} elseif(isset($arrFieldProp[$strNameField])) {
				if ($_REQUEST['action'] == 'upload') {
					// Сохраним файл
开发者ID:ASDAFF,项目名称:Bitrix.autosave.form,代码行数:31,代码来源:save.php

示例10: CIBlockElement

					continue;
				}
				if ($bBizproc)
					call_user_func(array(ENTITY, "UnlockDocument"), $ID, "");
				else
					CIBlockElement::WF_UnLock($ID);
			}
			break;
		case 'clear_counter':
			if ($TYPE=="E")
			{
				if(CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit"))
				{
					$obE = new CIBlockElement();
					$arFields = array('SHOW_COUNTER' => false, 'SHOW_COUNTER_START' => false);
					if(!$obE->Update($ID, $arFields, false, false))
						$lAdmin->AddGroupError(GetMessage("IBLIST_A_SAVE_ERROR", array("#ID#" => $ID, "#ERROR_MESSAGE#" => $obE->LAST_ERROR)), $TYPE.$ID);
				}
				else
				{
					$lAdmin->AddGroupError(GetMessage("IBLIST_A_UPDERR_ACCESS", array("#ID#" => $ID)), $TYPE.$ID);
				}
			}
			break;
		}
	}

	if(isset($return_url) && strlen($return_url)>0)
		LocalRedirect($return_url);
}
开发者ID:nycmic,项目名称:bittest,代码行数:30,代码来源:iblock_list_admin.php

示例11: saveToIBElement

 /**
  * @param int $elementID
  * @param int $target
  * @param string $description
  * @return bool
  * @throws RequestError
  */
 public function saveToIBElement($elementID, $target = self::F_IB_IMG_DETAIL, $description = '')
 {
     if (true !== $this->_bRequestSuccess && true !== $this->_bDownloadSuccess) {
         return false;
     }
     if ($this->_ID === null) {
         $this->_ID = static::generateID();
     }
     if (!CheckDirPath(OBX_DOC_ROOT . static::DOWNLOAD_FOLDER . '/' . $this->_ID)) {
         throw new RequestError('', RequestError::E_PERM_DENIED);
     }
     $downloadFileRelPath = $this->getDownloadFilePath(false);
     if ($this->_bDownloadSuccess) {
         $arFile = \CFile::MakeFileArray($downloadFileRelPath);
     } elseif ($this->_bRequestSuccess) {
         $this->saveToFile($downloadFileRelPath);
         $this->_saveFileName = null;
         $this->_saveRelPath = null;
         $this->_savePath = null;
         $arFile = \CFile::MakeFileArray($downloadFileRelPath);
     }
     $arFile['name'] = $this->_originalName . '.' . $this->_originalExt;
     if (is_string($description) && !empty($description)) {
         $arFile['description'] = $description;
     }
     $el = new \CIBlockElement();
     $arFields = array();
     if ($target === self::F_IB_IMG_PREVIEW) {
         $arFields['PREVIEW_PICTURE'] = $arFile;
     } elseif ($target === self::F_IB_IMG_DETAIL) {
         $arFields['DETAIL_PICTURE'] = $arFile;
     } elseif ($target === self::F_IB_IMG_BOTH) {
         $arFields['PREVIEW_PICTURE'] = $arFile;
         $arFields['DETAIL_PICTURE'] = $arFile;
     }
     return $el->Update($elementID, $arFields);
 }
开发者ID:OpenBX,项目名称:obx.core,代码行数:44,代码来源:requestbxfile.php

示例12: OnPayads

/**
 * @param $id ID заказа
 * @param $val статус оплаты Y или N
 * функция после подтверждения оплаты
 * изменяет статус объявления на VIP
 */

function OnPayads($id,$val)
{
    // Если оплата Y
    if($val == 'Y')
    {
        //SendEmailPartnerByOrder($id, "SALE_ORDER_PAIDPARTNER");
        $dbBasketItems = CSaleBasket::GetList(
            array("PRICE" => "DESC"),
            array(
                "ORDER_ID" => $id
            ),
            false,
            false,
            array("ID", "NAME")
        );

        while ($arBasketItems = $dbBasketItems->Fetch())
        {

            $dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasketItems["ID"]));
            if($arProp = $dbProp -> GetNext())
            {

                $dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasketItems["ID"]));
                if($arProp = $dbProp -> GetNext())
                {

                    if($arProp['CODE']=='TEST_VIP'){
                        $status_true=true;
                        $ELEMENT_ID = intval($arProp['VALUE']);
                        $PROPERTY_CODE = "VIPORDERCHECK";
                        $PROPERTY_VALUE = "Y";
                        if (CModule::IncludeModule("iblock"))
                            CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => $PROPERTY_VALUE));

                    }
                    if($arProp['CODE']=='TEST_ADSUP'){
                        $status_true=true;
                        $ELEMENT_ID = intval($arProp['VALUE']);
                        $PROPERTY_CODE = "ADSUP";
                        $PROPERTY_VALUE = "Y";
                        if (CModule::IncludeModule("iblock")){
                            //CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => $PROPERTY_VALUE));
                            $el = new CIBlockElement;
                            $el->Update($ELEMENT_ID, Array('TIMESTAMP_X' => true,"ACTIVE_FROM"=>date("d.m.Y H:i:s")));
                        }

                    }
                }
            }
        }
        if($status_true){
            CSaleOrder::StatusOrder($id, "Y");
        }else{
            CSaleOrder::StatusOrder($id, "P");
        }


    }
}
开发者ID:ASDAFF,项目名称:gpbitrix,代码行数:67,代码来源:class.php

示例13: array

						{
							$arFields["WF_STATUS_ID"] = $_POST["WF_STATUS_ID"];
						}
					}

					if($bBizproc)
					{
						$BP_HISTORY_NAME = $arFields["NAME"];
						if($ID <= 0)
							$arFields["BP_PUBLISHED"] = "N";
					}

					if($ID > 0)
					{
						$bCreateRecord = false;
						$res = $bs->Update($ID, $arFields, $WF=="Y", true, true);
					}
					else
					{
						$bCreateRecord = true;
						$ID = $bs->Add($arFields, $bWorkflow, true, true);
						$res = ($ID > 0);
						$PARENT_ID = $ID;

						if ($res)
						{
							if ($arShowTabs['sku'])
							{
								$arFilter = array('IBLOCK_ID' => $arMainCatalog['IBLOCK_ID'],'=PROPERTY_'.$arMainCatalog['SKU_PROPERTY_ID'] => '-'.$str_TMP_ID);
								$rsOffersItems = CIBlockElement::GetList(
									array(),
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:iblock_element_edit.php

示例14: UpdateUFRights

 public static function UpdateUFRights($files, $rights, $ufEntity = array())
 {
     static $arTasks = null;
     if (!is_array($rights) || sizeof($rights) <= 0) {
         return false;
     }
     if ($files === null || $files === false) {
         return false;
     }
     if (!is_array($files)) {
         $files = array($files);
     }
     if (sizeof($files) <= 0) {
         return false;
     }
     if (!CModule::IncludeModule('iblock') || !CModule::IncludeModule('webdav')) {
         return false;
     }
     $arFiles = array();
     foreach ($files as $id) {
         $id = intval($id);
         if (intval($id) > 0) {
             $arFiles[] = $id;
         }
     }
     if (sizeof($arFiles) <= 0) {
         return false;
     }
     if ($arTasks == null) {
         $arTasks = CWebDavIblock::GetTasks();
     }
     $arCodes = array();
     foreach ($rights as $value) {
         if (substr($value, 0, 2) === 'SG') {
             $arCodes[] = $value . '_K';
         }
         $arCodes[] = $value;
     }
     $arCodes = array_unique($arCodes);
     $i = 0;
     $arViewRights = $arEditRights = array();
     $curUserID = 'U' . $GLOBALS['USER']->GetID();
     foreach ($arCodes as $right) {
         if ($curUserID == $right) {
             // do not override owner's rights
             continue;
         }
         $key = 'n' . $i++;
         $arViewRights[$key] = array('GROUP_CODE' => $right, 'TASK_ID' => $arTasks['R']);
     }
     $ibe = new CIBlockElement();
     $dbWDFile = $ibe->GetList(array(), array('ID' => $arFiles, 'SHOW_NEW' => 'Y'), false, false, array('ID', 'NAME', 'SECTION_ID', 'IBLOCK_ID', 'WF_NEW'));
     $iblockIds = array();
     if ($dbWDFile) {
         while ($arWDFile = $dbWDFile->Fetch()) {
             $id = $arWDFile['ID'];
             if ($arWDFile['WF_NEW'] == 'Y') {
                 $ibe->Update($id, array('BP_PUBLISHED' => 'Y'));
             }
             if (CIBlock::GetArrayByID($arWDFile['IBLOCK_ID'], "RIGHTS_MODE") === "E") {
                 $ibRights = CWebDavIblock::_get_ib_rights_object('ELEMENT', $id, $arWDFile['IBLOCK_ID']);
                 $ibRights->SetRights(CWebDavTools::appendRights($ibRights, $arViewRights, $arTasks));
                 if (empty($iblockIds[$arWDFile['IBLOCK_ID']])) {
                     $iblockIds[$arWDFile['IBLOCK_ID']] = $arWDFile['IBLOCK_ID'];
                 }
             }
         }
         global $CACHE_MANAGER;
         foreach ($iblockIds as $iblockId) {
             $CACHE_MANAGER->ClearByTag('iblock_id_' . $iblockId);
         }
         unset($iblockId);
     }
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:74,代码来源:calendar.php

示例15: __InTaskTaskComplete

function __InTaskTaskComplete($taskCompleteId, $iblockId, $taskType, $ownerId, $arTaskStatus, $arParams)
{
    $errorMessage = "";
    $taskCompleteId = IntVal($taskCompleteId);
    if ($taskCompleteId <= 0) {
        return "";
    }
    $arTask = __InTaskGetTask($taskCompleteId, $iblockId, $taskType, $ownerId);
    if (!$arTask) {
        $errorMessage .= GetMessage("INTL_TASK_NOT_FOUND") . ".";
    }
    if (StrLen($errorMessage) <= 0) {
        if ($arTask["PROPS"]["TASKASSIGNEDTO"]["VALUE"] != $GLOBALS["USER"]->GetID()) {
            $errorMessage .= GetMessage("INTL_CAN_NOT_FINISH") . ".";
        }
    }
    if (StrLen($arResult["ErrorMessage"]) <= 0) {
        $obIB = new CIBlockElement();
        $obIB->SetPropertyValueCode($taskCompleteId, $arTask["PROPS"]["TASKSTATUS"]["ID"], $arTaskStatus["COMPLETED"]["ID"]);
        $obIB->SetPropertyValueCode($taskCompleteId, $arTask["PROPS"]["TASKCOMPLETE"]["ID"], array(100));
        $obIB->SetPropertyValueCode($taskCompleteId, $arTask["PROPS"]["TASKFINISH"]["ID"], array(Date($GLOBALS["DB"]->DateFormatToPHP(FORMAT_DATETIME))));
        // added by sigurd
        CIntranetUtils::UpdateOWSVersion($iblockId, $taskCompleteId);
        $obIB->Update($taskCompleteId, array('TIMESTAMP_X' => Date($GLOBALS["DB"]->DateFormatToPHP(FORMAT_DATETIME))));
        $arMessageFields = array("=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE_TYPE" => SONET_MESSAGE_SYSTEM, "FROM_USER_ID" => $GLOBALS["USER"]->GetID(), "TO_USER_ID" => $arTask["FIELDS"]["CREATED_BY"]);
        if ($arMessageFields["FROM_USER_ID"] != $arMessageFields["TO_USER_ID"]) {
            $path2view = ($GLOBALS["APPLICATION"]->IsHTTPS() ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("owner_id" => $arTask["PROPS"]["TASKASSIGNEDTO"]["VALUE"], "task_id" => $taskCompleteId, "action" => "view"));
            $arMessageFields["MESSAGE"] = str_replace(array("#URL_VIEW#", "#NAME#"), array($path2view, $arTask["FIELDS"]["NAME"]), GetMessage("INTL_FINISH_MESSAGE"));
            CSocNetMessages::Add($arMessageFields);
        }
    }
    return $errorMessage;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:33,代码来源:action.php


注:本文中的CIBlockElement::Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。