本文整理汇总了PHP中CIntranetUtils::checkGUID方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::checkGUID方法的具体用法?PHP CIntranetUtils::checkGUID怎么用?PHP CIntranetUtils::checkGUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIntranetUtils
的用法示例。
在下文中一共展示了CIntranetUtils::checkGUID方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _GetWhere
protected static function _GetWhere($ID)
{
if ($SP_LIST_ID = CIntranetUtils::checkGUID($ID)) {
return 'SP_LIST_ID=\'' . $SP_LIST_ID . '\'';
} else {
$ID = intval($ID);
if ($ID <= 0) {
return false;
}
return 'IBLOCK_ID=\'' . $ID . '\'';
}
}
示例2: UpdateListItems
public function UpdateListItems($listName, $updates)
{
global $USER;
$arStatusValues = array_flip($this->arStatusValues);
$arPriorityValues = array_flip($this->arPriorityValues);
if (!$listName_original = CIntranetUtils::checkGUID($listName))
return new CSoapFault('Data error', 'Wrong GUID - '.$listName);
$obResponse = new CXMLCreator('Results');
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$arSections = CCalendarSect::GetList(array('arFilter' => array('XML_ID' => $listName_original)));
if (!$arSections || !is_array($arSections[0]))
return new CSoapFault(
'List not found',
'List with '.$listName.' GUID not found'
);
$arSection = $arSections[0];
$bGroup = $arSection['CAL_TYPE'] == 'group';
$calType = $arSection['CAL_TYPE'];
$ownerId = $arSection['OWNER_ID'];
if ($bGroup)
{
CModule::IncludeModule('socialnetwork');
$arGroupTmp = CSocNetGroup::GetByID($arSection['SOCNET_GROUP_ID']);
if ($arGroupTmp["CLOSED"] == "Y")
if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")
return new CSoapFault('Cannot modify archive group calendar', 'Cannot modify archive group calendar');
}
$obBatch = $updates->children[0];
$atrONERROR = $obBatch->getAttribute('OnError');
$atrDATEINUTC = $obBatch->getAttribute('DateInUtc');
$atrPROPERTIES = $obBatch->getAttribute('Properties');
$arChanges = $obBatch->children;
$arResultIDs = array();
$dateStart = ConvertTimeStamp(strtotime('-1 hour'), 'FULL');
$arResponseRows = array();
$arReplicationIDs = array();
$userId = (is_object($USER) && $USER->GetID()) ? $USER->GetID() : 1;
foreach ($arChanges as $obMethod)
{
$arData = array('_command' => $obMethod->getAttribute('Cmd'));
foreach ($obMethod->children as $obField)
{
$name = $obField->getAttribute('Name');
if ($name == 'MetaInfo')
$name .= '_'.$obField->getAttribute('Property');
$arData[$name] = $obField->content;
}
if ($arData['_command'] == 'Delete')
{
$obRes = new CXMLCreator('Result');
$obRes->setAttribute('ID', $obMethod->getAttribute('ID').','.$arData['_command']);
$obRes->setAttribute('List', $listName);
$obRes->addChild($obNode = new CXMLCreator('ErrorCode'));
$res = CCalendar::DeleteEvent($arData['ID']);
if ($res === true)
$obNode->setData('0x00000000');
else
$obNode->setData('0x81020014');
/*
0x00000000 - ok
0x81020015 - data conflict
0x81020014 - generic error such as invalid value for Field
0x81020016 - item does not exist
*/
$obResponse->addChild($obRes);
}
elseif ($arData['_command'] == 'New' || $arData['_command'] == 'Update')
{
$q = ToLower($arData['Description']);
if (($pos = strrpos($q, '</body>')) !== false) $arData['Description'] = substr($arData['Description'], 0, $pos);
if (($pos = strpos($q, '<body>')) !== false) $arData['Description'] = substr($arData['Description'], $pos + 6);
$arData['Description'] = str_replace('</DIV>', "\r\n</DIV>", $arData['Description']);
$arData['Description'] = str_replace(array(" ", " "), "", $arData['Description']);
$arData['Description'] = preg_replace("/<![^>]*>/", '', $arData['Description']);
//$arData['Description'] = strip_tags($arData['Description']);
$arData['Description'] = trim($arData['Description']);
$arData['Location'] = trim($arData['Location']);
if (isset($arData['EventDate']))
{
$arData['EventDate'] = $this->__makeTS($arData['EventDate']);
$arData['EndDate'] = $this->__makeTS($arData['EndDate']) + ($arData['fAllDayEvent'] ? -86340 : 0);
//.........这里部分代码省略.........
示例3: UpdateListItems
function UpdateListItems($listName, $updates)
{
global $USER, $DB;
$arPaths = array('user' => COption::GetOptionString('intranet', 'path_task_user_entry', '/company/personal/user/#USER_ID#/tasks/task/view/#TASK_ID#/'), 'group' => COption::GetOptionString('intranet', 'path_task_group_entry', '/workgroups/group/#GROUP_ID#/tasks/task/view/#TASK_ID#/'));
if (!$this->__Init()) {
return $this->error;
}
if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
}
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$obResponse = new CXMLCreator('Results');
$obBatch = $updates->children[0];
$atrONERROR = $obBatch->getAttribute('OnError');
$atrDATEINUTC = $obBatch->getAttribute('DateInUtc');
$atrPROPERTIES = $obBatch->getAttribute('Properties');
$arChanges = $obBatch->children;
$arResultIDs = array();
$dateStart = ConvertTimeStamp(strtotime('-1 hour'), 'FULL');
$arResponseRows = array();
$arResponseRowsError = array();
$arReplicationIDs = array();
foreach ($arChanges as $obMethod) {
$arData = array('_command' => $obMethod->getAttribute('Cmd'));
$ID = false;
$bUpdate = true;
$arElement = false;
$arSection = $this->arUsersSection;
foreach ($obMethod->children as $obField) {
$name = $obField->getAttribute('Name');
if ($name == 'MetaInfo') {
$name .= '_' . $obField->getAttribute('Property');
}
$arData[$name] = $obField->content;
}
$obResponseRow = new CXMLCreator('Result');
$obResponseRow->setAttribute('ID', $obMethod->getAttribute('ID') . ',' . $arData['_command']);
$obResponseRow->setAttribute('List', $listName);
$obResponseRow->addChild($obErrorCode = new CXMLCreator('ErrorCode'));
if ($arData['ID'] > 0) {
$rsElement = CTasks::GetById($arData['ID']);
if ($rsElement && ($arElement = $rsElement->Fetch())) {
if (!is_array($arElement)) {
$obErrorCode->setData('0x81020016');
$bUpdate = false;
} else {
if ($arElement['taskType'] == "group") {
$arGroupTmp = CSocNetGroup::GetByID($arElement['ownerId']);
if ($arGroupTmp["CLOSED"] == "Y") {
if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y") {
return new CSoapFault('Cannot modify archive group task', 'Cannot modify archive group task');
}
}
}
$arElement['arParams'] = array(intval($arElement['GROUP_ID']) > 0 ? 'PATH_TO_USER_TASKS_TASK' : 'PATH_TO_GROUP_TASKS_TASK' => str_replace(array('#USER_ID#', '#GROUP_ID#', '#TASK_ID#'), array($USER->GetID(), $arSection['XML_ID'], $arElement['ID']), $arPaths[$arElement['taskType']]));
}
} else {
$obErrorCode->setData('0x81020016');
$bUpdate = false;
}
}
if ($bUpdate) {
if ($arData['_command'] == 'Delete' && $arElement["CREATED_BY"] == $USER->GetID()) {
$arError = false;
if (!CTasks::Delete($arElement['ID'])) {
$obErrorCode->setData('0x81020014');
} else {
$obErrorCode->setData('0x00000000');
}
} elseif ($arData['_command'] == 'New' || $arData['_command'] == 'Update') {
$arData['Body'] = trim($arData['Body']);
$arData['Body'] = str_replace(array(" ", " ", ' '), "", $arData['Body']);
$arData['Body'] = preg_replace("/<![^>]*>/", '', $arData['Body']);
if (($pos = strpos($arData['Body'], '<BODY>')) !== false) {
$arData['Body'] = substr($arData['Body'], $pos + 6);
}
echo $pos . ' ';
if (($pos = strpos($arData['Body'], '</BODY>')) !== false) {
$arData['Body'] = substr($arData['Body'], 0, $pos);
}
echo $pos . ' ';
$TZBias = intval(date('Z'));
$arData['StartDate'] = $arData['StartDate'] ? $this->__makeTS($arData['StartDate']) + $TZBias : '';
$arData['DueDate'] = $arData['DueDate'] ? $this->__makeTS($arData['DueDate']) + $TZBias : '';
$arData['MetaInfo_DateComplete'] = $arData['MetaInfo_DateComplete'] ? $this->__makeTS($arData['EndDate']) + $TZBias : '';
$probablyHtmlInDescription = strpos($arData['Body'], '<') !== false && strpos($arData['Body'], '>');
$arFields = array('DESCRIPTION_IN_BBCODE' => $probablyHtmlInDescription ? 'N' : 'Y', 'CHANGED_BY' => $USER->GetID(), 'CHANGED_DATE' => date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), time()), 'SITE_ID' => SITE_ID, 'TITLE' => $arData['Title'], 'START_DATE_PLAN' => $arData['StartDate'] ? ConvertTimeStamp($arData['StartDate']) : '', 'DEADLINE' => $arData['DueDate'] ? ConvertTimeStamp($arData['DueDate']) : '', 'DESCRIPTION' => $arData['Body'], 'PRIORITY' => isset($arData['Priority']) ? intval($arData['Priority']) : 1, 'DURATION_PLAN' => $arData['MetaInfo_TotalWork'] / 60, 'DURATION_FACT' => $arData['MetaInfo_ActualWork'] / 60, 'CLOSED_DATE' => $arData['MetaInfo_DateComplete'] ? ConvertTimeStamp($arData['MetaInfo_DateComplete']) : '');
if (in_array($arData['Status'], $this->arStatuses)) {
$arFields["STATUS"] = $arData['Status'];
}
if ($assigned_to = $arData['AssignedTo']) {
if ($USER_ID = $this->__getUser($assigned_to)) {
$arFields['RESPONSIBLE_ID'] = $USER_ID;
} else {
$obErrorCode->setData('0x81020054');
$bUpdate = false;
}
} else {
$arFields['RESPONSIBLE_ID'] = $USER->getId();
}
//.........这里部分代码省略.........
示例4: GetAttachmentCollection
function GetAttachmentCollection($listName, $listItemID)
{
$start = microtime(true);
if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
}
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$listItemID = intval($listItemID);
$dbRes = CUser::GetByID($listItemID);
//$dbRes = CUser::GetList(($by="id"), ($order="asc"), array("ID_EQUAL_EXACT"=>IntVal($listItemID)));
//$dbRes = $GLOBALS['DB']->Query('SELECT PERSONAL_PHOTO FROM b_user WHERE id=\''.$listItemID.'\'');
$obData = new CXMLCreator('Attachments');
if (($arUser = $dbRes->Fetch()) && $arUser['PERSONAL_PHOTO']) {
$arImage = self::InitImage($arUser['PERSONAL_PHOTO'], 100, 100);
$obData->addChild($obAttachment = new CXMLCreator('Attachment'));
$obAttachment->setData(CHTTP::URN2URI($arImage['CACHE']['src']));
//$data = '<Attachments><Attachment>http://'.$_SERVER['SERVER_NAME'].$arImage['CACHE']['src'].'</Attachment></Attachments>';
}
// else
// {
// $data = '<Attachments></Attachments>';
// }
//return array('GetAttachmentCollectionResult' => $data);
return array('GetAttachmentCollectionResult' => $obData);
}
示例5: UpdateListItems
function UpdateListItems($listName, $updates)
{
global $USER;
$arPaths = array('user' => COption::GetOptionString('intranet', 'path_task_user_entry', '/company/personal/user/#USER_ID#/tasks/task/view/#TASK_ID#/'), 'group' => COption::GetOptionString('intranet', 'path_task_group_entry', '/workgroups/group/#GROUP_ID#/tasks/task/view/#TASK_ID#/'));
if (!$this->__Init()) {
return $this->error;
}
if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
}
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
// one more dirty hack. now for bx.
//define('BX_INTASKS_FROM_COMPONENT', true);
//CModule::IncludeModule('socialnetwork');
//include($_SERVER['DOCUMENT_ROOT'].BX_PERSONAL_ROOT.'/components/bitrix/intranet.tasks/init.php');
//include($_SERVER['DOCUMENT_ROOT'].BX_PERSONAL_ROOT.'/components/bitrix/intranet.tasks/action.php');
$obResponse = new CXMLCreator('Results');
$arStatusValues = array();
$obStatus = CIBlockProperty::GetPropertyEnum('TaskStatus', array('SORT' => 'asc'), array('IBLOCK_ID' => $this->IBLOCK_ID));
while ($arStatus = $obStatus->Fetch()) {
$arStatusValues[$arStatus['XML_ID']] = $arStatus['ID'];
if ($arStatus['XML_ID'] == 'NotAccepted') {
$arStatusValues[$arStatus['VALUE']] = $arStatus['ID'];
}
}
/*
$arPriorityValues = array();
$obPriority = CIBlockProperty::GetPropertyEnum('TaskPriority', array('SORT' => 'asc'), array('IBLOCK_ID' => $this->IBLOCK_ID));
while ($arPriority = $obPriority->Fetch())
$arPriorityValues[$arPriority['XML_ID']] = $arPriority['ID'];
*/
$arPriorityValues = array_flip($this->arProperties['TaskPriority']['VARIANTS_ID']);
$arStatusValues = array_flip($this->arProperties['TaskStatus']['VARIANTS_ID']);
$arStatusXML_ID = array_flip($this->arProperties['TaskStatus']['VARIANTS']);
$obBatch = $updates->children[0];
$atrONERROR = $obBatch->getAttribute('OnError');
$atrDATEINUTC = $obBatch->getAttribute('DateInUtc');
$atrPROPERTIES = $obBatch->getAttribute('Properties');
$arChanges = $obBatch->children;
$arResultIDs = array();
$dateStart = ConvertTimeStamp(strtotime('-1 hour'), 'FULL');
$arResponseRows = array();
$arResponseRowsError = array();
$arReplicationIDs = array();
foreach ($arChanges as $obMethod) {
$arData = array('_command' => $obMethod->getAttribute('Cmd'));
$ID = false;
$bUpdate = true;
$arElement = false;
$arSection = $this->arUsersSection;
foreach ($obMethod->children as $obField) {
$name = $obField->getAttribute('Name');
if ($name == 'MetaInfo') {
$name .= '_' . $obField->getAttribute('Property');
}
$arData[$name] = $obField->content;
}
$obResponseRow = new CXMLCreator('Result');
$obResponseRow->setAttribute('ID', $obMethod->getAttribute('ID') . ',' . $arData['_command']);
$obResponseRow->setAttribute('List', $listName);
$obResponseRow->addChild($obErrorCode = new CXMLCreator('ErrorCode'));
if ($arData['ID'] > 0) {
//$dbRes = CIBlockElement::GetByID($arData['ID']);
$arElement = CIntranetTasks::GetById($arData['ID']);
if (!is_array($arElement)) {
$obErrorCode->setData('0x81020016');
$bUpdate = false;
} else {
//$arElement = $obElement->GetFields();
//$arElement['prop'] = $obElement->GetProperties();
if ($arElement['IBLOCK_SECTION_ID'] != $arSection['ID']) {
if (!($arSection = $this->__getSection($arElement['IBLOCK_SECTION_ID']))) {
return new CSoapFault('Some error', 'Unknown error with iblock sections');
}
}
// don't forget about depth of sections, Max has modification
if ($arElement['taskType'] == "group") {
$arGroupTmp = CSocNetGroup::GetByID($arElement['ownerId']);
if ($arGroupTmp["CLOSED"] == "Y") {
if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y") {
return new CSoapFault('Cannot modify archive group task', 'Cannot modify archive group task');
}
}
}
$arElement['arParams'] = array($arElement['taskType'] == 'user' ? 'PATH_TO_USER_TASKS_TASK' : 'PATH_TO_GROUP_TASKS_TASK' => str_replace(array('#USER_ID#', '#GROUP_ID#', '#TASK_ID#'), array($USER->GetID(), $arSection['XML_ID'], $arElement['ID']), $arPaths[$arElement['taskType']]));
}
}
if ($bUpdate) {
if ($arData['_command'] == 'Delete') {
$arError = false;
if (CIntranetTasksDocument::CanUserOperateDocument(INTASK_DOCUMENT_OPERATION_DELETE_DOCUMENT, $USER->GetID(), $arElement['ID'], array())) {
if (!CIntranetTasks::Delete($arElement['ID'], $arError)) {
$obErrorCode->setData('0x81020014');
} else {
$obErrorCode->setData('0x00000000');
}
} else {
$obErrorCode->setData('0x81020014');
}
/*
//.........这里部分代码省略.........
示例6: foreach
.bx-sp-lists div.bx-sp-unavail {
background-color: #FFFAFA;
color: #CCCCCC;
}
.bx-sp-lists div.bx-sp-unavail a { color: #CCCCCC; }
.bx-sp-lists div.bx-sp-current {
background-color: #EAF8DF;
}
</style>
<div class="bx-sp-lists">
<?php
foreach ($arResult['LISTS'] as $list) {
$ID_CLEAR = htmlspecialcharsbx(CIntranetUtils::checkGUID($list['ID']));
$bExists = $ID_CLEAR != $arResult['SERVICE']['SP_LIST_ID'] && in_array($ID_CLEAR, $arResult['LISTS_CONNECTED']);
$url_img = $list['IMAGE'] ? $arResult['URL']['scheme'] . '://' . $arResult['URL']['host'] . $list['IMAGE'] : '';
$url_list = $arResult['URL']['scheme'] . '://' . $arResult['URL']['host'] . $list['URL'];
?>
<div id="line_<?php
echo $ID_CLEAR;
?>
" class="<?php
echo $bExists ? 'bx-sp-unavail' : '';
?>
" onclick="SLsetListValue(this)">
<input type="radio" name="sp_list_id" value="<?php
echo $ID_CLEAR;
?>
" id="<?php
示例7: UpdateListItems
function UpdateListItems($listName, $updates)
{
global $USER;
$arStatusValues = array_flip($this->arStatusValues);
$arPriorityValues = array_flip($this->arPriorityValues);
$arWeekDays = array_flip($this->arWeekDays);
if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
}
$obResponse = new CXMLCreator('Results');
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$obRes = CIBlockSection::GetList(array('SORT' => 'ASC'), array('XML_ID' => $listName_original));
if (!($arSection = $obRes->Fetch())) {
return new CSoapFault('List not found', 'List with ' . $listName . ' GUID is not found');
}
$bGroup = $arSection['SOCNET_GROUP_ID'] != '';
if ($bGroup) {
CModule::IncludeModule('socialnetwork');
$arGroupTmp = CSocNetGroup::GetByID($arSection['SOCNET_GROUP_ID']);
if ($arGroupTmp["CLOSED"] == "Y") {
if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y") {
return new CSoapFault('Cannot modify archive group calendar', 'Cannot modify archive group calendar');
}
}
}
$obCalendar = new CEventCalendar();
$obCalendar->Init(array('ownerType' => $bGroup ? 'GROUP' : 'USER', 'ownerId' => $bGroup ? $arSection['SOCNET_GROUP_ID'] : (is_object($USER) && $USER->GetID() ? $USER->GetID() : false), 'bOwner' => true, 'iblockId' => $arSection['IBLOCK_ID'], 'bCache' => false));
// dirty hack
$arPermissions = $obCalendar->GetPermissions(array('setProperties' => true));
$obBatch = $updates->children[0];
$atrONERROR = $obBatch->getAttribute('OnError');
$atrDATEINUTC = $obBatch->getAttribute('DateInUtc');
$atrPROPERTIES = $obBatch->getAttribute('Properties');
$arChanges = $obBatch->children;
$arResultIDs = array();
$dateStart = ConvertTimeStamp(strtotime('-1 hour'), 'FULL');
$arResponseRows = array();
$arReplicationIDs = array();
foreach ($arChanges as $obMethod) {
$arData = array('_command' => $obMethod->getAttribute('Cmd'));
foreach ($obMethod->children as $obField) {
$name = $obField->getAttribute('Name');
if ($name == 'MetaInfo') {
$name .= '_' . $obField->getAttribute('Property');
}
$arData[$name] = $obField->content;
}
if ($arData['_command'] == 'Delete') {
$obRes = new CXMLCreator('Result');
$obRes->setAttribute('ID', $obMethod->getAttribute('ID') . ',' . $arData['_command']);
$obRes->setAttribute('List', $listName);
$obRes->addChild($obNode = new CXMLCreator('ErrorCode'));
if (CECEvent::Delete(array('id' => $arData['ID'], 'ownerType' => $bGroup ? 'GROUP' : 'USER', 'ownerId' => $bGroup ? $arSection['SOCNET_GROUP_ID'] : (is_object($USER) && $USER->GetID() ? $USER->GetID() : false), 'bOwner' => true, 'iblockId' => $arSection['IBLOCK_ID'], 'RMiblockId' => $this->__getRMIblockID(), 'allowResMeeting' => true))) {
CEventCalendar::ClearCache('/event_calendar/events/' . $arSection['IBLOCK_ID'] . '/');
$obNode->setData('0x00000000');
} else {
$obNode->setData('0x81020014');
}
/*
0x00000000 - ok
0x81020015 - data conflict
0x81020014 - generic error such as invalid value for Field
0x81020016 - item does not exist
*/
$obResponse->addChild($obRes);
} elseif ($arData['_command'] == 'New' || $arData['_command'] == 'Update') {
$q = ToLower($arData['Description']);
if (($pos = strrpos($q, '</body>')) !== false) {
$arData['Description'] = substr($arData['Description'], 0, $pos);
}
if (($pos = strpos($q, '<body>')) !== false) {
$arData['Description'] = substr($arData['Description'], $pos + 6);
}
$arData['Description'] = str_replace('</DIV>', "\r\n</DIV>", $arData['Description']);
$arData['Description'] = str_replace(array(" ", " "), "", $arData['Description']);
$arData['Description'] = preg_replace("/<![^>]*>/", '', $arData['Description']);
//$arData['Description'] = strip_tags($arData['Description']);
$arData['Description'] = trim($arData['Description']);
$arData['Location'] = trim($arData['Location']);
$arData['EventDate'] = $this->__makeTS($arData['EventDate']);
$arData['EndDate'] = $this->__makeTS($arData['EndDate']) + ($arData['fAllDayEvent'] ? -86340 : 0);
$TZBias = intval(date('Z', $arData['EventDate']));
$arData['EventType'] = intval($arData['EventType']);
if ($arData['EventType'] == 2) {
$arData['EventType'] = 0;
}
if ($arData['EventType'] > 2) {
return new CSoapFault('Unsupported event type', 'Event type unsupported');
}
$arData['fRecurrence'] = intval($arData['fRecurrence']);
if ($arData['RecurrenceData']) {
//$xmlstr = $arData['XMLTZone'];
//$arData['XMLTZone'] = new CDataXML();
//$arData['XMLTZone']->LoadString($xmlstr);
$xmlstr = $arData['RecurrenceData'];
$obRecurData = new CDataXML();
$obRecurData->LoadString($xmlstr);
/*
<recurrence>
<rule>
//.........这里部分代码省略.........
示例8: CSPListsClient
$CLIENT = new CSPListsClient($arResult['URL']);
if (!($arResult['LISTS'] = $CLIENT->GetListCollection())) {
if ($ex = $APPLICATION->GetException()) {
$arResult['ERROR'] = $ex->GetString();
} else {
$arResult['ERROR'] = 'STRANGE ERROR OCCURED!';
}
}
$arResult['LISTS_CONNECTED'] = array();
$dbRes = CIntranetSharepoint::GetList();
while ($arRes = $dbRes->Fetch()) {
$arResult['LISTS_CONNECTED'][] = $arRes['SP_LIST_ID'];
}
} else {
$listID = CIntranetUtils::makeGUID($_REQUEST['list_id']);
$listID_clear = CIntranetUtils::checkGUID($listID);
if (!$_REQUEST['FIELDS']) {
$STEP = 3;
$CLIENT = new CSPListsClient($arResult['URL']);
if (!($arResult['LIST'] = $CLIENT->GetList($listID_clear))) {
if ($ex = $APPLICATION->GetException()) {
$arResult['ERROR'] = $ex->GetString();
} else {
$arResult['ERROR'] = 'STRANGE ERROR OCCURED!';
}
}
$_SESSION['SP_LIST_' . $listID_clear] = $arResult['LIST'];
} else {
$STEP = 4;
$FIELDS = $_REQUEST['FIELDS'];
$SESSIONLIST = $_SESSION['SP_LIST_' . $listID_clear];
示例9: GetList
public static function GetList($arOrder = array(), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
{
global $DB;
$arFields = array("ID" => array("FIELD" => "I.ID", "TYPE" => "int"), "IBLOCK_ID" => array("FIELD" => "S.IBLOCK_ID", "TYPE" => "int"), "SP_LIST_ID" => array("FIELD" => "S.SP_LIST_ID", "TYPE" => "string"), "SP_URL" => array("FIELD" => "S.SP_URL", "TYPE" => "string"), "SP_AUTH_USER" => array("FIELD" => "S.SP_AUTH_USER", "TYPE" => "string"), "SP_AUTH_PASS" => array("FIELD" => "S.SP_AUTH_PASS", "TYPE" => "string"), "SYNC_DATE" => array("FIELD" => "S.SYNC_DATE", "TYPE" => "datetime"), "SYNC_ERRORS" => array("FIELD" => "S.SYNC_ERRORS", "TYPE" => "int"), "SYNC_LAST_TOKEN" => array("FIELD" => "S.SYNC_LAST_TOKEN", "TYPE" => "string"), "SYNC_PAGING" => array("FIELD" => "S.SYNC_PAGING", "TYPE" => "string"), "HANDLER_MODULE" => array("FIELD" => "S.HANDLER_MODULE", "TYPE" => "string"), "HANDLER_CLASS" => array("FIELD" => "S.HANDLER_CLASS", "TYPE" => "string"), "PRIORITY" => array("FIELD" => "S.PRIORITY", "TYPE" => "string"));
if ($arFilter['SP_LIST_ID']) {
$arFilter['SP_LIST_ID'] = CIntranetUtils::checkGUID($arFilter['SP_LIST_ID']);
}
$arSqls = self::PrepareSql($arFields, $arOrder, $arFilter, $arGroupBy, $arSelectFields);
$arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "", $arSqls["SELECT"]);
if (is_array($arGroupBy) && count($arGroupBy) == 0) {
$strSql = "SELECT " . $arSqls["SELECT"] . " " . "FROM b_intranet_sharepoint S, b_iblock I " . "\t" . $arSqls["FROM"] . " " . "WHERE S.IBLOCK_ID = I.ID ";
if (strlen($arSqls["WHERE"]) > 0) {
$strSql .= "AND " . $arSqls["WHERE"] . " ";
}
if (strlen($arSqls["GROUPBY"]) > 0) {
$strSql .= "GROUP BY " . $arSqls["GROUPBY"] . " ";
}
$dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if ($arRes = $dbRes->Fetch()) {
return $arRes["CNT"];
} else {
return False;
}
}
$strSql = "SELECT " . $arSqls["SELECT"] . " " . "FROM b_intranet_sharepoint S, b_iblock I " . "\t" . $arSqls["FROM"] . " " . "WHERE S.IBLOCK_ID = I.ID ";
if (strlen($arSqls["WHERE"]) > 0) {
$strSql .= "AND " . $arSqls["WHERE"] . " ";
}
if (strlen($arSqls["GROUPBY"]) > 0) {
$strSql .= "GROUP BY " . $arSqls["GROUPBY"] . " ";
}
if (strlen($arSqls["ORDERBY"]) > 0) {
$strSql .= "ORDER BY " . $arSqls["ORDERBY"] . " ";
}
if (is_array($arNavStartParams) && IntVal($arNavStartParams["nTopCount"]) <= 0) {
$strSql_tmp = "SELECT COUNT('x') as CNT " . "FROM b_intranet_sharepoint S, b_iblock I " . "\t" . $arSqls["FROM"] . " " . "WHERE S.IBLOCK_ID = I.ID ";
if (strlen($arSqls["WHERE"]) > 0) {
$strSql_tmp .= "AND " . $arSqls["WHERE"] . " ";
}
if (strlen($arSqls["GROUPBY"]) > 0) {
$strSql_tmp .= "GROUP BY " . $arSqls["GROUPBY"] . " ";
}
$dbRes = $DB->Query($strSql_tmp, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$cnt = 0;
if (strlen($arSqls["GROUPBY"]) <= 0) {
if ($arRes = $dbRes->Fetch()) {
$cnt = $arRes["CNT"];
}
} else {
$cnt = $dbRes->SelectedRowsCount();
}
$dbRes = new CDBResult();
$dbRes->NavQuery($strSql, $cnt, $arNavStartParams);
} else {
if (is_array($arNavStartParams) && IntVal($arNavStartParams["nTopCount"]) > 0) {
$strSql .= "LIMIT " . $arNavStartParams["nTopCount"];
}
$dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
return $dbRes;
}