add: all
This commit is contained in:
parent
a15319c4d1
commit
eebf859afa
39 changed files with 2742 additions and 937 deletions
50
app/Http/Controllers/CsvController/CsvDataInit.php
Normal file
50
app/Http/Controllers/CsvController/CsvDataInit.php
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\CsvController;
|
||||
|
||||
class CsvDataInit
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function get_issue_labels(array $issue)
|
||||
{
|
||||
$labels = '';
|
||||
foreach ($issue['labels'] as $label) {
|
||||
$labels .= $label['name'] . ',';
|
||||
}
|
||||
return $labels;
|
||||
}
|
||||
|
||||
function handle_labels($array, $issue_labels){
|
||||
foreach ($issue_labels as $key => $label) {
|
||||
if (strpos($label['name'],'Kind') !== false) {
|
||||
$array['Kind'] = $label['name'];
|
||||
}
|
||||
if (strpos($label['name'],'RequestBy') !== false) {
|
||||
$array['Request By'] = $label['name'];
|
||||
}
|
||||
if (strpos($label['name'],'Priority') !== false) {
|
||||
$array['Priority'] = $label['name'];
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
function initialize_csv_data(array $issue){
|
||||
return array(
|
||||
'Progetto' => $issue['repository']['name'],
|
||||
'#' => $issue['number'],
|
||||
'Titolo' => $issue['title'],
|
||||
'URL' => $issue['html_url'],
|
||||
'Aperto_il' => $issue['created_at'],
|
||||
'Chiuso_il' => $issue['closed_at'],
|
||||
'Etichette' => $this->get_issue_labels($issue),
|
||||
'Kind' => '',
|
||||
'Request By' => '',
|
||||
'Priority' => '',
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue