Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Todos kanban #2867

Merged
merged 6 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


<div id="fileManager">
<div class="maincontentinner">
<div class="">
@displayNotification()
<h5 class="subtitle"><?= $tpl->__('headline.browse_files_headline') ?></h5>

Expand Down Expand Up @@ -64,7 +64,7 @@
</div>
<?php } ?>
</div>
<div class="maincontentinner">
<div class="">

<div class='mediamgr'>

Expand Down
7 changes: 3 additions & 4 deletions app/Domain/Goalcanvas/Templates/components/canvas.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@props([
'canvasId' => '',
'canvasTitle' => '',
Expand All @@ -19,10 +18,10 @@
@else
<div class="row">
<div class="col-md-12">
<a href="#/goalcanvas/editCanvasItem?type=goal&canvasId={{ $canvasId }}"
class="btn btn-primary pull-right">
<x-global::forms.button scale="sm" class="pull-right" tag="a"
href="#/goalcanvas/editCanvasItem?type=goal&canvasId={{ $canvasId }}">
<i class="fa fa-plus"></i> Create New Goal
</a>
</x-global::forms.button>
<h5 class='subtitle'>
<a href='{{ BASE_URL }}/goalcanvas/showCanvas/{{ $canvasId }}'>
{{ $canvasTitle }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
{{ $row['title'] }}
</a>
</h4>
<br />
<strong>Metric:</strong> {{ $row['description'] }}
<br /><br />

Expand Down Expand Up @@ -102,7 +101,7 @@
</x-global::forms._archive.dropdownPill>
@endif

<div class="right" style="margin-right:10px;">
<div class="right">
<span class="fas fa-comments"></span>
<small>{{ $nbcomments }}</small>
</div>
Expand Down
23 changes: 7 additions & 16 deletions app/Domain/Goalcanvas/Templates/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

$canvasSvc = app()->make(Goalcanvas::class);


$elementName = 'goal';
/**
* showCanvasTop.inc template - Top part of the main canvas page
Expand Down Expand Up @@ -109,22 +108,17 @@ class="sr-only">{{ sprintf(__('text.percent_complete'), round($goalStats['avgPer
$canvasItems = $canvasSvc->getCanvasItemsById($canvasRow['id']);
@endphp --}}

<x-goalcanvas::canvas
id="{{ $canvasRow['id'] }}"
{{-- canvasTitle="{{ $canvasRow['title'] }}" --}}
{{-- :goalItems="$canvasItems" --}}
<x-goalcanvas::canvas id="{{ $canvasRow['id'] }}" {{-- canvasTitle="{{ $canvasRow['title'] }}" --}} {{-- :goalItems="$canvasItems" --}}
{{-- :statusLabels="$statusLabels"
:relatesLabels="$relatesLabels"
:users="$users" --}}
/>

:users="$users" --}} />
@endforeach
@endif
</div>



{{--
{{--
* showCanvasBottom.blade.php template - Bottom part of the main canvas page
*
* Required variables:
Expand All @@ -144,11 +138,8 @@ class="sr-only">{{ sprintf(__('text.percent_complete'), round($goalStats['avgPer

@if ($login::userIsAtLeast($roles::$editor))
<br><br>
<x-global::forms.button
tag="a"
href="javascript:void(0)"
class="addCanvasLink btn btn-primary"
>
<x-global::forms.button tag="a" href="javascript:void(0)"
class="addCanvasLink btn btn-primary">
{!! __('links.icon.create_new_board') !!}
</x-global::forms.button>
@endif
Expand Down Expand Up @@ -184,7 +175,7 @@ class="addCanvasLink btn btn-primary"
leantime.authController.makeInputReadonly(".maincontentinner");
@endif

});
</script>
});
</script>

@endsection
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-global::content.modal.modal-buttons/>
<x-global::content.modal.modal-buttons />

<x-global::content.modal.header>
Big Rock
Expand All @@ -13,15 +13,16 @@
action="{{ BASE_URL }}/goalcanvas/bigRock/{{ !empty($bigRock->id) ? $bigRock->id : '' }}">

<br />
<x-global::forms.text-input type="text" name="title" id="wikiTitle" value="{{ $bigRock->title }}" labelText="{{ __('label.goal_description') }}" variant='title'/><br />
<x-global::forms.text-input placeholder="{{ __('label.goal_description') }}" type="text" name="title" id="wikiTitle"
value="{{ $bigRock->title }}" variant='title' /><br />

<br />
<div class="row">
<div class="col-md-6">
<x-global::forms.button type="submit" id="saveBtn">
<x-global::forms.button scale="xs" type="submit" id="saveBtn">
{{ __('buttons.save') }}
</x-global::forms.button>
</div>
</div>
<div class="col-md-6 align-right padding-top-sm">

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class="w-1/2"
<label>{{ __('label.start_date') }}</label>
<input type="text" autocomplete="off" value="{{ format($canvasItem['startDate'])->date() }}"
name="startDate" class="startDate" />


<label>{{ __('label.end_date') }}</label>
<input type="text" autocomplete="off" value="{{ format($canvasItem['endDate'])->date() }}"
Expand Down
50 changes: 47 additions & 3 deletions app/Domain/Ideas/Js/ideasController.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,55 @@ export const initIdeaKanban = function (statusList) {
});
};

var initStatusDropdown = function () {
jQuery("body").on(
"click",
".statusDropdown .dropdown .menu li a",
function () {

var value = jQuery(this).attr("data-value");
var dataValue = value.split("_");
// var dataValue = jQuery(this).attr("data-value").split("_");
var dataLabel = jQuery(this).attr('data-label');

if (dataValue.length == 3) {
var canvasItemId = dataValue[0];
var status = dataValue[1];
var statusClass = dataValue[2];


jQuery.ajax(
{
type: 'PATCH',
url: appUrl + '/api/ideas',
data:
{
id : canvasItemId,
box:status
}
}
)
// .done(
// function () {
// jQuery("#statusDropdownMenuLink" + canvasItemId + " span.text").text(dataLabel);
// jQuery("#statusDropdownMenuLink" + canvasItemId).removeClass().addClass("" + statusClass + " dropdown-toggle f-left status ");
// jQuery.growl({message: leantime.i18n.__("short_notifications.status_updated")});

// }
// );
}
}
);

};

// Make public what you want to have public, everything else is private
export default {
initMasonryWall: initMasonryWall,
export const ideasController= {
// initMasonryWall: initMasonryWall,
initBoardControlModal: initBoardControlModal,
initWallImageModals: initWallImageModals,
setKanbanHeights: setKanbanHeights,
initIdeaKanban: initIdeaKanban
initIdeaKanban: initIdeaKanban,
initStatusDropdown: initStatusDropdown

};
64 changes: 27 additions & 37 deletions app/Domain/Ideas/Templates/showBoards.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ class="active">
<div class="clearfix" style="padding-bottom: 8px;"></div>

<div class="dropdown ticketDropdown statusDropdown show firstDropdown colorized">
<x-global::actions.dropdown contentRole="link" position="bottom" align="start"
class="f-left status {{ $canvasLabels[$row->box]['class'] }}">
<x-global::actions.dropdown scale="sm" contentRole="link" position="bottom"
align="start" class="f-left status {{ $canvasLabels[$row->box]['class'] }}"
:indicator-class="$canvasLabels[$row->box]['class']" selectable="true">
<!-- Dropdown Button -->
<x-slot:labelText>
<span class="text">{{ $canvasLabels[$row->box]['name'] }}</span>&nbsp;<i
Expand All @@ -174,7 +175,8 @@ class="fa fa-caret-down" aria-hidden="true"></i>
<!-- Dropdown Items -->
@foreach ($canvasLabels as $key => $label)
<x-global::actions.dropdown.item href="javascript:void(0);"
class="{{ $label['class'] }}" :data-label="$label['name']" :data-value="$row->id . '_' . $key . '_' . $label['class']"
class="{{ $label['class'] }}" :data-label="$label['name']" :data-class="$label['class']"
:data-value="$row->id . '_' . $key . '_' . $label['class']"
id="ticketStatusChange{{ $row->id }}{{ $key }}">
{{ $label['name'] }}
</x-global::actions.dropdown.item>
Expand Down Expand Up @@ -290,24 +292,17 @@ class="f-left">
<div class="modal-content">
<form action="" method="post">
<div class="modal-header">
<x-global::forms.button
type="button"
class="close"
data-dismiss="modal"
aria-hidden="true">
&times;
</x-global::forms.button>
<x-global::forms.button type="button" class="close" data-dismiss="modal"
aria-hidden="true">
&times;
</x-global::forms.button>

<h4 class="modal-title">{!! __('headlines.start_new_idea_board') !!}</h4>
</div>
<div class="modal-body">
<x-global::forms.text-input
type="text"
name="canvastitle"
<x-global::forms.text-input type="text" name="canvastitle"
placeholder="{{ __('input.placeholders.name_for_idea_board') }}"
labelText="{{ __('label.topic_idea_board') }}"
variant="title"
/>
labelText="{{ __('label.topic_idea_board') }}" variant="title" />

</div>
<div class="modal-footer">
Expand All @@ -330,24 +325,17 @@ class="close"
<div class="modal-content">
<form action="" method="post">
<div class="modal-header">
<x-global::forms.button
type="button"
class="close"
data-dismiss="modal"
aria-hidden="true">
&times;
</x-global::forms.button>
<x-global::forms.button type="button" class="close" data-dismiss="modal"
aria-hidden="true">
&times;
</x-global::forms.button>

<h4 class="modal-title">{!! __('headlines.edit_board_name') !!}</h4>
</div>
<div class="modal-body">
<x-global::forms.text-input
type="text"
name="canvastitle"
value="{{ $canvasTitle }}"
labelText="{{ __('label.title_idea_board') }}"
variant="title"
/>
<x-global::forms.text-input type="text" name="canvastitle"
value="{{ $canvasTitle }}" labelText="{{ __('label.title_idea_board') }}"
variant="title" />

</div>
<div class="modal-footer">
Expand All @@ -368,17 +356,20 @@ class="close"
</div>


<script type="text/javascript">

<script type="module">
import "@mix('/js/Domain/Ideas/Js/ideasController.js')"
import "@mix('/js/Domain/Canvas/Js/canvasController.js')"
jQuery(document).ready(function() {
//new SlimSelect({ select: '#searchCanvas' });

leantime.ideasController.initMasonryWall();
leantime.ideasController.initBoardControlModal();
leantime.ideasController.initWallImageModals();
// initMasonryWall();
// initBoardControlModal();
// initWallImageModals();

ideasController.initStatusDropdown();
@if ($login::userIsAtLeast($roles::$editor))
leantime.canvasController.initUserDropdown('ideas');
leantime.canvasController.initStatusDropdown('ideas');
initUserDropdown('ideas');
@else
leantime.authController.makeInputReadonly(".maincontentinner");
@endif
Expand All @@ -398,5 +389,4 @@ class="close"
@endif
});
</script>

@endsection
1 change: 0 additions & 1 deletion app/Domain/Tickets/Controllers/EditMilestone.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public function post($params)
return $this->tpl->emptyResponse();
} else {
$result = $this->ticketService->quickAddMilestone($params);

if (is_numeric($result)) {
$params['id'] = $result;

Expand Down
51 changes: 11 additions & 40 deletions app/Domain/Tickets/Controllers/NewTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,49 +114,20 @@ public function post($params): Response
$params['timeTo'] = format(value: $params['timeTo'] ?? '', fromFormat: FromFormat::User24hTime)->userTime24toUserTime();

$result = $this->ticketService->addTicket($params);

if (is_array($result) === false) {
if ($result !== false) {
$this->tpl->setNotification($this->language->__('notifications.ticket_saved'), 'success');
return response()->json(['success' => true]);

// if (isset($params['saveAndCloseTicket']) === true && $params['saveAndCloseTicket'] == 1) {
// return Frontcontroller::redirectHtmx('#/tickets/showTicket/'.$result.'?closeModal=1');
// } else {
// return Frontcontroller::redirectHtmx('#/tickets/showTicket/'.$result);
// }
} else {
// $this->tpl->setNotification($this->language->__($result['msg']), 'error');

$ticket = app()->makeWith(TicketModel::class, ['values' => $params]);
$ticket->userLastname = session('userdata.name');

$this->tpl->assign('ticket', $ticket);
$this->tpl->assign('statusLabels', $this->ticketService->getStatusLabels());
$this->tpl->assign('ticketTypes', $this->ticketService->getTicketTypes());
$this->tpl->assign('efforts', $this->ticketService->getEffortLabels());
$this->tpl->assign('priorities', $this->ticketService->getPriorityLabels());
$this->tpl->assign('milestones', $this->ticketService->getAllMilestones(['sprint' => '', 'type' => 'milestone', 'currentProject' => session('currentProject')]));
$this->tpl->assign('sprints', $this->sprintService->getAllSprints(session('currentProject')));

$this->tpl->assign('kind', $this->timesheetService->getLoggableHourTypes());
$this->tpl->assign('ticketHours', 0);
$this->tpl->assign('userHours', 0);

$this->tpl->assign('timesheetsAllHours', 0);
$this->tpl->assign('remainingHours', 0);

$this->tpl->assign('userInfo', $this->userService->getUser(session('userdata.id')));
$this->tpl->assign('users', $this->projectService->getUsersAssignedToProject(session('currentProject')));

$allAssignedprojects = $this->projectService->getProjectsUserHasAccessTo(session('userdata.id'), 'open');
$this->tpl->assign('allAssignedprojects', $allAssignedprojects);

// return $this->tpl->displayPartial('tickets::partials.newTicketModal');
return response()->json(['success' => false]);
}

if (isset($params['saveAndCloseTicket']) === true && $params['saveAndCloseTicket'] == 1) {
return Frontcontroller::redirect('#/tickets/showTicket/'.$result.'?closeModal=1');
} else {
return Frontcontroller::redirect(url: session('lastPage').'#/tickets/showTicket/'.$result);
}
}
}

return response()->json(['success' => true]);
return Frontcontroller::redirect(url: session('lastPage')."#/tickets/newTicket");
// return Frontcontroller::redirect(CURRENT_URL);

}
}
}
Loading