Esempio n. 1
0
 private function getGridData($gridId)
 {
     $grid = array('ID' => $gridId);
     $securityContext = $this->storage->getCurrentUserSecurityContext();
     $parameters = array('with' => array('FILE', 'CREATE_USER'), 'filter' => array('IS_EXPIRED' => false, 'OBJECT.STORAGE_ID' => $this->storage->getId(), 'CREATED_BY' => $this->getUser()->getId()));
     $parameters = Driver::getInstance()->getRightsManager()->addRightsCheck($securityContext, $parameters, array('OBJECT_ID', 'OBJECT.CREATED_BY'));
     $items = ExternalLink::getModelList($parameters);
     Collection::sortByColumn($items, array('CREATE_TIME' => array(SORT_NUMERIC, SORT_ASC)));
     $urlManager = Driver::getInstance()->getUrlManager();
     $rows = array();
     foreach ($items as $externalLink) {
         /** @var ExternalLink $externalLink */
         $exportData = $externalLink->toArray();
         $nameSpecialChars = htmlspecialcharsbx($externalLink->getFile()->getName());
         $createDateText = htmlspecialcharsbx((string) $externalLink->getCreateTime());
         $columnName = "\n\t\t\t\t<table class=\"bx-disk-object-name\"><tr>\n\t\t\t\t\t\t<td style=\"width: 45px;\"><div data-object-id=\"{$externalLink->getId()}\" class=\"draggable bx-file-icon-container-small bx-disk-file-icon\"></div></td>\n\t\t\t\t\t\t<td><a class=\"bx-disk-folder-title\" id=\"disk_obj_{$externalLink->getId()}\" href=\"\" data-bx-dateModify=\"{$createDateText}\">{$nameSpecialChars}</a></td>\n\t\t\t\t</tr></table>\n\t\t\t";
         $createdByLink = \CComponentEngine::makePathFromTemplate($this->arParams['PATH_TO_USER'], array("user_id" => $externalLink->getCreatedBy()));
         $rows[] = array('data' => $exportData, 'columns' => array('CREATE_TIME' => formatDate('x', $externalLink->getCreateTime()->getTimestamp(), time() + CTimeZone::getOffset()), 'UPDATE_TIME' => formatDate('x', $externalLink->getCreateTime()->getTimestamp(), time() + CTimeZone::getOffset()), 'NAME' => $columnName, 'FORMATTED_SIZE' => CFile::formatSize($externalLink->getFile()->getSize()), 'CREATE_USER' => "\n\t\t\t\t\t\t<div class=\"bx-disk-user-link\"><a target='_blank' href=\"{$createdByLink}\" id=\"\">" . htmlspecialcharsbx($externalLink->getCreateUser()->getFormattedName()) . "</a></div>\n\t\t\t\t\t"), 'actions' => array(array("PSEUDO_NAME" => "download", "DEFAULT" => true, "ICONCLASS" => "download", "TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DOWNLOAD'), "ONCLICK" => "jsUtils.Redirect(arguments, '" . $urlManager->getUrlForDownloadFile($externalLink->getFile()) . "')"), array("PSEUDO_NAME" => "disable_external_link", "ICONCLASS" => "disable_external_link", "TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DISABLE_EXTERNAL_LINK'), "SHORT_TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DISABLE_EXTERNAL_LINK_SHORT'), "ONCLICK" => "BX.Disk['ExternalLinkListClass_{$this->getComponentId()}'].disableExternalLink({$externalLink->getId()}, {$externalLink->getObjectId()})")));
     }
     unset($externalLink);
     $grid['MODE'] = 'list';
     $grid['HEADERS'] = array(array('id' => 'ID', 'name' => 'ID', 'default' => false, 'show_checkbox' => true), array('id' => 'NAME', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_NAME'), 'default' => true), array('id' => 'CREATE_TIME', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_CREATE_TIME'), 'default' => true), array('id' => 'CREATE_USER', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_CREATE_USER'), 'default' => false), array('id' => 'FORMATTED_SIZE', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_FORMATTED_SIZE'), 'default' => true));
     $grid['ROWS'] = $rows;
     $grid['ROWS_COUNT'] = count($rows);
     $grid['FOOTER'] = array();
     return $grid;
 }
    public function GetSettingsHTML($arFields, $strHTMLControlName, &$arPropertyFields)
    {
        $arPropertyFields = array("HIDE" => array("ROW_COUNT", "COL_COUNT", "MULTIPLE_CNT"), 'USER_TYPE_SETTINGS_TITLE' => GetMessage('BT_UT_SKU_SETTING_TITLE'));
        $arSettings = self::PrepareSettings($arFields);
        $strResult = '<tr>
		<td>' . GetMessage('BT_UT_SKU_SETTING_VIEW') . '</td>
		<td>' . SelectBoxFromArray($strHTMLControlName["NAME"] . '[VIEW]', self::GetPropertyViewsList(true), htmlspecialcharsbx($arSettings['VIEW'])) . '</td>
		</tr>
		<tr>
		<td>' . GetMessage('BT_UT_SKU_SETTING_MAX_WIDTH') . '</td>
		<td><input type="text" name="' . $strHTMLControlName["NAME"] . '[MAX_WIDTH]" value="' . intval($arSettings['MAX_WIDTH']) . '">&nbsp;' . GetMessage('BT_UT_SKU_SETTING_COMMENT_MAX_WIDTH') . '</td>
		</tr>
		<tr>
		<td>' . GetMessage('BT_UT_SKU_SETTING_MIN_HEIGHT') . '</td>
		<td><input type="text" name="' . $strHTMLControlName["NAME"] . '[MIN_HEIGHT]" value="' . intval($arSettings['MIN_HEIGHT']) . '">&nbsp;' . GetMessage('BT_UT_SKU_SETTING_COMMENT_MIN_HEIGHT') . '</td>
		</tr>
		<tr>
		<td>' . GetMessage('BT_UT_SKU_SETTING_MAX_HEIGHT') . '</td>
		<td><input type="text" name="' . $strHTMLControlName["NAME"] . '[MAX_HEIGHT]" value="' . intval($arSettings['MAX_HEIGHT']) . '">&nbsp;' . GetMessage('BT_UT_SKU_SETTING_COMMENT_MAX_HEIGHT') . '</td>
		</tr>
		<tr>
		<td>' . GetMessage('BT_UT_SKU_SETTING_BAN_SYMBOLS') . '</td>
		<td><input type="text" name="' . $strHTMLControlName["NAME"] . '[BAN_SYM]" value="' . htmlspecialcharsbx($arSettings['BAN_SYM']) . '"></td>
		</tr>
		<tr>
		<td>' . GetMessage('BT_UT_SKU_SETTING_REP_SYMBOL') . '</td>
		<td>' . SelectBoxFromArray($strHTMLControlName["NAME"] . '[REP_SYM]', parent::GetReplaceSymList(true), htmlspecialcharsbx($arSettings['REP_SYM'])) . '&nbsp;<input type="text" name="' . $strHTMLControlName["NAME"] . '[OTHER_REP_SYM]" size="1" maxlength="1" value="' . $arSettings['OTHER_REP_SYM'] . '"></td>
		</tr>';
        return $strResult;
    }
function _DumpPostVars($vname, $vvalue, $var_stack = array())
{
    if (is_array($vvalue)) {
        foreach ($vvalue as $key => $value) {
            _DumpPostVars($key, $value, array_merge($var_stack, array($vname)));
        }
    } else {
        if (count($var_stack) > 0) {
            $var_name = $var_stack[0];
            for ($i = 1; $i < count($var_stack); $i++) {
                $var_name .= "[" . $var_stack[$i] . "]";
            }
            $var_name .= "[" . $vname . "]";
        } else {
            $var_name = $vname;
        }
        if ($var_name != "sessid") {
            ?>
<input type="hidden" name="<?php 
            echo htmlspecialcharsbx($var_name);
            ?>
" value="<?php 
            echo htmlspecialcharsbx($vvalue);
            ?>
"><?php 
        }
    }
}
 /**
  * @param FieldType $fieldType
  * @param $value
  * @return string
  */
 protected static function formatValuePrintable(FieldType $fieldType, $value)
 {
     if (!Loader::includeModule('disk')) {
         return '';
     }
     $attachedId = (int) $value;
     $attachedModel = \Bitrix\Disk\AttachedObject::loadById($attachedId, array('OBJECT'));
     if (!$attachedModel) {
         return '';
     }
     global $USER;
     $userId = $USER->getID();
     if ($userId) {
         if (!$attachedModel->canRead($userId)) {
             return '';
         }
     }
     $file = $attachedModel->getFile();
     if (!$file) {
         return '';
     }
     $driver = \Bitrix\Disk\Driver::getInstance();
     $urlManager = $driver->getUrlManager();
     return '[url=' . $urlManager->getUrlUfController('download', array('attachedId' => $attachedModel->getId())) . ']' . htmlspecialcharsbx($file->getName()) . '[/url]';
 }
Esempio n. 5
0
 static function WriteToLog($text, $code = "")
 {
     $filename = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/xdimport.log";
     $f = fopen($filename, "a");
     fwrite($f, date("Y-m-d H:i:s") . " " . str_pad($code, 7) . " " . htmlspecialcharsbx($text) . "\n");
     fclose($f);
 }
Esempio n. 6
0
 function __CrmMobileCompanyEditRenderMultiFields($typeName, &$fields, &$typeInfos, $prefix = '')
 {
     $typeName = strtoupper($typeName);
     $data = isset($fields[$typeName]) ? $fields[$typeName] : array();
     if ($prefix !== '') {
         $prefix .= '_' . strtolower($typeName);
     } else {
         $prefix = strtolower($typeName);
     }
     $typeInfo = isset($typeInfos[$typeName]) ? $typeInfos[$typeName] : array();
     if (empty($data)) {
         if (!isset($fields[$typeName])) {
             $fields[$typeName] = array();
         }
         $fields[$typeName]['n1'] = array('VALUE' => '', 'VALUE_TYPE' => '');
         $data = $fields[$typeName];
     }
     foreach ($data as $key => &$datum) {
         $value = isset($datum['VALUE']) ? $datum['VALUE'] : '';
         echo '<input class="crm_input_text fll" id="', $prefix, '_', $key, '_value', '" style="width: 70%;" type="text" value="', htmlspecialcharsbx($value), '" />';
         $valueTypeID = isset($datum['VALUE_TYPE']) ? $datum['VALUE_TYPE'] : '';
         echo '<select class="crm_input_select flr" id="', $prefix, '_', $key, '_value_type', '">';
         foreach ($typeInfo as $curValueTypeID => &$curValueType) {
             echo '<option value="', htmlspecialcharsbx($curValueTypeID), '"', $valueTypeID === $curValueTypeID ? 'selected="selected"' : '', ' >', isset($curValueType['ABBR']) ? $curValueType['ABBR'] : $curValueTypeID, '</option>';
         }
         unset($curValueType);
         reset($typeInfo);
         echo '</select>';
     }
     unset($datum);
     echo '<div class="clb" style="margin-bottom: 10px;"></div>', '<a id="', $prefix, '_add_btn', '" class="crm_people_cont_aqua_two">', '+&nbsp;', htmlspecialcharsbx(GetMessage("M_CRM_COMPANY_EDIT_BTN_ADD_{$typeName}")), '</a>';
 }
function fill_all_values($sid, $type, $mess = false, $site = false)
{
    global $arrTickets, $arrT, $MESS;
    $z = $type == "SLA" ? CTicketSLA::GetDropDown($site) : CTicketDictionary::GetList($v1 = "s_dropdown", $v2 = "asc", array("TYPE" => $type, "SITE" => $site), $v3);
    if ($type != "SLA") {
        if ($mess === false) {
            $mess = GetMessage("SUP_NO");
        }
        $arrTickets[$sid][0]["NAME"] = "(" . $mess . ")";
        $arrTickets[$sid][0]["COUNTER_OPEN"] = $arrT[$sid][0]["COUNTER_OPEN"];
        $arrTickets[$sid][0]["COUNTER_OPEN_RED"] = $arrT[$sid][0]["COUNTER_OPEN_RED"];
        $arrTickets[$sid][0]["COUNTER_OPEN_GREEN"] = $arrT[$sid][0]["COUNTER_OPEN_GREEN"];
        $arrTickets[$sid][0]["COUNTER_CLOSE"] = $arrT[$sid][0]["COUNTER_CLOSE"];
        $arrTickets[$sid][0]["MESSAGES_OPEN"] = $arrT[$sid][0]["MESSAGES_OPEN"];
        $arrTickets[$sid][0]["OVERDUE_MESSAGES_OPEN"] = $arrT[$sid][0]["OVERDUE_MESSAGES_OPEN"];
        $arrTickets[$sid][0]["MESSAGES_CLOSE"] = $arrT[$sid][0]["MESSAGES_CLOSE"];
        $arrTickets[$sid][0]["OVERDUE_MESSAGES_CLOSE"] = $arrT[$sid][0]["OVERDUE_MESSAGES_CLOSE"];
    }
    while ($zr = $z->Fetch()) {
        $arrTickets[$sid][$zr["ID"]]["NAME"] = "[<a title='" . GetMessage("MAIN_ADMIN_MENU_EDIT") . "' href='/bitrix/admin/ticket_dict_edit.php?ID=" . $zr["ID"] . "'>" . $zr["ID"] . "</a>] " . htmlspecialcharsbx($zr["NAME"]);
        $arrTickets[$sid][$zr["ID"]]["COUNTER_OPEN"] = $arrT[$sid][$zr["ID"]]["COUNTER_OPEN"];
        $arrTickets[$sid][$zr["ID"]]["COUNTER_OPEN_RED"] = $arrT[$sid][$zr["ID"]]["COUNTER_OPEN_RED"];
        $arrTickets[$sid][$zr["ID"]]["COUNTER_OPEN_GREEN"] = $arrT[$sid][$zr["ID"]]["COUNTER_OPEN_GREEN"];
        $arrTickets[$sid][$zr["ID"]]["COUNTER_CLOSE"] = $arrT[$sid][$zr["ID"]]["COUNTER_CLOSE"];
        $arrTickets[$sid][$zr["ID"]]["MESSAGES_OPEN"] = $arrT[$sid][$zr["ID"]]["MESSAGES_OPEN"];
        $arrTickets[$sid][$zr["ID"]]["OVERDUE_MESSAGES_OPEN"] = $arrT[$sid][$zr["ID"]]["OVERDUE_MESSAGES_OPEN"];
        $arrTickets[$sid][$zr["ID"]]["MESSAGES_CLOSE"] = $arrT[$sid][$zr["ID"]]["MESSAGES_CLOSE"];
        $arrTickets[$sid][$zr["ID"]]["OVERDUE_MESSAGES_CLOSE"] = $arrT[$sid][$zr["ID"]]["OVERDUE_MESSAGES_CLOSE"];
    }
}
Esempio n. 8
0
 public function ReceiveMessage($senderJId, array $arMessage, CXMPPClient $senderClient)
 {
     if (strlen($senderJId) <= 0) {
         return false;
     }
     if (!array_key_exists("iq", $arMessage) || !array_key_exists("bind", $arMessage["iq"]) || $arMessage['iq']['bind']['.']['xmlns'] != 'urn:ietf:params:xml:ns:xmpp-bind') {
         return false;
     }
     $type = "";
     if (array_key_exists("type", $arMessage["iq"]["."])) {
         $type = $arMessage["iq"]["."]["type"];
     }
     if ($type == "set") {
         $resource = $arMessage["iq"]["bind"]["resource"]["#"];
         if (strlen($resource) <= 0) {
             $resource = "bx";
         }
         $senderClient->SetResource($resource);
         $arMessageTmp = array("iq" => array("." => array("type" => "result", "to" => htmlspecialcharsbx($senderClient->GetClientDomain()) . "/" . $senderClient->GetStreamId(), "id" => $arMessage['iq']['.']['id']), "bind" => array("." => array("xmlns" => "urn:ietf:params:xml:ns:xmpp-bind"), "jid" => array("#" => $senderJId . "/" . $resource))));
         $messageTmp = CXMPPParser::ToXml($arMessageTmp);
         $senderClient->__Send($messageTmp);
     } else {
         $arMessageTmp = array("iq" => array("." => array("type" => "result", "from" => $senderClient->GetClientDomain(), "id" => $arMessage['iq']['.']['id'])));
         $messageTmp = CXMPPParser::ToXml($arMessageTmp);
         $senderClient->__Send($messageTmp);
     }
     return true;
 }
Esempio n. 9
0
 function CreatePropertyTables($entity_id)
 {
     global $DB, $APPLICATION;
     if (!$DB->TableExists("b_utm_" . strtolower($entity_id))) {
         if (defined("MYSQL_TABLE_TYPE")) {
             $DB->Query("SET storage_engine = '" . MYSQL_TABLE_TYPE . "'", true);
         }
         $rs = $DB->Query("\n\t\t\t\tcreate table b_utm_" . strtolower($entity_id) . " (\n\t\t\t\t\tID int(11) not null auto_increment,\n\t\t\t\t\tVALUE_ID int(11) not null,\n\t\t\t\t\tFIELD_ID int(11) not null,\n\t\t\t\t\tVALUE text,\n\t\t\t\t\tVALUE_INT int,\n\t\t\t\t\tVALUE_DOUBLE float,\n\t\t\t\t\tVALUE_DATE datetime,\n\t\t\t\t\tINDEX ix_utm_" . $entity_id . "_1(FIELD_ID),\n\t\t\t\t\tINDEX ix_utm_" . $entity_id . "_2(VALUE_ID),\n\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t)\n\t\t\t", false, "FILE: " . __FILE__ . "<br>LINE: " . __LINE__);
         if (!$rs) {
             $APPLICATION->ThrowException(GetMessage("USER_TYPE_TABLE_CREATION_ERROR", array("#ENTITY_ID#" => htmlspecialcharsbx($entity_id))));
             return false;
         }
     }
     if (!$DB->TableExists("b_uts_" . strtolower($entity_id))) {
         if (defined("MYSQL_TABLE_TYPE")) {
             $DB->Query("SET storage_engine = '" . MYSQL_TABLE_TYPE . "'", true);
         }
         $rs = $DB->Query("\n\t\t\t\tcreate table b_uts_" . strtolower($entity_id) . " (\n\t\t\t\t\tVALUE_ID int(11) not null,\n\t\t\t\t\tPRIMARY KEY (VALUE_ID)\n\t\t\t\t)\n\t\t\t", false, "FILE: " . __FILE__ . "<br>LINE: " . __LINE__);
         if (!$rs) {
             $APPLICATION->ThrowException(GetMessage("USER_TYPE_TABLE_CREATION_ERROR", array("#ENTITY_ID#" => htmlspecialcharsbx($entity_id))));
             return false;
         }
     }
     return true;
 }
Esempio n. 10
0
 /**
  * @param FieldType $fieldType
  * @param array $field
  * @param mixed $value
  * @param bool $allowSelection
  * @param int $renderMode
  * @return string
  */
 protected static function renderControl(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
 {
     if ($renderMode & FieldType::RENDER_MODE_DESIGNER) {
         return '';
     }
     return '<input type="file" id="' . htmlspecialcharsbx(static::generateControlId($field)) . '" name="' . htmlspecialcharsbx(static::generateControlName($field)) . '">';
 }
Esempio n. 11
0
function fancy_output($content)
{
    if (isTextMode()) {
        return sprintf('<pre>%s</pre>', htmlspecialcharsbx($content));
    }
    return sprintf('<p>%s</e>', $content);
}
Esempio n. 12
0
    public static function GetPublicEditHtml($arProperty, $arValue, $strHTMLControlName)
    {
        $strID = preg_replace('/[^a-zA-Z0-9_]/i', 'x', $strHTMLControlName["VALUE"]);
        CJSCore::Init(array('asd_palette'));
        $strResult = '<input type="text" name="' . htmlspecialcharsbx($strHTMLControlName['VALUE']) . '" id="' . htmlspecialcharsbx($strID) . '" value="' . htmlspecialcharsbx($arValue['VALUE']) . '" />';
        $strResult .= '<script type="text/javascript">
			BX.ready(function()
   			{
     			$("#' . htmlspecialcharsbx($strID) . '").jPicker({
     				window: {title: "' . GetMessage('ASD_UT_PALETTE_WND_TITLE') . '"},
     				images: {clientPath : "/bitrix/js/asd.iblock/jpicker/images/"},
      				localization: {
						text: {
							title: "' . GetMessage('ASD_UT_PALETTE_WND_TITLE') . '",
							newColor: "' . GetMessage('ASD_UT_PALETTE_WND_NEW_COLOR') . '", currentColor: "' . GetMessage('ASD_UT_PALETTE_WND_CURRENT_COLOR') . '",
							ok: "' . GetMessage('ASD_UT_PALETTE_WND_OK') . '", cancel: "' . GetMessage('ASD_UT_PALETTE_WND_CANCEL') . '"
    					},
						tooltips: {
							colors: { newColor: "' . GetMessage('ASD_UT_PALETTE_TIPS_NEW_COLOR') . '", currentColor: "' . GetMessage('ASD_UT_PALETTE_TIPS_CURRENT_COLOR') . '" },
							buttons: { ok: "' . GetMessage('ASD_UT_PALETTE_TIPS_BTN_OK') . '", cancel: "' . GetMessage('ASD_UT_PALETTE_TIPS_BTN_CANCEL') . '" },
							hue: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_HUE_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_HUE_VALUE') . '" },
							saturation: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_SATURATION_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_SATURATION_VALUE') . '" },
							value: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_BRIGHTNESS_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_BRIGHTNESS_VALUE') . '" },
							red: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_RED_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_RED_VALUE') . '" },
							green: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_GREEN_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_GREEN_VALUE') . '" },
							blue: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_BLUE_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_BLUE_VALUE') . '" },
							alpha: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_ALPHA_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_ALPHA_VALUE') . '" },
							hex: { textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_HEX_VALUE') . '", alpha: "' . GetMessage('ASD_UT_PALETTE_TIPS_HEX_ALPHA') . '" }
						}
					}
     			});
   			});
			</script>';
        return $strResult;
    }
 /**
  * @param FieldType $fieldType
  * @param $value
  * @return string
  */
 protected static function formatValuePrintable(FieldType $fieldType, $value)
 {
     if (!Loader::includeModule('disk')) {
         return '';
     }
     $userFieldManager = \Bitrix\Disk\Driver::getInstance()->getUserFieldManager();
     list($connectorClass, $moduleId) = $userFieldManager->getConnectorDataByEntityType('lists_workflow');
     $documentType = $fieldType->getDocumentType();
     $iblockId = str_replace('iblock_', '', $documentType[2]);
     $attachedModel = \Bitrix\Disk\AttachedObject::load(array('OBJECT_ID' => $value, '=ENTITY_TYPE' => $connectorClass, '=ENTITY_ID' => $iblockId, '=MODULE_ID' => $moduleId));
     if (!$attachedModel) {
         return '';
     }
     global $USER;
     $userId = $USER->getID();
     if ($userId) {
         if (!$attachedModel->canRead($userId)) {
             return '';
         }
     }
     $file = $attachedModel->getFile();
     if (!$file) {
         return '';
     }
     $driver = \Bitrix\Disk\Driver::getInstance();
     $urlManager = $driver->getUrlManager();
     return '[url=' . $urlManager->getUrlUfController('download', array('attachedId' => $attachedModel->getId())) . ']' . htmlspecialcharsbx($file->getName()) . '[/url]';
 }
Esempio n. 14
0
    function __CrmFieldMultiEditRenderItem($item, $mnemonic, $typeID, $referenceData, $editorID)
    {
        $itemID = isset($item['ID']) ? $item['ID'] : '';
        $itemVal = isset($item['VALUE']) ? $item['VALUE'] : '';
        ?>
<div class="bx-crm-edit-fm-item">
		<input type="text" class="bx-crm-edit-input" name="<?php 
        echo htmlspecialcharsbx($mnemonic);
        ?>
[<?php 
        echo htmlspecialcharsbx($typeID);
        ?>
][<?php 
        echo htmlspecialcharsbx($itemID);
        ?>
][VALUE]" value="<?php 
        echo htmlspecialcharsbx($itemVal);
        ?>
"><?php 
        echo SelectBoxFromArray(CUtil::JSEscape($mnemonic) . '[' . htmlspecialcharsbx($typeID) . '][' . htmlspecialcharsbx($itemID) . '][VALUE_TYPE]', $referenceData, isset($item['VALUE_TYPE']) ? $item['VALUE_TYPE'] : '', '', "class='bx-crm-edit-input bx-crm-edit-input-small'");
        ?>
<div class="delete-action" onclick="BX.CrmFieldMultiEditor.items['<?php 
        echo CUtil::addslashes($editorID);
        ?>
'].deleteItem('<?php 
        echo CUtil::addslashes($itemID);
        ?>
');" title="<?php 
        echo GetMessage('CRM_STATUS_LIST_DELETE');
        ?>
"></div>
		</div><?php 
    }
Esempio n. 15
0
 function __CrmMobileLeadViewRenderMultiFields($type, &$fields, &$typeInfos)
 {
     $data = isset($fields[$type]) ? $fields[$type] : array();
     if (empty($data)) {
         return '';
     }
     $result = '';
     $typeInfo = isset($typeInfos[$type]) ? $typeInfos[$type] : array();
     foreach ($data as $datum) {
         $value = isset($datum['VALUE']) ? $datum['VALUE'] : '';
         if ($value === '') {
             continue;
         }
         $type = isset($datum['VALUE_TYPE']) ? $datum['VALUE_TYPE'] : '';
         $legend = '';
         if (isset($typeInfo[$type])) {
             $legend = isset($typeInfo[$type]['ABBR']) ? $typeInfo[$type]['ABBR'] : '';
             if ($legend === '' && isset($typeInfo[$type]['SHORT'])) {
                 $legend = $typeInfo[$type]['SHORT'];
             }
         }
         if ($result !== '') {
             $result .= '<br/>';
         }
         $result .= htmlspecialcharsbx($value) . ' ' . htmlspecialcharsbx($legend);
     }
     return $result;
 }
Esempio n. 16
0
	static public function GetFormHtml($arParams)
	{
		$appID = trim(self::GetOption("vkontakte_appid"));
		$appSecret = trim(self::GetOption("vkontakte_appsecret"));

		$gAuth = new CVKontakteOAuthInterface($appID, $appSecret);

		if(IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME'))
		{
			$redirect_uri = self::CONTROLLER_URL."/redirect.php";
			$state = urlencode(CSocServUtil::GetCurUrl('auth_service_id='.self::ID.'&check_key='.$_SESSION["UNIQUE_KEY"]));
		}
		else
		{
			$redirect_uri = CSocServUtil::GetCurUrl('auth_service_id='.self::ID);
			$redirect_uri = CSocServUtil::ServerName().$GLOBALS['APPLICATION']->GetCurPage(true).'?auth_service_id='.self::ID;
			$state = urlencode('site_id='.SITE_ID.'&backurl='.urlencode($GLOBALS["APPLICATION"]->GetCurPageParam('check_key='.$_SESSION["UNIQUE_KEY"], array("logout", "auth_service_error", "auth_service_id", "backurl"))));
		}

		$url = $gAuth->GetAuthUrl($redirect_uri, $state);
		$phrase = ($arParams["FOR_INTRANET"]) ? GetMessage("socserv_vk_note_intranet") : GetMessage("socserv_vk_note");
		if($arParams["FOR_INTRANET"])
			return array("ON_CLICK" => 'onclick="BX.util.popup(\''.htmlspecialcharsbx(CUtil::JSEscape($url)).'\', 580, 400)"');
		return '<a href="javascript:void(0)" onclick="BX.util.popup(\''.htmlspecialcharsbx(CUtil::JSEscape($url)).'\', 580, 400)" class="bx-ss-button vkontakte-button"></a><span class="bx-spacer"></span><span>'.$phrase.'</span>';

	}
Esempio n. 17
0
function __get_import_profiles($strItemID)
{
    global $USER;
    global $adminMenu;
    if (!isset($USER) || !($USER instanceof CUser && 'CUser' == get_class($USER))) {
        return array();
    }
    if (empty($strItemID)) {
        return array();
    }
    $boolRead = $USER->CanDoOperation('catalog_read');
    $boolImportEdit = $USER->CanDoOperation('catalog_import_edit');
    $boolImportExec = $USER->CanDoOperation('catalog_import_exec');
    $arProfileList = array();
    if (($boolRead || $boolImportEdit || $boolImportExec) && method_exists($adminMenu, "IsSectionActive")) {
        if ($adminMenu->IsSectionActive($strItemID)) {
            $rsProfiles = CCatalogImport::GetList(array("NAME" => "ASC", "ID" => "ASC"), array("IN_MENU" => "Y"));
            while ($arProfile = $rsProfiles->Fetch()) {
                $strName = strlen($arProfile["NAME"]) > 0 ? $arProfile["NAME"] : $arProfile["FILE_NAME"];
                if ('Y' == $arProfile['DEFAULT_PROFILE']) {
                    $arProfileList[] = array("text" => htmlspecialcharsbx($strName), "url" => "cat_exec_imp.php?lang=" . LANGUAGE_ID . "&ACT_FILE=" . $arProfile["FILE_NAME"] . "&ACTION=IMPORT&PROFILE_ID=" . $arProfile["ID"] . "&" . bitrix_sessid_get(), "title" => GetMessage("CAM_IMPORT_DESCR_IMPORT") . " &quot;" . htmlspecialcharsbx($strName) . "&quot;", "readonly" => !$boolImportExec);
                } else {
                    $arProfileList[] = array("text" => htmlspecialcharsbx($strName), "url" => "cat_import_setup.php?lang=" . LANGUAGE_ID . "&ACT_FILE=" . $arProfile["FILE_NAME"] . "&ACTION=IMPORT_EDIT&PROFILE_ID=" . $arProfile["ID"] . "&" . bitrix_sessid_get(), "title" => GetMessage("CAM_IMPORT_DESCR_EDIT") . " &quot;" . htmlspecialcharsbx($strName) . "&quot;", "readonly" => !$boolImportEdit);
                }
            }
        }
    }
    return $arProfileList;
}
Esempio n. 18
0
	public function GetFormHtml($arParams)
	{
		$url = $this->getUrl('opener', null, $arParams);
		if($arParams["FOR_INTRANET"])
			return array("ON_CLICK" => 'onclick="BX.util.popup(\''.htmlspecialcharsbx(CUtil::JSEscape($url)).'\', 580, 400)"');
		return '<a href="javascript:void(0)" onclick="BX.util.popup(\''.htmlspecialcharsbx(CUtil::JSEscape($url)).'\', 580, 400)" class="bx-ss-button liveid-button"></a><span class="bx-spacer"></span><span>'.GetMessage("MAIN_OPTION_COMMENT").'</span>';
	}
Esempio n. 19
0
function OnModuleInstalledEvent($id, $installed, $Module)
{
    foreach (GetModuleEvents("main", "OnModuleInstalled", true) as $arEvent) {
        ExecuteModuleEventEx($arEvent, array($id, $installed));
    }
    $cModules = COption::GetOptionString("main", "mp_modules_date", "");
    $arModules = array();
    if (strlen($cModules) > 0) {
        $arModules = unserialize($cModules);
    }
    if ($installed == "Y") {
        $arModules[] = array("ID" => $id, "NAME" => htmlspecialcharsbx($Module->MODULE_NAME), "TMS" => time());
        if (count($arModules) > 3) {
            $arModules = array_slice($arModules, -3);
        }
        COption::SetOptionString("main", "mp_modules_date", serialize($arModules));
    } else {
        foreach ($arModules as $arid => $val) {
            if ($val["ID"] == $id) {
                unset($arModules[$arid]);
            }
        }
        if (count($arModules) > 0) {
            COption::SetOptionString("main", "mp_modules_date", serialize($arModules));
        } else {
            COption::RemoveOption("main", "mp_modules_date");
        }
        $_SESSION["MP_MOD_DELETED"] = array("ID" => $id, "NAME" => $Module->MODULE_NAME);
    }
}
Esempio n. 20
0
function error_alert()
{
	$sTableID = "tbl_php_commandline";
	$arErrorType = array(
		E_ERROR => "Fatal error",
		E_PARSE => "Parse error",
	);
	$e = error_get_last();
	if(is_null($e) === false && isset($arErrorType[$e['type']]))
	{
		ob_end_clean();
		echo "<h2>".GetMessage("php_cmd_error")."&nbsp;</h2><p>";
		echo '<b>'.$arErrorType[$e['type']].'</b>: '.htmlspecialcharsbx($e['message']).' in <b>'.htmlspecialcharsbx($e['file']).'</b> on line <b>'.htmlspecialcharsbx($e['line']).'</b>';
	}
	else
	{
		global $DB;
		if(
			isset($DB)
			&& is_object($DB)
			&& $DB->GetErrorMessage() != ''
		)
		{
			ob_end_clean();
			echo "<h2>".GetMessage("php_cmd_error")."&nbsp;</h2><p>";
			echo '<font color=#ff0000>Query Error: '.htmlspecialcharsbx($DB->GetErrorSQL()).'</font> ['.htmlspecialcharsbx($DB->GetErrorMessage()).']';
		}
	}
}
    function GetSettingsHTML($arBucket, $bServiceSet, $cur_SERVICE_ID, $bVarsFromForm)
    {
        if ($bVarsFromForm) {
            $arSettings = $_POST["SETTINGS"][$this->GetID()];
        } else {
            $arSettings = unserialize($arBucket["SETTINGS"]);
        }
        if (!is_array($arSettings)) {
            $arSettings = array("PROJECT_ID" => "", "ACCESS_KEY" => "", "SECRET_KEY" => "");
        }
        $htmlID = htmlspecialcharsbx($this->GetID());
        $result = '
		<tr id="SETTINGS_0_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr adm-detail-required-field">
			<td>' . GetMessage("CLO_STORAGE_GOOGLE_EDIT_PROJECT_ID") . ':</td>
			<td><input type="hidden" name="SETTINGS[' . $htmlID . '][PROJECT_ID]" id="' . $htmlID . 'PROJECT_ID" value="' . htmlspecialcharsbx($arSettings['PROJECT_ID']) . '"><input type="text" size="55" name="' . $htmlID . 'INP_" id="' . $htmlID . 'INP_PROJECT_ID" value="' . htmlspecialcharsbx($arSettings['PROJECT_ID']) . '" ' . ($arBucket['READ_ONLY'] == 'Y' ? '"disabled"' : '') . ' onchange="BX(\'' . $htmlID . 'PROJECT_ID\').value = this.value"></td>
		</tr>
		<tr id="SETTINGS_1_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr adm-detail-required-field">
			<td>' . GetMessage("CLO_STORAGE_GOOGLE_EDIT_ACCESS_KEY") . ':</td>
			<td><input type="hidden" name="SETTINGS[' . $htmlID . '][ACCESS_KEY]" id="' . $htmlID . 'ACCESS_KEY" value="' . htmlspecialcharsbx($arSettings['ACCESS_KEY']) . '"><input type="text" size="55" name="' . $htmlID . 'INP_ACCESS_KEY" id="' . $htmlID . 'INP_ACCESS_KEY" value="' . htmlspecialcharsbx($arSettings['ACCESS_KEY']) . '" ' . ($arBucket['READ_ONLY'] == 'Y' ? '"disabled"' : '') . ' onchange="BX(\'' . $htmlID . 'ACCESS_KEY\').value = this.value"></td>
		</tr>
		<tr id="SETTINGS_2_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr adm-detail-required-field">
			<td>' . GetMessage("CLO_STORAGE_GOOGLE_EDIT_SECRET_KEY") . ':</td>
			<td><input type="hidden" name="SETTINGS[' . $htmlID . '][SECRET_KEY]" id="' . $htmlID . 'SECRET_KEY" value="' . htmlspecialcharsbx($arSettings['SECRET_KEY']) . '"><input type="text" size="55" name="' . $htmlID . 'INP_SECRET_KEY" id="' . $htmlID . 'INP_SECRET_KEY" value="' . htmlspecialcharsbx($arSettings['SECRET_KEY']) . '" autocomplete="off" ' . ($arBucket['READ_ONLY'] == 'Y' ? '"disabled"' : '') . ' onchange="BX(\'' . $htmlID . 'SECRET_KEY\').value = this.value"></td>
		</tr>
		<tr id="SETTINGS_3_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr">
			<td>&nbsp;</td>
			<td>' . BeginNote() . GetMessage("CLO_STORAGE_GOOGLE_EDIT_HELP") . EndNote() . '</td>
		</tr>
		';
        return $result;
    }
Esempio n. 22
0
 function SelectBox($sFieldName, $sValue, $sDefaultValue = "", $JavaChangeFunc = "", $sAdditionalParams = "")
 {
     if (!isset($GLOBALS["MAIN_EXTRA_LIST_CACHE"]) || !is_array($GLOBALS["MAIN_EXTRA_LIST_CACHE"]) || count($GLOBALS["MAIN_EXTRA_LIST_CACHE"]) < 1) {
         unset($GLOBALS["MAIN_EXTRA_LIST_CACHE"]);
         $l = CExtra::GetList(array("NAME" => "ASC"));
         while ($l_res = $l->Fetch()) {
             $GLOBALS["MAIN_EXTRA_LIST_CACHE"][] = $l_res;
         }
     }
     $s = '<select name="' . $sFieldName . '"';
     if (!empty($JavaChangeFunc)) {
         $s .= ' OnChange="' . $JavaChangeFunc . '"';
     }
     if (!empty($sAdditionalParams)) {
         $s .= ' ' . $sAdditionalParams . ' ';
     }
     $s .= '>' . "\n";
     $found = false;
     $intCount = count($GLOBALS["MAIN_EXTRA_LIST_CACHE"]);
     for ($i = 0; $i < $intCount; $i++) {
         $found = intval($GLOBALS["MAIN_EXTRA_LIST_CACHE"][$i]["ID"]) == intval($sValue);
         $s1 .= '<option value="' . $GLOBALS["MAIN_EXTRA_LIST_CACHE"][$i]["ID"] . '"' . ($found ? ' selected' : '') . '>' . htmlspecialcharsbx($GLOBALS["MAIN_EXTRA_LIST_CACHE"][$i]["NAME"]) . ' (' . htmlspecialcharsbx($GLOBALS["MAIN_EXTRA_LIST_CACHE"][$i]["PERCENTAGE"]) . '%)</option>' . "\n";
     }
     if (!empty($sDefaultValue)) {
         $s .= "<option value='' " . ($found ? "" : "selected") . ">" . htmlspecialcharsbx($sDefaultValue) . "</option>";
     }
     return $s . $s1 . '</select>';
 }
Esempio n. 23
0
function BXCreateSection(&$fileContent, &$sectionFileContent, &$absoluteFilePath, &$sectionPath)
{
    //Check quota
    $quota = new CDiskQuota();
    if (!$quota->CheckDiskQuota(array("FILE_SIZE" => strlen($fileContent) + strlen($sectionFileContent)))) {
        $GLOBALS["APPLICATION"]->ThrowException($quota->LAST_ERROR, "BAD_QUOTA");
        return false;
    }
    $io = CBXVirtualIo::GetInstance();
    //Create dir
    if (!$io->CreateDirectory($absoluteFilePath)) {
        $GLOBALS["APPLICATION"]->ThrowException(GetMessage("PAGE_NEW_FOLDER_CREATE_ERROR") . "<br /> (" . htmlspecialcharsbx($absoluteFilePath) . ")", "DIR_NOT_CREATE");
        return false;
    }
    //Create .section.php
    $f = $io->GetFile($absoluteFilePath . "/.section.php");
    if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/.section.php", $sectionFileContent)) {
        return false;
    }
    //Create index.php
    if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/index.php", $fileContent)) {
        return false;
    } else {
        if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
            $res_log['path'] = $sectionPath . "/index.php";
            CEventLog::Log("content", "PAGE_ADD", "main", "", serialize($res_log));
        }
    }
    return true;
}
Esempio n. 24
0
    function GetSettingsHTML($arBucket, $bServiceSet, $cur_SERVICE_ID, $bVarsFromForm)
    {
        if ($bVarsFromForm) {
            $arSettings = $_POST["SETTINGS"][$this->GetID()];
        } else {
            $arSettings = unserialize($arBucket["SETTINGS"]);
        }
        if (!is_array($arSettings)) {
            $arSettings = array("HOST" => "testapi.clodo.ru", "USER" => "", "KEY" => "");
        }
        $htmlID = htmlspecialcharsbx($this->GetID());
        $result = '
		<tr id="SETTINGS_2_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr adm-detail-required-field">
			<td>' . GetMessage("CLO_STORAGE_CLODO_EDIT_HOST") . ':</td>
			<td><input type="hidden" name="SETTINGS[' . $htmlID . '][HOST]" id="' . $htmlID . 'HOST" value="' . htmlspecialcharsbx($arSettings['HOST']) . '"><input type="text" size="55" name="' . $htmlID . 'INP_HOST" id="' . $htmlID . 'INP_HOST" value="' . htmlspecialcharsbx($arSettings['HOST']) . '" ' . ($arBucket['READ_ONLY'] == 'Y' ? '"disabled"' : '') . ' onchange="BX(\'' . $htmlID . 'HOST\').value = this.value"></td>
		</tr>
		<tr id="SETTINGS_0_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr adm-detail-required-field">
			<td>' . GetMessage("CLO_STORAGE_CLODO_EDIT_USER") . ':</td>
			<td><input type="hidden" name="SETTINGS[' . $htmlID . '][USER]" id="' . $htmlID . 'USER" value="' . htmlspecialcharsbx($arSettings['USER']) . '"><input type="text" size="55" name="' . $htmlID . 'INP_" id="' . $htmlID . 'INP_USER" value="' . htmlspecialcharsbx($arSettings['USER']) . '" ' . ($arBucket['READ_ONLY'] == 'Y' ? '"disabled"' : '') . ' onchange="BX(\'' . $htmlID . 'USER\').value = this.value"></td>
		</tr>
		<tr id="SETTINGS_1_' . $htmlID . '" style="display:' . ($cur_SERVICE_ID == $this->GetID() || !$bServiceSet ? '' : 'none') . '" class="settings-tr adm-detail-required-field">
			<td>' . GetMessage("CLO_STORAGE_CLODO_EDIT_KEY") . ':</td>
			<td><input type="hidden" name="SETTINGS[' . $htmlID . '][KEY]" id="' . $htmlID . 'KEY" value="' . htmlspecialcharsbx($arSettings['KEY']) . '"><input type="text" size="55" name="' . $htmlID . 'INP_KEY" id="' . $htmlID . 'INP_KEY" value="' . htmlspecialcharsbx($arSettings['KEY']) . '" autocomplete="off" ' . ($arBucket['READ_ONLY'] == 'Y' ? '"disabled"' : '') . ' onchange="BX(\'' . $htmlID . 'KEY\').value = this.value"></td>
		</tr>
		';
        return $result;
    }
Esempio n. 25
0
 /**
  * Method will be invoked after an database record updated.
  *
  * @param array $oldRecord All fields before update.
  * @param array $newRecord All fields after update.
  *
  * @return void
  */
 public static function afterUpdateTrigger(array $oldRecord, array $newRecord)
 {
     if ($oldRecord['TITLE'] !== $newRecord['TITLE']) {
         if (\CModule::IncludeModule("pull")) {
             $ar = \CIMChat::GetRelationById($newRecord['CHAT_ID']);
             foreach ($ar as $rel) {
                 \CIMContactList::CleanChatCache($rel['USER_ID']);
                 \CPullStack::AddByUser($rel['USER_ID'], array('module_id' => 'im', 'command' => 'chatRename', 'params' => array('chatId' => $newRecord['CHAT_ID'], 'chatTitle' => htmlspecialcharsbx($newRecord['TITLE']))));
             }
         }
     }
     if ($oldRecord['AVATAR'] !== $newRecord['AVATAR']) {
         if (\CModule::IncludeModule('pull')) {
             $avatarImage = \CIMChat::GetAvatarImage($newRecord['AVATAR']);
             $ar = \CIMChat::GetRelationById($newRecord['CHAT_ID']);
             foreach ($ar as $relation) {
                 \CIMContactList::CleanChatCache($relation['USER_ID']);
                 \CPullStack::AddByUser($relation['USER_ID'], array('module_id' => 'im', 'command' => 'chatAvatar', 'params' => array('chatId' => $newRecord['CHAT_ID'], 'chatAvatar' => $avatarImage)));
             }
         }
     }
     if ($oldRecord['COLOR'] !== $newRecord['COLOR']) {
         if (\CModule::IncludeModule('pull')) {
             $ar = \CIMChat::GetRelationById($newRecord['CHAT_ID']);
             foreach ($ar as $relation) {
                 \CIMContactList::CleanChatCache($relation['USER_ID']);
                 \CPullStack::AddByUser($relation['USER_ID'], array('module_id' => 'im', 'command' => 'chatChangeColor', 'params' => array('chatId' => $newRecord['CHAT_ID'], 'chatColor' => \Bitrix\Im\Color::getColor($newRecord['COLOR']))));
             }
         }
     }
 }
Esempio n. 26
0
 public function prepareDataForEdit($entityTypeID, array &$fields, $encode = true)
 {
     /** @var DealConverter $converter */
     $converter = $this->converter;
     $userFields = DealConversionMapper::getUserFields($entityTypeID);
     $mappedFields = $converter->mapEntityFields($entityTypeID, array('ENABLE_FILES' => false));
     foreach ($mappedFields as $k => $v) {
         if ($k === 'PRODUCT_ROWS') {
             $fields[$k] = $v;
             continue;
         } elseif (strpos($k, 'UF_CRM') === 0) {
             $userField = isset($userFields[$k]) ? $userFields[$k] : null;
             if (is_array($userField)) {
                 // hack for UF
                 if ($userField['USER_TYPE_ID'] === 'file') {
                     $GLOBALS["{$k}_old_id"] = $v;
                 } else {
                     $_REQUEST[$k] = $v;
                 }
             }
         } elseif ($encode) {
             $fields["~{$k}"] = $v;
             if (!is_array($v)) {
                 $fields[$k] = htmlspecialcharsbx($v);
             }
         }
     }
 }
Esempio n. 27
0
    function GetSettingsHTML($arUserField = false, $arHtmlControl, $bVarsFromForm)
    {
        $result = '';
        if ($bVarsFromForm) {
            $iblock_id = $GLOBALS[$arHtmlControl["NAME"]]["IBLOCK_ID"];
        } elseif (is_array($arUserField)) {
            $iblock_id = $arUserField["SETTINGS"]["IBLOCK_ID"];
        } else {
            $iblock_id = "";
        }
        if (CModule::IncludeModule('iblock')) {
            $result .= '
			<tr>
				<td>' . GetMessage("USER_TYPE_WEBDAV_FILE_IBLOCK_ID") . ':</td>
				<td>
					' . GetIBlockDropDownList($iblock_id, $arHtmlControl["NAME"] . '[IBLOCK_TYPE_ID]', $arHtmlControl["NAME"] . '[IBLOCK_ID]', false, 'class="adm-detail-iblock-types"', 'class="adm-detail-iblock-list"') . '
				</td>
			</tr>
			';
        } else {
            $result .= '
			<tr>
				<td>' . GetMessage("USER_TYPE_WEBDAV_FILE_IBLOCK_ID") . ':</td>
				<td>
					<input type="text" size="6" name="' . $arHtmlControl["NAME"] . '[IBLOCK_ID]" value="' . htmlspecialcharsbx($value) . '">
				</td>
			</tr>
			';
        }
        if ($bVarsFromForm) {
            $value = $GLOBALS[$arHtmlControl["NAME"]]["UF_TO_SAVE_ALLOW_EDIT"];
        } elseif (is_array($arUserField)) {
            $value = $arUserField["SETTINGS"]["UF_TO_SAVE_ALLOW_EDIT"];
        } else {
            $value = '';
        }
        $result .= '
		<tr>
			<td>' . GetMessage("USER_TYPE_WEBDAV_FILE_UF_TO_SAVE_ALLOW_EDIT") . ':</td>
			<td>
				<input type="text" name="' . $arHtmlControl["NAME"] . '[UF_TO_SAVE_ALLOW_EDIT]" size="40"  maxlength="20" value="' . $value . '">
			</td>
		</tr>
		';
        /*if($bVarsFromForm)
        			$SECTION_ID = $GLOBALS[$arHtmlControl["NAME"]]["SECTION_ID"] === "Y"? "Y": "N";
        		elseif(is_array($arUserField))
        			$SECTION_ID = $arUserField["SETTINGS"]["SECTION_ID"] === "Y"? "Y": "N";
        		else
        			$SECTION_ID = "N";*/
        if ($bVarsFromForm) {
            $value = $GLOBALS[$arHtmlControl["NAME"]]["DEFAULT_VALUE"];
        } elseif (is_array($arUserField)) {
            $value = $arUserField["SETTINGS"]["DEFAULT_VALUE"];
        } else {
            $value = "";
        }
        return $result;
    }
Esempio n. 28
0
function ___WDBPStartWorkflowParametersShow($templateId, $arWorkflowParameters, $bVarsFromForm, &$arFields)
{
    $templateId = intval($templateId);
    if ($templateId <= 0) {
        return;
    }
    if (!isset($arWorkflowParameters) || !is_array($arWorkflowParameters)) {
        $arWorkflowParameters = array();
    }
    $arParametersValues = array();
    $keys = array_keys($arWorkflowParameters);
    foreach ($keys as $key) {
        $v = $bVarsFromForm ? $_REQUEST["bizproc" . $templateId . "_" . $key] : $arWorkflowParameters[$key]["Default"];
        if (!is_array($v)) {
            $arParametersValues[$key] = htmlspecialcharsbx($v);
        } else {
            $keys1 = array_keys($v);
            foreach ($keys1 as $key1) {
                $arParametersValues[$key][$key1] = htmlspecialcharsbx($v[$key1]);
            }
        }
    }
    foreach ($arWorkflowParameters as $parameterKey => $arParameter) {
        $parameterKeyExt = "bizproc" . $templateId . "_" . $parameterKey;
        $sData = GetMessage("BPCGDOC_INVALID_TYPE");
        switch ($arParameter["Type"]) {
            case "int":
            case "double":
                $sData = '<input type="text" name="' . $parameterKeyExt . '" size="10" value="' . $arParametersValues[$parameterKey] . '" />';
                break;
            case "string":
                $sData = '<input type="text" name="' . $parameterKeyExt . '" size="50" value="' . $arParametersValues[$parameterKey] . '" />';
                break;
            case "text":
                $sData = '<textarea name="' . $parameterKeyExt . '" rows="5" cols="40">' . $arParametersValues[$parameterKey] . '</textarea>';
                break;
            case "select":
                $sData = '<select name="' . $parameterKeyExt . ($arParameter["Multiple"] ? '[]" size="5" multiple="multiple"' : '"') . '>';
                if (is_array($arParameter["Options"]) && count($arParameter["Options"]) > 0) {
                    foreach ($arParameter["Options"] as $key => $value) {
                        $sData .= '<option value="' . $key . '"' . (!$arParameter["Multiple"] && $key == $arParametersValues[$parameterKey] || $arParameter["Multiple"] && is_array($arParametersValues[$parameterKey]) && in_array($key, $arParametersValues[$parameterKey]) ? ' selected="selected"' : '') . '>' . $value . '</option>';
                    }
                }
                $sData .= '</select>';
                break;
            case "bool":
                $sData = '<select name="' . $parameterKeyExt . '">' . '<option value="Y"' . ($arParametersValues[$parameterKey] == "Y" ? ' selected="selected"' : '') . '>' . GetMessage("WD_Y") . '</option>' . '<option value="N"' . ($arParametersValues[$parameterKey] == "N" ? ' selected="selected"' : '') . '>' . GetMessage("WD_N") . '</option>' . '</select>';
                break;
            case "date":
            case "datetime":
                $sData = CAdminCalendar::CalendarDate($parameterKeyExt, $arParametersValues[$parameterKey], 19, $arParameter["Type"] == "date");
                break;
            case "user":
                $sData = '<textarea name="' . $parameterKeyExt . '" id="id_' . $parameterKeyExt . '" rows="3" cols="40">' . $arParametersValues[$parameterKey] . '</textarea><input type="button" value="..." onclick="BPAShowSelector(\'id_' . $parameterKeyExt . '\', \'user\');" />';
                break;
        }
        $arFields[] = array("id" => $parameterKeyExt, "required" => $arParameter["Required"], "name" => $arParameter["Name"], "tooltip" => trim($arParameter["Description"]), "type" => "custom", "value" => $sData);
    }
}
Esempio n. 29
0
	public function GetFormHtml($arParams)
	{
		$url = self::getUrl();
		$phrase = ($arParams["FOR_INTRANET"]) ? GetMessage("socserv_google_form_note_intranet") : GetMessage("socserv_google_form_note");
		if($arParams["FOR_INTRANET"])
			return array("ON_CLICK" => 'onclick="BX.util.popup(\''.htmlspecialcharsbx(CUtil::JSEscape($url)).'\', 580, 400)"');
		return '<a href="javascript:void(0)" onclick="BX.util.popup(\''.htmlspecialcharsbx(CUtil::JSEscape($url)).'\', 580, 400)" class="bx-ss-button google-button"></a><span class="bx-spacer"></span><span>'.$phrase.'</span>';
	}
Esempio n. 30
-1
    function GetSettingsHTML($arUserField = false, $arHtmlControl, $bVarsFromForm)
    {
        $result = '';
        if ($bVarsFromForm) {
            $value = htmlspecialcharsbx($GLOBALS[$arHtmlControl['NAME']]['ENTITY_TYPE']);
        } elseif (is_array($arUserField)) {
            $value = htmlspecialcharsbx($arUserField['SETTINGS']['ENTITY_TYPE']);
        } else {
            $value = '';
        }
        $ar = CCrmStatus::GetEntityTypes();
        foreach ($ar as $entityType) {
            $arr['reference'][] = $entityType['NAME'];
            $arr['reference_id'][] = $entityType['ID'];
        }
        $result .= '
		<tr>
			<td>' . GetMessage('USER_TYPE_CRM_ENTITY_TYPE') . ':</td>
			<td>
				' . SelectBoxFromArray($arHtmlControl["NAME"] . '[ENTITY_TYPE]', $arr, $value) . '
			</td>
		</tr>
		';
        return $result;
    }