10 private static $cachedTasks =
array();
18 $searchInputID = strval($searchInputID);
19 $dataInputID = strval($dataInputID);
34 $delay = intval($delay);
40 echo
'<input type="text" id="',
htmlspecialcharsbx($searchInputID) ,
'" style="width:200px;" >',
44 'BX.ready(function(){',
45 'BX.CrmUserSearchPopup.deletePopup("',
$ID,
'");',
46 'BX.CrmUserSearchPopup.create("',
$ID,
'", { searchInput: BX("', CUtil::JSEscape($searchInputID),
'"), dataInput: BX("', CUtil::JSEscape($dataInputID),
'"), componentName: "', CUtil::JSEscape(
$componentName),
'", user: {} }, ', $delay,
');',
49 $GLOBALS[
'APPLICATION']->IncludeComponent(
50 'bitrix:intranet.user.selector.new',
55 'INPUT_NAME' => $searchInputID,
56 'SHOW_EXTRANET_USERS' =>
'NONE',
62 array(
'HIDE_ICONS' =>
'Y')
66 public static function getWorkflowTasks($workflowId, $withUsers =
false, $extendUserInfo =
false)
68 $withUsers = $withUsers ? 1 : 0;
69 $extendUserInfo = $extendUserInfo ? 1 : 0;
73 return [
'COMPLETED' => [],
'RUNNING' => []];
76 if (!isset(self::$cachedTasks[$workflowId][$withUsers][$extendUserInfo]))
82 [
'WORKFLOW_ID' => $workflowId],
100 while ($task = $taskIterator->getNext())
103 $tasks[
$key][] = $task;
104 $ids[] = $task[
'ID'];
106 if ($withUsers &&
sizeof($ids))
112 $tasks[
'COMPLETED_CNT'] =
sizeof($tasks[
'COMPLETED']);
113 $tasks[
'RUNNING_CNT'] =
sizeof($tasks[
'RUNNING']);
115 self::$cachedTasks[$workflowId][$withUsers][$extendUserInfo] = $tasks;
118 return self::$cachedTasks[$workflowId][$withUsers][$extendUserInfo];
124 foreach ($tasks as &$t)
126 $t[
'USERS'] =
array();
128 if (isset($taskUsers[$t[
'ID']]))
130 foreach ($taskUsers[$t[
'ID']] as $u)
134 if (empty($u[
'FULL_NAME']))
136 if (empty($u[
'PHOTO_SRC']))
140 $t[
'USERS_CNT'] =
sizeof($t[
'USERS']);
150 if (empty($user[
'PERSONAL_PHOTO']))
152 $arFileTmp = \CFile::ResizeImageGet(
153 $user[
"PERSONAL_PHOTO"],
154 array(
'width' => 58,
'height' => 58),
158 return $arFileTmp[
'src'];
165 'select' => [
'ID',
'NAME',
'LAST_NAME',
'SECOND_NAME',
'LOGIN'],
177 return \CUser::FormatName(\CSite::GetNameFormat(
false), $user,
true,
false);
192 if (CModule::includeModule(
"fileman"))
194 $editor = new \CHTMLEditor;
196 'useFileDialogs' =>
false,
198 'minBodyWidth' => 350,
199 'normalBodyWidth' => 555,
200 'bAllowPhp' =>
false,
201 'limitPhpAccess' =>
false,
202 'showTaskbars' =>
false,
203 'showNodeNavi' =>
false,
204 'askBeforeUnloadPage' =>
true,
207 'autoResize' =>
true,
208 'autoResizeOffset' => 40,
209 'saveOnBlur' =>
true,
210 'controlsMap' =>
array(
211 array(
'id' =>
'Bold',
'compact' =>
true,
'sort' => 80),
212 array(
'id' =>
'Italic',
'compact' =>
true,
'sort' => 90),
213 array(
'id' =>
'Underline',
'compact' =>
true,
'sort' => 100),
214 array(
'id' =>
'Strikeout',
'compact' =>
true,
'sort' => 110),
215 array(
'id' =>
'RemoveFormat',
'compact' =>
true,
'sort' => 120),
216 array(
'id' =>
'Color',
'compact' =>
true,
'sort' => 130),
217 array(
'id' =>
'FontSelector',
'compact' =>
false,
'sort' => 135),
218 array(
'id' =>
'FontSize',
'compact' =>
false,
'sort' => 140),
219 array(
'separator' =>
true,
'compact' =>
false,
'sort' => 145),
220 array(
'id' =>
'OrderedList',
'compact' =>
true,
'sort' => 150),
221 array(
'id' =>
'UnorderedList',
'compact' =>
true,
'sort' => 160),
222 array(
'id' =>
'AlignList',
'compact' =>
false,
'sort' => 190),
223 array(
'separator' =>
true,
'compact' =>
false,
'sort' => 200),
224 array(
'id' =>
'InsertLink',
'compact' =>
true,
'sort' => 210,
'wrap' =>
'bx-b-link-'.$id),
225 array(
'id' =>
'InsertImage',
'compact' =>
false,
'sort' => 220),
226 array(
'id' =>
'InsertVideo',
'compact' =>
true,
'sort' => 230,
'wrap' =>
'bx-b-video-'.$id),
227 array(
'id' =>
'InsertTable',
'compact' =>
false,
'sort' => 250),
228 array(
'id' =>
'Code',
'compact' =>
true,
'sort' => 260),
229 array(
'id' =>
'Quote',
'compact' =>
true,
'sort' => 270,
'wrap' =>
'bx-b-quote-'.$id),
230 array(
'id' =>
'Smile',
'compact' =>
false,
'sort' => 280),
231 array(
'separator' =>
true,
'compact' =>
false,
'sort' => 290),
232 array(
'id' =>
'Fullscreen',
'compact' =>
false,
'sort' => 310),
233 array(
'id' =>
'BbCode',
'compact' =>
true,
'sort' => 340),
234 array(
'id' =>
'More',
'compact' =>
true,
'sort' => 400)
237 'name' => $fieldName.
'[TEXT]',
238 'inputName' => $fieldName.
'[TEXT]',
245 echo
'<input type="hidden" name="'.$fieldName.
'[TYPE]" value="html">';
258 if (\
Bitrix\Main\Loader::includeModule(
'disk'))
270 if (\
Bitrix\Main\Loader::includeModule(
'disk'))
278 private static function replaceFileLinks(
string $description, $isMobile =
false)
280 $callback = $isMobile ? self::getMobileFileLinksReplaceCallback() : self::getFileLinksReplaceCallback();
282 return preg_replace_callback(
283 '|<a href="(/bitrix/tools/bizproc_show_file.php\?)([^"]+)"[^>]*>|',
289 private static function getFileLinksReplaceCallback()
299 $attributes = \Bitrix\Main\UI\Viewer\ItemAttributes::buildByFileId(
303 return "<a href=\"".$matches[1].$matches[2].
"\" ".$attributes.
">";
305 catch (ArgumentException $e)
308 '<a class="bizproc-file-not-found" data-hint="%s" data-hint-no-icon data-hint-center>',
309 Loc::getMessage(
'BIZPROC_VIEW_HELPER_FILE_NOT_FOUND')
318 private static function getMobileFileLinksReplaceCallback()
331 $query[
'mobile_action'] =
'bp_show_file';
334 return '<a href="#" data-url="' .
SITE_DIR .
'mobile/ajax.php?' . http_build_query(
$query)
336 .
'" onclick="BXMobileApp.UI.Document.open({url: this.getAttribute(\'data-url\'), '
337 .
'filename: this.getAttribute(\'data-name\')}); return false;">'
342 private static function replaceDiskLinks(
string $description, $isMobile =
false)
344 $callback = $isMobile ? self::getMobileDiskLinksReplaceCallback() : self::getDiskLinksReplaceCallback();
346 return preg_replace_callback(
347 '|<a href="(/bitrix/tools/disk/uf.php\?)([^"]+)"[^>]*>([^<]+)|',
353 private static function getDiskLinksReplaceCallback()
359 if (isset(
$query[
'attachedId']))
361 $attach = \Bitrix\Disk\AttachedObject::loadById(
$query[
'attachedId']);
366 $attributes = \Bitrix\Main\UI\Viewer\ItemAttributes::buildByFileId(
367 $attach->getFileId(),
370 return "<a href=\"".$matches[1].$matches[2].
"\" ".$attributes.
">".
$matches[3];
372 catch (ArgumentException $e)
375 '<a class="bizproc-file-not-found" data-hint="%s" data-hint-no-icon data-hint-center>',
376 Loc::getMessage(
'BIZPROC_VIEW_HELPER_FILE_NOT_FOUND')
386 private static function getMobileDiskLinksReplaceCallback()
393 $query[
'mobile_action'] =
'disk_uf_view';
396 return '<a href="#" data-url="'.SITE_DIR.
'mobile/ajax.php?'.http_build_query(
$query)
397 .
'" data-name="'.
htmlspecialcharsbx(
$filename).
'" onclick="BXMobileApp.UI.Document.open({url: this.getAttribute(\'data-url\'), filename: this.getAttribute(\'data-name\')}); return false;">'.
$matches[3];
404 string $context = self::DESKTOP_CONTEXT
409 if (!isset($cache[$workflowId]))
411 $cache[$workflowId] = ResultTable::getList([
413 '=WORKFLOW_ID' => $workflowId,
415 'select' => [
'ACTIVITY',
'RESULT'],
420 $renderedResult =
null;
436 ? (
new \
Bitrix\Bizproc\Result\MobileResultHandler($workflowId))->handle($renderedResult)
437 : (new \Bitrix\Bizproc\Result\WebResultHandler($workflowId))->handle($renderedResult)
440 return $processedResult;
450 $thisYear = $date->
format(
'Y') === date(
'Y');
453 ?
$culture?->getDayMonthFormat() ??
'j F'
454 :
$culture?->getLongDateFormat() ??
'j F Y'
456 $tf =
$culture?->getShortTimeFormat() ??
'H:i';
458 return \FormatDate(
"$df, $tf", $date->
toUserTime());
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getRow(array $parameters)
static callStaticMethod($code, $method, $arParameters=array())
static GetList($arOrder=array("ID"=> "DESC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static getTaskUsers($taskId)
static renderUserSearch($ID, $searchInputID, $dataInputID, $componentName, $siteID='', $nameFormat='', $delay=0)
static getUserFullNameById(int $userId)
static getUserFullName(array $user)
static getUserPhotoSrc(array $user)
static getWorkflowResult(string $workflowId, int $userId, string $context=self::DESKTOP_CONTEXT)
static getHtmlEditor($id, $fieldName, $content='')
static formatDateTime(?DateTime $date)
static prepareMobileTaskDescription($description)
static getWorkflowTasks($workflowId, $withUsers=false, $extendUserInfo=false)
static prepareTaskDescription($description)
static joinUsersToTasks(&$tasks, &$taskUsers, $extendUserInfo=false)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
const BX_RESIZE_IMAGE_EXACT
const SITE_DIR(!defined('LANG'))
htmlspecialcharsback($str)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
if(empty($signedUserToken)) $key
$GLOBALS['_____370096793']