344 lines
18 KiB
Plaintext
344 lines
18 KiB
Plaintext
@model AccountManagement.Application.Contracts.Task.EditTask
|
|
@using System.Security.Claims
|
|
@using AccountManagement.Application.Contracts.Media
|
|
@{
|
|
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
|
|
|
MediaViewModel voice = null;
|
|
var userId = Convert.ToInt64(User.FindFirstValue("AccountId"));
|
|
|
|
string svgName = "unknow";
|
|
string[] fileExtensions = new string[]
|
|
{
|
|
".ai", ".avi", ".bmp", ".crd", ".csv", ".dll", ".doc", ".docx", ".dwg",
|
|
".eps", ".exe", ".flv", ".giff", ".html", ".iso", ".java", ".jpg", ".mdb",
|
|
".mid", ".mov", ".mp3", ".mp4", ".mpeg", ".pdf", ".png", ".ppt", ".ps",
|
|
".psd", ".pub", ".rar", ".raw", ".rss", ".svg", ".tiff", ".txt", ".wav",
|
|
".wma", ".xml", ".xsl", ".zip"
|
|
};
|
|
int i = 1;
|
|
|
|
<script src="~/AssetsClient/js/jquery-ui.js"></script>
|
|
<link href="~/assetsadminnew/tasks/css/task-manager-create.css?ver=@adminVersion" rel="stylesheet" />
|
|
<link href="~/AssetsClient/css/select2.css?ver=@adminVersion" rel="stylesheet" />
|
|
<link href="~/assetsadminnew/tasks/css/detailmodal.css?ver=@adminVersion" rel="stylesheet" />
|
|
<link href="~/assetsadminnew/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" />
|
|
|
|
if (Model.AssignViewModels?.Count > 1)
|
|
{
|
|
<style>
|
|
.modal-xl-taskTime {
|
|
max-width: 720px;
|
|
}
|
|
</style>
|
|
}
|
|
else
|
|
{
|
|
<style>
|
|
.modal-xl-taskTime {
|
|
max-width: 560px;
|
|
}
|
|
</style>
|
|
}
|
|
|
|
}
|
|
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header d-block header-custom-color">
|
|
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
<div class="topColor"></div>
|
|
|
|
<h6 class="modal-titleHead mb-2">ارجاع دهنده: <span class="modal-titleHeadSub">@Model.SenderViewModel.Fullname</span></h6>
|
|
<h6 class="modal-titleHead">ارجاع گیرنده: <span class="modal-titleHeadSub" id="AssignedName">@Model.AssignViewModels?.First().AssignedName</span></h6>
|
|
</div>
|
|
|
|
<div class="modal-body p-2">
|
|
<div class="container-fluid h-m-100">
|
|
<div class="row h-m-100">
|
|
<div class="@(Model.AssignViewModels?.Count > 1 ? "col-12 col-md-3 pe-0" : "d-none")">
|
|
<div class="assigns_section">
|
|
@{
|
|
var index = 0;
|
|
}
|
|
@if (Model.AssignViewModels?.Count > 0)
|
|
{
|
|
@foreach (var assign in Model.AssignViewModels!)
|
|
{
|
|
var btnClass = index == 0 ? "active" : "";
|
|
<button type="button" class="btnAssignList @btnClass" data-id="@assign.Id" onclick="loadChatMessage(@assign.Id)">
|
|
@assign.AssignedName
|
|
</button>
|
|
<span class="d-none" id="addAssignedName_@assign.Id">@assign.AssignedName</span>
|
|
<span class="d-none" id="addEndTaskDateFa_@assign.Id">@assign.EndTaskDateFa</span>
|
|
|
|
index++;
|
|
}
|
|
}
|
|
@if (!string.IsNullOrWhiteSpace(Model.EndTaskDate))
|
|
{
|
|
<input type="hidden" id="UserEndTaskDate" value="@Model.EndTaskDate" />
|
|
}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="h-m-100 @(Model.AssignViewModels?.Count > 1 ? "col-12 col-md-9 ps-0" : "col-12")">
|
|
<div class="chat-section">
|
|
<div class="chat-card-main">
|
|
<div class="row">
|
|
<div class="col-6 ">
|
|
<h6 class="taskTitle justify-content-start row align-items-center mb-1">
|
|
<span class="col-5 col-md-4 ps-0">طرف حساب:</span>
|
|
<span class="taskTitleSub col-7 col-md-8">@Model.ContractingPartyName</span>
|
|
</h6>
|
|
<h6 class="taskTitle justify-content-start row align-items-center">
|
|
<span class="col-5 col-md-4 ps-0 ps-0">عنوان وظیفه:</span>
|
|
<span class="taskTitleSub col-7 col-md-8">@Model.Title</span>
|
|
</h6>
|
|
</div>
|
|
<div class="col-6 ">
|
|
<h6 class="taskTitle text-end row align-items-center mb-1">
|
|
<span class="col-6 col-md-5 ps-0">تاریخ ایجاد:</span>
|
|
<span class="taskTitleSub text-center col-6 col-md-7 justify-content-center">@Model.CreateDateFa</span>
|
|
</h6>
|
|
<h6 class="taskTitle text-end row align-items-center">
|
|
<span class="col-6 col-md-5 ps-0">تاریخ سررسید:</span>
|
|
<span class="taskTitleSub text-center col-6 col-md-7 justify-content-center" id="AssignEndTaskDateFa">@Model.AssignViewModels?.First().EndTaskDateFa</span>
|
|
</h6>
|
|
</div>
|
|
</div>
|
|
@if (!String.IsNullOrWhiteSpace(Model.Description))
|
|
{
|
|
<div class="taskTitle">توضیحات :</div>
|
|
<div class="taskDesc">
|
|
<div class="taskDescText" id="taskDescText">
|
|
@Html.Raw(Model.Description)
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@if (Model.medias.Count > 0)
|
|
{
|
|
@foreach (var item in Model.medias)
|
|
{
|
|
if (item.Category == "صوت")
|
|
{
|
|
voice = item;
|
|
<div class="audio-player">
|
|
<div id="waveform" class="waveform"></div>
|
|
<button id="play-pause" class="player-btn play"></button>
|
|
</div>
|
|
}
|
|
}
|
|
}
|
|
|
|
@if (Model.medias.Count > 0)
|
|
{
|
|
|
|
<div class="d-flex align-items-center justify-content-end mt-2">
|
|
|
|
@foreach (var item in Model.medias)
|
|
{
|
|
if (item.Category == "فایل")
|
|
{
|
|
string fileName = System.IO.Path.GetFileName(item.Path);
|
|
string extension = System.IO.Path.GetExtension(fileName);
|
|
string nameWithoutExtension = fileName.Substring(0, fileName.LastIndexOf("."));
|
|
int maxLength = 20 - extension.Length;
|
|
int sliceLength = Math.Max((maxLength - 3) / 2, 0);
|
|
|
|
string start = nameWithoutExtension.Substring(0, Math.Min(sliceLength, nameWithoutExtension.Length));
|
|
string end = nameWithoutExtension.Substring(Math.Max(nameWithoutExtension.Length - sliceLength, 0));
|
|
|
|
var inBox = "inBox" + i;
|
|
@if (item.Path.EndsWith(".jpg") || item.Path.EndsWith(".jpeg") || item.Path.EndsWith(".png") || item.Path.EndsWith(".gif") || item.Path.EndsWith(".webp"))
|
|
{
|
|
<div class="upload-box empty inBox@(i)">
|
|
<section class="gallery">
|
|
<section class="container">
|
|
<div class="row p-0">
|
|
<div class="lightbox_img_wrap">
|
|
<img class="lightbox-enabled min-img" src="@Url.Page("./Index", "ShowPicture", new { filePath = item.Path })" data-imgsrc="@Url.Page("./Index", "ShowPicture", new { filePath = item.Path })" id="@Model.Id"/>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="lightbox-container">
|
|
|
|
<span class="material-symbols-outlined material-icons lightbox-btn left" id="left">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5"/>
|
|
</svg>
|
|
</span>
|
|
<span class="material-symbols-outlined material-icons lightbox-btn right" id="right">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5"/>
|
|
</svg>
|
|
</span>
|
|
<span id="close" class="close material-icons material-symbols-outlined">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"/>
|
|
</svg>
|
|
</span>
|
|
<div class="lightbox-image-wrapper">
|
|
<img alt="lightboximage" class="lightbox-image">
|
|
|
|
</div>
|
|
</section>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
if (fileExtensions.Contains(extension))
|
|
{
|
|
svgName = extension.TrimStart('.').ToLower();
|
|
<a href="@Url.Page("./Index", "GetFile", new { filePath = item.Path, id = Model.Id })"><img class="uploaded-file" src="/common/filesvg/@(svgName).svg"/></a>
|
|
}
|
|
else
|
|
{
|
|
<a href="@Url.Page("./Index", "GetFile", new { filePath = item.Path, id = Model.Id })"><img class="uploaded-file" src="/common/filesvg/unknow.svg"/></a>
|
|
}
|
|
}
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
</div>
|
|
}
|
|
|
|
<div class="row">
|
|
|
|
<span class="mt-3 col-2" style="font-size: 9px;line-height: 22px;">@Model.CreateDateFa</span>
|
|
|
|
<button class="taskDescMore col-8" id="showMoreButton">
|
|
<svg width="20px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
|
</svg>
|
|
</button>
|
|
<span class="col-2"></span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="mainChat">
|
|
<div id="ajaxChatSection"></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
@* && Model.ReceiverId.All(x => x == userId) || userId == Model.SenderId *@
|
|
@if (!Model.IsDone && !Model.IsCancel)
|
|
{
|
|
<div class="actionBtnsection showInMobile">
|
|
<div class="input-form row" id="select2MemberList">
|
|
<select class="form-select select2Member" id="select2AssignList" multiple="multiple">
|
|
|
|
@foreach (var item in Model.AssignsLists)
|
|
{
|
|
<option value="@item.Id">@item.Fullname</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
<div id="Desc-Time-Area" class="input-form row" style="display: none;">
|
|
<div id="Desc-Time-Area-1" class="col-8 textarea-col p-0">
|
|
<textarea class="form-control" id="Description" placeholder="توضیحات" style="height: 63px; resize: none;"></textarea>
|
|
</div>
|
|
<div id="Desc-Time-Area-2" class="col-4" style="margin: auto 0; padding-right: 6px; padding-left: 14px">
|
|
<div class="row select-time-section" style="display: none; height: 59px;">
|
|
<div class="col-4 timeSelect1 pe-0">
|
|
<input type="radio" class="tm-rad" name="btnradio" id="today" autocomplete="off">
|
|
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="today" style="font-size: 11px">امروز</label>
|
|
</div>
|
|
<div class="col-4 timeSelect2 p-0">
|
|
<input type="radio" class="tm-rad" name="btnradio" id="tommorow" autocomplete="off">
|
|
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="tommorow" style="font-size: 11px">فردا</label>
|
|
</div>
|
|
<div class="col-4 timeSelect3 p-0">
|
|
<input type="radio" class="tm-rad" name="btnradio" id="two-day-later" autocomplete="off">
|
|
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="two-day-later" style="font-size: 11px">پسفردا</label>
|
|
</div>
|
|
<div class="from-group position-relative pe-0">
|
|
<div >
|
|
<div>
|
|
<input type="text" id="EndTaskDate" class="form-control text-center date EndTaskDateStyle textFormTM" placeholder="تاریخ" onkeyup="CheckHoliday()" style="border-radius: 0 0 6px 6px;">
|
|
</div>
|
|
<div class="text-center" id="HolidayError" style="display: none; font-size: 11px; color: red; position: absolute; top: 6px; right: 21px; font-weight: 700;">تعطیل</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if (!Model.HasRequest)
|
|
{
|
|
@if (userId == Model.SenderId)
|
|
{
|
|
<button class="actionBtn" id="AssignBtn">ارجاع</button>
|
|
<button class="actionBtn" id="deadlineBtn">تغییر مهلت</button>
|
|
<button class="actionBtn" id="notPossibleBtn">لغو وظیفه</button>
|
|
<button class="actionBtn" id="doneBtn">تکمیل وظیفه</button>
|
|
}
|
|
else
|
|
{
|
|
<button class="actionBtn" id="AssignBtn">ارجاع</button>
|
|
<button class="actionBtn" id="deadlineBtn">مهلت برای روز خاص</button>
|
|
<button class="actionBtn" id="notPossibleBtn">قابل انجام نیست</button>
|
|
<button class="actionBtn" id="doneBtn">انجام شد</button>
|
|
}
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="modal-footer justify-content-center align-items-center p-2 pt-0">
|
|
<div class="row">
|
|
<div class="col-6 text-end">
|
|
<button type="button" class="btn-cancel2 d-flex align-items-center justify-content-center" data-bs-dismiss="modal">بستن</button>
|
|
</div>
|
|
@if (!Model.IsDone)
|
|
{
|
|
<div class="col-6 text-start">
|
|
<button id="save" type="button" class="btn-register text-white disable">ارسال</button>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
|
|
<script src="~/assetsclient/js/site.js"></script>
|
|
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
|
<script src="~/AssetsAdminNew/libs/wavesurfer/wavesurfer.min.js"></script>
|
|
<script src="~/assetsadminnew/libs/sweetalert2/sweetalert2.all.min.js"></script>
|
|
<script>
|
|
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
|
var checkIsHolidayAjax = '@Url.Page("./Create", "CheckHoliday")';
|
|
var createSaveTaskAjax = '@Url.Page("/Company/Task/Create", "CreateSaveTask")';
|
|
var voiceSrc = '@(voice == null ? "" : @Url.Page("./Index", "ShowVoice", new { filePath = voice?.Path }))';
|
|
var loadChatMessageAjax = '@Url.Page("./Index", "ChatMessageDetailsTask")';
|
|
var postSaveComplete = '@Url.Page("./Index", "Complete")';
|
|
var postCreateCancelRequest = '@Url.Page("./Index", "CreateCancelRequest")';
|
|
var postCreateTimeRequest = '@Url.Page("./Index", "CreateTimeRequest")';
|
|
var postCreateAssign = '@Url.Page("./Index", "CreateAssign")';
|
|
var taskId = Number(@Model.Id);
|
|
var UserId = @User.FindFirstValue("AccountId");
|
|
</script>
|
|
|
|
@if (Convert.ToInt64(User.FindFirstValue("AccountId")) == Model.SenderId)
|
|
{
|
|
<script src="~/assetsadminnew/tasks/js/detailmodalSender.js?ver=@adminVersion"></script>
|
|
}
|
|
else
|
|
{
|
|
<script src="~/assetsadminnew/tasks/js/detailmodal.js?ver=@adminVersion"></script>
|
|
}
|