use new meta HTML classes
This commit is contained in:
parent
5257696592
commit
f95b3a3d70
|
@ -108,20 +108,11 @@ class asteriskExtension extends baseModule {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
// profile options
|
// profile options
|
||||||
$return['profile_options'] = array(
|
$profileContainer = new htmlTable();
|
||||||
array(
|
$profileContainer->addElement(new htmlTableExtendedInputField(_('Account context'), 'AsteriskExtension_AstContext', null, 'AstContext'), true);
|
||||||
array('kind' => 'text', 'text' => _('Account context') . ":"),
|
$profileContainer->addElement(new htmlTableExtendedInputField(_('Priority'), 'AsteriskExtension_AstPriority', null, 'AstPriority'), true);
|
||||||
array('kind' => 'input', 'name' => 'AsteriskExtension_AstContext', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
|
$profileContainer->addElement(new htmlTableExtendedInputField(_('Application'), 'AsteriskExtension_AstApplication', null, 'AstApplication'), true);
|
||||||
array('kind' => 'help', 'value' => 'AstContext')),
|
$return['profile_options'] = $profileContainer;
|
||||||
array(
|
|
||||||
array('kind' => 'text', 'text' => _('Priority') . ":"),
|
|
||||||
array('kind' => 'input', 'name' => 'AsteriskExtension_AstPriority', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
|
|
||||||
array('kind' => 'help', 'value' => 'AstPriority')),
|
|
||||||
array(
|
|
||||||
array('kind' => 'text', 'text' => _('Application') . ":"),
|
|
||||||
array('kind' => 'input', 'name' => 'AsteriskExtension_AstApplication', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
|
|
||||||
array('kind' => 'help', 'value' => 'AstApplication'))
|
|
||||||
);
|
|
||||||
$return['profile_mappings'] = array(
|
$return['profile_mappings'] = array(
|
||||||
'AsteriskExtension_AstContext' => 'AstContext',
|
'AsteriskExtension_AstContext' => 'AstContext',
|
||||||
'AsteriskExtension_AstPriority' => 'AstPriority',
|
'AsteriskExtension_AstPriority' => 'AstPriority',
|
||||||
|
@ -213,48 +204,66 @@ class asteriskExtension extends baseModule {
|
||||||
* @param array $_POST HTTP-POST values
|
* @param array $_POST HTTP-POST values
|
||||||
*/
|
*/
|
||||||
function display_html_attributes() {
|
function display_html_attributes() {
|
||||||
$return = array();
|
$return = new htmlTable();
|
||||||
|
// cn
|
||||||
$return[] = array(
|
$cn = '';
|
||||||
array('kind' => 'text', 'text' => _("Common name") . '*'),
|
if (isset($this->attributes['cn'][0])) {
|
||||||
array('kind' => 'input', 'name' => 'cn', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['cn'][0]),
|
$cn = $this->attributes['cn'][0];
|
||||||
array('kind' => 'help', 'value' => 'cn'));
|
}
|
||||||
$return[] = array(
|
$cnInput = new htmlTableExtendedInputField(_("Common name"), 'cn', $cn, 'cn');
|
||||||
array('kind' => 'text', 'text' => _("Account context") . '*'),
|
$cnInput->setRequired(true);
|
||||||
array('kind' => 'input', 'name' => 'AstContext', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['AstContext'][0]),
|
$return->addElement($cnInput, true);
|
||||||
array('kind' => 'help', 'value' => 'AstContext'));
|
// account context
|
||||||
$return[] = array(
|
$accountContext = '';
|
||||||
array('kind' => 'text', 'text' => _("Extension name") . '*'),
|
if (isset($this->attributes['AstContext'][0])) {
|
||||||
array('kind' => 'input', 'name' => 'AstExtension', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['AstExtension'][0]),
|
$accountContext = $this->attributes['AstContext'][0];
|
||||||
array('kind' => 'help', 'value' => 'AstExtension'));
|
}
|
||||||
$return[] = array(
|
$accountContextInput = new htmlTableExtendedInputField(_("Account context"), 'AstContext', $accountContext, 'AstContext');
|
||||||
array('kind' => 'text', 'text' => _("Priority") . '*'),
|
$accountContextInput->setRequired(true);
|
||||||
array('kind' => 'input', 'name' => 'AstPriority', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['AstPriority'][0]),
|
$return->addElement($accountContextInput, true);
|
||||||
array('kind' => 'help', 'value' => 'AstPriority'));
|
// extension name
|
||||||
$return[] = array(
|
$extName = '';
|
||||||
array('kind' => 'text', 'text' => _("Application") . '*'),
|
if (isset($this->attributes['AstExtension'][0])) {
|
||||||
array('kind' => 'input', 'name' => 'AstApplication', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['AstApplication'][0]),
|
$extName = $this->attributes['AstExtension'][0];
|
||||||
array('kind' => 'help', 'value' => 'AstApplication'));
|
}
|
||||||
$return[] = array(
|
$extNameInput = new htmlTableExtendedInputField(_("Extension name"), 'AstExtension', $extName, 'AstExtension');
|
||||||
array('kind' => 'text', 'text' => _("Application data")),
|
$extNameInput->setRequired(true);
|
||||||
array('kind' => 'input', 'name' => 'AstApplicationData', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['AstApplicationData'][0]),
|
$return->addElement($extNameInput, true);
|
||||||
array('kind' => 'help', 'value' => 'AstApplicationData'));
|
// priority
|
||||||
|
$priority = '';
|
||||||
$return[] = array(
|
if (isset($this->attributes['AstPriority'][0])) {
|
||||||
array('kind' => 'text', 'text' => _("Extension owners") . '*'),
|
$priority = $this->attributes['AstPriority'][0];
|
||||||
array('kind' => 'input', 'name' => 'form_subpage_' . get_class($this) . '_user_open', 'type' => 'submit', 'value' => _('Change')),
|
}
|
||||||
array('kind' => 'help', 'value' => 'member'));
|
$priorityInput = new htmlTableExtendedInputField(_("Priority"), 'AstPriority', $priority, 'AstPriority');
|
||||||
$memberPart = array();
|
$priorityInput->setRequired(true);
|
||||||
|
$return->addElement($priorityInput, true);
|
||||||
|
// application
|
||||||
|
$application = '';
|
||||||
|
if (isset($this->attributes['AstApplication'][0])) {
|
||||||
|
$application = $this->attributes['AstApplication'][0];
|
||||||
|
}
|
||||||
|
$applicationInput = new htmlTableExtendedInputField(_("Application"), 'AstApplication', $application, 'AstApplication');
|
||||||
|
$applicationInput->setRequired(true);
|
||||||
|
$return->addElement($applicationInput, true);
|
||||||
|
// application data
|
||||||
|
$applicationData = '';
|
||||||
|
if (isset($this->attributes['AstApplicationData'][0])) {
|
||||||
|
$applicationData = $this->attributes['AstApplicationData'][0];
|
||||||
|
}
|
||||||
|
$return->addElement(new htmlTableExtendedInputField(_("Application data"), 'AstApplicationData', $applicationData, 'AstApplicationData'), true);
|
||||||
|
// owners
|
||||||
|
$return->addElement(new htmlOutputText(_("Extension owners") . '*'));
|
||||||
|
$return->addElement(new htmlAccountPageButton(get_class($this), 'user', 'open', _('Change')));
|
||||||
|
$return->addElement(new htmlHelpLink('member'));
|
||||||
|
$return->addNewLine();
|
||||||
|
$return->addElement(new htmlOutputText(''));
|
||||||
|
$ownerList = new htmlTable();
|
||||||
if (isset($this->attributes['member'])) {
|
if (isset($this->attributes['member'])) {
|
||||||
for ($i = 0; $i < sizeof($this->attributes['member']); $i++) {
|
for ($i = 0; $i < sizeof($this->attributes['member']); $i++) {
|
||||||
$memberPart[] = array(array('kind' => 'text', 'text' => getAbstractDN($this->attributes['member'][$i])));
|
$ownerList->addElement(new htmlOutputText(getAbstractDN($this->attributes['member'][$i])), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$return[] = array(
|
$return->addElement($ownerList);
|
||||||
array('kind' => 'text', 'text' => ''),
|
|
||||||
array('kind' => 'table', 'value' => $memberPart),
|
|
||||||
array('kind' => 'text', 'text' => ''),
|
|
||||||
);
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,6 +273,7 @@ class asteriskExtension extends baseModule {
|
||||||
* @return array list of info/error messages
|
* @return array list of info/error messages
|
||||||
*/
|
*/
|
||||||
function display_html_user() {
|
function display_html_user() {
|
||||||
|
$return = new htmlTable();
|
||||||
// load list with all potential owners
|
// load list with all potential owners
|
||||||
$searchScope = 'user';
|
$searchScope = 'user';
|
||||||
if ($this->searchOwnersInTreeSuffix) {
|
if ($this->searchOwnersInTreeSuffix) {
|
||||||
|
@ -278,55 +288,46 @@ class asteriskExtension extends baseModule {
|
||||||
for ($i = 0; $i < sizeof($entries); $i++) {
|
for ($i = 0; $i < sizeof($entries); $i++) {
|
||||||
$dn = $entries[$i]['dn'];
|
$dn = $entries[$i]['dn'];
|
||||||
if (isset($dn) && (!isset($this->attributes['member']) || !in_array($dn, $this->attributes['member']))) {
|
if (isset($dn) && (!isset($this->attributes['member']) || !in_array($dn, $this->attributes['member']))) {
|
||||||
$users_dn[] = array($dn, getAbstractDN($dn));
|
$users_dn[getAbstractDN($dn)] = $dn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$members = $this->attributes['member'];
|
$memberList = $this->attributes['member'];
|
||||||
for ($i = 0; $i < sizeof($members); $i++) {
|
$members = array();
|
||||||
$members[$i] = array($members[$i], getAbstractDN($members[$i]));
|
for ($i = 0; $i < sizeof($memberList); $i++) {
|
||||||
|
$members[getAbstractDN($memberList[$i])] = $memberList[$i];
|
||||||
}
|
}
|
||||||
$return[] = array(array('kind' => 'table', 'value' => array(
|
// options
|
||||||
array(
|
$return->addElement(new htmlTableExtendedInputCheckbox('filterAsteriskUsers', $this->filterOwnerForAsteriskAccounts, _('Show only Asterisk accounts'), 'ownerOptions', false));
|
||||||
array('kind' => 'table', 'value' => array(
|
$refreshButton = new htmlButton('changeFilter', _('Refresh'));
|
||||||
array(
|
$refreshButton->rowspan = 2;
|
||||||
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'filterAsteriskUsers', 'checked' => $this->filterOwnerForAsteriskAccounts),
|
$return->addElement($refreshButton, true);
|
||||||
array('kind' => 'text', 'text' => _('Show only Asterisk accounts')),
|
$return->addElement(new htmlTableExtendedInputCheckbox('useTreeSuffix', $this->searchOwnersInTreeSuffix, _('Search tree suffix for users'), 'ownerOptions', false), true);
|
||||||
array('kind' => 'help', 'value' => 'ownerOptions')
|
$return->addElement(new htmlSpacer(null, '10px'), true);
|
||||||
),
|
// owners
|
||||||
array(
|
$ownerContent = new htmlTable();
|
||||||
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'useTreeSuffix', 'checked' => $this->searchOwnersInTreeSuffix),
|
$ownerContent->addElement(new htmlOutputText(_("Selected users")));
|
||||||
array('kind' => 'text', 'text' => _('Search tree suffix for users')),
|
$ownerContent->addElement(new htmlOutputText(""));
|
||||||
array('kind' => 'help', 'value' => 'ownerOptions')
|
$ownerContent->addElement(new htmlOutputText(_("Available users")));
|
||||||
)
|
$ownerContent->addNewLine();
|
||||||
)),
|
$selectedList = new htmlSelect('removeusers', $members, null, 15);
|
||||||
array('kind' => 'text', 'text' => ' '),
|
$selectedList->setHasDescriptiveElements(true);
|
||||||
array('kind' => 'input', 'name' => 'form_subpage_' . get_class($this) . '_user_changeFilter' ,'type' => 'submit', 'value' => _('Refresh') ),
|
$selectedList->setMultiSelect(true);
|
||||||
)
|
$selectedList->setRightToLeftTextDirection(true);
|
||||||
)));
|
$ownerContent->addElement($selectedList);
|
||||||
|
$ownerButtons = new htmlTable();
|
||||||
// !!! setRightToLeftText -> true for select
|
$ownerButtons->addElement(new htmlButton('addusers_button', 'back.gif', true), true);
|
||||||
|
$ownerButtons->addElement(new htmlButton('removeusers_button', 'forward.gif', true));
|
||||||
$return[] = array(
|
$ownerContent->addElement($ownerButtons);
|
||||||
array('kind' => 'fieldset', 'legend' => _("Extension owners"), 'value' => array(
|
$availableList = new htmlSelect('addusers', $users_dn, null, 15);
|
||||||
array(
|
$availableList->setHasDescriptiveElements(true);
|
||||||
array('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Selected users"), 'value' => array (
|
$availableList->setMultiSelect(true);
|
||||||
array(array('kind' => 'select', 'name' => 'removeusers', 'size' => '15', 'multiple' => true, 'options' => $members, 'descriptiveOptions' => true)))
|
$availableList->setRightToLeftTextDirection(true);
|
||||||
),
|
$ownerContent->addElement($availableList);
|
||||||
array('kind' => 'table', 'value' => array(
|
$ownerContent->colspan = 4;
|
||||||
array(array('kind' => 'input', 'type' => 'submit', 'name' => 'addusers_button', 'value' => '<=', 'td' => array('align' => 'center'))),
|
$return->addElement(new htmlSubTitle(_("Extension owners")), true);
|
||||||
array(array('kind' => 'input', 'type' => 'submit', 'name' => 'removeusers_button', 'value' => '=>', 'td' => array('align' => 'center'))),
|
$return->addElement($ownerContent, true);
|
||||||
array(array('kind' => 'help', 'value' => 'member', 'td' => array('align' => 'center')))
|
// back button
|
||||||
)),
|
$return->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'back', _('Ok')));
|
||||||
array('kind' => 'fieldset', 'td' => array('valign' => 'top'), 'legend' => _("Available users"), 'value' => array(
|
|
||||||
array(array('kind' => 'select', 'name' => 'addusers', 'size' => '15', 'multiple' => true, 'options' => $users_dn, 'descriptiveOptions' => true)))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
))
|
|
||||||
);
|
|
||||||
$return[] = array(
|
|
||||||
array('kind' => 'input', 'name' => 'form_subpage_' . get_class($this) . '_attributes_back' ,'type' => 'submit', 'value' => _('Back') ),
|
|
||||||
array('kind' => 'text'),
|
|
||||||
array('kind' => 'text'));
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +339,7 @@ class asteriskExtension extends baseModule {
|
||||||
* @return array list of info/error messages
|
* @return array list of info/error messages
|
||||||
*/
|
*/
|
||||||
function process_user() {
|
function process_user() {
|
||||||
if (isset($_POST['form_subpage_' . get_class($this) . '_user_changeFilter'])) {
|
if (isset($_POST['changeFilter'])) {
|
||||||
// update filter value
|
// update filter value
|
||||||
$this->filterOwnerForAsteriskAccounts = ($_POST['filterAsteriskUsers'] == 'on');
|
$this->filterOwnerForAsteriskAccounts = ($_POST['filterAsteriskUsers'] == 'on');
|
||||||
// update search suffix
|
// update search suffix
|
||||||
|
|
Loading…
Reference in New Issue