-
Notifications
You must be signed in to change notification settings - Fork 1
/
client_contacts_edit.pdt
146 lines (134 loc) · 7.71 KB
/
client_contacts_edit.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<div class="col-md-3">
<?php echo ($navigation ?? null); ?>
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12">
<?php
echo (isset($message) ? $message : null);
$this->WidgetClient->clear();
$this->WidgetClient->create($this->_('ClientContacts.edit.boxtitle_edit', true));
$this->WidgetClient->startBody();
$this->Form->create(null, ['class' => 'disable-on-submit']);
?>
<ul class="nav nav-tabs">
<li class="nav-item"><a href="#contact" class="nav-link active" data-toggle="tab"><?php $this->_('ClientContacts.edit.heading_contact');?></a></li>
<li class="nav-item"><a href="#settings" class="nav-link" data-toggle="tab"><?php $this->_('ClientContacts.edit.heading_settings');?></a></li>
<li class="nav-item"><a href="#authentication" class="nav-link" data-toggle="tab"><?php $this->_('ClientContacts.edit.heading_authentication');?></a></li>
</ul>
<div class="tab-content">
<div id="contact" class="tab-pane fade show active">
<?php
// Set partials
echo (isset($contact_info) ? $contact_info : null);
echo (isset($phone_numbers) ? $phone_numbers : null);
?>
</div>
<div id="settings" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<h4><?php $this->_('ClientContacts.edit.heading_settings');?></h4>
</div>
<div class="col-md-6">
<div class="form-group">
<?php
$this->Form->label($this->_('ClientContacts.edit.field_contact_type', true), 'contact_type');
$this->Form->fieldSelect('contact_type', (isset($contact_types) ? $contact_types : null), (isset($vars->contact_type) ? $vars->contact_type : null), ['id' => 'contact_type', 'class' => 'form-control']);
?>
</div>
</div>
</div>
</div>
<div id="authentication" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<h4><?php $this->_('ClientContacts.edit.heading_authentication');?></h4>
</div>
<div class="col-md-12">
<div class="checkbox">
<label>
<?php $this->Form->fieldCheckbox('enable_login', 'true', (isset($user) ? $user : false), ['id' => 'enable_login', 'data-toggle' => 'collapse', 'data-target' => '#login_fields']);?>
<?php $this->_('ClientContacts.edit.field_enable_login');?>
</label>
</div>
<div id="login_fields" class="collapse<?php echo ((isset($user) ? $user : false) ? ' in' : '');?>">
<div class="form-group">
<?php $this->Form->label($this->_('ClientContacts.edit.field_username', true), 'username');?>
<?php
if ((isset($user) ? $user : null)) {
?>
<p><?php (print (isset($user->username) ? $this->Html->safe($user->username) : null));?></p>
<?php
} else {
$this->Form->fieldText('username', (isset($vars->username) ? $vars->username : null), ['id' => 'username', 'class' => 'form-control']);
}
?>
</div>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientContacts.edit.field_new_password', true), 'new_password');
$this->Form->fieldPassword('new_password', ['id' => 'new_password', 'class' => 'form-control']);
?>
</div>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientContacts.edit.field_confirm_password', true), 'confirm_password');
$this->Form->fieldPassword('confirm_password', ['id' => 'confirm_password', 'class' => 'form-control']);
?>
</div>
<div class="row">
<div class="col-md-12">
<h4><?php $this->_('ClientContacts.edit.heading_permissions');?></h4>
</div>
<?php
foreach ((array)(isset($permissions) ? $permissions : null) as $area => $name) {
?>
<div class="col-sm-4">
<div class="checkbox-inline">
<label>
<?php
$this->Form->fieldCheckbox('permissions[area][]', $area, in_array($area, (array)(isset($vars->permissions['area']) ? $vars->permissions['area'] : null)));
(print (isset($name) ? $this->Html->safe($name) : null));
?>
<?php
if ($this->_('ClientContacts.tooltip.' . $area, true) != '') {
?>
<a href="#" data-toggle="tooltip" title="<?php $this->_('ClientContacts.tooltip.' . $area);?>"><i class="fas fa-question-circle text-info"></i></a>
<?php
}
?>
</label>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-light float-right"><i class="fas fa-plus-circle"></i> <?php $this->_('ClientContacts.edit.field_editsubmit');?></button>
<?php
$this->Form->end();
$this->WidgetClient->endBody();
$this->WidgetClient->end();
?>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
if ($("#enable_login").is(":checked")) {
$("#login_fields").addClass('show');
}
setUsername();
$("#email").on('change', function() {
setUsername();
});
function setUsername() {
$("#username").val($("#email").val());
}
});
</script>