Skip to content

Commit 3abae4a

Browse files
committed
fixed merge conflict
2 parents f4a7a37 + 7686544 commit 3abae4a

67 files changed

Lines changed: 1163 additions & 832 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ProcessMaker/Console/Commands/Install.php‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Install extends Command
3939

4040
/**
4141
* The values for our .env to populate
42-
*
42+
*
4343
* $var array
4444
*/
4545
private $env;
@@ -67,7 +67,9 @@ public function handle()
6767
'APP_ENV' => 'production',
6868
'APP_KEY' => $this->key,
6969
'BROADCAST_DRIVER' => 'redis',
70-
'BROADCASTER_KEY' => '21a795019957dde6bcd96142e05d4b10'
70+
'BROADCASTER_KEY' => '21a795019957dde6bcd96142e05d4b10',
71+
'APP_TIMEZONE' => 'UTC',
72+
'DATE_FORMAT' => '"m/d/Y H:i"'
7173
];
7274

7375

@@ -101,10 +103,10 @@ public function handle()
101103
$this->error(__("The url you provided was invalid. Please provide the scheme, host and path and have no trailing slashes."));
102104
}
103105
$this->env['APP_URL'] = $this->ask(__('What is the url of this ProcessMaker Installation? (Ex: https://pm.example.com, no trailing slash)'));
104-
} while($invalid = (!filter_var($this->env['APP_URL'],
105-
FILTER_VALIDATE_URL,
106-
FILTER_FLAG_SCHEME_REQUIRED |
107-
FILTER_FLAG_HOST_REQUIRED)
106+
} while($invalid = (!filter_var($this->env['APP_URL'],
107+
FILTER_VALIDATE_URL,
108+
FILTER_FLAG_SCHEME_REQUIRED |
109+
FILTER_FLAG_HOST_REQUIRED)
108110
|| ($this->env['APP_URL'][strlen($this->env['APP_URL']) - 1] == '/'))
109111
);
110112
// Set broadcaster url

‎ProcessMaker/Http/Controllers/ProfileController.php‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,26 @@ class ProfileController extends Controller
1717
*/
1818
public function edit()
1919
{
20-
$current_user = \Auth::user();
20+
$currentUser = \Auth::user();
2121
$states = JsonData::states();
22-
$timezones = JsonData::timezones();
2322
$countries = JsonData::countries();
23+
24+
$timezones = array_reduce(JsonData::timezones(),
25+
function ($result, $item) {
26+
$result[$item] = $item;
27+
return $result;
28+
}
29+
);
30+
31+
$datetimeFormats = array_reduce(JsonData::datetimeFormats(),
32+
function ($result, $item) {
33+
$result[$item['format']] = $item['title'];
34+
return $result;
35+
}
36+
);
37+
2438
return view('profile.edit',
25-
compact('current_user', 'states', 'timezones', 'countries'));
39+
compact('currentUser', 'states', 'timezones', 'countries', 'datetimeFormats'));
2640
}
2741

2842
/**

‎ProcessMaker/Http/Controllers/TaskController.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
class TaskController extends Controller
99
{
1010
private static $dueLabels = [
11-
'open' => 'Due in :day',
12-
'completed' => 'Completed on',
13-
'overdue' => 'Due :day',
11+
'open' => 'Due ',
12+
'completed' => 'Completed ',
13+
'overdue' => 'Due ',
1414
];
1515

1616
public function index()

‎ProcessMaker/Models/Group.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Database\Eloquent\Model;
66
use Illuminate\Validation\Rule;
7+
use ProcessMaker\Traits\SerializeToIso8601;
78

89
/**
910
* Represents a group definition.
@@ -30,6 +31,7 @@
3031
*/
3132
class Group extends Model
3233
{
34+
use SerializeToIso8601;
3335

3436
protected $fillable = [
3537
'name',

‎ProcessMaker/Models/JsonData.php‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
class JsonData extends Model
1212
{
1313
public static function timezones(){
14-
$temp = json_decode(file_get_contents(resource_path(). '/js/data/timeszones.json'), true);
15-
$timezones=[];
16-
foreach($temp['data'] as $t){
17-
$timezones[$t['value']] = $t['content'];
18-
}
19-
return $timezones;
14+
return json_decode(file_get_contents(resource_path(). '/js/data/timeszones.json'), false);
2015
}
2116

2217
public static function states(){
@@ -26,4 +21,8 @@ public static function states(){
2621
public static function countries(){
2722
return json_decode(file_get_contents(resource_path(). '/js/data/countries.json'), true);
2823
}
24+
25+
public static function datetimeFormats(){
26+
return json_decode(file_get_contents(resource_path(). '/js/data/datetime_formats.json'), true);
27+
}
2928
}

‎ProcessMaker/Models/Process.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface;
1111
use ProcessMaker\Nayra\Contracts\Storage\BpmnDocumentInterface;
1212
use ProcessMaker\Nayra\Storage\BpmnDocument;
13+
use ProcessMaker\Traits\SerializeToIso8601;
1314
use Spatie\MediaLibrary\HasMedia\HasMedia;
1415
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
1516

@@ -46,6 +47,7 @@
4647
class Process extends Model implements HasMedia
4748
{
4849
use HasMediaTrait;
50+
use SerializeToIso8601;
4951

5052
/**
5153
* The attributes that aren't mass assignable.

‎ProcessMaker/Models/ProcessCategory.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Database\Eloquent\Model;
66
use Illuminate\Validation\Rule;
77
use ProcessMaker\Models\Process;
8+
use ProcessMaker\Traits\SerializeToIso8601;
89

910
/**
1011
* Represents a business process category definition.
@@ -30,6 +31,7 @@
3031
*/
3132
class ProcessCategory extends Model
3233
{
34+
use SerializeToIso8601;
3335

3436
protected $fillable = [
3537
'name',

‎ProcessMaker/Models/ProcessRequest.php‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Validation\Rule;
77
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
88
use ProcessMaker\Nayra\Engine\ExecutionInstanceTrait;
9+
use ProcessMaker\Traits\SerializeToIso8601;
910

1011
/**
1112
* Represents an Eloquent model of a Request which is an instance of a Process.
@@ -50,6 +51,7 @@ class ProcessRequest extends Model implements ExecutionInstanceInterface
5051
{
5152

5253
use ExecutionInstanceTrait;
54+
use SerializeToIso8601;
5355

5456
/**
5557
* The attributes that aren't mass assignable.
@@ -270,16 +272,4 @@ public function summary()
270272

271273
return $result;
272274
}
273-
274-
/**
275-
* Prepare a date for array / JSON serialization.
276-
*
277-
* @param \DateTimeInterface $date
278-
*
279-
* @return string
280-
*/
281-
protected function serializeDate(\DateTimeInterface $date)
282-
{
283-
return $date->format(Carbon::ISO8601);
284-
}
285275
}

‎ProcessMaker/Models/ProcessRequestToken.php‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Database\Eloquent\Model;
77
use ProcessMaker\Nayra\Bpmn\TokenTrait;
88
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
9+
use ProcessMaker\Traits\SerializeToIso8601;
910

1011
/**
1112
* ProcessRequestToken is used to store the state of a token of the
@@ -29,6 +30,7 @@
2930
class ProcessRequestToken extends Model implements TokenInterface
3031
{
3132
use TokenTrait;
33+
use SerializeToIso8601;
3234

3335
/**
3436
* Attributes that are not mass assignable.
@@ -173,16 +175,4 @@ public function getAdvanceStatusAttribute()
173175

174176
return $result;
175177
}
176-
177-
/**
178-
* Prepare a date for array / JSON serialization.
179-
*
180-
* @param \DateTimeInterface $date
181-
*
182-
* @return string
183-
*/
184-
protected function serializeDate(\DateTimeInterface $date)
185-
{
186-
return $date->format(Carbon::ISO8601);
187-
}
188178
}

‎ProcessMaker/Models/Screen.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Carbon\Carbon;
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Validation\Rule;
8+
use ProcessMaker\Traits\SerializeToIso8601;
89

910
/**
1011
* Class Screen
@@ -37,6 +38,7 @@
3738
*/
3839
class Screen extends Model
3940
{
41+
use SerializeToIso8601;
4042

4143
protected $casts = [
4244
'config' => 'array'

0 commit comments

Comments
 (0)