Skip to content

Commit 4325639

Browse files
authored
Merge pull request #32 from momo10216/bugfix-php-8
Bugfix php 8
2 parents 697fff8 + 71197a4 commit 4325639

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

admin/models/fields/modal/persons.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ protected function getInput() {
3434
$script[] = ' document.getElementById("'.$this->id.'_name").value = name+", "+firstname+", "+address+", "+city;';
3535
$script[] = ' SqueezeBox.close();';
3636
$script[] = ' }';
37+
$script[] = ' function jClearPerson_'.$this->id.'(id) {';
38+
$script[] = ' document.getElementById("'.$this->id.'_id").value = "";';
39+
$script[] = ' document.getElementById("'.$this->id.'_name").value = "";';
40+
$script[] = ' }';
3741
// Add the script to the document head.
3842
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
3943
// Setup variables for display.
@@ -71,7 +75,12 @@ protected function getInput() {
7175
// The current article display field.
7276
$html[] = '<span class="input-append">';
7377
$html[] = '<input type="text" class="input-medium" id="'.$this->id.'_name" value="'.$fullname.'" disabled="disabled" size="35" />';
74-
$html[] = '<a class="modal btn hasTooltip" title="'.JHtml::tooltipText('COM_CLUBMANAGEMENT_CHANGE_PERSON').'" href="'.$link.'&amp;'.JSession::getFormToken().'=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> '.JText::_('JSELECT').'</a>';
78+
if (isset($this->element['select']) && ($this->element['select'] == 'true')) {
79+
$html[] = '<a class="modal btn hasTooltip" title="'.JHtml::tooltipText('COM_CLUBMANAGEMENT_CHANGE_PERSON').'" href="'.$link.'&amp;'.JSession::getFormToken().'=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> '.JText::_('JSELECT').'</a>';
80+
}
81+
if (isset($this->element['clear']) && ($this->element['clear'] == 'true')) {
82+
$html[] = '<button type="button" class="btn" id="' . $this->id . '_clear" onclick="window.jClearPerson_' . $this->id . '(\'' . $this->id . '\'); return false;"><span class="icon-remove" aria-hidden="true"></span>' . JText::_('JCLEAR').'</button>';
83+
}
7584
$html[] = '</span>';
7685
// class='required' for client side validation
7786
$class = '';

admin/models/forms/person.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@
142142
size="40"
143143
required="false"
144144
household="true"
145-
excludeCurrentId="true" />
145+
excludeCurrentId="true"
146+
select="true"
147+
new="true"
148+
edit="true"
149+
clear="true" />
146150

147151
<field name="hh_salutation_override" type="text"
148152
label="COM_CLUBMANAGEMENT_PERSONS_FIELD_HH_SALUTATION_OVERWRITE_LABEL"

0 commit comments

Comments
 (0)