<?php
print_r($arResult);
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/main/utils.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/bitrix/forum.interface/templates/popup/script.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/bitrix/forum.interface/templates/.default/script.js");
$arParams["FILES_COUNT"] = intVal(intVal($arParams["FILES_COUNT"]) > 0 ? $arParams["FILES_COUNT"] : 1);
$arParams["IMAGE_SIZE"] = (intVal($arParams["IMAGE_SIZE"]) > 0 ? $arParams["IMAGE_SIZE"] : 100);
if (LANGUAGE_ID == 'ru')
{
$path = str_replace(array("\\", "//"), "/", dirname(__FILE__)."/ru/script.php");
include($path);
}
?>
<script>
BX.message({
TASKS_COMMENTS_CONFIRM_REMOVE : '<?php echo GetMessageJS('TASKS_COMMENTS_CONFIRM_REMOVE'); ?>'
});
</script>
<a name="postform"></a>
<div class="task-comments"></div>
<div id="form-comment-0">
<div id="task-comments-add-new-0" class="task-comments-add-new"<?php if (!empty($arResult["MESSAGE_VIEW"]) || !empty($arResult["ERROR_MESSAGE"])):?> style="display: none;"<?php endif?>>
<a id="task-comments-add-new-btn-add" style="display:none;" href="javascript: void(0);" class="task-comments-add-new-link" onclick="ShowCommentForm('0'); return false;"><?php echo GetMessage("F_ADD_COMMENT")?></a>
</div>
</div>
<?php if (!empty($arResult["MESSAGE_VIEW"])):?>
<div class="reviews-header-box">
<div class="reviews-header-title">
<span><?php echo GetMessage("F_PREVIEW")?> </span>
</div>
</div>
<div class="reviews-info-box reviews-post-preview">
<div class="reviews-info-box-inner">
<div class="reviews-post-entry">
<div class="reviews-post-text">
<?php echo $arResult["MESSAGE_VIEW"]["POST_MESSAGE_TEXT"]?>
</div>
<?php if (!empty($arResult["REVIEW_FILES"])):?>
<div class="reviews-post-attachments">
<label><?php echo GetMessage("F_ATTACH_FILES")?> </label>
<?php foreach ($arResult["REVIEW_FILES"] as $arFile):?>
<div class="reviews-post-attachment">
<?php
$GLOBALS["APPLICATION"]->IncludeComponent(
"bitrix:forum.interface",
"show_file",
Array(
"FILE" => $arFile,
"WIDTH" => $arResult["PARSER"]->image_params["width"],
"HEIGHT" => $arResult["PARSER"]->image_params["height"],
"CONVERT" => "N",
"FAMILY" => "FORUM",
"SINGLE" => "Y",
"RETURN" => "N",
"SHOW_LINK" => "Y"
),
null,
array("HIDE_ICONS" => "Y")
);
?>
</div>
<?php endforeach?>
</div>
<?php endif?>
</div>
</div>
</div>
<div class="reviews-br"></div>
<?php endif?>
<?php if (!empty($arResult["ERROR_MESSAGE"])):?>
<div class="reviews-note-box reviews-note-error">
<div class="reviews-note-box-text">
<?php echo ShowError($arResult["ERROR_MESSAGE"], "reviews-note-error");?>
</div>
</div>
<?php endif?>
<div class="task-comments-form-wrap" id="task-comments-form-wrap"<?php if (!empty($arResult["MESSAGE_VIEW"]) || !empty($arResult["ERROR_MESSAGE"])):?> style="display: block;"<?php endif?>>
<form name="REPLIER" id="REPLIER" action="<?php echo POST_FORM_ACTION_URI?><?php if(!isset($_GET["IFRAME"]) || $_GET["IFRAME"] != "Y"):?>#postform<?php endif?>" method="POST" enctype="multipart/form-data" class="reviews-form">
<input type="hidden" name="back_page" value="<?php echo $arResult["CURRENT_PAGE"]?>" />
<input type="hidden" name="ELEMENT_ID" value="<?php echo $arParams["TASK_ID"]?>" />
<input type="hidden" name="COMMENT_ID" value="<?php
if ($_REQUEST["remove_comment"] !== 'Y')
{
if (isset($_REQUEST["COMMENT_ID"]) && intval($_REQUEST["COMMENT_ID"]) > 0)
echo intval($_REQUEST["COMMENT_ID"]);
}
?>" />
<input type="hidden" name="preview_comment" value="N" />
<input type="hidden" name="remove_comment" value="N" />
<?php echo bitrix_sessid_post()?>
<div id="task-comments-form" class="task-comments-form">
<?php
$arSmiles = array();
if(!empty($arResult["SMILES"]))
{
foreach($arResult["SMILES"] as $arSmile)
{
$arSmiles[] = array(
'name' => $arSmile["NAME"],
'path' => $arSmile["IMAGE"],
'code' => str_replace("\\\\","\\",$arSmile["TYPING"])
);
}
}
CModule::IncludeModule("fileman");
$LHE = new CLightHTMLEditor();
$LHE->Show(array(
'id' => "REVIEW_TEXT",
'content' => isset($arResult["~REVIEW_TEXT"]) ? $arResult["~REVIEW_TEXT"] : "",
'inputName' => "REVIEW_TEXT",
'inputId' => "",
'width' => "100%",
'height' => "200px",
'bUseFileDialogs' => false,
'BBCode' => true,
'bBBParseImageSize' => true,
'jsObjName' => "oLHE",
'toolbarConfig' => Array(
'Bold', 'Italic', 'Underline', 'Strike',
'ForeColor','FontList', 'FontSizeList',
'RemoveFormat',
'Quote', 'Code',
'Image',
'CreateLink', 'DeleteLink',
'Table',
'InsertOrderedList',
'InsertUnorderedList',
'SmileList',
'Source'
),
'smileCountInToolbar' => 1,
'arSmiles' => $arSmiles,
'ctrlEnterHandler' => 'tasksCommentCtrlEnterHandler',
'bResizable' => true,
'bAutoResize' => false,
'bQuoteFromSelection' => true,
'bBBParseImageSize' => true,
'documentCSS' => '
body blockquote.bx-quote { width: 90%; padding: 10px 17px !important; background:url("/bitrix/js/tasks/css/images/quote-gray.png") no-repeat left top #F7F7F7; color:#7D7D7D !important; margin:0 !important; }
body pre.lhe-code { width: 90%; background-color:#F7F7F7 !important; color:#7D7D7D !important; font-family:"Courier New" !important; font-size:12px !important; padding:10px 17px !important; }
'
));
?>
</div>
<span id="task-add_file" class="task-add_file"></span>
<?php if ($arResult["SHOW_PANEL_ATTACH_IMG"] == "Y"):?>
<div class="reviews-reply-field reviews-reply-field-upload">
<?php
$iCount = 0;
if (!empty($arResult["REVIEW_FILES"])):
foreach ($arResult["REVIEW_FILES"] as $key => $val):
$iCount++;
$iFileSize = intVal($val["FILE_SIZE"]);
$size = array(
"B" => $iFileSize,
"KB" => round($iFileSize/1024, 2),
"MB" => round($iFileSize/1048576, 2)
);
$sFileSize = $size["KB"].GetMessage("F_KB");
if ($size["KB"] < 1)
{
$sFileSize = $size["B"].GetMessage("F_B");
}
elseif ($size["MB"] >= 1 )
{
$sFileSize = $size["MB"].GetMessage("F_MB");
}
?>
<div class="reviews-uploaded-file">
<input type="hidden" name="FILES[<?php echo $key?>]" value="<?php echo $key?>" />
<input type="checkbox" name="FILES_TO_UPLOAD[<?php echo $key?>]" id="FILES_TO_UPLOAD_<?php echo $key?>" value="<?php echo $key?>" checked="checked" />
<label for="FILES_TO_UPLOAD_<?php echo $key?>"><?php echo $val["ORIGINAL_NAME"]?> (<?php echo $val["CONTENT_TYPE"]?>)
<?php echo $sFileSize?> ( <a href="/bitrix/components/bitrix/forum.interface/show_file.php?action=download&fid=<?php echo $key?>"><?php echo GetMessage("F_DOWNLOAD")?> </a> ) </label>
</div>
<?php endforeach?>
<?php endif?>
<?php
if ($iCount < $arParams["FILES_COUNT"]):
$iFileSize = intVal(COption::GetOptionString("forum", "file_max_size", 50000));
$size = array(
"B" => $iFileSize,
"KB" => round($iFileSize/1024, 2),
"MB" => round($iFileSize/1048576, 2)
);
$sFileSize = $size["KB"].GetMessage("F_KB");
if ($size["KB"] < 1)
{
$sFileSize = $size["B"].GetMessage("F_B");
}
elseif ($size["MB"] >= 1 )
{
$sFileSize = $size["MB"].GetMessage("F_MB");
}
?>
<div class="reviews-upload-info" style="display: none;" id="upload_files_info_<?php echo $arParams["form_index"]?>">
<?php if ($arResult["FORUM"]["ALLOW_UPLOAD"] == "F"):?>
<span><?php echo str_replace("#EXTENSION#", $arResult["FORUM"]["ALLOW_UPLOAD_EXT"], GetMessage("F_FILE_EXTENSION"))?> </span>
<?php endif?>
<span><?php echo str_replace("#SIZE#", $sFileSize, GetMessage("F_FILE_SIZE"))?> </span>
</div>
<?php for ($ii = $iCount; $ii < $arParams["FILES_COUNT"]; $ii++):?>
<div class="reviews-upload-file" style="display: none;" id="upload_files_<?php echo $ii?>_<?php echo $arParams["form_index"]?>">
<input name="FILE_NEW_<?php echo $ii?>" type="file" value="" size="30" />
</div>
<?php endfor?>
<a href="javascript:void(0);" class="task-show_input" onclick="AttachFile('<?php echo $iCount?>', '<?php echo ($ii - $iCount)?>', '<?php echo $arParams["form_index"]?>', this); return false;"><?php echo ($arResult["FORUM"]["ALLOW_UPLOAD"]=="Y") ? GetMessage("F_LOAD_IMAGE") : GetMessage("F_LOAD_FILE") ?></a>
<?php endif?>
</div>
<?php endif?>
<div class="task-blog-comment-buttons">
<input name="send_button" type="submit" value="<?php echo GetMessage("OPINIONS_SEND")?>"
onclick="this.form.preview_comment.value = 'N';
window.setTimeout(BX.proxy(function() { this.disabled = true; }, this), 100);" />
<input name="view_button" type="submit" value="<?php echo GetMessage("OPINIONS_PREVIEW")?>" onclick="this.form.preview_comment.value = 'VIEW';" />
</div>
</form>
</div>
<div class="task-comments-wrap">
<?php if (!empty($arResult["MESSAGES"])):?>
<?php if ($arResult['NAV_PAGE_COUNT'] > 1):?>
<?php echo $arResult["NAV_STRING"]?><br />
<?php endif?>
<?php
if ($arResult['ORDER_DIRECTION'] === 'DESC')
$editableCommentIndex = 1; // if sort order DESC than we can edit only FIRST comment
else
$editableCommentIndex = count($arResult["MESSAGES"]); // if sort order ASC than we can edit only LAST comment
$bCommentsCanBeRemoved = COption::GetOptionString('tasks', 'task_comment_allow_remove');
$bCommentsCanBeEdited = COption::GetOptionString('tasks', 'task_comment_allow_edit');
$i = 0;
foreach ($arResult["MESSAGES"] as $res):?>
<?php $i++;?>
<div class="task-comments-list">
<a name="message<?php echo $res["ID"]?>"></a>
<div class="task-comment-info">
<div class="task-comments-avatar"<?php if ($res["AUTHOR_PHOTO"]):?> style="background:url('<?php echo $res["AUTHOR_PHOTO"]?>') no-repeat center center;"<?php endif?>></div>
<?php if (intval($res["AUTHOR_ID"]) > 0 && !empty($res["AUTHOR_URL"])):?><a class="task-comments-author" href="<?php
echo $res["AUTHOR_URL"];
?>"><?php
echo tasksFormatName(
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LAST_NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LOGIN'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['SECOND_NAME'],
$arParams['NAME_TEMPLATE'],
true // escape special chars
);
?></a><?php else:?><?php
echo tasksFormatName(
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LAST_NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LOGIN'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['SECOND_NAME'],
$arParams['NAME_TEMPLATE'],
true // escape special chars
);
?><?php endif?>
<span class="task-comments-date"><?php echo $res["POST_DATE"]?></span>
<?if ($arParams["SHOW_RATING"] == "Y") {?>
<div class="task-comments-rating rating_vote_graphic">
<?
$arRatingParams = Array(
"ENTITY_TYPE_ID" => "FORUM_POST",
"ENTITY_ID" => $res["ID"],
"OWNER_ID" => $res["AUTHOR_ID"],
"PATH_TO_USER_PROFILE" => strlen($arParams["PATH_TO_USER"]) > 0? $arParams["PATH_TO_USER"]: $arParams["~URL_TEMPLATES_PROFILE_VIEW"]
);
if (!isset($res['RATING']))
$res['RATING'] = array(
"USER_VOTE" => 0,
"USER_HAS_VOTED" => 'N',
"TOTAL_VOTES" => 0,
"TOTAL_POSITIVE_VOTES" => 0,
"TOTAL_NEGATIVE_VOTES" => 0,
"TOTAL_VALUE" => 0
);
$arRatingParams = array_merge($arRatingParams, $res['RATING']);
$GLOBALS["APPLICATION"]->IncludeComponent( "bitrix:rating.vote", $arParams["RATING_TYPE"], $arRatingParams, $component, array("HIDE_ICONS" => "Y"));
?>
</div>
<? } ?>
<div class="task-blog-clear-float"></div>
</div>
<div class="task-comment-content">
<?php echo $res["POST_MESSAGE_TEXT"]?>
<?php foreach ($res["FILES"] as $arFile):?>
<div class="reviews-message-img">
<?php
$GLOBALS["APPLICATION"]->IncludeComponent(
"bitrix:forum.interface",
"show_file",
Array(
"FILE" => $arFile,
"CONVERT" => "N",
"FAMILY" => "FORUM",
"SINGLE" => "Y",
"RETURN" => "N",
"SHOW_LINK" => "Y"),
null,
array("HIDE_ICONS" => "Y")
);
?>
</div>
<?php endforeach?>
<div class="task-comment-links">
<?php
global $APPLICATION;
if (
$bCommentsCanBeEdited
&&
(
$USER->IsAdmin()
|| CTasksTools::IsPortalB24Admin()
||
(
($i == $editableCommentIndex)
&& ($USER->GetID() == $res["AUTHOR_ID"])
)
)
)
{
?><a href="javascript: void(0);"
onclick="Edit('<?php echo $res["FOR_JS"]["POST_MESSAGE"]?>', '<?php echo $res["ID"]?>');return false;"><?php echo GetMessage("F_EDIT")?></a> | <?php
}
if (
$bCommentsCanBeRemoved
&&
(
$USER->IsAdmin()
|| CTasksTools::IsPortalB24Admin()
||
(
($i == $editableCommentIndex)
&& ($USER->GetID() == $res["AUTHOR_ID"])
)
)
)
{
?><a href="javascript: void(0);"
onclick="Remove('<?php echo $res["ID"]?>');return false;"><?php echo GetMessage('F_REMOVE')?></a> | <?php
}
?><a href="javascript: void(0);"
onclick="Reply('<?php echo $res["FOR_JS"]["AUTHOR_NAME"]?>', '<?php echo $res["FOR_JS"]["POST_MESSAGE"]?>', '<?php echo $res["ID"]?>');return false;"><?php
echo GetMessage("F_ANSWER")?></a> | <a
href="<?php echo $APPLICATION->GetCurPageParam('', array('IFRAME')); ?>#message<?php echo $res["ID"]?>" target="_blank"><?php echo GetMessage("F_LINK")?></a>
<? if ($arParams["SHOW_RATING"] == "Y") { ?>
<span class="rating_vote_text">
|
<?
$arRatingParams = Array(
"ENTITY_TYPE_ID" => "FORUM_POST",
"ENTITY_ID" => $res["ID"],
"OWNER_ID" => $res["AUTHOR_ID"],
"PATH_TO_USER_PROFILE" => strlen($arParams["PATH_TO_USER"]) > 0? $arParams["PATH_TO_USER"]: $arParams["~URL_TEMPLATES_PROFILE_VIEW"]
);
if (!isset($res['RATING']))
$res['RATING'] = array(
"USER_VOTE" => 0,
"USER_HAS_VOTED" => 'N',
"TOTAL_VOTES" => 0,
"TOTAL_POSITIVE_VOTES" => 0,
"TOTAL_NEGATIVE_VOTES" => 0,
"TOTAL_VALUE" => 0
);
$arRatingParams = array_merge($arRatingParams, $res['RATING']);
$GLOBALS["APPLICATION"]->IncludeComponent( "bitrix:rating.vote", $arParams["RATING_TYPE"], $arRatingParams, $component, array("HIDE_ICONS" => "Y"));
?>
</span>
<? } ?>
</div>
</div>
</div>
<div id="form-comment-<?php echo $res["ID"]?>"></div>
<?php endforeach?>
<?php if (strlen($arResult["NAV_STRING"]) > 0 && $arResult['NAV_PAGE_COUNT'] > 1):?>
<br /><?php echo $arResult["NAV_STRING"]?>
<?php endif?>
<div id="form-comment-00"><div class="task-add-comment" id="task-comments-add-new-00"><a href="javascript: void(0);" onclick="ShowCommentForm('00');return false;"><?php echo GetMessage("F_ADD_COMMENT")?></a></div></div>
<?php endif?>
</div>
<?php
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/main/utils.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/bitrix/forum.interface/templates/popup/script.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/bitrix/forum.interface/templates/.default/script.js");
$arParams["FILES_COUNT"] = intVal(intVal($arParams["FILES_COUNT"]) > 0 ? $arParams["FILES_COUNT"] : 1);
$arParams["IMAGE_SIZE"] = (intVal($arParams["IMAGE_SIZE"]) > 0 ? $arParams["IMAGE_SIZE"] : 100);
if (LANGUAGE_ID == 'ru')
{
$path = str_replace(array("\\", "//"), "/", dirname(__FILE__)."/ru/script.php");
include($path);
}
?>
<script>
BX.message({
TASKS_COMMENTS_CONFIRM_REMOVE : '<?php echo GetMessageJS('TASKS_COMMENTS_CONFIRM_REMOVE'); ?>'
});
</script>
<a name="postform"></a>
<div class="task-comments"></div>
<div id="form-comment-0">
<div id="task-comments-add-new-0" class="task-comments-add-new"<?php if (!empty($arResult["MESSAGE_VIEW"]) || !empty($arResult["ERROR_MESSAGE"])):?> style="display: none;"<?php endif?>>
<a id="task-comments-add-new-btn-add" style="display:none;" href="javascript: void(0);" class="task-comments-add-new-link" onclick="ShowCommentForm('0'); return false;"><?php echo GetMessage("F_ADD_COMMENT")?></a>
</div>
</div>
<?php if (!empty($arResult["MESSAGE_VIEW"])):?>
<div class="reviews-header-box">
<div class="reviews-header-title">
<span><?php echo GetMessage("F_PREVIEW")?> </span>
</div>
</div>
<div class="reviews-info-box reviews-post-preview">
<div class="reviews-info-box-inner">
<div class="reviews-post-entry">
<div class="reviews-post-text">
<?php echo $arResult["MESSAGE_VIEW"]["POST_MESSAGE_TEXT"]?>
</div>
<?php if (!empty($arResult["REVIEW_FILES"])):?>
<div class="reviews-post-attachments">
<label><?php echo GetMessage("F_ATTACH_FILES")?> </label>
<?php foreach ($arResult["REVIEW_FILES"] as $arFile):?>
<div class="reviews-post-attachment">
<?php
$GLOBALS["APPLICATION"]->IncludeComponent(
"bitrix:forum.interface",
"show_file",
Array(
"FILE" => $arFile,
"WIDTH" => $arResult["PARSER"]->image_params["width"],
"HEIGHT" => $arResult["PARSER"]->image_params["height"],
"CONVERT" => "N",
"FAMILY" => "FORUM",
"SINGLE" => "Y",
"RETURN" => "N",
"SHOW_LINK" => "Y"
),
null,
array("HIDE_ICONS" => "Y")
);
?>
</div>
<?php endforeach?>
</div>
<?php endif?>
</div>
</div>
</div>
<div class="reviews-br"></div>
<?php endif?>
<?php if (!empty($arResult["ERROR_MESSAGE"])):?>
<div class="reviews-note-box reviews-note-error">
<div class="reviews-note-box-text">
<?php echo ShowError($arResult["ERROR_MESSAGE"], "reviews-note-error");?>
</div>
</div>
<?php endif?>
<div class="task-comments-form-wrap" id="task-comments-form-wrap"<?php if (!empty($arResult["MESSAGE_VIEW"]) || !empty($arResult["ERROR_MESSAGE"])):?> style="display: block;"<?php endif?>>
<form name="REPLIER" id="REPLIER" action="<?php echo POST_FORM_ACTION_URI?><?php if(!isset($_GET["IFRAME"]) || $_GET["IFRAME"] != "Y"):?>#postform<?php endif?>" method="POST" enctype="multipart/form-data" class="reviews-form">
<input type="hidden" name="back_page" value="<?php echo $arResult["CURRENT_PAGE"]?>" />
<input type="hidden" name="ELEMENT_ID" value="<?php echo $arParams["TASK_ID"]?>" />
<input type="hidden" name="COMMENT_ID" value="<?php
if ($_REQUEST["remove_comment"] !== 'Y')
{
if (isset($_REQUEST["COMMENT_ID"]) && intval($_REQUEST["COMMENT_ID"]) > 0)
echo intval($_REQUEST["COMMENT_ID"]);
}
?>" />
<input type="hidden" name="preview_comment" value="N" />
<input type="hidden" name="remove_comment" value="N" />
<?php echo bitrix_sessid_post()?>
<div id="task-comments-form" class="task-comments-form">
<?php
$arSmiles = array();
if(!empty($arResult["SMILES"]))
{
foreach($arResult["SMILES"] as $arSmile)
{
$arSmiles[] = array(
'name' => $arSmile["NAME"],
'path' => $arSmile["IMAGE"],
'code' => str_replace("\\\\","\\",$arSmile["TYPING"])
);
}
}
CModule::IncludeModule("fileman");
$LHE = new CLightHTMLEditor();
$LHE->Show(array(
'id' => "REVIEW_TEXT",
'content' => isset($arResult["~REVIEW_TEXT"]) ? $arResult["~REVIEW_TEXT"] : "",
'inputName' => "REVIEW_TEXT",
'inputId' => "",
'width' => "100%",
'height' => "200px",
'bUseFileDialogs' => false,
'BBCode' => true,
'bBBParseImageSize' => true,
'jsObjName' => "oLHE",
'toolbarConfig' => Array(
'Bold', 'Italic', 'Underline', 'Strike',
'ForeColor','FontList', 'FontSizeList',
'RemoveFormat',
'Quote', 'Code',
'Image',
'CreateLink', 'DeleteLink',
'Table',
'InsertOrderedList',
'InsertUnorderedList',
'SmileList',
'Source'
),
'smileCountInToolbar' => 1,
'arSmiles' => $arSmiles,
'ctrlEnterHandler' => 'tasksCommentCtrlEnterHandler',
'bResizable' => true,
'bAutoResize' => false,
'bQuoteFromSelection' => true,
'bBBParseImageSize' => true,
'documentCSS' => '
body blockquote.bx-quote { width: 90%; padding: 10px 17px !important; background:url("/bitrix/js/tasks/css/images/quote-gray.png") no-repeat left top #F7F7F7; color:#7D7D7D !important; margin:0 !important; }
body pre.lhe-code { width: 90%; background-color:#F7F7F7 !important; color:#7D7D7D !important; font-family:"Courier New" !important; font-size:12px !important; padding:10px 17px !important; }
'
));
?>
</div>
<span id="task-add_file" class="task-add_file"></span>
<?php if ($arResult["SHOW_PANEL_ATTACH_IMG"] == "Y"):?>
<div class="reviews-reply-field reviews-reply-field-upload">
<?php
$iCount = 0;
if (!empty($arResult["REVIEW_FILES"])):
foreach ($arResult["REVIEW_FILES"] as $key => $val):
$iCount++;
$iFileSize = intVal($val["FILE_SIZE"]);
$size = array(
"B" => $iFileSize,
"KB" => round($iFileSize/1024, 2),
"MB" => round($iFileSize/1048576, 2)
);
$sFileSize = $size["KB"].GetMessage("F_KB");
if ($size["KB"] < 1)
{
$sFileSize = $size["B"].GetMessage("F_B");
}
elseif ($size["MB"] >= 1 )
{
$sFileSize = $size["MB"].GetMessage("F_MB");
}
?>
<div class="reviews-uploaded-file">
<input type="hidden" name="FILES[<?php echo $key?>]" value="<?php echo $key?>" />
<input type="checkbox" name="FILES_TO_UPLOAD[<?php echo $key?>]" id="FILES_TO_UPLOAD_<?php echo $key?>" value="<?php echo $key?>" checked="checked" />
<label for="FILES_TO_UPLOAD_<?php echo $key?>"><?php echo $val["ORIGINAL_NAME"]?> (<?php echo $val["CONTENT_TYPE"]?>)
<?php echo $sFileSize?> ( <a href="/bitrix/components/bitrix/forum.interface/show_file.php?action=download&fid=<?php echo $key?>"><?php echo GetMessage("F_DOWNLOAD")?> </a> ) </label>
</div>
<?php endforeach?>
<?php endif?>
<?php
if ($iCount < $arParams["FILES_COUNT"]):
$iFileSize = intVal(COption::GetOptionString("forum", "file_max_size", 50000));
$size = array(
"B" => $iFileSize,
"KB" => round($iFileSize/1024, 2),
"MB" => round($iFileSize/1048576, 2)
);
$sFileSize = $size["KB"].GetMessage("F_KB");
if ($size["KB"] < 1)
{
$sFileSize = $size["B"].GetMessage("F_B");
}
elseif ($size["MB"] >= 1 )
{
$sFileSize = $size["MB"].GetMessage("F_MB");
}
?>
<div class="reviews-upload-info" style="display: none;" id="upload_files_info_<?php echo $arParams["form_index"]?>">
<?php if ($arResult["FORUM"]["ALLOW_UPLOAD"] == "F"):?>
<span><?php echo str_replace("#EXTENSION#", $arResult["FORUM"]["ALLOW_UPLOAD_EXT"], GetMessage("F_FILE_EXTENSION"))?> </span>
<?php endif?>
<span><?php echo str_replace("#SIZE#", $sFileSize, GetMessage("F_FILE_SIZE"))?> </span>
</div>
<?php for ($ii = $iCount; $ii < $arParams["FILES_COUNT"]; $ii++):?>
<div class="reviews-upload-file" style="display: none;" id="upload_files_<?php echo $ii?>_<?php echo $arParams["form_index"]?>">
<input name="FILE_NEW_<?php echo $ii?>" type="file" value="" size="30" />
</div>
<?php endfor?>
<a href="javascript:void(0);" class="task-show_input" onclick="AttachFile('<?php echo $iCount?>', '<?php echo ($ii - $iCount)?>', '<?php echo $arParams["form_index"]?>', this); return false;"><?php echo ($arResult["FORUM"]["ALLOW_UPLOAD"]=="Y") ? GetMessage("F_LOAD_IMAGE") : GetMessage("F_LOAD_FILE") ?></a>
<?php endif?>
</div>
<?php endif?>
<div class="task-blog-comment-buttons">
<input name="send_button" type="submit" value="<?php echo GetMessage("OPINIONS_SEND")?>"
onclick="this.form.preview_comment.value = 'N';
window.setTimeout(BX.proxy(function() { this.disabled = true; }, this), 100);" />
<input name="view_button" type="submit" value="<?php echo GetMessage("OPINIONS_PREVIEW")?>" onclick="this.form.preview_comment.value = 'VIEW';" />
</div>
</form>
</div>
<div class="task-comments-wrap">
<?php if (!empty($arResult["MESSAGES"])):?>
<?php if ($arResult['NAV_PAGE_COUNT'] > 1):?>
<?php echo $arResult["NAV_STRING"]?><br />
<?php endif?>
<?php
if ($arResult['ORDER_DIRECTION'] === 'DESC')
$editableCommentIndex = 1; // if sort order DESC than we can edit only FIRST comment
else
$editableCommentIndex = count($arResult["MESSAGES"]); // if sort order ASC than we can edit only LAST comment
$bCommentsCanBeRemoved = COption::GetOptionString('tasks', 'task_comment_allow_remove');
$bCommentsCanBeEdited = COption::GetOptionString('tasks', 'task_comment_allow_edit');
$i = 0;
foreach ($arResult["MESSAGES"] as $res):?>
<?php $i++;?>
<div class="task-comments-list">
<a name="message<?php echo $res["ID"]?>"></a>
<div class="task-comment-info">
<div class="task-comments-avatar"<?php if ($res["AUTHOR_PHOTO"]):?> style="background:url('<?php echo $res["AUTHOR_PHOTO"]?>') no-repeat center center;"<?php endif?>></div>
<?php if (intval($res["AUTHOR_ID"]) > 0 && !empty($res["AUTHOR_URL"])):?><a class="task-comments-author" href="<?php
echo $res["AUTHOR_URL"];
?>"><?php
echo tasksFormatName(
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LAST_NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LOGIN'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['SECOND_NAME'],
$arParams['NAME_TEMPLATE'],
true // escape special chars
);
?></a><?php else:?><?php
echo tasksFormatName(
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LAST_NAME'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['LOGIN'],
$res['AUTHOR_DYNAMIC_NAME_AS_ARRAY']['SECOND_NAME'],
$arParams['NAME_TEMPLATE'],
true // escape special chars
);
?><?php endif?>
<span class="task-comments-date"><?php echo $res["POST_DATE"]?></span>
<?if ($arParams["SHOW_RATING"] == "Y") {?>
<div class="task-comments-rating rating_vote_graphic">
<?
$arRatingParams = Array(
"ENTITY_TYPE_ID" => "FORUM_POST",
"ENTITY_ID" => $res["ID"],
"OWNER_ID" => $res["AUTHOR_ID"],
"PATH_TO_USER_PROFILE" => strlen($arParams["PATH_TO_USER"]) > 0? $arParams["PATH_TO_USER"]: $arParams["~URL_TEMPLATES_PROFILE_VIEW"]
);
if (!isset($res['RATING']))
$res['RATING'] = array(
"USER_VOTE" => 0,
"USER_HAS_VOTED" => 'N',
"TOTAL_VOTES" => 0,
"TOTAL_POSITIVE_VOTES" => 0,
"TOTAL_NEGATIVE_VOTES" => 0,
"TOTAL_VALUE" => 0
);
$arRatingParams = array_merge($arRatingParams, $res['RATING']);
$GLOBALS["APPLICATION"]->IncludeComponent( "bitrix:rating.vote", $arParams["RATING_TYPE"], $arRatingParams, $component, array("HIDE_ICONS" => "Y"));
?>
</div>
<? } ?>
<div class="task-blog-clear-float"></div>
</div>
<div class="task-comment-content">
<?php echo $res["POST_MESSAGE_TEXT"]?>
<?php foreach ($res["FILES"] as $arFile):?>
<div class="reviews-message-img">
<?php
$GLOBALS["APPLICATION"]->IncludeComponent(
"bitrix:forum.interface",
"show_file",
Array(
"FILE" => $arFile,
"CONVERT" => "N",
"FAMILY" => "FORUM",
"SINGLE" => "Y",
"RETURN" => "N",
"SHOW_LINK" => "Y"),
null,
array("HIDE_ICONS" => "Y")
);
?>
</div>
<?php endforeach?>
<div class="task-comment-links">
<?php
global $APPLICATION;
if (
$bCommentsCanBeEdited
&&
(
$USER->IsAdmin()
|| CTasksTools::IsPortalB24Admin()
||
(
($i == $editableCommentIndex)
&& ($USER->GetID() == $res["AUTHOR_ID"])
)
)
)
{
?><a href="javascript: void(0);"
onclick="Edit('<?php echo $res["FOR_JS"]["POST_MESSAGE"]?>', '<?php echo $res["ID"]?>');return false;"><?php echo GetMessage("F_EDIT")?></a> | <?php
}
if (
$bCommentsCanBeRemoved
&&
(
$USER->IsAdmin()
|| CTasksTools::IsPortalB24Admin()
||
(
($i == $editableCommentIndex)
&& ($USER->GetID() == $res["AUTHOR_ID"])
)
)
)
{
?><a href="javascript: void(0);"
onclick="Remove('<?php echo $res["ID"]?>');return false;"><?php echo GetMessage('F_REMOVE')?></a> | <?php
}
?><a href="javascript: void(0);"
onclick="Reply('<?php echo $res["FOR_JS"]["AUTHOR_NAME"]?>', '<?php echo $res["FOR_JS"]["POST_MESSAGE"]?>', '<?php echo $res["ID"]?>');return false;"><?php
echo GetMessage("F_ANSWER")?></a> | <a
href="<?php echo $APPLICATION->GetCurPageParam('', array('IFRAME')); ?>#message<?php echo $res["ID"]?>" target="_blank"><?php echo GetMessage("F_LINK")?></a>
<? if ($arParams["SHOW_RATING"] == "Y") { ?>
<span class="rating_vote_text">
|
<?
$arRatingParams = Array(
"ENTITY_TYPE_ID" => "FORUM_POST",
"ENTITY_ID" => $res["ID"],
"OWNER_ID" => $res["AUTHOR_ID"],
"PATH_TO_USER_PROFILE" => strlen($arParams["PATH_TO_USER"]) > 0? $arParams["PATH_TO_USER"]: $arParams["~URL_TEMPLATES_PROFILE_VIEW"]
);
if (!isset($res['RATING']))
$res['RATING'] = array(
"USER_VOTE" => 0,
"USER_HAS_VOTED" => 'N',
"TOTAL_VOTES" => 0,
"TOTAL_POSITIVE_VOTES" => 0,
"TOTAL_NEGATIVE_VOTES" => 0,
"TOTAL_VALUE" => 0
);
$arRatingParams = array_merge($arRatingParams, $res['RATING']);
$GLOBALS["APPLICATION"]->IncludeComponent( "bitrix:rating.vote", $arParams["RATING_TYPE"], $arRatingParams, $component, array("HIDE_ICONS" => "Y"));
?>
</span>
<? } ?>
</div>
</div>
</div>
<div id="form-comment-<?php echo $res["ID"]?>"></div>
<?php endforeach?>
<?php if (strlen($arResult["NAV_STRING"]) > 0 && $arResult['NAV_PAGE_COUNT'] > 1):?>
<br /><?php echo $arResult["NAV_STRING"]?>
<?php endif?>
<div id="form-comment-00"><div class="task-add-comment" id="task-comments-add-new-00"><a href="javascript: void(0);" onclick="ShowCommentForm('00');return false;"><?php echo GetMessage("F_ADD_COMMENT")?></a></div></div>
<?php endif?>
</div>
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
CUtil::InitJSCore(array('popup', 'tooltip'));
// commented out probably wrong script $GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/bitrix/tasks.task.edit/templates/.default/script.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/areal/tasks.list/templates/.default/script.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/components/areal/tasks.list/templates/.default/table-view.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/tasks/task-popups.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/tasks/task-reminders.js");
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/tasks/task-iframe-popup.js");
$GLOBALS['APPLICATION']->SetAdditionalCSS("/bitrix/js/intranet/intranet-common.css");
$GLOBALS['APPLICATION']->SetAdditionalCSS("/bitrix/js/main/core/css/core_popup.css");
$GLOBALS['APPLICATION']->SetAdditionalCSS("/bitrix/js/tasks/css/tasks.css");
$GLOBALS["APPLICATION"]->IncludeComponent(
'bitrix:main.calendar',
'',
array(
'SILENT' => 'Y',
),
null,
array('HIDE_ICONS' => 'Y')
);
$arPaths = array(
"PATH_TO_TASKS_TASK" => $arParams["PATH_TO_TASKS_TASK"],
"PATH_TO_USER_PROFILE" => $arParams["PATH_TO_USER_PROFILE"]
);
$loggedInUser = $USER->getId();
$createUrl = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => 0, "action" => "edit"));
$createSubtaskUrl = $createUrl.(strpos($createUrl, "?") === false ? "?" : "&")."PARENT_ID=".$arResult["TASK"]["ID"];
$APPLICATION->IncludeComponent(
"bitrix:tasks.iframe.popup",
".default",
array(
"ON_TASK_ADDED" => "onPopupTaskAdded",
"ON_TASK_CHANGED" => "onPopupTaskChanged",
"ON_TASK_DELETED" => "onPopupTaskDeleted"
),
null,
array("HIDE_ICONS" => "Y")
);
if (!defined('TASKS_MUL_INCLUDED')):
$APPLICATION->IncludeComponent("bitrix:main.user.link",
'',
array(
"AJAX_ONLY" => "Y",
"PATH_TO_SONET_USER_PROFILE" => $arParams["~PATH_TO_USER_PROFILE"],
"PATH_TO_SONET_MESSAGES_CHAT" => $arParams["~PATH_TO_MESSAGES_CHAT"],
"DATE_TIME_FORMAT" => $arParams["~DATE_TIME_FORMAT"],
"SHOW_YEAR" => $arParams["SHOW_YEAR"],
"NAME_TEMPLATE" => $arParams["~NAME_TEMPLATE"],
"SHOW_LOGIN" => $arParams["SHOW_LOGIN"],
"PATH_TO_CONPANY_DEPARTMENT" => $arParams["~PATH_TO_CONPANY_DEPARTMENT"],
"PATH_TO_VIDEO_CALL" => $arParams["~PATH_TO_VIDEO_CALL"],
),
false,
array("HIDE_ICONS" => "Y")
);
define('TASKS_MUL_INCLUDED', 1);
endif;
$loggedInUserWorkPosition = '';
if ($rs = CUser::getById($loggedInUser))
{
if ($arUserData = $rs->fetch())
$loggedInUserWorkPosition = $arUserData['WORK_POSITION'];
}
$loggedInUserFormattedName = CUser::FormatName(
$arParams['~NAME_TEMPLATE'],
array(
'NAME' => $USER->GetFirstName(),
'LAST_NAME' => $USER->GetLastName(),
'SECOND_NAME' => $USER->GetSecondName(),
'LOGIN' => $USER->GetLogin()
),
true,
$bEscapeSpecChars = false
);
?>
<script type="text/javascript">
BX.message({
TASKS_PRIORITY : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY")); ?>',
TASKS_APPLY : '<?php echo CUtil::JSEscape(GetMessage("TASKS_APPLY")); ?>',
TASKS_ADD_IN_REPORT : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ADD_IN_REPORT")); ?>',
TASKS_MARK : '<?php echo CUtil::JSEscape(GetMessage("TASKS_MARK")); ?>',
TASKS_PRIORITY_LOW : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY_0")); ?>',
TASKS_PRIORITY_MIDDLE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY_1")); ?>',
TASKS_PRIORITY_HIGH : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY_2")); ?>',
TASKS_MARK_NONE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_MARK_NONE")); ?>',
TASKS_MARK_POSITIVE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_MARK_P")); ?>',
TASKS_MARK_NEGATIVE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_MARK_N")); ?>',
TASKS_DURATION : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DURATION")); ?>',
TASKS_SELECT : '<?php echo CUtil::JSEscape(GetMessage("TASKS_SELECT")); ?>',
TASKS_OK : '<?php echo CUtil::JSEscape(GetMessage("TASKS_OK")); ?>',
TASKS_CANCEL : '<?php echo CUtil::JSEscape(GetMessage("TASKS_CANCEL")); ?>',
TASKS_DECLINE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DECLINE_TASK")); ?>',
TASKS_DECLINE_REASON : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DECLINE_REASON")); ?>',
TASKS_NO_TITLE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_NO_TITLE")); ?>',
TASKS_NO_RESPONSIBLE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_NO_RESPONSIBLE")); ?>',
TASKS_PATH_TO_USER_PROFILE : '<?php echo CUtil::JSEscape($arParams["PATH_TO_USER_PROFILE"]); ?>',
TASKS_PATH_TO_TASK : '<?php echo CUtil::JSEscape($arParams["PATH_TO_TASKS_TASK"]); ?>',
TASKS_PATH_TO_USER_TASKS_TASK : '<?php echo CUtil::JSEscape($arParams["PATH_TO_USER_TASKS_TASK"]); ?>',
PATH_TO_GROUP_TASKS : '<?php echo CUtil::JSEscape($arParams["PATH_TO_GROUP_TASKS"]); ?>',
TASKS_HOURS_N : '<?php echo CUtil::JSEscape(GetMessage("TASKS_HOURS_N")); ?>',
TASKS_HOURS_G : '<?php echo CUtil::JSEscape(GetMessage("TASKS_HOURS_G")); ?>',
TASKS_HOURS_P : '<?php echo CUtil::JSEscape(GetMessage("TASKS_HOURS_P")); ?>',
TASKS_REMINDER_TITLE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMINDER_TITLE")); ?>',
TASKS_ABOUT_DEADLINE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ABOUT_DEADLINE")); ?>',
TASKS_BY_DATE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_BY_DATE")); ?>',
TASKS_REMIND_BEFORE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMIND_BEFORE")); ?>',
TASKS_REMIND_VIA_JABBER : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMIND_VIA_JABBER")); ?>',
TASKS_REMIND_VIA_EMAIL : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMIND_VIA_EMAIL")); ?>',
TASKS_REMIND_VIA_JABBER_EX : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMIND_VIA_JABBER_EX")); ?>',
TASKS_REMIND_VIA_EMAIL_EX : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMIND_VIA_EMAIL_EX")); ?>',
TASKS_REMINDER_OK : '<?php echo CUtil::JSEscape(GetMessage("TASKS_REMINDER_OK")); ?>',
TASKS_DOUBLE_CLICK : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DOUBLE_CLICK")); ?>',
TASKS_MENU : '<?php echo CUtil::JSEscape(GetMessage("TASKS_MENU")); ?>',
TASKS_FINISH : '<?php echo CUtil::JSEscape(GetMessage("TASKS_FINISH")); ?>',
TASKS_FINISHED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_FINISHED")); ?>',
TASKS_QUICK_IN_GROUP : '<?php echo CUtil::JSEscape(GetMessage("TASKS_QUICK_IN_GROUP")); ?>',
TASKS_TASK_TITLE_LABEL : '<?php echo CUtil::JSEscape(GetMessage("TASKS_TASK_TITLE_LABEL")); ?>',
TASKS_RESPONSIBLE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_RESPONSIBLE")); ?>',
TASKS_DIRECTOR : '<?php echo CUtil::JSEscape(GetMessage("TASKS_CREATOR")); ?>',
TASKS_DATE_CREATED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DATE_CREATED")); ?>',
TASKS_DATE_DEADLINE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_QUICK_DEADLINE")); ?>',
TASKS_DATE_START : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DATE_START")); ?>',
TASKS_DATE_END : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DATE_END")); ?>',
TASKS_DATE_STARTED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DATE_STARTED")); ?>',
TASKS_DATE_COMPLETED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DATE_COMPLETED")); ?>',
TASKS_STATUS : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS")); ?>',
TASKS_STATUS_IN_PROGRESS : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_IN_PROGRESS")); ?>',
TASKS_STATUS_ACCEPTED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_ACCEPTED")); ?>',
TASKS_STATUS_COMPLETED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_COMPLETED")); ?>',
TASKS_STATUS_DELAYED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_DELAYED")); ?>',
TASKS_STATUS_NEW : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_NEW")); ?>',
TASKS_STATUS_OVERDUE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_OVERDUE")); ?>',
TASKS_STATUS_WAITING : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_WAITING")); ?>',
TASKS_STATUS_DECLINED : '<?php echo CUtil::JSEscape(GetMessage("TASKS_STATUS_DECLINED")); ?>',
TASKS_PRIORITY_0 : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY_0")); ?>',
TASKS_PRIORITY_1 : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY_1")); ?>',
TASKS_PRIORITY_2 : '<?php echo CUtil::JSEscape(GetMessage("TASKS_PRIORITY_2")); ?>',
TASKS_QUICK_INFO_DETAILS : '<?php echo CUtil::JSEscape(GetMessage("TASKS_QUICK_INFO_DETAILS")); ?>',
TASKS_QUICK_INFO_EMPTY_DATE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_QUICK_INFO_EMPTY_DATE")); ?>',
TASKS_ADD_TASK : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ADD_TASK")); ?>',
TASKS_DELETE_CONFIRM : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DELETE_CONFIRM")); ?>',
TASKS_DELETE_TASK_CONFIRM : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DELETE_TASK_CONFIRM")); ?>',
TASKS_DELETE_FILE_CONFIRM : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DELETE_FILE_CONFIRM")); ?>',
TASKS_FILES: '<?php echo CUtil::JSEscape(GetMessage("TASKS_TASK_FILES")); ?>',
TASKS_GROUP_ADD: '<?php echo CUtil::JSEscape(GetMessage("TASKS_GROUP_ADD")); ?>',
TASKS_SIDEBAR_DEADLINE_NO: '<?php echo CUtil::JSEscape(GetMessage("TASKS_SIDEBAR_DEADLINE_NO")); ?>',
TASKS_SIDEBAR_STOP_WATCH_CONFIRM : '<?php echo CUtil::JSEscape(GetMessage("TASKS_SIDEBAR_STOP_WATCH_CONFIRM")); ?>',
TASKS_DATE_MUST_BE_IN_FUTURE : '<?php echo CUtil::JSEscape(GetMessage("TASKS_DATE_MUST_BE_IN_FUTURE")); ?>',
TASKS_LOGGED_IN_USER_FORMATTED_NAME : '<?php echo CUtil::JSEscape($loggedInUserFormattedName); ?>',
TASKS_LOGGED_IN_USER_WORK_POSITION : '<?php echo CUtil::JSEscape($loggedInUserWorkPosition); ?>',
TASKS_CONTEXT_IS_IFRAME : '<?php if ($arResult['IS_IFRAME']) echo 'true'; else echo 'false'; ?>',
TASKS_CONTEXT_PATH_TO_TEMPLATES_TEMPLATE : '<?php echo CUtil::JSEscape($arParams['PATH_TO_TEMPLATES_TEMPLATE']); ?>',
TASKS_CONTEXT_PATH_TO_USER_PROFILE : '<?php echo CUtil::JSEscape($arParams['PATH_TO_USER_PROFILE']); ?>',
TASKS_CONTEXT_PATH_TO_TASKS : '<?php echo CUtil::JSEscape($arParams['PATH_TO_TASKS']); ?>',
TASKS_CONTEXT_NAME_TEMPLATE : '<?php echo CUtil::JSEscape($arParams['NAME_TEMPLATE']); ?>',
TASKS_CONTEXT_TASK_ID : <?php echo (int) $arParams['TASK_ID']; ?>
});
// This needs for __onBeforeUnload preventer
var iframePopup = window.top.BX.TasksIFrameInst;
if (iframePopup)
{
window.top.BX.TasksIFrameInst.isEditMode = false;
}
var taskData = <?php
$bSkipJsMenu = false;
$bIsIe = false;
$userAgent = strtolower($_SERVER["HTTP_USER_AGENT"]);
if (strpos($userAgent, "opera") === false && strpos($userAgent, "msie") !== false)
$bIsIe = true;
if (isset($arResult["IS_IFRAME"]) && ($arResult["IS_IFRAME"] === true) && $bIsIe)
$bSkipJsMenu = true;
tasksRenderJSON($arResult["TASK"], sizeof($arResult["SUBTASKS"]), $arPaths, true, true, true, $arParams["~NAME_TEMPLATE"], $arAdditionalFields = array(), $bSkipJsMenu);
?>;
if (!window.top.BX("gantt-container"))
{
for(var i = taskData.menuItems.length - 1; i >= 0; i--)
{
if (taskData.menuItems[i].className == "task-menu-popup-item-add-deadline" || taskData.menuItems[i].className == "task-menu-popup-item-remove-deadline")
{
taskData.menuItems.splice (i, 1);
}
}
}
<?php if ($arResult["IS_IFRAME"] && ($arResult["CALLBACK"] == "CHANGED" || $arResult["CALLBACK"] == "ADDED")):?>
(function() {
var iframePopup = window.top.BX.TasksIFrameInst;
if (iframePopup)
{
<?php
if ($arResult["CALLBACK"] == "CHANGED")
{
?>
iframePopup.onTaskChanged(taskData);
<?php
}
else
{
if (is_array($arResult["SUBTASKS"]) && count($arResult["SUBTASKS"]))
{
?>
iframePopup.onTaskAdded(
taskData,
null,
{
multipleTasksAdded : true,
firstTask : true,
callbackOnAfterAdd : function () {
var subTaskData = null;
<?php
foreach ($arResult["SUBTASKS"] as $subTaskData)
{
?>
subTaskData = <?php tasksRenderJSON($subTaskData, 0, $arPaths, true, true, true, $arParams["NAME_TEMPLATE"]); ?>
iframePopup.onTaskAdded(
subTaskData,
null,
{
multipleTasksAdded : true,
firstTask : false
}
);
<?php
}
?>
}
}
);
<?php
}
else
{
?>
iframePopup.onTaskAdded(taskData);
<?php
}
}
?>
if (iframePopup.lastAction != "view")
{
iframePopup.close();
}
}
})();
<?php endif?>
var arFilter = {};
var arOrder = {};
var tasksListAjaxUrl = "/bitrix/components/bitrix/tasks.list/ajax.php?SITE_ID=<?php echo SITE_ID?><?php echo $arResult["TASK_TYPE"] == "group" ? "&GROUP_ID=".$arParams["GROUP_ID"] : ""?>&nt=<?php echo urlencode($arParams['NAME_TEMPLATE']); ?>";
var ajaxUrl = tasksListAjaxUrl;
var postFormAction = "<?php echo CUtil::JSEscape(POST_FORM_ACTION_URI)?>";
var detailTaksID = <?php echo $arResult["TASK"]["ID"]?>;
var currentUser = <?php echo $USER->GetID(); ?>;
var defaultQuickParent = <?php echo $arResult["TASK"]["ID"]?>;
var reminders = <?php echo $arResult["REMINDERS"] ? CUtil::PhpToJsObject($arResult["REMINDERS"]) : "[]" ?>;
<?php
// Prevent loading page without header and footer when not in iframe (it's may happens on "open in new window")
if ($arResult["IS_IFRAME"])
{
?>
if (window == window.top)
{
// not in iframe, so reload page as not in IFRAME
window.location = '<?php echo CUtil::JSEscape($APPLICATION->GetCurPageParam('', array('IFRAME'))); ?>';
}
<?php
}
?>
var tasksRemindersPopUp;
BX.ready(function() {
if (BX('pagetitle'))
BX('pagetitle').style.paddingRight = '200px';
tasksRemindersPopUp = new BX.TaskReminders.create("tasks-reminder-popup", BX("task-reminder-link"), reminders, <?php echo $arResult["TASK"]["DEADLINE"] ? "\"".CUtil::JSEscape($arResult["TASK"]["DEADLINE"])."\"" : "false" ?>, {
events: {
onRemindersSave: function (reminders)
{
for (var i = 0; i < this.reminders.length; i++)
{
reminders[i].r_date = BX.date.format(
BX.date.convertBitrixFormat(
BX.message('FORMAT_DATE')
),
reminders[i].date
);
//reminders[i].r_date = this.calendar.FormatDate(reminders[i].date);
}
var data = {
mode : "reminders",
sessid : BX.message("bitrix_sessid"),
id : <?php echo $arResult["TASK"]["ID"]?>,
reminders : reminders
};
BX.ajax.post(ajaxUrl, data);
},
onRemindersChange: function (reminders) {
if (reminders.length) {
BX.addClass(BX("task-reminder-link").parentNode, "task-reminder-selected");
} else {
BX.removeClass(BX("task-reminder-link").parentNode, "task-reminder-selected");
}
}
}
});
BX.bind(BX("task-reminder-link"), "click", function (e) {
if(!e) e = window.event;
tasksRemindersPopUp.show();
BX.PreventDefault(e);
});
});
var tasks_funcOnChangeOfSomeDateFields = function (field)
{
value = field.value;
if (field.id == "task-new-item-deadline" || field.id == "task-deadline-hidden")
BX.removeClass(field.parentNode.parentNode, "webform-field-textbox-empty");
if (field.id == "task-deadline-hidden")
{
var dateSpan = field.previousSibling;
dateSpan.innerHTML = value;
dateSpan.className = "task-detail-deadline webform-field-action-link";
field.nextSibling.style.display = "";
field.value = value;
tasksRemindersPopUp.setDeadline(field.value)
var data = {
mode : "deadline",
sessid : BX.message("bitrix_sessid"),
id : <?php echo $arResult["TASK"]["ID"]?>,
deadline : value
};
BX.ajax({
'url' : ajaxUrl,
'dataType': 'html',
'method' : 'POST',
'data' : data,
'processData' : true,
'onsuccess': function() {
var data = {
'PATH_TO_USER_PROFILE' : '<?php echo CUtil::JSEscape($arParams['PATH_TO_USER_PROFILE']); ?>',
'sessid' : BX.message('bitrix_sessid'),
'task_id' : <?php echo (int) $arResult['TASK']['ID']; ?>
};
// name format
var urlRequest = '<?php
echo CUtil::JSEscape($this->__component->GetPath()
. '/ajax.php?lang=' . urlencode(LANGUAGE_ID)
. '&action=render_task_log_last_row_with_date_change'
. '&SITE_ID=' . urlencode($arParams['SITE_ID'])
. '&nt=' . urlencode($arParams['NAME_TEMPLATE']));
?>';
BX.ajax({
'method': 'POST',
'dataType': 'json',
'url': urlRequest,
'data': data,
'processData' : true,
'onsuccess': function(datum) {
var count = parseInt(BX('task-switcher-text-log-count').innerHTML, 10) + 1;
BX('task-switcher-text-log-count').innerHTML = count.toString();
var row = BX.create("tr", { children : [
BX.create(
"td",
{
props : { className: "task-log-date-column" },
html : datum.td1
}
),
BX.create(
"td",
{
props : { className: "task-log-author-column" },
html : datum.td2
}
),
BX.create(
"td",
{
props : { className: "task-log-where-column" },
html : datum.td3
}
),
BX.create(
"td",
{
props : { className: "task-log-what-column" },
html : datum.td4
}
)
]});
BX('task-log-table').appendChild(row);
return;
}
});
return;
}
});
if (!taskData.dateDeadline || taskData.dateDeadline.getTime() != value)
{
taskData.dateDeadline = new Date(BX.parseDate(value));
var form = document.float_calendar_time;
if (form)
{
taskData.dateDeadline.setHours(parseInt(form.hours.value, 10));
taskData.dateDeadline.setMinutes(parseInt(form.minutes.value, 10));
taskData.dateDeadline.setSeconds(parseInt(form.seconds.value, 10));
}
window.top.BX.TasksIFrameInst.onTaskChanged(taskData);
}
}
};
var createMenu = [
{
text : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ADD_TASK")); ?>',
title : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ADD_TASK")); ?>',
className : "task-menu-popup-item-create",
href: '<?php echo CUtil::JSEscape($createUrl); ?>',
onclick : function(event) {
AddQuickPopupTask(event);
this.popupWindow.close();
}
},
{
text : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ADD_SUBTASK_2")); ?>',
title : '<?php echo CUtil::JSEscape(GetMessage("TASKS_ADD_SUBTASK_2")); ?>',
className : "task-menu-popup-item-create",
href: '<?php echo CUtil::JSEscape($createSubtaskUrl)?>',
onclick : function(event) {
AddQuickPopupTask(event, {PARENT_ID: <?php echo (int) $arResult['TASK']['ID']; ?>});
this.popupWindow.close();
}
}
]
</script>
<div class="webform task-detail">
<div class="webform-round-corners webform-main-fields">
<div class="webform-corners-top">
<div class="webform-left-corner"></div>
<div class="webform-right-corner"></div>
</div>
<div class="webform-content task-detail-title-label"><?php echo GetMessage("TASKS_TASK_TITLE")?>
<div class="task-reminder<?php if ($arResult["REMINDERS"]):?> task-reminder-selected<?php endif?>"><a href="" class="webform-field-action-link task-reminder-link" id="task-reminder-link"><?php echo GetMessage("TASKS_REMIND")?></a></div>
</div>
</div>
<div class="webform-round-corners webform-main-block webform-main-block-topless webform-main-block-bottomless">
<div class="webform-content">
<div class="task-detail-title"><?php echo $arResult["TASK"]["TITLE"]?></div>
<div class="task-detail-description"><?php
echo $arResult['TASK']['DESCRIPTION'];
?></div>
<?php
$APPLICATION->IncludeComponent(
"bitrix:tasks.task.detail.parts",
".default",
array(
'MODE' => 'VIEW TASK',
'BLOCKS' => array("checklist"),
'IS_IFRAME' => $arResult['IS_IFRAME'],
'GROUP_ID' => $arParams['GROUP_ID'],
'PATH_TO_TASKS_TASK' => $arParams['PATH_TO_TASKS_TASK'],
'PATH_TO_USER_PROFILE' => $arParams['PATH_TO_USER_PROFILE'],
'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE'],
'ALLOWED_ACTIONS' => $arResult['ALLOWED_ACTIONS'],
'TASK_ID' => $arResult['TASK']['ID'],
'CHECKLIST_ITEMS' => $arResult['CHECKLIST_ITEMS']
),
null,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
</div>
<div class="webform-round-corners webform-additional-block webform-additional-block-topless">
<div class="webform-content">
<table cellspacing="0" class="task-detail-additional-layout">
<tr>
<td class="task-detail-additional-layout-tags">
<label><?php echo GetMessage("TASKS_TASK_TAGS")?>:</label><span class="task-detail-tags"><?php
if ($arResult['ALLOWED_ACTIONS']['ACTION_EDIT'])
{
$name = $APPLICATION->IncludeComponent(
"bitrix:tasks.tags.selector",
".default",
array(
"NAME" => "TAGS",
"VALUE" => $arResult["TASK"]["~TAGS"],
"ON_SELECT" => "SaveTags"
),
null,
array('HIDE_ICONS' => 'Y')
);
}
elseif ($arResult["TASK"]["TAGS"])
{
if (is_array($arResult["TASK"]["TAGS"]))
{
echo implode(", ", $arResult["TASK"]["TAGS"]);
}
else
{
echo $arResult["TASK"]["TAGS"];
}
}
else
{
echo GetMessage("TASKS_TASK_NO_TAGS");
}
?></span>
</td>
<td class="task-detail-additional-layout-files">
<div class="task-detail-files">
<?php if ($arResult["TASK"]["FILES"] || $arResult["TASK"]["FORUM_FILES"]):?>
<label class="task-detail-files-title"><?php echo GetMessage("TASKS_TASK_FILES")?>:</label>
<div class="task-detail-files-list">
<?php
$bCanRemoveFiles = false;
if ($arResult['ALLOWED_ACTIONS']['ACTION_EDIT'])
$bCanRemoveFiles = true;
$i = 0;
foreach($arResult["TASK"]["FILES"] as $key=>$file)
{
$linkId = 'task-detail-file-href-' . (int) $file['ID'];
?>
<?php $i++?>
<div class="task-detail-file webform-field-upload-list"
><span class="task-detail-file-number"><?php echo $i;
?>.</span><span class="task-detail-file-info"
><a id="<?php echo $linkId; ?>"
href="/bitrix/components/bitrix/tasks.task.detail/show_file.php?fid=<?php echo $file["ID"]?>"
target="_blank" class="task-detail-file-link"
><?php
echo $file["ORIGINAL_NAME"];
?></a><span class="task-detail-file-size">(<?php
echo CFile::FormatSize($file["FILE_SIZE"]);
?>)</span><?php
if ($bCanRemoveFiles)
{
?><a href="#" class="delete-file"
onclick="
BX.PreventDefault(event);
return tasksDetailsNS.deleteFile(
<?php echo (int) $file['ID']; ?>,
<?php echo (int) $arResult["TASK"]['ID']; ?>,
'<?php echo $linkId; ?>',
this
);"
></a><?php
}
?></span></div>
<?php
}
foreach($arResult["TASK"]["FORUM_FILES"] as $file):?>
<?php $i++?>
<div class="task-detail-file"><span class="task-detail-file-number"><?php echo $i?>.</span><span class="task-detail-file-info"><a href="#message<?php echo $file["MESSAGE_ID"]?>" class="task-detail-file-comment"/><a class="task-detail-file-link" target="_blank" href="/bitrix/components/bitrix/forum.interface/show_file.php?fid=<?php echo $file["ID"]?>"><?php echo $file["ORIGINAL_NAME"]?></a><span class="task-detail-file-size">(<?php echo CFile::FormatSize($file["FILE_SIZE"])?>)</span></span></div>
<?php endforeach?>
</div>
<?php else:?>
<?php endif?>
</div>
</td>
</tr>
</table>
<?php if ($arResult['ALLOWED_ACTIONS']['ACTION_EDIT']):?>
<div class="task-detail-group"><label><?php echo GetMessage("TASKS_TASK_GROUP")?>:</label><span class="task-detail-group-name task-detail-group-name-inline"><a href="<?php echo $arResult["TASK"]["GROUP_ID"] ? CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arResult["TASK"]["GROUP_ID"])) : "javascript: void(0);"?>" class="webform-field-action-link" id="task-group-change"><?php if ($arResult["TASK"]["GROUP_ID"]):?><?php echo $arResult["TASK"]["GROUP_NAME"]?></a><span class="task-group-delete" onclick="ClearGroup(<?php echo $arResult["TASK"]["GROUP_ID"]?>, this)"></span><?php else:?><?php echo GetMessage("TASKS_GROUP_ADD")?></a><?php endif?></span></div>
<?php
$APPLICATION->IncludeComponent(
"bitrix:socialnetwork.group.selector", ".default", array(
"JS_OBJECT_NAME" => "taskGroupPopup",
"BIND_ELEMENT" => "task-group-change",
"SELECTED" => ($arResult["TASK"]["GROUP_ID"] ? $arResult["TASK"]["GROUP_ID"] : 0),
"ON_SELECT" => "onTaskGroupSelect",
"FEATURES_PERMS" => array("tasks", "create_tasks")
), null, array("HIDE_ICONS" => "Y")
);
?>
<?php elseif ($arResult["TASK"]["GROUP_ID"] && CSocNetGroup::CanUserViewGroup($USER->GetID(), $arResult["TASK"]["GROUP_ID"])):?>
<div class="task-detail-group"><span class="task-detail-group-label"><?php echo GetMessage("TASKS_TASK_GROUP")?>:</span><span class="task-detail-group-name"><a href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arResult["TASK"]["GROUP_ID"]))?>" class="task-detail-group-link" target="_top"><?php echo $arResult["TASK"]["GROUP_NAME"]?></a></span></div>
<?php endif?>
<?php
if ($arResult["TASK"]["PARENT_ID"])
{
$rsTask = CTasks::GetList(array(), array("ID" => $arResult["TASK"]["PARENT_ID"]), array("ID", "TITLE"));
if ($parent = $rsTask->GetNext())
{
?>
<div class="task-detail-supertask">
<span class="task-detail-supertask-label"><?php echo GetMessage("TASKS_PARENT_TASK")?>:</span>
<span class="task-detail-group-name"><a href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => $parent["ID"], "action" => "view"))?>" class="task-detail-group-link"<?php if ($arResult["IS_IFRAME"]):?> onclick="taskIFramePopup.view(<?php echo $parent["ID"]?>);return false;"<?php endif?>><?php echo $parent["TITLE"]?></a></span>
</div>
<?php
}
}
if($arResult["SHOW_USER_FIELDS"]):?>
<div class="task-detail-properties">
<table cellspacing="0" class="task-properties-layout">
<?php
foreach($arResult["USER_FIELDS"] as $arUserField)
{
if ($arUserField["VALUE"] === null)
continue;
?>
<tr>
<td class="task-property-name"><?php echo htmlspecialcharsbx($arUserField["EDIT_FORM_LABEL"])?>:</td>
<td class="task-property-value"><span class="fields"><?php
if ($arUserField['USER_TYPE']['USER_TYPE_ID'] === 'file')
{
if ( ! is_array($arUserField['VALUE']) )
$arUserField['VALUE'] = array($arUserField['VALUE']);
$first = true;
foreach ($arUserField['VALUE'] as $fileId)
{
$isImage = false;
$arFile = CFile::GetFileArray($fileId);
if ( ! $arFile )
continue;
if (
(substr($arFile["CONTENT_TYPE"], 0, 6) == "image/")
//&& (CFile::CheckImageFile($arFile) === null)
)
{
$isImage = true;
}
if ( ! $first )
echo '<span class="bx-br-separator"><br /></span>';
else
$first = false;
echo '<span class="fields files">';
if ($isImage)
{
$arFile['SRC'] = "/bitrix/components/bitrix/tasks.task.detail/show_file.php?fid=" . $arFile['ID'] . "&TASK_ID=" . (int) $arResult['TASK']['ID'];
echo CFile::ShowImage(
$arFile,
$arParams["FILE_MAX_WIDTH"],
$arParams["FILE_MAX_HEIGHT"],
"",
"",
($arParams["FILE_SHOW_POPUP"]=="Y")
);
}
else
{
?>
<span class="task-detail-file-info"><a
href="/bitrix/components/bitrix/tasks.task.detail/show_file.php?fid=<?php echo $arFile['ID']; ?>&TASK_ID=<?php echo (int) $arResult['TASK']['ID']; ?>"
target="_blank" class="task-detail-file-link"><?php
echo htmlspecialcharsbx($arFile['ORIGINAL_NAME']);
?></a><span class="task-detail-file-size">(<?php
echo CFile::FormatSize($arFile['FILE_SIZE']);
?>)</span></span>
<?php
}
echo '</span>';
}
}
else
{
$APPLICATION->IncludeComponent(
"bitrix:system.field.view",
$arUserField["USER_TYPE"]["USER_TYPE_ID"],
array("arUserField" => $arUserField),
null,
array("HIDE_ICONS"=>"Y")
);
}
?></td>
</tr>
<?php
}
?>
</table>
</div>
<?php endif?>
</div>
<div class="webform-corners-bottom">
<div class="webform-left-corner"></div>
<div class="webform-right-corner"></div>
</div>
</div>
<?php
// =========================== Start of buttons area ===========================
$APPLICATION->IncludeComponent(
"bitrix:tasks.task.detail.parts",
".default",
array(
'MODE' => 'VIEW TASK',
'BLOCKS' => array("buttons"),
'IS_IFRAME' => $arResult['IS_IFRAME'],
'GROUP_ID' => $arParams['GROUP_ID'],
'PATH_TO_TASKS_TASK' => $arParams['PATH_TO_TASKS_TASK'],
'PATH_TO_USER_PROFILE' => $arParams['PATH_TO_USER_PROFILE'],
'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE'],
'ALLOWED_ACTIONS' => $arResult['ALLOWED_ACTIONS'],
'TASK_ID' => $arResult['TASK']['ID'],
'TASK' => $arResult['TASK']
),
null,
array('HIDE_ICONS' => 'Y')
);
// =========================== End of buttons area ===========================
?>
<div class="task-detail-subtasks" id="task-detail-subtasks-block"<?php if (!sizeof($arResult["SUBTASKS"])):?> style="display: none;"<?php endif?>>
<div class="task-list">
<div class="task-list-left-corner"></div>
<div class="task-list-right-corner"></div>
<table class="task-list-table task-list-table-unsortable" cellspacing="0" id="subtask-list-table">
<colgroup>
<col class="task-title-column" />
<col class="task-menu-column" />
<col class="task-flag-column" />
<col class="task-priority-column" />
<col class="task-deadline-column" />
<col class="task-responsible-column" />
<col class="task-director-column" />
<col class="task-grade-column" />
<col class="task-complete-column" />
</colgroup>
<thead>
<tr>
<th class="task-title-column" colspan="4">
<div class="task-head-cell">
<span class="task-head-cell-sort-order"></span>
<span class="task-head-cell-title"><?php echo GetMessage("TASKS_TASK_SUBTASKS")?></span>
<span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div>
</th>
<th class="task-deadline-column">
<div class="task-head-cell"><span class="task-head-cell-sort-order"></span><span class="task-head-cell-title"><?php echo GetMessage("TASKS_DEADLINE")?></span><span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div></th>
<th class="task-responsible-column">
<div class="task-head-cell"><span class="task-head-cell-sort-order"></span><span class="task-head-cell-title"><?php echo GetMessage("TASKS_RESPONSIBLE")?></span><span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div></th>
<th class="task-director-column" >
<div class="task-head-cell"><span class="task-head-cell-sort-order"></span><span class="task-head-cell-title"><?php echo GetMessage("TASKS_CREATOR")?></span><span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div></th>
<th class="task-grade-column"> </th>
<th class="task-complete-column"> </th>
</tr>
</thead>
<tbody>
<tr class="task-list-item task-list-item-hidden" id="task-new-item-row">
<td class="task-new-item-column" colspan="9">
<form onSubmit="return AddTask()">
<table class="task-new-item-table" cellspacing="0">
<tr>
<td class="task-new-item-title"><label for="task-new-item-name"><?php
echo GetMessage("TASKS_QUICK_TITLE");
?></label><input
type="text" id="task-new-item-name" class="task-new-item-textbox"
/><div class="task-new-item-description"><span class="task-new-item-link"
id="task-new-item-description-link"><?php echo GetMessage("TASKS_QUICK_DESCRIPTION");
?></span><div class="task-description-textarea"
id="task-quick-description-textarea"><textarea
id="task-new-item-description"></textarea></div></div><div class="task-new-item-buttons"><span class="task-new-item-buttons-wrap"><input type="submit" id="task-new-item-submit" value="<?php echo GetMessage("TASKS_QUICK_SAVE")?>" /> <input type="button" id="task-new-item-cancel" value="<?php echo GetMessage("TASKS_QUICK_CANCEL")?>" onClick="HideQuickTask()" /></span><span class="task-new-item-link" id="task-new-item-link-group"><?php echo GetMessage("TASKS_QUICK_IN_GROUP")?></span></div></td>
<td class="task-new-item-priority"><a href="javascript: void(0)" class="task-priority-box" onclick="return ShowPriorityPopup(0, this, 0);" title="<?php echo GetMessage("TASKS_PRIORITY")?>: <?php echo GetMessage("TASKS_PRIORITY_0")?>"><i id="task-new-item-priority" class="task-priority-icon task-priority-0"></i></a></td>
<td class="task-new-item-deadline">
<label for="task-new-item-deadline"><?php echo GetMessage("TASKS_QUICK_DEADLINE")?></label>
<input type="text" id="task-new-item-deadline" name="DEADLINE" class="task-new-item-textbox"
onClick="
<?php /* jsCal endar. Show(this, this.name, this.name, '', true, Math.round((new Date()) / 1000) - (new Date()).getTimezoneOffset()*60, '', false); */ ?>
BX.calendar({
node: this,
field: BX('task-new-item-deadline'),
form: '',
bTime: true,
currentTime: Math.round((new Date()) / 1000) - (new Date()).getTimezoneOffset()*60,
bHideTimebar: false,
callback_after: function(value) {
tasks_funcOnChangeOfSomeDateFields(BX('task-new-item-deadline'));
}
});
" />
</td>
<td class="task-new-item-responsible"><label for="task-new-item-responsible"><?php echo GetMessage("TASKS_RESPONSIBLE")?></label><input type="text" id="task-new-item-responsible" class="task-new-item-textbox" value="<?php
echo tasksFormatName(
$arResult["USER"] ? $arResult["USER"]["NAME"] : htmlspecialcharsbx($USER->GetFirstName()),
$arResult["USER"] ? $arResult["USER"]["LAST_NAME"] : htmlspecialcharsbx($USER->GetLastName()),
$arResult["USER"] ? $arResult["USER"]["LOGIN"] : htmlspecialcharsbx($USER->GetLogin()),
$arResult["USER"] ? $arResult["USER"]["SECOND_NAME"] : htmlspecialcharsbx($USER->GetSecondName()),
$arParams["NAME_TEMPLATE"],
false
);
?>" /><input type="hidden" name="task-new-item-responsible-hidden" id="task-new-item-responsible-hidden" value="<?php echo $arParams["USER_ID"]?>" /></td>
</tr>
</table>
<?php
$APPLICATION->IncludeComponent(
"bitrix:intranet.user.selector.new",
".default",
array(
"MULTIPLE" => "N",
"NAME" => "QUICK_RESPONSIBLE",
"INPUT_NAME" => "task-new-item-responsible",
"VALUE" => $arParams["USER_ID"],
"POPUP" => "Y",
"ON_SELECT" => "onQuickResponsibleSelect",
"PATH_TO_USER_PROFILE" => $arParams["PATH_TO_USER_PROFILE"],
"SITE_ID" => SITE_ID,
"GROUP_ID_FOR_SITE" => (isset($_GET["GROUP_ID"]) && intval($_GET["GROUP_ID"]) > 0 ? $_GET["GROUP_ID"] : (isset($arParams["GROUP_ID"]) && intval($arParams["GROUP_ID"]) > 0 ? $arParams["GROUP_ID"] : false)),
'SHOW_EXTRANET_USERS' => 'FROM_MY_GROUPS',
'DISPLAY_TAB_GROUP' => 'Y',
"NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"]
),
null,
array("HIDE_ICONS" => "Y")
);
$APPLICATION->IncludeComponent(
"bitrix:socialnetwork.group.selector", ".default", array(
"BIND_ELEMENT" => "task-new-item-link-group",
"ON_SELECT" => "onGroupSelect",
"FEATURES_PERMS" => array("tasks", "create_tasks")
), null, array("HIDE_ICONS" => "Y")
);
?>
</form>
</td>
</tr>
<?php if (sizeof($arResult["SUBTASKS"])):?>
<?php $currentProject = false?>
<?php foreach($arResult["SUBTASKS"] as $task):?>
<?php if ($arResult["TASK_TYPE"] != "group" && $task["GROUP_ID"] && $task["GROUP_ID"] != $currentProject):?>
<?php
$currentProject = $task["GROUP_ID"];
$task["GROUP_NAME"] = $arResult["GROUPS"][$task["GROUP_ID"]]["NAME"];
?>
<tr class="task-list-item" id="task-project-<?php echo $task["GROUP_ID"]?>">
<td class="task-project-column" colspan="9">
<div class="task-project-column-inner">
<div class="task-project-name"><span class="task-project-folding<?php if (!$arResult["GROUPS"][$task["GROUP_ID"]]["EXPANDED"]):?> task-project-folding-closed<?php endif?>" onclick="ToggleProjectTasks(<?php echo $arResult["GROUPS"][$task["GROUP_ID"]]["ID"]?>, event);"></span><a class="task-project-name-link" href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_TASKS"], array("group_id" => $arResult["GROUPS"][$task["GROUP_ID"]]["ID"]))?>" onclick="ToggleProjectTasks(<?php echo $arResult["GROUPS"][$task["GROUP_ID"]]["ID"]?>, event);"><?php echo $arResult["GROUPS"][$task["GROUP_ID"]]["NAME"]?></a></div>
<?php if (is_object($USER) && $USER->IsAuthorized()):?>
<div class="task-project-actions"><a class="task-project-action-link" href="<?php $path = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => 0, "action" => "edit")); echo $path.(strstr($path, "?") ? "&" : "?")."GROUP_ID=".$arResult["GROUPS"][$task["GROUP_ID"]]["ID"].($arResult["IS_IFRAME"] ? "&IFRAME=Y" : "");?>"><i class="task-project-action-icon"></i><span class="task-project-action-text"><?php echo GetMessage("TASKS_ADD_TASK")?></span></a><span class="task-project-lightning" onclick="ShowQuickTask(null, {group: {id: <?php echo $task["GROUP_ID"]?>, title: '<?php echo CUtil::JSEscape($arResult["GROUPS"][$task["GROUP_ID"]]["NAME"])?>'}});"></span></div>
<?php endif?>
</div>
</td>
</tr>
<?php endif?>
<?php tasksRenderListItem($task, $arResult["CHILDREN_COUNT"]["PARENT_".$task["ID"]], $arPaths, 0, false, false, SITE_ID, 0, true, false, "bitrix:tasks.list.item", ".default", $arParams["NAME_TEMPLATE"])?>
<?php endforeach?>
<?php else:?>
<tr class="task-list-item" id="task-list-no-tasks"><td class="task-new-item-column" colspan="9" style="text-align: center"><?php echo GetMessage("TASKS_NO_SUBTASKS")?></td></tr>
<?php endif?>
</tbody>
</table>
</div>
</div>
<?php if (sizeof($arResult["PREV_TASKS"])):?>
<div class="task-detail-previous-tasks">
<div class="task-list">
<div class="task-list-left-corner"></div>
<div class="task-list-right-corner"></div>
<table class="task-list-table task-list-table-unsortable" cellspacing="0">
<colgroup>
<col class="task-title-column" />
<col class="task-menu-column" />
<col class="task-flag-column" />
<col class="task-priority-column" />
<col class="task-deadline-column" />
<col class="task-responsible-column" />
<col class="task-director-column" />
<col class="task-grade-column" />
<col class="task-complete-column" />
</colgroup>
<thead>
<tr>
<th class="task-title-column" colspan="4">
<div class="task-head-cell">
<span class="task-head-cell-sort-order"></span>
<span class="task-head-cell-title"><?php echo GetMessage("TASKS_TASK_PREVIOUS_TASKS")?></span>
<span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div>
</th>
<th class="task-deadline-column">
<div class="task-head-cell"><span class="task-head-cell-sort-order"></span><span class="task-head-cell-title"><?php echo GetMessage("TASKS_DEADLINE")?></span><span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div></th>
<th class="task-responsible-column">
<div class="task-head-cell"><span class="task-head-cell-sort-order"></span><span class="task-head-cell-title"><?php echo GetMessage("TASKS_RESPONSIBLE")?></span><span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div></th>
<th class="task-director-column" >
<div class="task-head-cell"><span class="task-head-cell-sort-order"></span><span class="task-head-cell-title"><?php echo GetMessage("TASKS_CREATOR")?></span><span class="task-head-cell-clear-underlay"><a class="task-head-cell-sort-clear" href="#"><i class="task-head-cell-sort-clear-icon"></i></a></span></div></th>
<th class="task-grade-column"> </th>
<th class="task-complete-column"> </th>
</tr>
</thead>
<tbody>
<?php if (sizeof($arResult["PREV_TASKS"])):?>
<?php $currentProject = false?>
<?php foreach($arResult["PREV_TASKS"] as $task):?>
<?php if ($arResult["TASK_TYPE"] != "group" && $task["GROUP_ID"] && $task["GROUP_ID"] != $currentProject):?>
<?php
$currentProject = $task["GROUP_ID"];
$task["GROUP_NAME"] = $arResult["GROUPS"][$task["GROUP_ID"]]["NAME"];
?>
<tr class="task-list-item" id="task-project-<?php echo $task["GROUP_ID"]?>">
<td class="task-project-column" colspan="9">
<div class="task-project-column-inner">
<div class="task-project-name"><span class="task-project-folding<?php if (!$arResult["GROUPS"][$task["GROUP_ID"]]["EXPANDED"]):?> task-project-folding-closed<?php endif?>" onclick="ToggleProjectTasks(<?php echo $arResult["GROUPS"][$task["GROUP_ID"]]["ID"]?>, event);"></span><a class="task-project-name-link" href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_TASKS"], array("group_id" => $arResult["GROUPS"][$task["GROUP_ID"]]["ID"]))?>" onclick="ToggleProjectTasks(<?php echo $arResult["GROUPS"][$task["GROUP_ID"]]["ID"]?>, event);"><?php echo $arResult["GROUPS"][$task["GROUP_ID"]]["NAME"]?></a></div>
<?php if (is_object($USER) && $USER->IsAuthorized()):?>
<div class="task-project-actions"><a class="task-project-action-link" href="<?php $path = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => 0, "action" => "edit")); echo $path.(strstr($path, "?") ? "&" : "?")."GROUP_ID=".$arResult["GROUPS"][$task["GROUP_ID"]]["ID"].($arResult["IS_IFRAME"] ? "&IFRAME=Y" : "");?>"><i class="task-project-action-icon"></i><span class="task-project-action-text"><?php echo GetMessage("TASKS_ADD_TASK")?></span></a><span class="task-project-lightning" onclick="ShowQuickTask(null, {group: {id: <?php echo $task["GROUP_ID"]?>, title: '<?php echo CUtil::JSEscape($arResult["GROUPS"][$task["GROUP_ID"]]["NAME"])?>'}});"></span></div>
<?php endif?>
</div>
</td>
</tr>
<?php endif?>
<?php tasksRenderListItem($task, $arResult["CHILDREN_COUNT"]["PARENT_".$task["ID"]], $arPaths, 0, false, false, SITE_ID, 0, true, false, "bitrix:tasks.list.item", ".default", $arParams["NAME_TEMPLATE"])?>
<?php endforeach?>
<?php endif?>
</tbody>
</table>
</div>
</div>
<?php endif?>
<div class="task-comments-and-log">
<div class="task-comments-log-switcher">
<span class="task-switcher task-switcher-selected" id="task-comments-switcher"><span class="task-switcher-left"></span><span class="task-switcher-text"><span class="task-switcher-text-inner"><?php echo GetMessage("TASKS_TASK_COMMENTS")?> (<?php echo intval($arResult["TASK"]["COMMENTS_COUNT"])?>)</span></span><span class="task-switcher-right"></span></span>
<span class="task-switcher" id="task-log-switcher"><span class="task-switcher-left"></span><span class="task-switcher-text"><span class="task-switcher-text-inner"><?php echo GetMessage("TASKS_TASK_LOG")?> (<span id="task-switcher-text-log-count"><?php echo sizeof($arResult["LOG"])?></span>)</span></span><span class="task-switcher-right"></span></span>
<span class="task-switcher" id="task-time-switcher"><span class="task-switcher-left"></span><span class="task-switcher-text"><span class="task-switcher-text-inner"><?php echo GetMessage("TASKS_ELAPSED_TIME")?> (<?php echo floor($arResult["FULL_ELAPSED_TIME"] / 60)?><?php echo GetMessage("TASKS_ELAPSED_H")?> <?php echo $arResult["FULL_ELAPSED_TIME"] % 60?><?php echo GetMessage("TASKS_ELAPSED_M")?>)</span></span><span class="task-switcher-right"></span></span>
</div>
<div class="task-comments-block task-comments-block-selected" id="task-comments-block">
<a name="comments"></a>
<?php
$APPLICATION->IncludeComponent(
'bitrix:tasks.topic.reviews',
'',
array(
'TASK' => $arResult['TASK'],
'CACHE_TYPE' => $arParams['CACHE_TYPE'],
'CACHE_TIME' => $arParams['CACHE_TIME'],
'MESSAGES_PER_PAGE' => $arParams['ITEM_DETAIL_COUNT'],
'USE_CAPTCHA' => 'N',
'PREORDER' => 'ACCORD_FORUM_SETTINGS',
'PATH_TO_SMILE' => $arParams['PATH_TO_FORUM_SMILE'],
'FORUM_ID' => $arParams['FORUM_ID'],
'TASK_ID' => $arResult['TASK']['ID'],
'SHOW_RATING' => $arParams['SHOW_RATING'],
'RATING_TYPE' => $arParams['RATING_TYPE'],
'FILES_COUNT' => $arResult['MAX_UPLOAD_FILES_IN_COMMENTS'],
'SHOW_LINK_TO_FORUM' => 'N',
'URL_TEMPLATES_PROFILE_VIEW' => $arParams['PATH_TO_USER_PROFILE'],
'PAGE_NAVIGATION_TEMPLATE' => 'arrows',
"NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"]
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<div class="task-log-block" id="task-log-block">
<a name="updates"></a>
<?php
if (sizeof($arResult["LOG"]) > 0):
?>
<table id="task-log-table" class="task-log-table" cellspacing="0">
<col class="task-log-date-column" />
<col class="task-log-author-column" />
<col class="task-log-where-column" />
<col class="task-log-what-column" />
<tr>
<th class="task-log-date-column"><?php echo GetMessage("TASKS_LOG_WHEN")?></th>
<th class="task-log-author-column"><?php echo GetMessage("TASKS_LOG_WHO")?></th>
<th class="task-log-where-column"><?php echo GetMessage("TASKS_LOG_WHERE")?></th>
<th class="task-log-what-column"><?php echo GetMessage("TASKS_LOG_WHAT")?></th>
</tr>
<?php
$commentsCurrPage = (intval($_GET["PAGEN_2"]) > 1 ? intval($_GET["PAGEN_2"]) : 1);
$funcFormatForHuman = function($seconds)
{
if ($seconds === NULL)
return '';
$hours = (int) ($seconds / 3600);
if ($hours < 24)
$duration = $hours . ' ' . GetMessage('TASKS_TASK_DURATION_HOURS');
elseif ($hours % 24)
{
$duration = (int) ($hours / 24) . ' ' . GetMessage('TASKS_TASK_DURATION_DAYS') . ' '
. ($hours % 24) . ' ' . GetMessage('TASKS_TASK_DURATION_HOURS');
}
else
$duration = (int) ($hours / 24) . ' ' . GetMessage('TASKS_TASK_DURATION_DAYS');
return ($duration);
};
$funcFormatForHumanMinutes = function($minutes)
{
if ($minutes === NULL)
return '';
$hours = (int) ($minutes / 60);
if ($minutes < 60)
$duration = $minutes . ' ' . GetMessage('TASKS_TASK_DURATION_MINUTES');
elseif ($minutes % 60)
{
$duration = $hours . ' ' . GetMessage('TASKS_TASK_DURATION_HOURS') . ' '
. (int) ($minutes % 60) . ' ' . GetMessage('TASKS_TASK_DURATION_MINUTES');
}
else
$duration = $hours . ' ' . GetMessage('TASKS_TASK_DURATION_HOURS');
return ($duration);
};
foreach($arResult["LOG"] as $record):?>
<?php $anchor_id = RandString(8);?>
<tr>
<td class="task-log-date-column"><span class="task-log-date"><?php echo FormatDateFromDB($record["CREATED_DATE"]);?></span></td>
<td class="task-log-author-column"><script type="text/javascript">BX.tooltip(<?php echo $record["USER_ID"]?>, "anchor_log_<?php echo $anchor_id?>", "");</script><a id="anchor_log_<?php echo $anchor_id?>" class="task-log-author" target="_top" href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PROFILE"], array("user_id" => $record["USER_ID"]))?>"><?php
echo tasksFormatNameShort(
$record["USER_NAME"],
$record["USER_LAST_NAME"],
$record["USER_LOGIN"],
$record["USER_SECOND_NAME"],
$arParams["NAME_TEMPLATE"],
false
)?></a></td>
<td class="task-log-where-column"><span class="task-log-where"><?php echo GetMessage("TASKS_LOG_".$record["FIELD"])?><?php
if ($record["FIELD"] == "DELETED_FILES")
{
?>: <?php echo $record["FROM_VALUE"]?><?php
}
elseif ($record["FIELD"] == "NEW_FILES")
{
?>: <?php echo $record["TO_VALUE"]?><?php
}
elseif ($record["FIELD"] == "COMMENT" || $record["FIELD"] == "COMMENT_EDIT")
{
$link = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => $arResult["TASK"]["ID"], "action" => "view"));
if ($pageNumber != 1)
{
$link .= (strpos($link, "?") === false ? "?" : "&")."MID=".intval($record["TO_VALUE"]);
}
if ($arResult["IS_IFRAME"])
{
$link .= (strpos($link, "?") === false ? "?" : "&")."IFRAME=Y";
}
$link .= "#message".$record["TO_VALUE"];
?> <a href="javascript: void(0)" onClick="GoToComment('<?php echo $link?>', <?php echo $pageNumber == $commentsCurrPage ? "true" : "false"?>)">#<?php echo $record["TO_VALUE"]?></a><?php
}
?></span></td>
<td class="task-log-what-column"><span class="task-log-what"><?php
switch($record["FIELD"])
{
case "DURATION_PLAN_SECONDS":
echo $funcFormatForHuman($record['FROM_VALUE']);;
?><span class="task-log-arrow">→</span><?php
echo $funcFormatForHuman($record['TO_VALUE']);;
break;
case "TITLE":
case "DURATION_PLAN":
case 'CHECKLIST_ITEM_CREATE':
case 'CHECKLIST_ITEM_REMOVE':
case 'CHECKLIST_ITEM_RENAME':
echo $record["FROM_VALUE"];
?><span class="task-log-arrow">→</span><?php
echo $record["TO_VALUE"];
break;
case "DURATION_FACT":
echo $funcFormatForHumanMinutes($record["FROM_VALUE"]);
?><span class="task-log-arrow">→</span><?php
echo $funcFormatForHumanMinutes($record["TO_VALUE"]);
break;
case "RESPONSIBLE_ID":
$rsUserFrom = CUser::GetByID($record["FROM_VALUE"]);
if ($arUserFrom = $rsUserFrom->GetNext())
{
$anchor_id = RandString(8);
$sUserFrom = '<script type="text/javascript">BX.tooltip('.$arUserFrom["ID"].', "anchor_log_'.$anchor_id.'", "");</script><a id="anchor_log_'.$anchor_id.'" class="task-log-author" href="'.CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PROFILE"], array("user_id" => $arUserFrom["ID"])).'">'
. tasksFormatNameShort(
$arUserFrom["NAME"],
$arUserFrom["LAST_NAME"],
$arUserFrom["LOGIN"],
$arUserFrom["SECOND_NAME"],
$arParams["NAME_TEMPLATE"],
false
).'</a>';
}
$rsUserTo = CUser::GetByID($record["TO_VALUE"]);
if ($arUserTo = $rsUserTo->GetNext())
{
$anchor_id = RandString(8);
$sUserTo = '<script type="text/javascript">BX.tooltip('.$arUserTo["ID"].', "anchor_log_'.$anchor_id.'", "");</script><a id="anchor_log_'.$anchor_id.'" class="task-log-author" href="'.CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PROFILE"], array("user_id" => $arUserTo["ID"])).'">'
. tasksFormatNameShort(
$arUserTo["NAME"],
$arUserTo["LAST_NAME"],
$arUserTo["LOGIN"],
$arUserTo["SECOND_NAME"],
$arParams["NAME_TEMPLATE"],
false
).'</a>';
}
?>
<?php echo $sUserFrom?><span class="task-log-arrow">→</span><?php echo $sUserTo?>
<?php
break;
case "DEADLINE":
case "START_DATE_PLAN":
case "END_DATE_PLAN":
if ($record['FROM_VALUE'] > 0)
{
// Don't format time, if it's 00:00
if (date("H:i", $record["FROM_VALUE"]) == "00:00")
echo FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $record['FROM_VALUE']);
else
echo FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $record['FROM_VALUE']);
}
?><span class="task-log-arrow">→</span><?php
if ($record['TO_VALUE'] > 0)
{
// Don't format time, if it's 00:00
if (date("H:i", $record["TO_VALUE"]) == "00:00")
echo FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $record['TO_VALUE']);
else
echo FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $record['TO_VALUE']);
}
break;
case "ACCOMPLICES":
case "AUDITORS":
$arUsersFromStr = array();
if ($record["FROM_VALUE"])
{
$rsUsersFrom = CUser::GetList(($by="id"), ($order="asc"), array("ID" => str_replace(",", "|", $record["FROM_VALUE"])));
while ($arUserFrom = $rsUsersFrom->GetNext())
{
$anchor_id = RandString(8);
$arUsersFromStr[] = '<script type="text/javascript">BX.tooltip('.$arUserFrom["ID"].', "anchor_log_'.$anchor_id.'", "");</script><a id="anchor_log_'.$anchor_id.'" class="task-log-link" href="'.CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PROFILE"], array("user_id" => $arUserFrom["ID"])).'">'
. tasksFormatNameShort(
$arUserFrom["NAME"],
$arUserFrom["LAST_NAME"],
$arUserFrom["LOGIN"],
$arUserFrom["SECOND_NAME"],
$arParams["NAME_TEMPLATE"],
false
).'</a>';
}
}
$arUsersToStr = array();
if ($record["TO_VALUE"])
{
$rsUsersTo = CUser::GetList(($by="id"), ($order="asc"), array("ID" => str_replace(",", "|", $record["TO_VALUE"])));
while ($arUserTo = $rsUsersTo->GetNext())
{
$anchor_id = RandString(8);
$arUsersToStr[] = '<script type="text/javascript">BX.tooltip('.$arUserTo["ID"].', "anchor_log_'.$anchor_id.'", "");</script><a id="anchor_log_'.$anchor_id.'" class="task-log-link" href="'.CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PROFILE"], array("user_id" => $arUserTo["ID"])).'">'
. tasksFormatNameShort(
$arUserTo["NAME"],
$arUserTo["LAST_NAME"],
$arUserTo["LOGIN"],
$arUserTo["SECOND_NAME"],
$arParams["NAME_TEMPLATE"],
false).'</a>';
}
}
?>
<?php echo implode(", ", $arUsersFromStr)?><span class="task-log-arrow">→</span><?php echo implode(", ", $arUsersToStr)?>
<?php
break;
case "TAGS":
?>
<?php echo str_replace(",", ", ", $record["FROM_VALUE"])?><span class="task-log-arrow">→</span><?php echo str_replace(",", ", ", $record["TO_VALUE"])?>
<?php
break;
case "PRIORITY":
?>
<?php echo GetMessage("TASKS_PRIORITY_".$record["FROM_VALUE"])?><span class="task-log-arrow">→</span><?php echo GetMessage("TASKS_PRIORITY_".$record["TO_VALUE"])?>
<?php
break;
case "GROUP_ID":
if ($record["FROM_VALUE"] && CSocNetGroup::CanUserViewGroup($USER->GetID(), $record["FROM_VALUE"]))
{
$arGroupFrom = CSocNetGroup::GetByID($record["FROM_VALUE"]);
{
if ($arGroupFrom)
{
?><a href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arGroupFrom["ID"]))?>"><?php echo $arGroupFrom["NAME"]?></a><?php
}
}
}
?><span class="task-log-arrow">→</span><?php
if ($record["TO_VALUE"] && CSocNetGroup::CanUserViewGroup($USER->GetID(), $record["TO_VALUE"]))
{
$arGroupTo = CSocNetGroup::GetByID($record["TO_VALUE"]);
{
if ($arGroupTo)
{
?><a href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arGroupTo["ID"]))?>"><?php echo $arGroupTo["NAME"]?></a><?php
}
}
}
break;
case "PARENT_ID":
if ($record["FROM_VALUE"])
{
$rsTaskFrom = CTasks::GetList(array(), array("ID" => $record["FROM_VALUE"]), array("ID", "TITLE"));
{
if ($arTaskFrom = $rsTaskFrom->GetNext())
{
?><a href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => $arTaskFrom["ID"], "action" => "view"))?>"><?php echo $arTaskFrom["TITLE"]?></a><?php
}
}
}
?><span class="task-log-arrow">→</span><?php
if ($record["TO_VALUE"])
{
$rsTaskTo = CTasks::GetList(array(), array("ID" => $record["TO_VALUE"]), array("ID", "TITLE"));
{
if ($arTaskTo = $rsTaskTo->GetNext())
{
?><a href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("task_id" => $arTaskTo["ID"], "action" => "view"))?>"><?php echo $arTaskTo["TITLE"]?></a><?php
}
}
}
break;
case "DEPENDS_ON":
$arTasksFromStr = array();
if ($record["FROM_VALUE"])
{
$rsTasksFrom = CTasks::GetList(array(), array("ID" => explode(",", $record["FROM_VALUE"])), array("ID", "TITLE"));
while ($arTaskFrom = $rsTasksFrom->GetNext())
{
$arTasksFromStr[] = '<a class="task-log-link" href="'.CComponentEn
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?
$pageId = "group_tasks";
include("util_group_menu.php");
include("util_group_profile.php");
?>
<?
if (CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arResult["VARIABLES"]["group_id"], "tasks"))
{
?>
<?
if (COption::GetOptionString("intranet", "use_tasks_2_0", "N") == "Y")
{
$APPLICATION->IncludeComponent(
$arResult["VARIABLES"]["action"] == "edit" ? "bitrix:tasks.task.edit" : "areal:tasks.task.detail",
".default",
Array(
"GROUP_ID" => $arResult["VARIABLES"]["group_id"],
"PAGE_VAR" => $arResult["ALIASES"]["page"],
"GROUP_VAR" => $arResult["ALIASES"]["group_id"],
"VIEW_VAR" => $arResult["ALIASES"]["view_id"],
"TASK_VAR" => $arResult["ALIASES"]["task_id"],
"ACTION_VAR" => $arResult["ALIASES"]["action"],
"ACTION" => $arResult["VARIABLES"]["action"],
"TASK_ID" => $arResult["VARIABLES"]["task_id"],
"PATH_TO_GROUP_TASKS" => $arResult["PATH_TO_GROUP_TASKS"],
"PATH_TO_GROUP_TASKS_TASK" => $arResult["PATH_TO_GROUP_TASKS_TASK"],
"PATH_TO_GROUP_TASKS_VIEW" => $arResult["PATH_TO_GROUP_TASKS_VIEW"],
"PATH_TO_USER_TASKS_TEMPLATES" => $arParams["PATH_TO_USER_TASKS_TEMPLATES"],
"PATH_TO_USER_TEMPLATES_TEMPLATE" => $arParams["PATH_TO_USER_TEMPLATES_TEMPLATE"],
"PATH_TO_USER_PROFILE" => $arParams["PATH_TO_USER"],
"SHOW_RATING" => $arParams["SHOW_RATING"],
"RATING_TYPE" => $arParams["RATING_TYPE"],
"PATH_TO_GROUP" => $arResult["PATH_TO_GROUP"],
"PATH_TO_MESSAGES_CHAT" => $arParams["PATH_TO_MESSAGES_CHAT"],
"PATH_TO_VIDEO_CALL" => $arParams["PATH_TO_VIDEO_CALL"],
"PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"],
"PATH_TO_FORUM_SMILE" => $arParams["PATH_TO_FORUM_SMILE"],
"TASKS_FIELDS_SHOW" => $arParams["TASKS_FIELDS_SHOW"],
"SET_NAV_CHAIN" => $arResult["SET_NAV_CHAIN"],
"SET_TITLE" => $arResult["SET_TITLE"],
"FORUM_ID" => $arParams["TASK_FORUM_ID"],
"NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"],
"SHOW_LOGIN" => $arParams["SHOW_LOGIN"],
"DATE_TIME_FORMAT" => $arResult["DATE_TIME_FORMAT"],
"SHOW_YEAR" => $arParams["SHOW_YEAR"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"THUMBNAIL_LIST_SIZE" => 30,
),
$component,
array("HIDE_ICONS" => "Y")
);
}
else
{
$APPLICATION->IncludeComponent("bitrix:intranet.tasks.menu", ".default", Array(
"IBLOCK_ID" => $arParams["TASK_IBLOCK_ID"],
"OWNER_ID" => $arResult["VARIABLES"]["group_id"],
"TASK_TYPE" => 'group',
"PAGE_VAR" => $arResult["ALIASES"]["page"],
"GROUP_VAR" => $arResult["ALIASES"]["group_id"],
"VIEW_VAR" => $arResult["ALIASES"]["view_id"],
"TASK_VAR" => $arResult["ALIASES"]["task_id"],
"ACTION_VAR" => $arResult["ALIASES"]["action"],
"ACTION" => $arResult["VARIABLES"]["action"],
"TASK_ID" => $arResult["VARIABLES"]["task_id"],
"PATH_TO_GROUP_TASKS" => $arResult["PATH_TO_GROUP_TASKS"],
"PATH_TO_GROUP_TASKS_TASK" => $arResult["PATH_TO_GROUP_TASKS_TASK"],
"PATH_TO_GROUP_TASKS_VIEW" => $arResult["PATH_TO_GROUP_TASKS_VIEW"],
"PAGE_ID" => "group_tasks_task",
),
$component,
array("HIDE_ICONS" => "Y")
);
$zzz = $APPLICATION->IncludeComponent(
"bitrix:intranet.tasks.create",
".default",
Array(
"IBLOCK_ID" => $arParams["TASK_IBLOCK_ID"],
"OWNER_ID" => $arResult["VARIABLES"]["group_id"],
"TASK_TYPE" => 'group',
"PAGE_VAR" => $arResult["ALIASES"]["page"],
"GROUP_VAR" => $arResult["ALIASES"]["group_id"],
"VIEW_VAR" => $arResult["ALIASES"]["view_id"],
"TASK_VAR" => $arResult["ALIASES"]["task_id"],
"ACTION_VAR" => $arResult["ALIASES"]["action"],
"ACTION" => $arResult["VARIABLES"]["action"],
"TASK_ID" => $arResult["VARIABLES"]["task_id"],
"PATH_TO_GROUP_TASKS" => $arResult["PATH_TO_GROUP_TASKS"],
"PATH_TO_GROUP_TASKS_TASK" => $arResult["PATH_TO_GROUP_TASKS_TASK"],
"PATH_TO_GROUP_TASKS_VIEW" => $arResult["PATH_TO_GROUP_TASKS_VIEW"],
"PATH_TO_USER" => $arParams["PATH_TO_USER"],
"PATH_TO_GROUP" => $arResult["PATH_TO_GROUP"],
"PATH_TO_MESSAGES_CHAT" => $arParams["PATH_TO_MESSAGES_CHAT"],
"PATH_TO_VIDEO_CALL" => $arParams["PATH_TO_VIDEO_CALL"],
"PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"],
"TASKS_FIELDS_SHOW" => $arParams["TASKS_FIELDS_SHOW"],
"SET_NAV_CHAIN" => $arResult["SET_NAV_CHAIN"],
"SET_TITLE" => $arResult["SET_TITLE"],
"FORUM_ID" => $arParams["TASK_FORUM_ID"],
"NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"],
"SHOW_LOGIN" => $arParams["SHOW_LOGIN"],
"DATE_TIME_FORMAT" => $arResult["DATE_TIME_FORMAT"],
"SHOW_YEAR" => $arParams["SHOW_YEAR"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"THUMBNAIL_LIST_SIZE" => 30,
),
$component,
array("HIDE_ICONS" => "Y")
);
if ($zzz && IntVal($arResult["VARIABLES"]["task_id"]) > 0 && $arResult["VARIABLES"]["action"] == "view")
{
?>
<br /><br />
<?
$APPLICATION->IncludeComponent(
"bitrix:forum.topic.reviews",
"",
Array(
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"MESSAGES_PER_PAGE" => $arParams["ITEM_DETAIL_COUNT"],
"USE_CAPTCHA" => "N",
"PREORDER" => "Y",
"PATH_TO_SMILE" => $arParams["PATH_TO_FORUM_SMILE"],
"FORUM_ID" => $arParams["TASK_FORUM_ID"],
"URL_TEMPLATES_READ" => $arParams["URL_TEMPLATES_READ"],
"SHOW_LINK_TO_FORUM" => "N",
"ELEMENT_ID" => $arResult["VARIABLES"]["task_id"],
),
$component,
array("HIDE_ICONS" => "Y")
);
}
}
}
?>
<td class='firstCol' <?if($arResult['INDICATOR_NAMES'][$arElem['SECTION']]== "Численность застрахованных лиц по ОМС, в том числе:" || $arResult['INDICATOR_NAMES'][$arElem['SECTION']]== "Страховые премии по ДМС, в том числе:"):?> style='font-weight:bold;' <?endif?>><?=$arResult['INDICATOR_NAMES'][$arElem['SECTION']]?></td> <? /* Вывод количества застрахованных */ ?>
а также нижеследующая идея по прогнозу доходов, расходов, и влияния текущих расходов на финансовую будущую цель.