-
Notifications
You must be signed in to change notification settings - Fork 1
/
client_main_myinfo.pdt
115 lines (112 loc) · 8.4 KB
/
client_main_myinfo.pdt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<div id="my-info" class="col-md-3 d-none d-md-block">
<div class="card card-blesta">
<div class="card-header">
<?php $this->_('ClientMain.myinfo.client_id', false, (isset($client->id_code) ? $this->Html->safe($client->id_code) : null));?>
</div>
<div class="card-body">
<address>
<strong><?php echo (isset($contact->first_name) ? $this->Html->safe($contact->first_name) : null) . ' ' . (isset($contact->last_name) ? $this->Html->safe($contact->last_name) : null);?></strong><br />
<?php
echo (!empty($contact->company) ? (isset($contact->company) ? $this->Html->safe($contact->company) : null) . '<br />' : '');
echo (!empty($contact->address1) ? (isset($contact->address1) ? $this->Html->safe($contact->address1) : null) . '<br />' : '');
echo (!empty($contact->address2) ? (isset($contact->address2) ? $this->Html->safe($contact->address2) : null) . '<br />' : '');
echo (!empty($contact->city) ? (isset($contact->city) ? $this->Html->safe($contact->city) : null) . (!empty($contact->state) ? ', ' . (isset($contact->state) ? $this->Html->safe($contact->state) : null) : '') : (isset($contact->state) ? $this->Html->safe($contact->state) : null));
echo ' ' . (isset($contact->zip) ? $this->Html->safe($contact->zip) : null) . ' ' . (isset($contact->country) ? $this->Html->safe($contact->country) : null);
?>
<hr />
<a href="mailto:<?php (print (isset($contact->email) ? $this->Html->safe($contact->email) : null));?>"><?php (print (isset($contact->email) ? $this->Html->safe($contact->email) : null));?></a><br />
<?php
// Display client phone numbers
if ((isset($contact->numbers) ? $contact->numbers : false) && ($num_numbers = count($contact->numbers)) > 0) {
for ($i = 0; $i < $num_numbers; $i++) {
$number_location = (isset($contact->numbers[$i]->location) ? $contact->numbers[$i]->location : null);
$number_type = (isset($contact->numbers[$i]->type) ? $contact->numbers[$i]->type : null);
(print (isset($contact->numbers[$i]->number) ? $this->Html->safe($contact->numbers[$i]->number) : null));?>
<?php $this->_('ClientMain.myinfo.number', false, (isset($number_locations[$number_location]) ? $this->Html->safe($number_locations[$number_location]) : null), (isset($number_types[$number_type]) ? $this->Html->safe($number_types[$number_type]) : null));?>
<br />
<?php
}
}
?>
</address>
</div>
<div class="card-footer clearfix">
<a href="<?php echo $this->Html->safe($this->base_uri . 'main/edit/');?>" class="btn btn-sm btn-light btn-block">
<i class="fas fa-pencil-alt"></i> <?php $this->_('ClientMain.myinfo.link_editclient');?>
</a>
</div>
</div>
<div class="card card-blesta">
<div class="card-header">
<?php $this->_('ClientMain.myinfo.contacts');?>
</div>
<div class="list-group">
<?php
if (count($contacts ?? []) > 0) {
foreach ($contacts as $contact) {
if ($contact->contact_type !== 'primary') {
?>
<a href="<?php echo $this->Html->safe($this->base_uri . 'contacts/edit/' . $contact->id . '/');?>" class="list-group-item list-group-item-action"><i class="fas fa-user fa-fw"></i> <?php echo (isset($contact->first_name) ? $this->Html->safe($contact->first_name) : null) . ' ' . (isset($contact->last_name) ? $this->Html->safe($contact->last_name) : null);?></a>
<?php
}
}
} else {
?>
<div class="card-body">
<div class="alert alert-info" role="alert">
<?php $this->_('ClientMain.!info.no_contacts');?>
</div>
</div>
<?php
}
?>
</div>
<div class="card-footer clearfix">
<a href="<?php echo $this->Html->safe($this->base_uri . 'contacts/add/');?>" class="btn btn-sm btn-light btn-block">
<i class="fas fa-plus"></i> <?php $this->_('ClientMain.myinfo.link_addcontact');?>
</a>
</div>
</div>
<div class="list-group list-options">
<?php
if ((isset($myinfo_settings['invoice']) ? $myinfo_settings['invoice'] : null) && count((isset($invoice_delivery_methods) ? $invoice_delivery_methods : [])) > 1) {
?>
<a href="<?php echo $this->Html->safe($this->base_uri . 'main/invoicemethod/');?>" class="list-group-item">
<i class="fas fa-envelope-open-text fa-lg float-right"></i>
<p class="list-group-item-text"><?php (print (isset($myinfo_settings['invoice']['description']) ? $this->Html->safe($myinfo_settings['invoice']['description']) : null));?> <?php $this->_('ClientMain.myinfo.setting_change');?></p>
</a>
<?php
}
?>
<?php
if ((isset($myinfo_settings['autodebit']['enabled']) ? $myinfo_settings['autodebit']['enabled'] : false)) {
?>
<a href="<?php echo $this->Html->safe($this->base_uri . 'accounts/');?>" class="list-group-item">
<i class="fas fa-cog fa-lg float-right"></i>
<p class="list-group-item-text"><?php (print (isset($myinfo_settings['autodebit']['description']) ? $this->Html->safe($myinfo_settings['autodebit']['description']) : null));?> <?php $this->_('ClientMain.myinfo.setting_change');?></p>
</a>
<?php
}
?>
</div>
<div class="amounts"></div>
</div>
<?php
$this->Javascript->setInline('
$(document).ready(function() {
fetchCurrencyAmounts("' . (isset($contact->settings['default_currency']) ? $contact->settings['default_currency'] : null) . '");
$(".col-md-3 .amounts").on("click", "a", function() {
fetchCurrencyAmounts($(this).attr("id"));
return false;
});
});
function fetchCurrencyAmounts(currency) {
$(this).blestaRequest("GET", "' . $this->Html->safe($this->base_uri . 'main/getcurrencyamounts/') . '" + currency, null, function(data) {
if (data)
$(".amounts").html(data);
},
null,
{dataType:"json"});
}
');
?>