Skip to content

Commit

Permalink
fixing csv
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Aug 24, 2024
1 parent 103c79e commit b365dbe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 6 additions & 1 deletion app/Domain/Connector/Controllers/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Leantime\Domain\Connector\Controllers {

use http\Client\Response;
use Leantime\Core\Controller\Controller;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Domain\Auth\Models\Roles;
Expand Down Expand Up @@ -84,7 +85,11 @@ public function run()
//STEP 1: Initiate connection
if ($params["step"] == "connect") {
//This should handle connection UI
$provider->connect();
$connection = $provider->connect();

if($connection instanceof \Symfony\Component\HttpFoundation\Response) {
return $connection;
}
}


Expand Down
8 changes: 5 additions & 3 deletions app/Domain/Connector/Services/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,15 @@ private function importTickets($finalMappings, $finalValues)
foreach ($finalValues as $row) {
$ticket = array();

array_change_key_case($row, CASE_LOWER);

for ($i = 0; $i < sizeof($finalMappings); $i = $i + 2) {
$ticket[$finalMappings[$i + 1]] = $row[$finalMappings[$i]];
}
$ticket['editorId'] = $row['editorId'];
$ticket['projectId'] = $row['projectId'];
$ticket['editorId'] = $row['editorid'];
$ticket['projectId'] = $row['projectid'];
$ticket['status'] = $row['status'];
$ticket['type'] = $row['type'] ?? 'task' != '' ? $row['type'] : 'task';
$ticket['type'] = $row['type'] ?? 'task';

if (isset($ticket["id"]) && is_numeric($ticket["id"])) {
$this->ticketService->updateTicket($ticket);
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/CsvImport/Templates/upload.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<?php echo $tpl->displayNotification() ?>

<h2>Upload CSV file</h2>
<p>You can upload CSVs to import or update Tasks, Projects, Goals. <a href="https://support.leantime.io/importing-data-via-csv" target="_blank">Check our documentaiton</a> to learn more about the formatting and to download templates</p>
<p>You can upload CSVs to import or update Tasks, Projects, Goals. <a href="https://support.leantime.io/importing-data-via-csv" target="_blank">Check our documentation</a> to learn more about the formatting and to download templates</p>
<br /><br/>
<div class="uploadWrapper" style="width:100%">

Expand Down

0 comments on commit b365dbe

Please sign in to comment.