mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for translation of task statuses
This commit is contained in:
parent
4210d11fc1
commit
7174939fe0
@ -13,6 +13,7 @@ namespace App\Http\Controllers\Reports;
|
||||
|
||||
use App\Http\Controllers\BaseController;
|
||||
use App\Http\Requests\Report\ClientReportRequest;
|
||||
use App\Models\Client;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Http\Response;
|
||||
use League\Csv\Writer;
|
||||
@ -21,7 +22,17 @@ class ClientReportController extends BaseController
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
public Writer $csv;
|
||||
private Writer $csv;
|
||||
|
||||
private array $keys;
|
||||
|
||||
/*
|
||||
[
|
||||
'client',
|
||||
'contacts',
|
||||
''
|
||||
]
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -64,7 +75,8 @@ class ClientReportController extends BaseController
|
||||
$company = auth()->user()->company();
|
||||
|
||||
$header = ['first name', 'last name', 'email'];
|
||||
|
||||
$this->keys = $request->input('keys');
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
@ -76,10 +88,14 @@ class ClientReportController extends BaseController
|
||||
//insert all the records
|
||||
// $this->csv->insertAll($records);
|
||||
|
||||
|
||||
Client::with('contacts')->where('company_id')
|
||||
->where('is_deleted',0)
|
||||
->cursor()
|
||||
->each(function ($client){
|
||||
|
||||
// $row =
|
||||
|
||||
});
|
||||
|
||||
echo $this->csv->toString();
|
||||
|
||||
|
@ -15,6 +15,7 @@ use App\Libraries\MultiDB;
|
||||
use App\Models\TaskStatus;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class CreateCompanyTaskStatuses
|
||||
{
|
||||
@ -51,6 +52,10 @@ class CreateCompanyTaskStatuses
|
||||
if(TaskStatus::where('company_id', $this->company->id)->count() > 0)
|
||||
return;
|
||||
|
||||
App::forgetInstance('translator');
|
||||
$t = app('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
|
||||
$task_statuses = [
|
||||
['name' => ctrans('texts.backlog'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), 'status_order' => 1],
|
||||
['name' => ctrans('texts.ready_to_do'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), 'status_order' => 2],
|
||||
|
Loading…
x
Reference in New Issue
Block a user