OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
171
app/Domain/Tickets/Templates/roadmapAll.blade.php
Normal file
171
app/Domain/Tickets/Templates/roadmapAll.blade.php
Normal file
@@ -0,0 +1,171 @@
|
||||
@extends($layout)
|
||||
|
||||
@section('content')
|
||||
|
||||
@php
|
||||
$milestones = $milestones ?? [];
|
||||
$clients = $clients ?? [];
|
||||
|
||||
$clientNameSelected = __('headline.all_clients');
|
||||
$htmlDropdownClients = '';
|
||||
foreach ($clients as $client) {
|
||||
$href = BASE_URL.'/tickets/roadmapAll?clientId='.$client['id'];
|
||||
$labelActive = '';
|
||||
if (isset($_GET['clientId']) && $_GET['clientId'] == $client['id']) {
|
||||
$labelActive = ' class="active"';
|
||||
$clientNameSelected = $client['name'];
|
||||
}
|
||||
$htmlDropdownClients .= "<li><a href='$href' $labelActive> {$client['name']} </a></li>";
|
||||
}
|
||||
|
||||
$roadmapView = session('usersettings.views.roadmap', 'Month');
|
||||
@endphp
|
||||
|
||||
@include('tickets::submodules.portfolioHeader')
|
||||
|
||||
<div class="maincontent">
|
||||
@include('tickets::submodules.portfolioTabs')
|
||||
|
||||
<div class="maincontentinner">
|
||||
|
||||
{!! $tpl->displayNotification() !!}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="pull-right">
|
||||
|
||||
<div class="btn-group viewDropDown">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">{!! __('label.roles.client') !!}: <span class="viewText">{{ $clientNameSelected }}</span><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href={{ BASE_URL.'/tickets/roadmapAll' }} {{ empty($labelActive) ? "class='active'" : '' }} > {!! __('headline.all_clients') !!} </a></li>
|
||||
{!! $htmlDropdownClients !!}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="btn-group dropRight">
|
||||
|
||||
@php
|
||||
$currentView = '';
|
||||
if ($roadmapView == 'Day') {
|
||||
$currentView = __('buttons.day');
|
||||
} elseif ($roadmapView == 'Week') {
|
||||
$currentView = __('buttons.week');
|
||||
} elseif ($roadmapView == 'Month') {
|
||||
$currentView = __('buttons.month');
|
||||
}
|
||||
@endphp
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">{!! __('buttons.timeframe') !!}: <span class="viewText">{{ $currentView }}</span><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" id="ganttTimeControl">
|
||||
<li><a href="javascript:void(0);" data-value="Day" class="{{ $roadmapView == 'Day' ? 'active' : '' }}"> {!! __('buttons.day') !!}</a></li>
|
||||
<li><a href="javascript:void(0);" data-value="Week" class="{{ $roadmapView == 'Week' ? 'active' : '' }}">{!! __('buttons.week') !!}</a></li>
|
||||
<li><a href="javascript:void(0);" data-value="Month" class="{{ $roadmapView == 'Month' ? 'active' : '' }}">{!! __('buttons.month') !!}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
if (count($milestones) == 0) {
|
||||
echo "<div class='empty' id='emptySprint' style='text-align:center;'>";
|
||||
echo "<div style='width:30%' class='svgContainer'>";
|
||||
echo file_get_contents(ROOT.'/dist/images/svg/undraw_adjustments_p22m.svg');
|
||||
echo '</div>';
|
||||
echo '<h4>'.__('headlines.no_milestones').'<br/>
|
||||
<br />
|
||||
<a href="'.BASE_URL.'/tickets/editMilestone" class="milestoneModal addCanvasLink btn btn-primary">'.__('links.add_milestone').'</a></h4></div>';
|
||||
}
|
||||
@endphp
|
||||
<div class="gantt-wrapper">
|
||||
<svg id="gantt"></svg>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@once @push('scripts')
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
|
||||
@if (isset($_GET['showMilestoneModal']))
|
||||
@php
|
||||
$modalUrl = $_GET['showMilestoneModal'] == '' ? '' : '/'.(int) $_GET['showMilestoneModal'];
|
||||
@endphp
|
||||
|
||||
leantime.ticketsController.openMilestoneModalManually("{{ BASE_URL }}/tickets/editMilestone{{ $modalUrl }}");
|
||||
window.history.pushState({},document.title, '{{ BASE_URL }}/tickets/roadmap');
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
});
|
||||
|
||||
@if (count($milestones) > 0)
|
||||
var tasks = [
|
||||
|
||||
@php
|
||||
foreach ($milestones as $mlst) {
|
||||
$headline = '['.$mlst->projectName.'] ';
|
||||
$headline .= __('label.'.strtolower($mlst->type)).': '.$mlst->headline;
|
||||
if ($mlst->type == 'milestone') {
|
||||
$headline .= ' ('.$mlst->percentDone.'% Done)';
|
||||
}
|
||||
|
||||
$color = '#8D99A6';
|
||||
if ($mlst->type == 'milestone') {
|
||||
$color = $mlst->tags;
|
||||
}
|
||||
|
||||
$sortIndex = 0;
|
||||
if ($mlst->sortIndex != '' && is_numeric($mlst->sortIndex)) {
|
||||
$sortIndex = $mlst->sortIndex;
|
||||
}
|
||||
|
||||
$dependencyList = [];
|
||||
if ($mlst->milestoneid != 0) {
|
||||
$dependencyList[] = $mlst->milestoneid;
|
||||
}
|
||||
|
||||
if ($mlst->dependingTicketId != 0) {
|
||||
$dependencyList[] = $mlst->dependingTicketId;
|
||||
}
|
||||
|
||||
echo "{
|
||||
projectName :'".$mlst->projectName."',
|
||||
id :'".$mlst->id."',
|
||||
name :".json_encode($headline).",
|
||||
start :'".(($mlst->editFrom != '0000-00-00 00:00:00' && ! str_starts_with($mlst->editFrom, '1969-12-31')) ? $mlst->editFrom : date('Y-m-d', strtotime('+1 day', time())))."',
|
||||
end :'".(($mlst->editTo != '0000-00-00 00:00:00' && ! str_starts_with($mlst->editTo, '1969-12-31')) ? $mlst->editTo : date('Y-m-d', strtotime('+1 week', time())))."',
|
||||
progress :'".$mlst->percentDone."',
|
||||
dependencies :'".implode(',', $dependencyList)."',
|
||||
custom_class :'',
|
||||
type: '".strtolower($mlst->type)."',
|
||||
bg_color: '".$color."',
|
||||
thumbnail: '".BASE_URL.'/api/users?profileImage='.$mlst->editorId."',
|
||||
sortIndex: ".$sortIndex.'
|
||||
|
||||
},';
|
||||
}
|
||||
@endphp
|
||||
];
|
||||
|
||||
@if ($login::userIsAtLeast($roles::$editor))
|
||||
leantime.ticketsController.initGanttChart(tasks, '{{ $roadmapView }}', false);
|
||||
@else
|
||||
leantime.ticketsController.initGanttChart(tasks, '{{ $roadmapView }}', true);
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@endpush @endonce
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user