-
Notifications
You must be signed in to change notification settings - Fork 1
/
client_services_cancel.pdt
88 lines (84 loc) · 3.98 KB
/
client_services_cancel.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
<?php
$this->Form->create(null, ['id' => 'cancel_service']);
?>
<div class="modal-header">
<h5 class="global_modal_title"><?php $this->_('ClientServices.cancel.heading_cancel');?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<?php
foreach ((array)(isset($confirm_cancel_messages) ? $confirm_cancel_messages : []) as $type => $message) {
?>
<div class="cancel_message <?php (print (isset($type) ? $this->Html->safe($type) : null));?>"><?php echo (isset($message) ? $message : null);?></div>
<?php
}
?>
<div class="form-group">
<div class="radio">
<label>
<?php
$this->Form->fieldRadio('cancel', 'term', ((isset($vars->cancel) ? $vars->cancel : null) == 'term'));
// Show language based on whether or not a renew date exists
if ((isset($service->date_renews) ? $service->date_renews : false)) {
$this->_('ClientServices.cancel.field_term_date', false, $this->Date->cast((isset($service->date_renews) ? $service->date_renews : null), 'date'));
} else {
$this->_('ClientServices.cancel.field_term');
}
?>
</label>
</div>
<div class="radio">
<label>
<?php
$this->Form->fieldRadio('cancel', 'now', ((isset($vars->cancel) ? $vars->cancel : null) == 'now'));
$this->_('ClientServices.cancel.field_now');
?>
</label>
</div>
<div class="radio">
<label>
<?php
$this->Form->fieldRadio('cancel', '', ((isset($vars->cancel) ? $vars->cancel : null) == ''));
$this->_('ClientServices.cancel.field_do_not');
?>
</label>
</div>
</div>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientServices.cancel.field_cancellation_reason', true), 'cancellation_reason');
$this->Form->fieldTextarea('cancellation_reason', (isset($vars->cancellation_reason) ? $vars->cancellation_reason : null), ['id' => 'cancellation_reason', 'class' => 'form-control']);
?>
</div>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientServices.cancel.field_password', true), 'password');
$this->Form->fieldPassword('password', ['id' => 'password', 'class' => 'form-control']);
?>
</div>
</div>
<div class="modal-footer">
<?php
$this->Form->fieldButton('cancel', $this->_('ClientServices.cancel.field_cancel_cancel', true), ['class' => 'btn btn-light', 'data-dismiss' => 'modal']);
$this->Form->fieldButton('submit', $this->_('ClientServices.cancel.field_cancel_submit', true), ['class' => 'btn btn-primary', 'type' => 'submit']);
?>
</div>
<?php
$this->Form->end();
?>
<script type="text/javascript">
$(document).ready(function() {
setCancelMessage();
$("#cancel_service input[name='cancel']").change(function() {
setCancelMessage();
});
function setCancelMessage() {
$("div.cancel_message").hide();
var message_type = $("#cancel_service input[name='cancel']:checked").val();
if (message_type)
$("div.cancel_message" + "." + message_type).show();
}
});
</script>