reduced code
This commit is contained in:
parent
f1f74c5f9e
commit
796f6a38c9
|
@ -1178,8 +1178,9 @@ abstract class baseModule {
|
||||||
* @param boolean $required this is a required field (default false)
|
* @param boolean $required this is a required field (default false)
|
||||||
* @param integer $length field length
|
* @param integer $length field length
|
||||||
* @param boolean $isTextArea show as text area (default false)
|
* @param boolean $isTextArea show as text area (default false)
|
||||||
|
* @return mixed reference to htmlTableExtendedInputField/htmlTableExtendedInputTextarea
|
||||||
*/
|
*/
|
||||||
protected function addSimpleInputTextField(&$container, $attrName, $label, $required = false, $length = null, $isTextArea = false) {
|
protected function &addSimpleInputTextField(&$container, $attrName, $label, $required = false, $length = null, $isTextArea = false) {
|
||||||
$value = '';
|
$value = '';
|
||||||
if (isset($this->attributes[$attrName][0])) {
|
if (isset($this->attributes[$attrName][0])) {
|
||||||
$value = $this->attributes[$attrName][0];
|
$value = $this->attributes[$attrName][0];
|
||||||
|
@ -1199,6 +1200,7 @@ abstract class baseModule {
|
||||||
}
|
}
|
||||||
$input->setRequired($required);
|
$input->setRequired($required);
|
||||||
$container->addElement($input, true);
|
$container->addElement($input, true);
|
||||||
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -200,25 +200,15 @@ class account extends baseModule {
|
||||||
// user name if no posixAccount
|
// user name if no posixAccount
|
||||||
$modules = $_SESSION['config']->get_AccountModules($this->get_scope());
|
$modules = $_SESSION['config']->get_AccountModules($this->get_scope());
|
||||||
if (!in_array('posixAccount', $modules)) {
|
if (!in_array('posixAccount', $modules)) {
|
||||||
$uid = null;
|
|
||||||
if (isset($this->attributes['uid'][0])) {
|
|
||||||
$uid = $this->attributes['uid'][0];
|
|
||||||
}
|
|
||||||
$title = _('User name');
|
$title = _('User name');
|
||||||
if ($this->get_scope()=='host') {
|
if ($this->get_scope()=='host') {
|
||||||
$title = _('Host name');
|
$title = _('Host name');
|
||||||
}
|
}
|
||||||
$uidElement = new htmlTableExtendedInputField($title, 'uid', $uid, 'uid');
|
$uidInput = $this->addSimpleInputTextField($container, 'uid', $title, true);
|
||||||
$uidElement->setRequired(true);
|
$uidInput->setFieldMaxLength(100);
|
||||||
$uidElement->setFieldMaxLength(20);
|
|
||||||
$container->addElement($uidElement, true);
|
|
||||||
}
|
}
|
||||||
// description
|
// description
|
||||||
$description = '';
|
$this->addSimpleInputTextField($container, 'description', _('Description'));
|
||||||
if (isset($this->attributes['description'][0])) {
|
|
||||||
$description = $this->attributes['description'][0];
|
|
||||||
}
|
|
||||||
$container->addElement(new htmlTableExtendedInputField(_('Description'), 'description', $description, 'description'));
|
|
||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -648,45 +648,16 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
$return = new htmlTable();
|
$return = new htmlTable();
|
||||||
if (in_array('AsteriskSIPUser', $this->attributes['objectClass'])) {
|
if (in_array('AsteriskSIPUser', $this->attributes['objectClass'])) {
|
||||||
// caller ID
|
// caller ID
|
||||||
$callerId = '';
|
$this->addSimpleInputTextField($return, 'AstAccountCallerID', _("Caller ID"), true);
|
||||||
if (isset($this->attributes['AstAccountCallerID'][0])) {
|
|
||||||
$callerId = $this->attributes['AstAccountCallerID'][0];
|
|
||||||
}
|
|
||||||
$callerIdInput = new htmlTableExtendedInputField(_("Caller ID"), 'AstAccountCallerID', $callerId, 'AstAccountCallerID');
|
|
||||||
$callerIdInput->setRequired(true);
|
|
||||||
$return->addElement($callerIdInput, true);
|
|
||||||
// host
|
// host
|
||||||
$host = '';
|
$this->addSimpleInputTextField($return, 'AstAccountHost', _("Host"), true);
|
||||||
if (isset($this->attributes['AstAccountHost'][0])) {
|
|
||||||
$host = $this->attributes['AstAccountHost'][0];
|
|
||||||
}
|
|
||||||
$hostInput = new htmlTableExtendedInputField(_("Host"), 'AstAccountHost', $host, 'AstAccountHost');
|
|
||||||
$hostInput->setRequired(true);
|
|
||||||
$return->addElement($hostInput, true);
|
|
||||||
// context
|
// context
|
||||||
$context = '';
|
$this->addSimpleInputTextField($return, 'AstAccountContext', _("Account context"), true);
|
||||||
if (isset($this->attributes['AstAccountContext'][0])) {
|
|
||||||
$context = $this->attributes['AstAccountContext'][0];
|
|
||||||
}
|
|
||||||
$contextInput = new htmlTableExtendedInputField(_("Account context"), 'AstAccountContext', $context, 'AstAccountContext');
|
|
||||||
$contextInput->setRequired(true);
|
|
||||||
$return->addElement($contextInput, true);
|
|
||||||
// account type
|
// account type
|
||||||
$accountType = '';
|
$this->addSimpleInputTextField($return, 'AstAccountType', _("Account type"), true);
|
||||||
if (isset($this->attributes['AstAccountType'][0])) {
|
|
||||||
$accountType = $this->attributes['AstAccountType'][0];
|
|
||||||
}
|
|
||||||
$accountTypeInput = new htmlTableExtendedInputField(_("Account type"), 'AstAccountType', $accountType, 'AstAccountType');
|
|
||||||
$accountTypeInput->setRequired(true);
|
|
||||||
$return->addElement($accountTypeInput, true);
|
|
||||||
// user agent
|
// user agent
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountUserAgent')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountUserAgent')) {
|
||||||
$AstAccountUserAgent = '';
|
$this->addSimpleInputTextField($return, 'AstAccountUserAgent', _("User agent"));
|
||||||
if (isset($this->attributes['AstAccountUserAgent'][0])) {
|
|
||||||
$AstAccountUserAgent = $this->attributes['AstAccountUserAgent'][0];
|
|
||||||
}
|
|
||||||
$AstAccountUserAgentInput = new htmlTableExtendedInputField(_("User agent"), 'AstAccountUserAgent', $AstAccountUserAgent, 'AstAccountUserAgent');
|
|
||||||
$return->addElement($AstAccountUserAgentInput, true);
|
|
||||||
}
|
}
|
||||||
// AMA flags
|
// AMA flags
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountAMAFlags')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountAMAFlags')) {
|
||||||
|
@ -703,12 +674,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
// call groups
|
// call groups
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountCallGroup')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountCallGroup')) {
|
||||||
$AstAccountCallGroup = '';
|
$this->addSimpleInputTextField($return, 'AstAccountCallGroup', _("Call groups"));
|
||||||
if (isset($this->attributes['AstAccountCallGroup'][0])) {
|
|
||||||
$AstAccountCallGroup = $this->attributes['AstAccountCallGroup'][0];
|
|
||||||
}
|
|
||||||
$AstAccountCallGroupInput = new htmlTableExtendedInputField(_("Call groups"), 'AstAccountCallGroup', $AstAccountCallGroup, 'AstAccountCallGroup');
|
|
||||||
$return->addElement($AstAccountCallGroupInput, true);
|
|
||||||
}
|
}
|
||||||
// DTMF flags
|
// DTMF flags
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDTMFMode')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDTMFMode')) {
|
||||||
|
@ -725,30 +691,15 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
// from user
|
// from user
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountFromUser')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountFromUser')) {
|
||||||
$AstAccountFromUser = '';
|
$this->addSimpleInputTextField($return, 'AstAccountFromUser', _("From user"));
|
||||||
if (isset($this->attributes['AstAccountFromUser'][0])) {
|
|
||||||
$AstAccountFromUser = $this->attributes['AstAccountFromUser'][0];
|
|
||||||
}
|
|
||||||
$AstAccountFromUserInput = new htmlTableExtendedInputField(_("From user"), 'AstAccountFromUser', $AstAccountFromUser, 'AstAccountFromUser');
|
|
||||||
$return->addElement($AstAccountFromUserInput, true);
|
|
||||||
}
|
}
|
||||||
// from domain
|
// from domain
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountFromDomain')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountFromDomain')) {
|
||||||
$AstAccountFromDomain = '';
|
$this->addSimpleInputTextField($return, 'AstAccountFromDomain', _("From domain"));
|
||||||
if (isset($this->attributes['AstAccountFromDomain'][0])) {
|
|
||||||
$AstAccountFromDomain = $this->attributes['AstAccountFromDomain'][0];
|
|
||||||
}
|
|
||||||
$AstAccountFromDomainInput = new htmlTableExtendedInputField(_("From domain"), 'AstAccountFromDomain', $AstAccountFromDomain, 'AstAccountFromDomain');
|
|
||||||
$return->addElement($AstAccountFromDomainInput, true);
|
|
||||||
}
|
}
|
||||||
// full contact
|
// full contact
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountFullContact')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountFullContact')) {
|
||||||
$AstAccountFullContact = '';
|
$this->addSimpleInputTextField($return, 'AstAccountFullContact', _("Full contact"));
|
||||||
if (isset($this->attributes['AstAccountFullContact'][0])) {
|
|
||||||
$AstAccountFullContact = $this->attributes['AstAccountFullContact'][0];
|
|
||||||
}
|
|
||||||
$AstAccountFullContactInput = new htmlTableExtendedInputField(_("Full contact"), 'AstAccountFullContact', $AstAccountFullContact, 'AstAccountFullContact');
|
|
||||||
$return->addElement($AstAccountFullContactInput, true);
|
|
||||||
}
|
}
|
||||||
// insecure
|
// insecure
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountInsecure')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountInsecure')) {
|
||||||
|
@ -765,12 +716,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
// mailbox
|
// mailbox
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountMailbox')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountMailbox')) {
|
||||||
$AstAccountMailbox = '';
|
$this->addSimpleInputTextField($return, 'AstAccountMailbox', _("Mailbox"));
|
||||||
if (isset($this->attributes['AstAccountMailbox'][0])) {
|
|
||||||
$AstAccountMailbox = $this->attributes['AstAccountMailbox'][0];
|
|
||||||
}
|
|
||||||
$AstAccountMailboxInput = new htmlTableExtendedInputField(_("Mailbox"), 'AstAccountMailbox', $AstAccountMailbox, 'AstAccountMailbox');
|
|
||||||
$return->addElement($AstAccountMailboxInput, true);
|
|
||||||
}
|
}
|
||||||
// NAT
|
// NAT
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountNAT')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountNAT')) {
|
||||||
|
@ -787,132 +733,62 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
// deny
|
// deny
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDeny')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDeny')) {
|
||||||
$AstAccountDeny = '';
|
$this->addSimpleInputTextField($return, 'AstAccountDeny', _("Deny"));
|
||||||
if (isset($this->attributes['AstAccountDeny'][0])) {
|
|
||||||
$AstAccountDeny = $this->attributes['AstAccountDeny'][0];
|
|
||||||
}
|
|
||||||
$AstAccountDenyInput = new htmlTableExtendedInputField(_("Deny"), 'AstAccountDeny', $AstAccountDeny, 'AstAccountDeny');
|
|
||||||
$return->addElement($AstAccountDenyInput, true);
|
|
||||||
}
|
}
|
||||||
// permit
|
// permit
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPermit')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPermit')) {
|
||||||
$AstAccountPermit = '';
|
$this->addSimpleInputTextField($return, 'AstAccountPermit', _("Permit"));
|
||||||
if (isset($this->attributes['AstAccountPermit'][0])) {
|
|
||||||
$AstAccountPermit = $this->attributes['AstAccountPermit'][0];
|
|
||||||
}
|
|
||||||
$AstAccountPermitInput = new htmlTableExtendedInputField(_("Permit"), 'AstAccountPermit', $AstAccountPermit, 'AstAccountPermit');
|
|
||||||
$return->addElement($AstAccountPermitInput, true);
|
|
||||||
}
|
}
|
||||||
// pickup group
|
// pickup group
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPickupGroup')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPickupGroup')) {
|
||||||
$AstAccountPickupGroup = '';
|
$this->addSimpleInputTextField($return, 'AstAccountPickupGroup', _("Pickup group"));
|
||||||
if (isset($this->attributes['AstAccountPickupGroup'][0])) {
|
|
||||||
$AstAccountPickupGroup = $this->attributes['AstAccountPickupGroup'][0];
|
|
||||||
}
|
|
||||||
$AstAccountPickupGroupInput = new htmlTableExtendedInputField(_("Pickup group"), 'AstAccountPickupGroup', $AstAccountPickupGroup, 'AstAccountPickupGroup');
|
|
||||||
$return->addElement($AstAccountPickupGroupInput, true);
|
|
||||||
}
|
}
|
||||||
// port
|
// port
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPort')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPort')) {
|
||||||
$AstAccountPort = '';
|
$AstAccountPort = $this->addSimpleInputTextField($return, 'AstAccountPort', _("Port"));
|
||||||
if (isset($this->attributes['AstAccountPort'][0])) {
|
$AstAccountPort->setValidationRule(htmlElement::VALIDATE_NUMERIC);
|
||||||
$AstAccountPort = $this->attributes['AstAccountPort'][0];
|
|
||||||
}
|
|
||||||
$AstAccountPortInput = new htmlTableExtendedInputField(_("Port"), 'AstAccountPort', $AstAccountPort, 'AstAccountPort');
|
|
||||||
$AstAccountPortInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
|
|
||||||
$return->addElement($AstAccountPortInput, true);
|
|
||||||
}
|
}
|
||||||
// qualify
|
// qualify
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountQualify')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountQualify')) {
|
||||||
$AstAccountQualify = '';
|
$this->addSimpleInputTextField($return, 'AstAccountQualify', _("Qualify"));
|
||||||
if (isset($this->attributes['AstAccountQualify'][0])) {
|
|
||||||
$AstAccountQualify = $this->attributes['AstAccountQualify'][0];
|
|
||||||
}
|
|
||||||
$AstAccountQualifyInput = new htmlTableExtendedInputField(_("Qualify"), 'AstAccountQualify', $AstAccountQualify, 'AstAccountQualify');
|
|
||||||
$return->addElement($AstAccountQualifyInput, true);
|
|
||||||
}
|
}
|
||||||
// restrict caller ID
|
// restrict caller ID
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRestrictCID')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRestrictCID')) {
|
||||||
$AstAccountRestrictCID = '';
|
$this->addSimpleInputTextField($return, 'AstAccountRestrictCID', _("Restrict caller ID"));
|
||||||
if (isset($this->attributes['AstAccountRestrictCID'][0])) {
|
|
||||||
$AstAccountRestrictCID = $this->attributes['AstAccountRestrictCID'][0];
|
|
||||||
}
|
|
||||||
$AstAccountRestrictCIDInput = new htmlTableExtendedInputField(_("Restrict caller ID"), 'AstAccountRestrictCID', $AstAccountRestrictCID, 'AstAccountRestrictCID');
|
|
||||||
$return->addElement($AstAccountRestrictCIDInput, true);
|
|
||||||
}
|
}
|
||||||
// RTP timeout
|
// RTP timeout
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRTPTimeout')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRTPTimeout')) {
|
||||||
$AstAccountRTPTimeout = '';
|
$AstAccountRTPTimeout = $this->addSimpleInputTextField($return, 'AstAccountRTPTimeout', _("RTP timeout"));
|
||||||
if (isset($this->attributes['AstAccountRTPTimeout'][0])) {
|
$AstAccountRTPTimeout->setValidationRule(htmlElement::VALIDATE_NUMERIC);
|
||||||
$AstAccountRTPTimeout = $this->attributes['AstAccountRTPTimeout'][0];
|
|
||||||
}
|
|
||||||
$AstAccountRTPTimeoutInput = new htmlTableExtendedInputField(_("RTP timeout"), 'AstAccountRTPTimeout', $AstAccountRTPTimeout, 'AstAccountRTPTimeout');
|
|
||||||
$AstAccountRTPTimeoutInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
|
|
||||||
$return->addElement($AstAccountRTPTimeoutInput, true);
|
|
||||||
}
|
}
|
||||||
// RTP hold timeout
|
// RTP hold timeout
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRTPHoldTimeout')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRTPHoldTimeout')) {
|
||||||
$AstAccountRTPHoldTimeout = '';
|
$AstAccountRTPHoldTimeoutInput = $this->addSimpleInputTextField($return, 'AstAccountRTPHoldTimeout', _("RTP hold timeout"));
|
||||||
if (isset($this->attributes['AstAccountRTPHoldTimeout'][0])) {
|
|
||||||
$AstAccountRTPHoldTimeout = $this->attributes['AstAccountRTPHoldTimeout'][0];
|
|
||||||
}
|
|
||||||
$AstAccountRTPHoldTimeoutInput = new htmlTableExtendedInputField(_("RTP hold timeout"), 'AstAccountRTPHoldTimeout', $AstAccountRTPHoldTimeout, 'AstAccountRTPHoldTimeout');
|
|
||||||
$AstAccountRTPHoldTimeoutInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
|
$AstAccountRTPHoldTimeoutInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
|
||||||
$return->addElement($AstAccountRTPHoldTimeoutInput, true);
|
|
||||||
}
|
}
|
||||||
// disallowed codec
|
// disallowed codec
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDisallowedCodec')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDisallowedCodec')) {
|
||||||
$AstAccountDisallowedCodec = '';
|
$this->addSimpleInputTextField($return, 'AstAccountDisallowedCodec', _("Disallowed codec"));
|
||||||
if (isset($this->attributes['AstAccountDisallowedCodec'][0])) {
|
|
||||||
$AstAccountDisallowedCodec = $this->attributes['AstAccountDisallowedCodec'][0];
|
|
||||||
}
|
|
||||||
$AstAccountDisallowedCodecInput = new htmlTableExtendedInputField(_("Disallowed codec"), 'AstAccountDisallowedCodec', $AstAccountDisallowedCodec, 'AstAccountDisallowedCodec');
|
|
||||||
$return->addElement($AstAccountDisallowedCodecInput, true);
|
|
||||||
}
|
}
|
||||||
// allowed codec
|
// allowed codec
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountAllowedCodec')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountAllowedCodec')) {
|
||||||
$AstAccountAllowedCodec = '';
|
$this->addSimpleInputTextField($return, 'AstAccountAllowedCodec', _("Allowed codec"));
|
||||||
if (isset($this->attributes['AstAccountAllowedCodec'][0])) {
|
|
||||||
$AstAccountAllowedCodec = $this->attributes['AstAccountAllowedCodec'][0];
|
|
||||||
}
|
|
||||||
$AstAccountAllowedCodecInput = new htmlTableExtendedInputField(_("Allowed codec"), 'AstAccountAllowedCodec', $AstAccountAllowedCodec, 'AstAccountAllowedCodec');
|
|
||||||
$return->addElement($AstAccountAllowedCodecInput, true);
|
|
||||||
}
|
}
|
||||||
// music on hold
|
// music on hold
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountMusicOnHold')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountMusicOnHold')) {
|
||||||
$AstAccountMusicOnHold = '';
|
$this->addSimpleInputTextField($return, 'AstAccountMusicOnHold', _("Music on hold"));
|
||||||
if (isset($this->attributes['AstAccountMusicOnHold'][0])) {
|
|
||||||
$AstAccountMusicOnHold = $this->attributes['AstAccountMusicOnHold'][0];
|
|
||||||
}
|
|
||||||
$AstAccountMusicOnHoldInput = new htmlTableExtendedInputField(_("Music on hold"), 'AstAccountMusicOnHold', $AstAccountMusicOnHold, 'AstAccountMusicOnHold');
|
|
||||||
$return->addElement($AstAccountMusicOnHoldInput, true);
|
|
||||||
}
|
}
|
||||||
// expiration timestamp
|
// expiration timestamp
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountExpirationTimestamp')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountExpirationTimestamp')) {
|
||||||
$AstAccountExpirationTimestamp = '';
|
$this->addSimpleInputTextField($return, 'AstAccountExpirationTimestamp', _("Expiration timestamp"));
|
||||||
if (isset($this->attributes['AstAccountExpirationTimestamp'][0])) {
|
|
||||||
$AstAccountExpirationTimestamp = $this->attributes['AstAccountExpirationTimestamp'][0];
|
|
||||||
}
|
|
||||||
$AstAccountExpirationTimestampInput = new htmlTableExtendedInputField(_("Expiration timestamp"), 'AstAccountExpirationTimestamp', $AstAccountExpirationTimestamp, 'AstAccountExpirationTimestamp');
|
|
||||||
$return->addElement($AstAccountExpirationTimestampInput, true);
|
|
||||||
}
|
}
|
||||||
// registration context
|
// registration context
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRegistrationContext')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRegistrationContext')) {
|
||||||
$AstAccountRegistrationContext = '';
|
$this->addSimpleInputTextField($return, 'AstAccountRegistrationContext', _("Registration context"));
|
||||||
if (isset($this->attributes['AstAccountRegistrationContext'][0])) {
|
|
||||||
$AstAccountRegistrationContext = $this->attributes['AstAccountRegistrationContext'][0];
|
|
||||||
}
|
|
||||||
$AstAccountRegistrationContextInput = new htmlTableExtendedInputField(_("Registration context"), 'AstAccountRegistrationContext', $AstAccountRegistrationContext, 'AstAccountRegistrationContext');
|
|
||||||
$return->addElement($AstAccountRegistrationContextInput, true);
|
|
||||||
}
|
}
|
||||||
// registration extension
|
// registration extension
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRegistrationExten')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRegistrationExten')) {
|
||||||
$AstAccountRegistrationExten = '';
|
$this->addSimpleInputTextField($return, 'AstAccountRegistrationExten', _("Registration extension"));
|
||||||
if (isset($this->attributes['AstAccountRegistrationExten'][0])) {
|
|
||||||
$AstAccountRegistrationExten = $this->attributes['AstAccountRegistrationExten'][0];
|
|
||||||
}
|
|
||||||
$AstAccountRegistrationExtenInput = new htmlTableExtendedInputField(_("Registration extension"), 'AstAccountRegistrationExten', $AstAccountRegistrationExten, 'AstAccountRegistrationExten');
|
|
||||||
$return->addElement($AstAccountRegistrationExtenInput, true);
|
|
||||||
}
|
}
|
||||||
// can call forward
|
// can call forward
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountCanCallForward')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountCanCallForward')) {
|
||||||
|
@ -929,39 +805,19 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
// IP address
|
// IP address
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountIPAddress')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountIPAddress')) {
|
||||||
$AstAccountIPAddress = '';
|
$this->addSimpleInputTextField($return, 'AstAccountIPAddress', _("IP address"));
|
||||||
if (isset($this->attributes['AstAccountIPAddress'][0])) {
|
|
||||||
$AstAccountIPAddress = $this->attributes['AstAccountIPAddress'][0];
|
|
||||||
}
|
|
||||||
$AstAccountIPAddressInput = new htmlTableExtendedInputField(_("IP address"), 'AstAccountIPAddress', $AstAccountIPAddress, 'AstAccountIPAddress');
|
|
||||||
$return->addElement($AstAccountIPAddressInput, true);
|
|
||||||
}
|
}
|
||||||
// default user
|
// default user
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDefaultUser')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDefaultUser')) {
|
||||||
$AstAccountDefaultUser = '';
|
$this->addSimpleInputTextField($return, 'AstAccountDefaultUser', _("Default user"));
|
||||||
if (isset($this->attributes['AstAccountDefaultUser'][0])) {
|
|
||||||
$AstAccountDefaultUser = $this->attributes['AstAccountDefaultUser'][0];
|
|
||||||
}
|
|
||||||
$AstAccountDefaultUserInput = new htmlTableExtendedInputField(_("Default user"), 'AstAccountDefaultUser', $AstAccountDefaultUser, 'AstAccountDefaultUser');
|
|
||||||
$return->addElement($AstAccountDefaultUserInput, true);
|
|
||||||
}
|
}
|
||||||
// registration server
|
// registration server
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRegistrationServer')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountRegistrationServer')) {
|
||||||
$AstAccountRegistrationServer = '';
|
$this->addSimpleInputTextField($return, 'AstAccountRegistrationServer', _("Registration server"));
|
||||||
if (isset($this->attributes['AstAccountRegistrationServer'][0])) {
|
|
||||||
$AstAccountRegistrationServer = $this->attributes['AstAccountRegistrationServer'][0];
|
|
||||||
}
|
|
||||||
$AstAccountRegistrationServerInput = new htmlTableExtendedInputField(_("Registration server"), 'AstAccountRegistrationServer', $AstAccountRegistrationServer, 'AstAccountRegistrationServer');
|
|
||||||
$return->addElement($AstAccountRegistrationServerInput, true);
|
|
||||||
}
|
}
|
||||||
// last qualify milliseconds
|
// last qualify milliseconds
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountLastQualifyMilliseconds')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountLastQualifyMilliseconds')) {
|
||||||
$AstAccountLastQualifyMilliseconds = '';
|
$this->addSimpleInputTextField($return, 'AstAccountLastQualifyMilliseconds', _("Last qualify milliseconds"));
|
||||||
if (isset($this->attributes['AstAccountLastQualifyMilliseconds'][0])) {
|
|
||||||
$AstAccountLastQualifyMilliseconds = $this->attributes['AstAccountLastQualifyMilliseconds'][0];
|
|
||||||
}
|
|
||||||
$AstAccountLastQualifyMillisecondsInput = new htmlTableExtendedInputField(_("Last qualify milliseconds"), 'AstAccountLastQualifyMilliseconds', $AstAccountLastQualifyMilliseconds, 'AstAccountLastQualifyMilliseconds');
|
|
||||||
$return->addElement($AstAccountLastQualifyMillisecondsInput, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -229,54 +229,22 @@ class asteriskVoicemail extends baseModule implements passwordService {
|
||||||
$return->addElement($message, true);
|
$return->addElement($message, true);
|
||||||
}
|
}
|
||||||
// mailbox
|
// mailbox
|
||||||
$mailbox = '';
|
$this->addSimpleInputTextField($return, 'AstVoicemailMailbox', _("Mailbox"), true);
|
||||||
if (isset($this->attributes['AstVoicemailMailbox'][0])) {
|
|
||||||
$mailbox = $this->attributes['AstVoicemailMailbox'][0];
|
|
||||||
}
|
|
||||||
$mailboxInput = new htmlTableExtendedInputField(_("Mailbox"), 'AstVoicemailMailbox', $mailbox, 'AstVoicemailMailbox');
|
|
||||||
$mailboxInput->setRequired(true);
|
|
||||||
$return->addElement($mailboxInput, true);
|
|
||||||
// account context
|
// account context
|
||||||
$acctContext = '';
|
$this->addSimpleInputTextField($return, 'AstContext', _("Account context"), true);
|
||||||
if (isset($this->attributes['AstContext'][0])) {
|
|
||||||
$acctContext = $this->attributes['AstContext'][0];
|
|
||||||
}
|
|
||||||
$acctContextInput = new htmlTableExtendedInputField(_("Account context"), 'AstContext', $acctContext, 'AstContext');
|
|
||||||
$acctContextInput->setRequired(true);
|
|
||||||
$return->addElement($acctContextInput, true);
|
|
||||||
|
|
||||||
$return->addElement(new htmlSpacer(null, '10px'), true);
|
$return->addElement(new htmlSpacer(null, '10px'), true);
|
||||||
|
|
||||||
// full name
|
// full name
|
||||||
$name = '';
|
$this->addSimpleInputTextField($return, 'AstVoicemailFullname', _("Full name"));
|
||||||
if (isset($this->attributes['AstVoicemailFullname'][0])) {
|
|
||||||
$name = $this->attributes['AstVoicemailFullname'][0];
|
|
||||||
}
|
|
||||||
$return->addElement(new htmlTableExtendedInputField(_("Full name"), 'AstVoicemailFullname', $name, 'AstVoicemailFullname'), true);
|
|
||||||
// email
|
// email
|
||||||
$email = '';
|
$this->addSimpleInputTextField($return, 'AstVoicemailEmail', _("Email address"));
|
||||||
if (isset($this->attributes['AstVoicemailEmail'][0])) {
|
|
||||||
$email = $this->attributes['AstVoicemailEmail'][0];
|
|
||||||
}
|
|
||||||
$return->addElement(new htmlTableExtendedInputField(_("Email address"), 'AstVoicemailEmail', $email, 'AstVoicemailEmail'), true);
|
|
||||||
// pager
|
// pager
|
||||||
$pager = '';
|
$this->addSimpleInputTextField($return, 'AstVoicemailPager', _("Pager"));
|
||||||
if (isset($this->attributes['AstVoicemailPager'][0])) {
|
|
||||||
$pager = $this->attributes['AstVoicemailPager'][0];
|
|
||||||
}
|
|
||||||
$return->addElement(new htmlTableExtendedInputField(_("Pager"), 'AstVoicemailPager', $pager, 'AstVoicemailPager'), true);
|
|
||||||
// options
|
// options
|
||||||
$options = '';
|
$this->addSimpleInputTextField($return, 'AstVoicemailOptions', _("Options"));
|
||||||
if (isset($this->attributes['AstVoicemailOptions'][0])) {
|
|
||||||
$options = $this->attributes['AstVoicemailOptions'][0];
|
|
||||||
}
|
|
||||||
$return->addElement(new htmlTableExtendedInputField(_("Options"), 'AstVoicemailOptions', $options, 'AstVoicemailOptions'), true);
|
|
||||||
// voicemail context
|
// voicemail context
|
||||||
$voiceContext = '';
|
$this->addSimpleInputTextField($return, 'AstVoicemailContext', _("Voicemail context"));
|
||||||
if (isset($this->attributes['AstVoicemailContext'][0])) {
|
|
||||||
$voiceContext = $this->attributes['AstVoicemailContext'][0];
|
|
||||||
}
|
|
||||||
$return->addElement(new htmlTableExtendedInputField(_("Voicemail context"), 'AstVoicemailContext', $voiceContext, 'AstVoicemailContext'), true);
|
|
||||||
// remove button
|
// remove button
|
||||||
$return->addElement(new htmlSpacer(null, '10px'), true);
|
$return->addElement(new htmlSpacer(null, '10px'), true);
|
||||||
$remButton = new htmlButton('remVoicemailObjectClass', _('Remove Asterisk voicemail extension'));
|
$remButton = new htmlButton('remVoicemailObjectClass', _('Remove Asterisk voicemail extension'));
|
||||||
|
|
Loading…
Reference in New Issue