Skip to content

Commit 0155d96

Browse files
committed
Bugfix
Fixed vcard title bug
1 parent a5890cf commit 0155d96

File tree

2 files changed

+64
-33
lines changed

2 files changed

+64
-33
lines changed

app/Http/Controllers/UserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public function saveLink(request $request)
362362
$suffix = $request->input('suffix');
363363
$nickname = $request->input('nickname');
364364
$organization = $request->input('organization');
365-
$title = $request->input('title');
365+
$vtitle = $request->input('vtitle');
366366
$role = $request->input('role');
367367
$workUrl = $request->input('work_url');
368368
$email = $request->input('email');
@@ -392,7 +392,7 @@ public function saveLink(request $request)
392392

393393
// Set the organization information
394394
$vCard->addCompany($organization);
395-
$vCard->addJobtitle($title);
395+
$vCard->addJobtitle($vtitle);
396396
$vCard->addUrl($workUrl);
397397

398398
// Set the phone numbers
Lines changed: 62 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,42 @@
1-
<?php use App\Models\Button; $button = Button::find($button_id); if(isset($button->name)){$buttonName = $button->name;}else{$buttonName = 0;} ?>
1+
<?php use JeroenDesloovere\VCard\VCard; use App\Models\Button; $button = Button::find($button_id); if(isset($button->name)){$buttonName = $button->name;}else{$buttonName = 0;} ?>
22

33
<select style="display:none" name="button" class="form-control"><option class="button button-default email" value="vcard">Vcard</option></select>
44

5+
{{-- @php
6+
$vcard = new VCard($link_url);
7+
8+
$prefix = $vcard->getPrefix();
9+
$firstName = $vcard->getFirstName();
10+
$middleName = $vcard->getMiddleName();
11+
$lastName = $vcard->getLastName();
12+
$suffix = $vcard->getSuffix();
13+
$organization = $vcard->getOrganization();
14+
$title = $vcard->getTitle();
15+
$role = $vcard->getRole();
16+
$workUrl = $vcard->getUrl();
17+
$email = $vcard->getEmail();
18+
$workEmail = $vcard->getWorkEmail();
19+
$homePhone = $vcard->getHomePhone();
20+
$workPhone = $vcard->getWorkPhone();
21+
$cellPhone = $vcard->getCellPhone();
22+
$homeAddressLabel = $vcard->getHomeAddressLabel();
23+
$homeAddressStreet = $vcard->getHomeAddressStreet();
24+
$homeAddressCity = $vcard->getHomeAddressCity();
25+
$homeAddressState = $vcard->getHomeAddressRegion();
26+
$homeAddressZip = $vcard->getHomeAddressPostalCode();
27+
$homeAddressCountry = $vcard->getHomeAddressCountry();
28+
$workAddressLabel = $vcard->getWorkAddressLabel();
29+
$workAddressStreet = $vcard->getWorkAddressStreet();
30+
$workAddressCity = $vcard->getWorkAddressCity();
31+
$workAddressState = $vcard->getWorkAddressRegion();
32+
$workAddressZip = $vcard->getWorkAddressPostalCode();
33+
$workAddressCountry = $vcard->getWorkAddressCountry();
34+
@endphp --}}
35+
536
<label for='title' class='form-label'>Custom Title</label>
6-
<input type='text' name='link_title' value='' class='form-control' />
37+
<input type='text' name='link_title' value='{{ $link_title }}' class='form-control' />
738
<span class='small text-muted'>Leave blank for default title</span><br>
8-
39+
{{$link_url}}
940
<br><h5>Upload existing file</h5>
1041
<div class="form-group col-lg-8">
1142
<label>Vcard</label>
@@ -14,95 +45,95 @@
1445

1546
<br><h4>Name</h4>
1647
<label for='prefix' class='form-label'>Prefix</label>
17-
<input type='text' name='prefix' value='' class='form-control'/>
48+
<input type='text' name='prefix' value='{{$prefix ?? ''}}' class='form-control'/>
1849
<br>
1950
<label for='first_name' class='form-label'>First Name</label>
20-
<input type='text' name='first_name' value='' class='form-control'/>
51+
<input type='text' name='first_name' value='{{$firstName ?? ''}}' class='form-control'/>
2152
<br>
2253
<label for='middle_name' class='form-label'>Middle Name</label>
23-
<input type='text' name='middle_name' value='' class='form-control'/>
54+
<input type='text' name='middle_name' value='{{$middleName ?? ''}}' class='form-control'/>
2455
<br>
2556
<label for='last_name' class='form-label'>Last Name</label>
26-
<input type='text' name='last_name' value='' class='form-control'/>
57+
<input type='text' name='last_name' value='{{$lastName ?? ''}}' class='form-control'/>
2758
<br>
2859
<label for='suffix' class='form-label'>Suffix</label>
29-
<input type='text' name='suffix' value='' class='form-control'/>
60+
<input type='text' name='suffix' value='{{$suffix ?? ''}}' class='form-control'/>
3061
<br>
3162
{{-- <label for='nickname' class='form-label'>Nickname</label>
32-
<input type='text' name='nickname' value='' class='form-control'/>
63+
<input type='text' name='nickname' value='{{ ?? ''}}' class='form-control'/>
3364
<br> --}}
3465

3566
<br><h4>Work</h4>
3667
<label for='organization' class='form-label'>Organization</label>
37-
<input type='text' name='organization' value='' class='form-control'/>
68+
<input type='text' name='organization' value='{{$organization ?? ''}}' class='form-control'/>
3869
<br>
39-
<label for='title' class='form-label'>Title</label>
40-
<input type='text' name='title' value='' class='form-control'/>
70+
<label for='vtitle' class='form-label'>Title</label>
71+
<input type='text' name='vtitle' value='{{$vtitle ?? ''}}' class='form-control'/>
4172
<br>
4273
<label for='role' class='form-label'>Role</label>
43-
<input type='text' name='role' value='' class='form-control'/>
74+
<input type='text' name='role' value='{{$role ?? ''}}' class='form-control'/>
4475
<br>
4576
<label for='work_url' class='form-label'>Work URL</label>
46-
<input type='url' name='work_url' value='' class='form-control'/>
77+
<input type='url' name='work_url' value='{{$workUrl ?? ''}}' class='form-control'/>
4778
<br>
4879

4980
<br><h4>Emails</h4>
5081
<label for='email' class='form-label'>Email</label>
51-
<input type='email' name='email' value='' class='form-control'/>
82+
<input type='email' name='email' value='{{$email ?? ''}}' class='form-control'/>
5283
<span class='small text-muted'>Enter your personal email</span>
5384
<br>
5485
<label for='work_email' class='form-label'>Work Email</label>
55-
<input type='email' name='work_email' value='' class='form-control'/>
86+
<input type='email' name='work_email' value='{{$workEmail ?? ''}}' class='form-control'/>
5687
<span class='small text-muted'>Enter your work email</span>
5788
<br>
5889

5990
<br><h4>Phones</h4>
6091
<label for='home_phone' class='form-label'>Home Phone</label>
61-
<input type='tel' name='home_phone' value='' class='form-control'/>
92+
<input type='tel' name='home_phone' value='{{$homePhone ?? ''}}' class='form-control'/>
6293
<br>
6394
<label for='work_phone' class='form-label'>Work Phone</label>
64-
<input type='tel' name='work_phone' value='' class='form-control'/>
95+
<input type='tel' name='work_phone' value='{{$workPhone ?? ''}}' class='form-control'/>
6596
<br>
6697
<label for='cell_phone' class='form-label'>Cell Phone</label>
67-
<input type='tel' name='cell_phone' value='' class='form-control'/>
98+
<input type='tel' name='cell_phone' value='{{$cellPhone ?? ''}}' class='form-control'/>
6899
<br>
69100

70101
<br><h4>Home Address</h4>
71102
<label for='home_address_label' class='form-label'>Label</label>
72-
<input type='text' name='home_address_label' value='' class='form-control'/>
103+
<input type='text' name='home_address_label' value='{{$homeAddressLabel ?? ''}}' class='form-control'/>
73104
<br>
74105
<label for='home_address_street' class='form-label'>Street</label>
75-
<input type='text' name='home_address_street' value='' class='form-control'/>
106+
<input type='text' name='home_address_street' value='{{$homeAddressStreet ?? ''}}' class='form-control'/>
76107
<br>
77108
<label for='home_address_city' class='form-label'>City</label>
78-
<input type='text' name='home_address_city' value='' class='form-control'/>
109+
<input type='text' name='home_address_city' value='{{$homeAddressCity ?? ''}}' class='form-control'/>
79110
<br>
80111
<label for='home_address_state' class='form-label'>State/Province</label>
81-
<input type='text' name='home_address_state' value='' class='form-control'/>
112+
<input type='text' name='home_address_state' value='{{$homeAddressState ?? ''}}' class='form-control'/>
82113
<br>
83114
<label for='home_address_zip' class='form-label'>Zip/Postal Code</label>
84-
<input type='text' name='home_address_zip' value='' class='form-control'/>
115+
<input type='text' name='home_address_zip' value='{{$homeAddressZip ?? ''}}' class='form-control'/>
85116
<br>
86117
<label for='home_address_country' class='form-label'>Country</label>
87-
<input type='text' name='home_address_country' value='' class='form-control'/>
118+
<input type='text' name='home_address_country' value='{{$homeAddressCountry ?? ''}}' class='form-control'/>
88119
<br>
89120
<br><h4>Work Address</h4>
90121
<label for='work_address_label' class='form-label'>Label</label>
91-
<input type='text' name='work_address_label' value='' class='form-control'/>
122+
<input type='text' name='work_address_label' value='{{$workAddressLabel ?? ''}}' class='form-control'/>
92123
<br>
93124
<label for='work_address_street' class='form-label'>Street</label>
94-
<input type='text' name='work_address_street' value='' class='form-control'/>
125+
<input type='text' name='work_address_street' value='{{$workAddressStreet ?? ''}}' class='form-control'/>
95126
<br>
96127
<label for='work_address_city' class='form-label'>City</label>
97-
<input type='text' name='work_address_city' value='' class='form-control'/>
128+
<input type='text' name='work_address_city' value='{{$workAddressCity ?? ''}}' class='form-control'/>
98129
<br>
99130
<label for='work_address_state' class='form-label'>State/Province</label>
100-
<input type='text' name='work_address_state' value='' class='form-control'/>
131+
<input type='text' name='work_address_state' value='{{$workAddressState ?? ''}}' class='form-control'/>
101132
<br>
102133
<label for='work_address_zip' class='form-label'>Zip/Postal Code</label>
103-
<input type='text' name='work_address_zip' value='' class='form-control'/>
134+
<input type='text' name='work_address_zip' value='{{$workAddressZip ?? ''}}' class='form-control'/>
104135
<br>
105136
<label for='work_address_country' class='form-label'>Country</label>
106-
<input type='text' name='work_address_country' value='' class='form-control'/>
137+
<input type='text' name='work_address_country' value='{{$workAddressCountry ?? ''}}' class='form-control'/>
107138
<br>
108139

0 commit comments

Comments
 (0)