reduced code
This commit is contained in:
parent
fe9fe9079f
commit
5200138e06
|
@ -1178,9 +1178,10 @@ 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)
|
||||||
|
* @param array $autoCompleteValues values for auto-completion
|
||||||
* @return mixed reference to htmlTableExtendedInputField/htmlTableExtendedInputTextarea
|
* @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, $autoCompleteValues = null) {
|
||||||
$value = '';
|
$value = '';
|
||||||
if (isset($this->attributes[$attrName][0])) {
|
if (isset($this->attributes[$attrName][0])) {
|
||||||
$value = $this->attributes[$attrName][0];
|
$value = $this->attributes[$attrName][0];
|
||||||
|
@ -1197,6 +1198,9 @@ abstract class baseModule {
|
||||||
if ($length != null) {
|
if ($length != null) {
|
||||||
$input->setFieldSize($length);
|
$input->setFieldSize($length);
|
||||||
}
|
}
|
||||||
|
if (!empty($autoCompleteValues)) {
|
||||||
|
$input->enableAutocompletion($autoCompleteValues);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$input->setRequired($required);
|
$input->setRequired($required);
|
||||||
$container->addElement($input, true);
|
$container->addElement($input, true);
|
||||||
|
@ -1273,7 +1277,7 @@ abstract class baseModule {
|
||||||
protected function processMultiValueInputTextField($attrName, &$errors, $validationID = null) {
|
protected function processMultiValueInputTextField($attrName, &$errors, $validationID = null) {
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
while (isset($_POST[$attrName . '_' . $counter])) {
|
while (isset($_POST[$attrName . '_' . $counter])) {
|
||||||
$this->attributes[$attrName][$counter] = $_POST[$attrName . '_' . $counter];
|
$this->attributes[$attrName][$counter] = trim($_POST[$attrName . '_' . $counter]);
|
||||||
if (($this->attributes[$attrName][$counter] == '') || isset($_POST['del_' . $attrName . '_' . $counter])) {
|
if (($this->attributes[$attrName][$counter] == '') || isset($_POST['del_' . $attrName . '_' . $counter])) {
|
||||||
unset($this->attributes[$attrName][$counter]);
|
unset($this->attributes[$attrName][$counter]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,11 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$this->messages['telephoneNumber'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_telephone', _('Please enter a valid telephone number!'));
|
$this->messages['telephoneNumber'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_telephone', _('Please enter a valid telephone number!'));
|
||||||
$this->messages['homePhone'][0] = array('ERROR', _('Home telephone number'), _('Please enter a valid telephone number!'));
|
$this->messages['homePhone'][0] = array('ERROR', _('Home telephone number'), _('Please enter a valid telephone number!'));
|
||||||
$this->messages['homePhone'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_homePhone', _('Please enter a valid telephone number!'));
|
$this->messages['homePhone'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_homePhone', _('Please enter a valid telephone number!'));
|
||||||
$this->messages['mobileTelephone'][0] = array('ERROR', _('Mobile number'), _('Please enter a valid mobile number!'));
|
$this->messages['mobile'][0] = array('ERROR', _('Mobile number'), _('Please enter a valid mobile number!'));
|
||||||
$this->messages['mobileTelephone'][1] = array('ERROR', _('Account %s:') . " inetOrgPerson_mobile", _('Please enter a valid mobile number!'));
|
$this->messages['mobileTelephone'][1] = array('ERROR', _('Account %s:') . " inetOrgPerson_mobile", _('Please enter a valid mobile number!'));
|
||||||
$this->messages['facsimileNumber'][0] = array('ERROR', _('Fax number'), _('Please enter a valid fax number!'));
|
$this->messages['facsimileTelephoneNumber'][0] = array('ERROR', _('Fax number'), _('Please enter a valid fax number!'));
|
||||||
$this->messages['facsimileNumber'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_fax', _('Please enter a valid fax number!'));
|
$this->messages['facsimileNumber'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_fax', _('Please enter a valid fax number!'));
|
||||||
$this->messages['email'][0] = array('ERROR', _('Email address'), _('Please enter a valid email address!'));
|
$this->messages['mail'][0] = array('ERROR', _('Email address'), _('Please enter a valid email address!'));
|
||||||
$this->messages['email'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_email', _('Please enter a valid email address!'));
|
$this->messages['email'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_email', _('Please enter a valid email address!'));
|
||||||
$this->messages['street'][0] = array('ERROR', _('Street'), _('Please enter a valid street name!'));
|
$this->messages['street'][0] = array('ERROR', _('Street'), _('Please enter a valid street name!'));
|
||||||
$this->messages['street'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_street', _('Please enter a valid street name!'));
|
$this->messages['street'][1] = array('ERROR', _('Account %s:') . ' inetOrgPerson_street', _('Please enter a valid street name!'));
|
||||||
|
@ -771,7 +771,7 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
"Headline" => _("Telephone number"), 'attr' => 'telephoneNumber',
|
"Headline" => _("Telephone number"), 'attr' => 'telephoneNumber',
|
||||||
"Text" => _("The user's telephone number.") . ' ' . _('Multiple values are separated by semicolon.')
|
"Text" => _("The user's telephone number.") . ' ' . _('Multiple values are separated by semicolon.')
|
||||||
),
|
),
|
||||||
'mobileTelephoneNumber' => array (
|
'mobile' => array (
|
||||||
"Headline" => _("Mobile number"), 'attr' => 'mobile',
|
"Headline" => _("Mobile number"), 'attr' => 'mobile',
|
||||||
"Text" => _("The user's mobile number.")
|
"Text" => _("The user's mobile number.")
|
||||||
),
|
),
|
||||||
|
@ -1031,96 +1031,22 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$this->attributes['givenName'][0] = trim($_POST['givenName']);
|
$this->attributes['givenName'][0] = trim($_POST['givenName']);
|
||||||
if (($this->attributes['givenName'][0] != '') && !get_preg($this->attributes['givenName'][0], 'realname')) $errors[] = $this->messages['givenName'][0];
|
if (($this->attributes['givenName'][0] != '') && !get_preg($this->attributes['givenName'][0], 'realname')) $errors[] = $this->messages['givenName'][0];
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) {
|
||||||
$titleCounter = 0;
|
$this->processMultiValueInputTextField('title', $errors, 'title');
|
||||||
while (isset($_POST['title' . $titleCounter])) {
|
|
||||||
$this->attributes['title'][$titleCounter] = $_POST['title' . $titleCounter];
|
|
||||||
if ($this->attributes['title'][$titleCounter] == '') {
|
|
||||||
unset($this->attributes['title'][$titleCounter]);
|
|
||||||
}
|
|
||||||
elseif (!get_preg($this->attributes['title'][$titleCounter], 'title')) {
|
|
||||||
$errors[] = $this->messages['title'][0];
|
|
||||||
}
|
|
||||||
$titleCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addtitle'])) {
|
|
||||||
$this->attributes['title'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['title'] = array_values($this->attributes['title']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEMailAddress')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEMailAddress')) {
|
||||||
$mailCounter = 0;
|
$this->processMultiValueInputTextField('mail', $errors, 'email');
|
||||||
while (isset($_POST['mail' . $mailCounter])) {
|
|
||||||
$this->attributes['mail'][$mailCounter] = trim($_POST['mail' . $mailCounter]);
|
|
||||||
if (($_POST['mail' . $mailCounter] != '') && !get_preg($this->attributes['mail'][$mailCounter], 'email')) $errors[] = $this->messages['email'][0];
|
|
||||||
if ($this->attributes['mail'][$mailCounter] == '') {
|
|
||||||
unset($this->attributes['mail'][$mailCounter]);
|
|
||||||
}
|
|
||||||
$mailCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addMail'])) {
|
|
||||||
$this->attributes['mail'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['mail'] = array_values($this->attributes['mail']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber')) {
|
||||||
$telephoneNumberCounter = 0;
|
$this->processMultiValueInputTextField('telephoneNumber', $errors, 'telephone');
|
||||||
while (isset($_POST['telephoneNumber' . $telephoneNumberCounter])) {
|
|
||||||
$this->attributes['telephoneNumber'][$telephoneNumberCounter] = trim($_POST['telephoneNumber' . $telephoneNumberCounter]);
|
|
||||||
if (!get_preg($this->attributes['telephoneNumber'][$telephoneNumberCounter], 'telephone')) $errors[] = $this->messages['telephoneNumber'][0];
|
|
||||||
if ($this->attributes['telephoneNumber'][$telephoneNumberCounter] == '') {
|
|
||||||
unset($this->attributes['telephoneNumber'][$telephoneNumberCounter]);
|
|
||||||
}
|
|
||||||
$telephoneNumberCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addTelephoneNumber'])) {
|
|
||||||
$this->attributes['telephoneNumber'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['telephoneNumber'] = array_values($this->attributes['telephoneNumber']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideMobileNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideMobileNumber')) {
|
||||||
$mobileCounter = 0;
|
$this->processMultiValueInputTextField('mobile', $errors, 'telephone');
|
||||||
while (isset($_POST['mobile' . $mobileCounter])) {
|
|
||||||
$this->attributes['mobile'][$mobileCounter] = trim($_POST['mobile' . $mobileCounter]);
|
|
||||||
if (!get_preg($this->attributes['mobile'][$mobileCounter], 'telephone')) $errors[] = $this->messages['mobileTelephone'][0];
|
|
||||||
if ($this->attributes['mobile'][$mobileCounter] == '') {
|
|
||||||
unset($this->attributes['mobile'][$mobileCounter]);
|
|
||||||
}
|
|
||||||
$mobileCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addMobile'])) {
|
|
||||||
$this->attributes['mobile'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['mobile'] = array_values($this->attributes['mobile']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideFaxNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideFaxNumber')) {
|
||||||
$facsimileTelephoneNumberCounter = 0;
|
$this->processMultiValueInputTextField('facsimileTelephoneNumber', $errors, 'telephone');
|
||||||
while (isset($_POST['facsimileTelephoneNumber' . $facsimileTelephoneNumberCounter])) {
|
|
||||||
$this->attributes['facsimileTelephoneNumber'][$facsimileTelephoneNumberCounter] = trim($_POST['facsimileTelephoneNumber' . $facsimileTelephoneNumberCounter]);
|
|
||||||
if (!get_preg($this->attributes['facsimileTelephoneNumber'][$facsimileTelephoneNumberCounter], 'telephone')) $errors[] = $this->messages['facsimileNumber'][0];
|
|
||||||
if ($this->attributes['facsimileTelephoneNumber'][$facsimileTelephoneNumberCounter] == '') {
|
|
||||||
unset($this->attributes['facsimileTelephoneNumber'][$facsimileTelephoneNumberCounter]);
|
|
||||||
}
|
|
||||||
$facsimileTelephoneNumberCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addFacsimileTelephoneNumber'])) {
|
|
||||||
$this->attributes['facsimileTelephoneNumber'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['facsimileTelephoneNumber'] = array_values($this->attributes['facsimileTelephoneNumber']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideHomeTelephoneNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideHomeTelephoneNumber')) {
|
||||||
$homePhoneCounter = 0;
|
$this->processMultiValueInputTextField('homePhone', $errors, 'telephone');
|
||||||
while (isset($_POST['homePhone' . $homePhoneCounter])) {
|
|
||||||
$this->attributes['homePhone'][$homePhoneCounter] = trim($_POST['homePhone' . $homePhoneCounter]);
|
|
||||||
if (!get_preg($this->attributes['homePhone'][$homePhoneCounter], 'telephone')) $errors[] = $this->messages['homePhone'][0];
|
|
||||||
if ($this->attributes['homePhone'][$homePhoneCounter] == '') {
|
|
||||||
unset($this->attributes['homePhone'][$homePhoneCounter]);
|
|
||||||
}
|
|
||||||
$homePhoneCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addHomePhone'])) {
|
|
||||||
$this->attributes['homePhone'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['homePhone'] = array_values($this->attributes['homePhone']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideStreet')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideStreet')) {
|
||||||
$this->processMultiValueInputTextField('street', $errors, 'street');
|
$this->processMultiValueInputTextField('street', $errors, 'street');
|
||||||
|
@ -1147,18 +1073,7 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$this->attributes['postalAddress'] = array_values($this->attributes['postalAddress']);
|
$this->attributes['postalAddress'] = array_values($this->attributes['postalAddress']);
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLabeledURI')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLabeledURI')) {
|
||||||
$labeledURICounter = 0;
|
$this->processMultiValueInputTextField('labeledURI', $errors);
|
||||||
while (isset($_POST['labeledURI' . $labeledURICounter])) {
|
|
||||||
$this->attributes['labeledURI'][$labeledURICounter] = trim($_POST['labeledURI' . $labeledURICounter]);
|
|
||||||
if ($this->attributes['labeledURI'][$labeledURICounter] == '') {
|
|
||||||
unset($this->attributes['labeledURI'][$labeledURICounter]);
|
|
||||||
}
|
|
||||||
$labeledURICounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addLabeledURI'])) {
|
|
||||||
$this->attributes['labeledURI'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['labeledURI'] = array_values($this->attributes['labeledURI']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideRegisteredAddress')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideRegisteredAddress')) {
|
||||||
$addressCounter = 0;
|
$addressCounter = 0;
|
||||||
|
@ -1195,66 +1110,19 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$this->processMultiValueInputTextField('physicalDeliveryOfficeName', $errors);
|
$this->processMultiValueInputTextField('physicalDeliveryOfficeName', $errors);
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideBusinessCategory')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideBusinessCategory')) {
|
||||||
$businessCategoryCounter = 0;
|
$this->processMultiValueInputTextField('businessCategory', $errors, 'businessCategory');
|
||||||
while (isset($_POST['businessCategory' . $businessCategoryCounter])) {
|
|
||||||
$this->attributes['businessCategory'][$businessCategoryCounter] = $_POST['businessCategory' . $businessCategoryCounter];
|
|
||||||
if ($this->attributes['businessCategory'][$businessCategoryCounter] == '') {
|
|
||||||
unset($this->attributes['businessCategory'][$businessCategoryCounter]);
|
|
||||||
}
|
|
||||||
elseif (!get_preg($this->attributes['businessCategory'][$businessCategoryCounter], 'businessCategory')) {
|
|
||||||
$errors[] = $this->messages['businessCategory'][0];
|
|
||||||
}
|
|
||||||
$businessCategoryCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addbusinessCategory'])) {
|
|
||||||
$this->attributes['businessCategory'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['businessCategory'] = array_values($this->attributes['businessCategory']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) {
|
||||||
$departmentNumberCounter = 0;
|
$this->processMultiValueInputTextField('departmentNumber', $errors);
|
||||||
while (isset($_POST['departmentNumber' . $departmentNumberCounter])) {
|
|
||||||
$this->attributes['departmentNumber'][$departmentNumberCounter] = $_POST['departmentNumber' . $departmentNumberCounter];
|
|
||||||
if ($this->attributes['departmentNumber'][$departmentNumberCounter] == '') {
|
|
||||||
unset($this->attributes['departmentNumber'][$departmentNumberCounter]);
|
|
||||||
}
|
|
||||||
$departmentNumberCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addDepartmentNumber'])) {
|
|
||||||
$this->attributes['departmentNumber'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['departmentNumber'] = array_values($this->attributes['departmentNumber']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeNumber')) {
|
||||||
$this->attributes['employeeNumber'][0] = $_POST['employeeNumber'];
|
$this->attributes['employeeNumber'][0] = $_POST['employeeNumber'];
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOu')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOu')) {
|
||||||
$ouCounter = 0;
|
$this->processMultiValueInputTextField('ou', $errors);
|
||||||
while (isset($_POST['ou' . $ouCounter])) {
|
|
||||||
$this->attributes['ou'][$ouCounter] = $_POST['ou' . $ouCounter];
|
|
||||||
if ($this->attributes['ou'][$ouCounter] == '') {
|
|
||||||
unset($this->attributes['ou'][$ouCounter]);
|
|
||||||
}
|
|
||||||
$ouCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addOu'])) {
|
|
||||||
$this->attributes['ou'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['ou'] = array_values($this->attributes['ou']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideO')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideO')) {
|
||||||
$oCounter = 0;
|
$this->processMultiValueInputTextField('o', $errors);
|
||||||
while (isset($_POST['o' . $oCounter])) {
|
|
||||||
$this->attributes['o'][$oCounter] = $_POST['o' . $oCounter];
|
|
||||||
if ($this->attributes['o'][$oCounter] == '') {
|
|
||||||
unset($this->attributes['o'][$oCounter]);
|
|
||||||
}
|
|
||||||
$oCounter++;
|
|
||||||
}
|
|
||||||
if (isset($_POST['addO'])) {
|
|
||||||
$this->attributes['o'][] = '';
|
|
||||||
}
|
|
||||||
$this->attributes['o'] = array_values($this->attributes['o']);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideInitials')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideInitials')) {
|
||||||
$this->attributes['initials'] = preg_split('/;[ ]*/', $_POST['initials']);
|
$this->attributes['initials'] = preg_split('/;[ ]*/', $_POST['initials']);
|
||||||
|
@ -1498,166 +1366,70 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber')) {
|
||||||
$telephoneNumbers = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'telephoneNumber', _('Telephone number'));
|
||||||
if (isset($this->attributes['telephoneNumber'][0])) {
|
if (!empty($this->attributes['telephoneNumber'])) {
|
||||||
$telephoneNumbers = $this->attributes['telephoneNumber'];
|
for ($i = 0; $i < sizeof($this->attributes['telephoneNumber']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'telephoneNumber_' . $i;
|
||||||
if (sizeof($telephoneNumbers) == 0) {
|
|
||||||
$telephoneNumbers[] = '';
|
|
||||||
}
|
|
||||||
$telephoneNumberLabel = new htmlOutputText(_('Telephone number'));
|
|
||||||
$telephoneNumberLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($telephoneNumberLabel);
|
|
||||||
$telephoneNumberContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($telephoneNumbers); $i++) {
|
|
||||||
$telephoneNumberContainer->addElement(new htmlInputField('telephoneNumber' . $i, $telephoneNumbers[$i]));
|
|
||||||
$equalWidthElements[] = 'telephoneNumber' . $i;
|
|
||||||
if ($i < (sizeof($telephoneNumbers) - 1)) {
|
|
||||||
$telephoneNumberContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$telephoneNumberContainer->addElement(new htmlButton('addTelephoneNumber', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($telephoneNumberContainer);
|
else {
|
||||||
$telephoneNumberHelp = new htmlHelpLink('telephoneNumber');
|
$equalWidthElements[] = 'telephoneNumber_0';
|
||||||
$telephoneNumberHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($telephoneNumberHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideHomeTelephoneNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideHomeTelephoneNumber')) {
|
||||||
$homePhones = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'homePhone', _('Home telephone number'));
|
||||||
if (isset($this->attributes['homePhone'][0])) {
|
if (!empty($this->attributes['homePhone'])) {
|
||||||
$homePhones = $this->attributes['homePhone'];
|
for ($i = 0; $i < sizeof($this->attributes['homePhone']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'homePhone_' . $i;
|
||||||
if (sizeof($homePhones) == 0) {
|
|
||||||
$homePhones[] = '';
|
|
||||||
}
|
|
||||||
$homePhoneLabel = new htmlOutputText(_('Home telephone number'));
|
|
||||||
$homePhoneLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($homePhoneLabel);
|
|
||||||
$homePhoneContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($homePhones); $i++) {
|
|
||||||
$homePhoneContainer->addElement(new htmlInputField('homePhone' . $i, $homePhones[$i]));
|
|
||||||
$equalWidthElements[] = 'homePhone' . $i;
|
|
||||||
if ($i < (sizeof($homePhones) - 1)) {
|
|
||||||
$homePhoneContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$homePhoneContainer->addElement(new htmlButton('addHomePhone', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($homePhoneContainer);
|
else {
|
||||||
$homePhoneHelp = new htmlHelpLink('homePhone');
|
$equalWidthElements[] = 'homePhone_0';
|
||||||
$homePhoneHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($homePhoneHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideMobileNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideMobileNumber')) {
|
||||||
$mobiles = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'mobile', _('Mobile number'));
|
||||||
if (isset($this->attributes['mobile'][0])) {
|
if (!empty($this->attributes['mobile'])) {
|
||||||
$mobiles = $this->attributes['mobile'];
|
for ($i = 0; $i < sizeof($this->attributes['mobile']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'mobile_' . $i;
|
||||||
if (sizeof($mobiles) == 0) {
|
|
||||||
$mobiles[] = '';
|
|
||||||
}
|
|
||||||
$mobileLabel = new htmlOutputText(_('Mobile number'));
|
|
||||||
$mobileLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($mobileLabel);
|
|
||||||
$mobileContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($mobiles); $i++) {
|
|
||||||
$mobileContainer->addElement(new htmlInputField('mobile' . $i, $mobiles[$i]));
|
|
||||||
$equalWidthElements[] = 'mobile' . $i;
|
|
||||||
if ($i < (sizeof($mobiles) - 1)) {
|
|
||||||
$mobileContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$mobileContainer->addElement(new htmlButton('addMobile', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($mobileContainer);
|
else {
|
||||||
$mobileHelp = new htmlHelpLink('mobileTelephoneNumber');
|
$equalWidthElements[] = 'mobile_0';
|
||||||
$mobileHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($mobileHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideFaxNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideFaxNumber')) {
|
||||||
$facsimileTelephoneNumbers = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'facsimileTelephoneNumber', _('Fax number'));
|
||||||
if (isset($this->attributes['facsimileTelephoneNumber'][0])) {
|
if (!empty($this->attributes['facsimileTelephoneNumber'])) {
|
||||||
$facsimileTelephoneNumbers = $this->attributes['facsimileTelephoneNumber'];
|
for ($i = 0; $i < sizeof($this->attributes['facsimileTelephoneNumber']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'facsimileTelephoneNumber_' . $i;
|
||||||
if (sizeof($facsimileTelephoneNumbers) == 0) {
|
|
||||||
$facsimileTelephoneNumbers[] = '';
|
|
||||||
}
|
|
||||||
$facsimileTelephoneNumberLabel = new htmlOutputText(_('Fax number'));
|
|
||||||
$facsimileTelephoneNumberLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($facsimileTelephoneNumberLabel);
|
|
||||||
$facsimileTelephoneNumberContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($facsimileTelephoneNumbers); $i++) {
|
|
||||||
$facsimileTelephoneNumberContainer->addElement(new htmlInputField('facsimileTelephoneNumber' . $i, $facsimileTelephoneNumbers[$i]));
|
|
||||||
$equalWidthElements[] = 'facsimileTelephoneNumber' . $i;
|
|
||||||
if ($i < (sizeof($facsimileTelephoneNumbers) - 1)) {
|
|
||||||
$facsimileTelephoneNumberContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$facsimileTelephoneNumberContainer->addElement(new htmlButton('addFacsimileTelephoneNumber', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($facsimileTelephoneNumberContainer);
|
else {
|
||||||
$facsimileTelephoneNumberHelp = new htmlHelpLink('facsimileTelephoneNumber');
|
$equalWidthElements[] = 'facsimileTelephoneNumber_0';
|
||||||
$facsimileTelephoneNumberHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($facsimileTelephoneNumberHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEMailAddress')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEMailAddress')) {
|
||||||
$mails = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'mail', _('Email address'));
|
||||||
if (isset($this->attributes['mail'][0])) {
|
if (!empty($this->attributes['mail'])) {
|
||||||
$mails = $this->attributes['mail'];
|
for ($i = 0; $i < sizeof($this->attributes['mail']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'mail_' . $i;
|
||||||
if (sizeof($mails) == 0) {
|
|
||||||
$mails[] = '';
|
|
||||||
}
|
|
||||||
$mailLabel = new htmlOutputText(_('Email address'));
|
|
||||||
$mailLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($mailLabel);
|
|
||||||
$mailContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($mails); $i++) {
|
|
||||||
$mailContainer->addElement(new htmlInputField('mail' . $i, $mails[$i]));
|
|
||||||
$equalWidthElements[] = 'mail' . $i;
|
|
||||||
if ($i < (sizeof($mails) - 1)) {
|
|
||||||
$mailContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$mailContainer->addElement(new htmlButton('addMail', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($mailContainer);
|
else {
|
||||||
$mailHelp = new htmlHelpLink('mail');
|
$equalWidthElements[] = 'mail_0';
|
||||||
$mailHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($mailHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLabeledURI')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLabeledURI')) {
|
||||||
$labeledURI = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'labeledURI', _('Web site'));
|
||||||
if (isset($this->attributes['labeledURI'][0])) {
|
if (!empty($this->attributes['labeledURI'])) {
|
||||||
$labeledURI = $this->attributes['labeledURI'];
|
for ($i = 0; $i < sizeof($this->attributes['labeledURI']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'labeledURI_' . $i;
|
||||||
if (sizeof($labeledURI) == 0) {
|
|
||||||
$labeledURI[] = '';
|
|
||||||
}
|
|
||||||
$labeledURILabel = new htmlOutputText(_('Web site'));
|
|
||||||
$labeledURILabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($labeledURILabel);
|
|
||||||
$labeledURIContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($labeledURI); $i++) {
|
|
||||||
$labeledURIContainer->addElement(new htmlInputField('labeledURI' . $i, $labeledURI[$i]));
|
|
||||||
$equalWidthElements[] = 'labeledURI' . $i;
|
|
||||||
if ($i < (sizeof($labeledURI) - 1)) {
|
|
||||||
$labeledURIContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$labeledURIContainer->addElement(new htmlButton('addLabeledURI', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($labeledURIContainer);
|
else {
|
||||||
$labeledURIHelp = new htmlHelpLink('labeledURI');
|
$equalWidthElements[] = 'labeledURI_0';
|
||||||
$labeledURIHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($labeledURIHelp, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle') || !$this->isBooleanConfigOptionSet('inetOrgPerson_hideCarLicense')
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle') || !$this->isBooleanConfigOptionSet('inetOrgPerson_hideCarLicense')
|
||||||
|
@ -1668,171 +1440,73 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) {
|
||||||
$titles = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'title', _('Job title'));
|
||||||
if (isset($this->attributes['title'][0])) {
|
if (!empty($this->attributes['title'])) {
|
||||||
$titles = $this->attributes['title'];
|
for ($i = 0; $i < sizeof($this->attributes['title']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'title_' . $i;
|
||||||
if (sizeof($titles) == 0) {
|
|
||||||
$titles[] = '';
|
|
||||||
}
|
|
||||||
$titleLabel = new htmlOutputText(_('Job title'));
|
|
||||||
$titleLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($titleLabel);
|
|
||||||
$titleContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($titles); $i++) {
|
|
||||||
$titleInput = new htmlInputField('title' . $i, $titles[$i]);
|
|
||||||
$titleInput->enableAutocompletion($this->titleCache);
|
|
||||||
$titleContainer->addElement($titleInput);
|
|
||||||
$equalWidthElements[] = 'title' . $i;
|
|
||||||
if ($i < (sizeof($titles) - 1)) {
|
|
||||||
$titleContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$titleContainer->addElement(new htmlButton('addtitle', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($titleContainer);
|
else {
|
||||||
$titleHelp = new htmlHelpLink('title');
|
$equalWidthElements[] = 'title_0';
|
||||||
$titleHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($titleHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideCarLicense')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideCarLicense')) {
|
||||||
$carLicense = '';
|
$this->addSimpleInputTextField($fieldContainer, 'carLicense', _('Car license'));
|
||||||
if (isset($this->attributes['carLicense'][0])) $carLicense = $this->attributes['carLicense'][0];
|
|
||||||
$fieldContainer->addElement(new htmlTableExtendedInputField(_('Car license'), 'carLicense', $carLicense, 'carLicense'), true);
|
|
||||||
$equalWidthElements[] = 'carLicense';
|
$equalWidthElements[] = 'carLicense';
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeNumber')) {
|
||||||
$employeeNumber = '';
|
$this->addSimpleInputTextField($fieldContainer, 'employeeNumber', _('Employee number'));
|
||||||
if (isset($this->attributes['employeeNumber'][0])) $employeeNumber = $this->attributes['employeeNumber'][0];
|
|
||||||
$fieldContainer->addElement(new htmlTableExtendedInputField(_('Employee number'), 'employeeNumber', $employeeNumber, 'employeeNumber'), true);
|
|
||||||
$equalWidthElements[] = 'employeeNumber';
|
$equalWidthElements[] = 'employeeNumber';
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeType')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeType')) {
|
||||||
$employeeType = '';
|
$this->addSimpleInputTextField($fieldContainer, 'employeeType', _('Employee type'), false, null, false, $this->employeeTypeCache);
|
||||||
if (isset($this->attributes['employeeType'][0])) $employeeType = $this->attributes['employeeType'][0];
|
|
||||||
$employeeTypeInput = new htmlTableExtendedInputField(_('Employee type'), 'employeeType', $employeeType, 'employeeType');
|
|
||||||
$employeeTypeInput->enableAutocompletion($this->employeeTypeCache);
|
|
||||||
$fieldContainer->addElement($employeeTypeInput, true);
|
|
||||||
$equalWidthElements[] = 'employeeType';
|
$equalWidthElements[] = 'employeeType';
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideBusinessCategory')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideBusinessCategory')) {
|
||||||
$businessCategories = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'businessCategory', _('Business category'), false, null, false, $this->businessCategoryCache);
|
||||||
if (isset($this->attributes['businessCategory'][0])) {
|
if (!empty($this->attributes['businessCategory'])) {
|
||||||
$businessCategories = $this->attributes['businessCategory'];
|
for ($i = 0; $i < sizeof($this->attributes['businessCategory']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'businessCategory_' . $i;
|
||||||
if (sizeof($businessCategories) == 0) {
|
|
||||||
$businessCategories[] = '';
|
|
||||||
}
|
|
||||||
$businessCategoryLabel = new htmlOutputText(_('Business category'));
|
|
||||||
$businessCategoryLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($businessCategoryLabel);
|
|
||||||
$businessCategoryContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($businessCategories); $i++) {
|
|
||||||
$businessCategoryInput = new htmlInputField('businessCategory' . $i, $businessCategories[$i]);
|
|
||||||
$businessCategoryInput->enableAutocompletion($this->businessCategoryCache);
|
|
||||||
$businessCategoryContainer->addElement($businessCategoryInput);
|
|
||||||
$equalWidthElements[] = 'businessCategory' . $i;
|
|
||||||
if ($i < (sizeof($businessCategories) - 1)) {
|
|
||||||
$businessCategoryContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$businessCategoryContainer->addElement(new htmlButton('addbusinessCategory', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($businessCategoryContainer);
|
else {
|
||||||
$businessCategoryHelp = new htmlHelpLink('businessCategory');
|
$equalWidthElements[] = 'businessCategory_0';
|
||||||
$businessCategoryHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($businessCategoryHelp, true);
|
|
||||||
}
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) {
|
||||||
$departmentNumbers = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'departmentNumber', _('Department'), false, null, false, $this->departmentCache);
|
||||||
if (isset($this->attributes['departmentNumber'][0])) {
|
if (!empty($this->attributes['departmentNumber'])) {
|
||||||
$departmentNumbers = $this->attributes['departmentNumber'];
|
for ($i = 0; $i < sizeof($this->attributes['departmentNumber']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'departmentNumber_' . $i;
|
||||||
if (sizeof($departmentNumbers) == 0) {
|
|
||||||
$departmentNumbers[] = '';
|
|
||||||
}
|
|
||||||
$departmentNumberLabel = new htmlOutputText(_('Department'));
|
|
||||||
$departmentNumberLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($departmentNumberLabel);
|
|
||||||
$departmentNumberContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($departmentNumbers); $i++) {
|
|
||||||
$departmentInput = new htmlInputField('departmentNumber' . $i, $departmentNumbers[$i]);
|
|
||||||
$departmentInput->enableAutocompletion($this->departmentCache);
|
|
||||||
$departmentNumberContainer->addElement($departmentInput);
|
|
||||||
$equalWidthElements[] = 'departmentNumber' . $i;
|
|
||||||
if ($i < (sizeof($departmentNumbers) - 1)) {
|
|
||||||
$departmentNumberContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$departmentNumberContainer->addElement(new htmlButton('addDepartmentNumber', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($departmentNumberContainer);
|
else {
|
||||||
$departmentNumberHelp = new htmlHelpLink('departmentNumber');
|
$equalWidthElements[] = 'departmentNumber_0';
|
||||||
$departmentNumberHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($departmentNumberHelp, true);
|
|
||||||
}
|
}
|
||||||
// organisational unit
|
// organisational unit
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOu')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOu')) {
|
||||||
$ous = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'ou', _('Organisational unit'), false, null, false, $this->ouCache);
|
||||||
if (isset($this->attributes['ou'][0])) {
|
if (!empty($this->attributes['ou'])) {
|
||||||
$ous = $this->attributes['ou'];
|
for ($i = 0; $i < sizeof($this->attributes['ou']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'ou_' . $i;
|
||||||
if (sizeof($ous) == 0) {
|
|
||||||
$ous[] = '';
|
|
||||||
}
|
|
||||||
$ouLabel = new htmlOutputText(_('Organisational unit'));
|
|
||||||
$ouLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($ouLabel);
|
|
||||||
$ouContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($ous); $i++) {
|
|
||||||
$ouInput = new htmlInputField('ou' . $i, $ous[$i]);
|
|
||||||
$ouInput->enableAutocompletion($this->ouCache);
|
|
||||||
$ouContainer->addElement($ouInput);
|
|
||||||
$equalWidthElements[] = 'ou' . $i;
|
|
||||||
if ($i < (sizeof($ous) - 1)) {
|
|
||||||
$ouContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$ouContainer->addElement(new htmlButton('addOu', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($ouContainer);
|
else {
|
||||||
$ouHelp = new htmlHelpLink('ou');
|
$equalWidthElements[] = 'ou_0';
|
||||||
$ouHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($ouHelp, true);
|
|
||||||
}
|
}
|
||||||
// organisation
|
// organisation
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideO')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideO')) {
|
||||||
$os = array();
|
$this->addMultiValueInputTextField($fieldContainer, 'o', _('Organisation'), false, null, false, $this->oCache);
|
||||||
if (isset($this->attributes['o'][0])) {
|
if (!empty($this->attributes['o'])) {
|
||||||
$os = $this->attributes['o'];
|
for ($i = 0; $i < sizeof($this->attributes['o']); $i++) {
|
||||||
}
|
$equalWidthElements[] = 'o_' . $i;
|
||||||
if (sizeof($os) == 0) {
|
|
||||||
$os[] = '';
|
|
||||||
}
|
|
||||||
$oLabel = new htmlOutputText(_('Organisation'));
|
|
||||||
$oLabel->alignment = htmlElement::ALIGN_TOP;
|
|
||||||
$fieldContainer->addElement($oLabel);
|
|
||||||
$oContainer = new htmlGroup();
|
|
||||||
for ($i = 0; $i < sizeof($os); $i++) {
|
|
||||||
$oInput = new htmlInputField('o' . $i, $os[$i]);
|
|
||||||
$oInput->enableAutocompletion($this->oCache);
|
|
||||||
$oContainer->addElement($oInput);
|
|
||||||
$equalWidthElements[] = 'o' . $i;
|
|
||||||
if ($i < (sizeof($os) - 1)) {
|
|
||||||
$oContainer->addElement(new htmlOutputText('<br>', false));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$oContainer->addElement(new htmlButton('addO', 'add.png', true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldContainer->addElement($oContainer);
|
else {
|
||||||
$oHelp = new htmlHelpLink('o');
|
$equalWidthElements[] = 'o_0';
|
||||||
$oHelp->alignment = htmlElement::ALIGN_TOP;
|
}
|
||||||
$fieldContainer->addElement($oHelp, true);
|
|
||||||
}
|
}
|
||||||
// user certificates
|
// user certificates
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideuserCertificate')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideuserCertificate')) {
|
||||||
|
@ -2292,7 +1966,7 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$facsimileTelephoneNumberList = preg_split('/;[ ]*/', $options['inetOrgPerson_facsimileTelephoneNumber'][0]);
|
$facsimileTelephoneNumberList = preg_split('/;[ ]*/', $options['inetOrgPerson_facsimileTelephoneNumber'][0]);
|
||||||
for ($i = 0; $i < sizeof($facsimileTelephoneNumberList); $i++) {
|
for ($i = 0; $i < sizeof($facsimileTelephoneNumberList); $i++) {
|
||||||
if (!get_preg($facsimileTelephoneNumberList[$i], 'telephone')) {
|
if (!get_preg($facsimileTelephoneNumberList[$i], 'telephone')) {
|
||||||
$messages[] = $this->messages['facsimileNumber'][0];
|
$messages[] = $this->messages['facsimileTelephoneNumber'][0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue