responsive

This commit is contained in:
Roland Gruber 2019-08-17 10:27:18 +02:00
parent 1acf7c95e4
commit 368a3988dc
1 changed files with 12 additions and 15 deletions

View File

@ -1,10 +1,9 @@
<?php <?php
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2010 Pavel Pozdnyak Copyright (C) 2010 Pavel Pozdnyak
2010 - 2015 Roland Gruber 2010 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -234,19 +233,18 @@ class asteriskVoicemail extends baseModule implements passwordService {
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
$return = new htmlTable(); $return = new htmlResponsiveRow();
if (in_array('AsteriskVoiceMail', $this->attributes['objectClass'])) { if (in_array('AsteriskVoiceMail', $this->attributes['objectClass'])) {
if (!isset($this->attributes['AstVoicemailPassword'])) { if (!isset($this->attributes['AstVoicemailPassword'])) {
$message = new htmlStatusMessage($this->messages['AstVoicemailPassword'][0][0], $this->messages['AstVoicemailPassword'][0][1]); $message = new htmlStatusMessage($this->messages['AstVoicemailPassword'][0][0], $this->messages['AstVoicemailPassword'][0][1]);
$message->colspan = 3; $return->add($message, 12);
$return->addElement($message, true);
} }
// mailbox // mailbox
$this->addSimpleInputTextField($return, 'AstVoicemailMailbox', _("Mailbox"), true); $this->addSimpleInputTextField($return, 'AstVoicemailMailbox', _("Mailbox"), true);
// account context // account context
$this->addSimpleInputTextField($return, 'AstContext', _("Account context"), true); $this->addSimpleInputTextField($return, 'AstContext', _("Account context"), true);
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addVerticalSpacer('1rem');
// full name // full name
$this->addSimpleInputTextField($return, 'AstVoicemailFullname', _("Full name")); $this->addSimpleInputTextField($return, 'AstVoicemailFullname', _("Full name"));
@ -259,14 +257,13 @@ class asteriskVoicemail extends baseModule implements passwordService {
// voicemail context // voicemail context
$this->addSimpleInputTextField($return, 'AstVoicemailContext', _("Voicemail context")); $this->addSimpleInputTextField($return, 'AstVoicemailContext', _("Voicemail context"));
// remove button // remove button
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addVerticalSpacer('2rem');
$remButton = new htmlButton('remVoicemailObjectClass', _('Remove Asterisk voicemail extension')); $remButton = new htmlButton('remVoicemailObjectClass', _('Remove Asterisk voicemail extension'));
$remButton->colspan = 2; $return->add($remButton, 12, 12, 12, 'text-center');
$return->addElement($remButton);
} }
else { else {
// add button // add button
$return->addElement(new htmlButton('addVoicemailObjectClass', _('Add Asterisk voicemail extension'))); $return->add(new htmlButton('addVoicemailObjectClass', _('Add Asterisk voicemail extension')), 12);
} }
return $return; return $return;
} }
@ -385,7 +382,9 @@ class asteriskVoicemail extends baseModule implements passwordService {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class
if (!in_array("AsteriskVoiceMail", $partialAccounts[$i]['objectClass'])) $partialAccounts[$i]['objectClass'][] = "AsteriskVoiceMail"; if (!in_array("AsteriskVoiceMail", $partialAccounts[$i]['objectClass'])) {
$partialAccounts[$i]['objectClass'][] = "AsteriskVoiceMail";
}
//add context //add context
if (empty($rawAccounts[$i][$ids['asteriskVoicemail_AstContext']])) { if (empty($rawAccounts[$i][$ids['asteriskVoicemail_AstContext']])) {
@ -425,11 +424,9 @@ class asteriskVoicemail extends baseModule implements passwordService {
* @return boolean true if LDAP operation can be done * @return boolean true if LDAP operation can be done
*/ */
function module_complete() { function module_complete() {
if (in_array('AsteriskVoiceMail', $this->attributes['objectClass'])) { if (in_array('AsteriskVoiceMail', $this->attributes['objectClass']) && empty($this->attributes['AstVoicemailPassword'][0])) {
if(!isset($this->attributes['AstVoicemailPassword'][0]) || $this->attributes['AstVoicemailPassword'][0] == "" ) {
return false; return false;
} }
}
return true; return true;
} }