Skip to content

Commit

Permalink
Merge pull request #2249 from Leantime/bugs
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
marcelfolaron authored Jan 27, 2024
2 parents 8650e30 + 2b3a337 commit 59f75ea
Show file tree
Hide file tree
Showing 19 changed files with 1,124 additions and 415 deletions.
4 changes: 2 additions & 2 deletions app/Domain/Api/Controllers/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public function post($params)
*/
public function patch($params)
{
if (
! in_array(array_keys($params), ['patchModalSettings', 'patchViewSettings', 'patchMenuStateSettings'])

if (count(array_intersect(array_keys($params), ['patchModalSettings', 'patchViewSettings', 'patchMenuStateSettings'])) == 0
|| (! empty($params['patchModalSettings']) && empty($params['settings']))
|| (! empty($params['patchViewSettings']) && empty($params['value']))
|| (! empty($params['patchMenuStateSettings']) && empty($params['value']))
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Dashboard/Templates/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@section('content')

<div class="maincontent" style="margin-top:0px">
<div class="maincontent" id="gridBoard" style="margin-top:0px; opacity:0;">

{!! $tpl->displayNotification() !!}

Expand Down
4 changes: 2 additions & 2 deletions app/Domain/Dashboard/Templates/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class="tw-leading-[50px]"
format($row['date'])->date(),
format($row['date'])->time()
) }}

</strong>
@if ($login::userIsAtLeast($roles::$editor))
<div class="inlineDropDownContainer tw-float-right tw-ml-[10px]">
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">
Expand All @@ -392,7 +392,7 @@ class="tw-leading-[50px]"
</ul>
</div>
@endif
</strong>


<div class="text" id="commentText-{{ $row['id'] }}">{!! $tpl->escapeMinimal($row['text']) !!}</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion app/Domain/Notifications/Services/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ public function getFeed()
'timeout' => 20
])->getBody()->getContents();

$responseXml = simplexml_load_string($response);
if(function_exists("simplexml_load_string")){
$responseXml = simplexml_load_string($response);
}else{
error_log("SimpleXML Extension is not available.");
}

return $responseXml;
}
Expand Down
14 changes: 10 additions & 4 deletions app/Domain/Plugins/Services/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@ public function getAllPlugins(bool $enabledOnly = false): false|array
collect($configplugins)
->filter(fn ($plugin) => ! empty($plugin))
->each(function ($plugin) use (&$installedPluginsById) {
$pluginModel = $this->createPluginFromComposer($plugin);

$installedPluginsById[$plugin] ??= $pluginModel;
$installedPluginsById[$plugin]->enabled = true;
$installedPluginsById[$plugin]->type = $this->pluginTypes['system'];
try {
$pluginModel = $this->createPluginFromComposer($plugin);

$installedPluginsById[$plugin] ??= $pluginModel;
$installedPluginsById[$plugin]->enabled = true;
$installedPluginsById[$plugin]->type = $this->pluginTypes['system'];
}catch(Exception $e){
error_log($e);
}

});
}

Expand Down
10 changes: 10 additions & 0 deletions app/Domain/Projects/Repositories/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,16 @@ public function deleteProject($id): void

$stmn->execute();
$stmn->closeCursor();


$query = "DELETE FROM zp_tickets WHERE projectId = :id";

$stmn = $this->db->database->prepare($query);
$stmn->bindValue(':id', $id, PDO::PARAM_INT);

$stmn->execute();
$stmn->closeCursor();

}

/**
Expand Down
5 changes: 5 additions & 0 deletions app/Domain/Tickets/Controllers/NewTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ public function get(): Response
public function post($params): Response
{
if (isset($params['saveTicket']) || isset($params['saveAndCloseTicket'])) {

$params['timeToFinish'] = format($params['timeToFinish'] ?? '')->time24toLocalTime(ignoreTimezone: true);
$params['timeFrom'] = format($params['timeFrom'] ?? '')->time24toLocalTime(ignoreTimezone: true);
$params['timeTo'] = format($params['timeTo'] ?? '')->time24toLocalTime(ignoreTimezone: true);

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

if (is_array($result) === false) {
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Tickets/Controllers/ShowTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function post($params): Response
$params['id'] = $id;

//Prepare values, time comes in as 24hours from time input. Service expects time to be in local user format
$params['dueTime'] = format($params['dueTime'] ?? '')->time24toLocalTime(ignoreTimezone: true);
$params['timeToFinish'] = format($params['timeToFinish'] ?? '')->time24toLocalTime(ignoreTimezone: true);
$params['timeFrom'] = format($params['timeFrom'] ?? '')->time24toLocalTime(ignoreTimezone: true);
$params['timeTo'] = format($params['timeTo'] ?? '')->time24toLocalTime(ignoreTimezone: true);

Expand Down
21 changes: 13 additions & 8 deletions app/Domain/Tickets/Js/ticketsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,18 +1023,23 @@ leantime.ticketsController = (function () {
jQuery(document).ready(function () {

countTickets();

jQuery(".filterBar .row-fluid").css("opacity", "1");

var height = 250;
jQuery(".sortableTicketList").each(function(){

jQuery(".sortableTicketList .column .contentInner").each(function () {
if (jQuery(this).height() > height) {
height = jQuery(this).height();
}
});
let height = 250;
let kanbanLaneId = jQuery(this).attr("id");

jQuery(this).find(".column .contentInner").each(function () {
if (jQuery(this).height() > height) {
height = jQuery(this).height();
}
});

height = height + 50;
jQuery(".sortableTicketList .column .contentInner").css("height", height);
jQuery("#"+kanbanLaneId+" .column .contentInner").css("height", height);

});

});

Expand Down
4 changes: 2 additions & 2 deletions app/Domain/Tickets/Services/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ public function getOpenUserTicketsBySprint($userId, $projectId): array
foreach ($allTickets as $row) {

$sprint = $row['sprint'] ?? "backlog";
$sprintName = empty($row['sprintName']) ? "label.not_assigned_to_list" : $row['sprintName'];
$sprintName = empty($row['sprintName']) ? $this->language->__("label.not_assigned_to_list") : $row['sprintName'];

//Only include todos that are not done
if (isset($statusLabels[$row['projectId'] ?? '']) &&
Expand Down Expand Up @@ -1896,7 +1896,7 @@ public function prepareTicketDates(&$values) {
if (!empty($values['dateToFinish'])) {

if (isset($values['timeToFinish']) && $values['timeToFinish'] != null) {
$values['dateToFinish'] = format($values['dateToFinish']." ".$values['timeToFinish'].":00")->isoDateTime();
$values['dateToFinish'] = format($values['dateToFinish']." ".$values['timeToFinish']."")->isoDateTime();
unset($values['timeToFinish']);
}else{
$values['dateToFinish'] = format($values['dateToFinish'])->isoDateEnd();
Expand Down
5 changes: 3 additions & 2 deletions app/Domain/Tickets/Templates/showKanban.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
onclick="jQuery('#ticket_new_link_<?=$key?>').toggle('fast'); jQuery('#ticket_new_<?=$key?>').toggle('fast', function() { jQuery(this).find('input[name=headline]').focus(); });">
<i class="fas fa-plus-circle"></i> Add To-Do</a>

<div class="hideOnLoad " id="ticket_new_<?=$key?>" style="padding-top:5px;">
<div class="hideOnLoad " id="ticket_new_<?=$key?>" style="padding-top:5px; padding-bottom:5px;">

<form method="post">
<input type="text" name="headline" style="width:100%;" placeholder="Enter To-Do Title" title="<?=$tpl->__("label.headline") ?>"/><br />
Expand Down Expand Up @@ -128,7 +128,7 @@
<div class="simpleAccordionContainer kanban" id="accordion_content-<?=$group['id'] ?>">
<?php } ?>

<div class="sortableTicketList kanbanBoard">
<div class="sortableTicketList kanbanBoard" id="kanboard-<?=$group['id'] ?>" style="margin-top:-5px;">

<div class="row-fluid">

Expand Down Expand Up @@ -353,6 +353,7 @@
<?php if ($login::userIsAtLeast($roles::$editor)) { ?>
leantime.ticketsController.initUserDropdown();
leantime.ticketsController.initMilestoneDropdown();
leantime.ticketsController.initDueDateTimePickers();
leantime.ticketsController.initEffortDropdown();
leantime.ticketsController.initPriorityDropdown();

Expand Down
8 changes: 7 additions & 1 deletion app/Domain/Widgets/Js/Widgetcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ leantime.widgetController = (function () {
},
});



grid.on('dragstop', function(event, item) {
saveGrid();
});
Expand All @@ -34,7 +36,11 @@ leantime.widgetController = (function () {
jQuery(this).find(".fitContent").click(function(){
resizeWidget(jQuery(this).closest(".grid-stack-item")[0]);
});
})
});

jQuery(document).ready(function(){
jQuery("#gridBoard").css("opacity", 1);
});

};

Expand Down
1 change: 1 addition & 0 deletions app/Domain/Widgets/Templates/partials/myProjects.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</div>
</div>
@endif
<div class="clearall"></div>

<x-global::accordion id="myProjectWidget-favorites" class="{{ $background }}">
<x-slot name="title">
Expand Down
2 changes: 1 addition & 1 deletion app/Plugins
Loading

0 comments on commit 59f75ea

Please sign in to comment.