mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 22:14:35 -04:00
Add dubai timezone
This commit is contained in:
parent
05019e7575
commit
79ed0abf6b
@ -449,10 +449,41 @@ class Activity extends StaticModel
|
|||||||
$replacements['created_at'] = $this->created_at ?? '';
|
$replacements['created_at'] = $this->created_at ?? '';
|
||||||
$replacements['ip'] = $this->ip ?? '';
|
$replacements['ip'] = $this->ip ?? '';
|
||||||
|
|
||||||
|
if($this->activity_type_id == 141)
|
||||||
|
$replacements = $this->harvestNoteEntities($replacements);
|
||||||
|
|
||||||
return $replacements;
|
return $replacements;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function harvestNoteEntities(array $replacements): array
|
||||||
|
{
|
||||||
|
$entities = [
|
||||||
|
':invoice',
|
||||||
|
':quote',
|
||||||
|
':credit',
|
||||||
|
':payment',
|
||||||
|
':task',
|
||||||
|
':expense',
|
||||||
|
':purchase_order',
|
||||||
|
':recurring_invoice',
|
||||||
|
':recurring_expense',
|
||||||
|
':client',
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach($entities as $entity)
|
||||||
|
{
|
||||||
|
$entity_key = substr($entity, 1);
|
||||||
|
|
||||||
|
if($this?->{$entity_key})
|
||||||
|
$replacements = array_merge($replacements, $this->matchVar($entity));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $replacements;
|
||||||
|
}
|
||||||
|
|
||||||
private function matchVar(string $variable)
|
private function matchVar(string $variable)
|
||||||
{
|
{
|
||||||
$system = ctrans('texts.system');
|
$system = ctrans('texts.system');
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Timezone;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
$t = \App\Models\Timezone::find(115);
|
||||||
|
|
||||||
|
if(!$t){
|
||||||
|
|
||||||
|
$t = new Timezone();
|
||||||
|
$t->id = 115;
|
||||||
|
$t->name = 'Asia/Dubai';
|
||||||
|
$t->location = '(GMT+04:00) Dubai';
|
||||||
|
$t->utc_offset = 14400;
|
||||||
|
$t->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
@ -151,6 +151,7 @@ class ConstantsSeeder extends Seeder
|
|||||||
$timezones[] = ['name'=>'Asia/Magadan', 'location' => '(GMT+12:00) Magadan', 'utc_offset' => 43200];
|
$timezones[] = ['name'=>'Asia/Magadan', 'location' => '(GMT+12:00) Magadan', 'utc_offset' => 43200];
|
||||||
$timezones[] = ['name'=>'Pacific/Auckland', 'location' => '(GMT+12:00) Auckland', 'utc_offset' => 43200];
|
$timezones[] = ['name'=>'Pacific/Auckland', 'location' => '(GMT+12:00) Auckland', 'utc_offset' => 43200];
|
||||||
$timezones[] = ['name'=>'Pacific/Fiji', 'location' => '(GMT+12:00) Fiji', 'utc_offset' => 43200];
|
$timezones[] = ['name'=>'Pacific/Fiji', 'location' => '(GMT+12:00) Fiji', 'utc_offset' => 43200];
|
||||||
|
$timezones[] = ['name' => 'Asia/Dubai', 'location' => '(GMT+04:00) Dubai', 'utc_offset' => 14400];
|
||||||
|
|
||||||
$x = 1;
|
$x = 1;
|
||||||
foreach ($timezones as $timezone) {
|
foreach ($timezones as $timezone) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user