summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-02-21 15:53:56 (GMT)
committerAleksander Machniak <alec@alec.pl>2012-02-21 15:53:56 (GMT)
commitdb5d28fb5bcf6cd09377b0bad104c3db28372e19 (patch)
tree120244040078fd5e03cafd10c90fe3541544f95d /lib
parent64a5c4f7a510dd7fed443ec3d5a3c4b6898eabf4 (diff)
downloadkolab-wap-db5d28fb5bcf6cd09377b0bad104c3db28372e19.tar.gz
Some improvements in forms
Diffstat (limited to 'lib')
-rw-r--r--lib/api/kolab_api_service_form_value.php1
-rw-r--r--lib/client/kolab_client_task_user.php18
-rw-r--r--lib/locale/en_US.php1
3 files changed, 12 insertions, 8 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index c914815..0f0ad74 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -56,7 +56,6 @@ class kolab_api_service_form_value extends kolab_api_service
return array("displayname" => $displayname);
}
-
}
public function generate_mail($getdata, $postdata)
diff --git a/lib/client/kolab_client_task_user.php b/lib/client/kolab_client_task_user.php
index 69bb996..67d3796 100644
--- a/lib/client/kolab_client_task_user.php
+++ b/lib/client/kolab_client_task_user.php
@@ -377,10 +377,12 @@ class kolab_client_task_user extends kolab_client_task
foreach ($auto_fields as $af_idx => $af) {
foreach ($fields as $section_idx => $section) {
foreach ($section['fields'] as $idx => $field) {
- if ($idx == $af_idx && empty($field['system'])) {
- $fields[$section_idx]['fields'][$idx]['readonly'] = true;
- $fields[$section_idx]['fields'][$idx]['disabled'] = true;
- $fields[$section_idx]['fields'][$idx]['required'] = false;
+ if ($idx == $af_idx) {
+ if (empty($field['system'])) {
+ $fields[$section_idx]['fields'][$idx]['readonly'] = true;
+ $fields[$section_idx]['fields'][$idx]['disabled'] = true;
+ $fields[$section_idx]['fields'][$idx]['required'] = false;
+ }
if (!empty($af['data'])) {
foreach ($af['data'] as $afd) {
@@ -406,12 +408,14 @@ class kolab_client_task_user extends kolab_client_task
// auto-generated field values
if (!empty($event_fields[$idx])) {
$event = json_encode(array_unique($event_fields[$idx]));
- $fields[$section_idx]['fields'][$idx]['onchange'] = "kadm.form_value_change('$form_id', $event)";
+ $fields[$section_idx]['fields'][$idx]['onchange'] = "kadm.form_value_change($event)";
}
}
}
$this->output->set_env('auto_fields', $auto_fields);
+ $this->output->set_env('form_id', $form_id);
+ $this->output->add_translation('user.password.mismatch');
// Hide account type selector if there's only one type
if (count($accttypes) < 2) {
@@ -490,13 +494,13 @@ class kolab_client_task_user extends kolab_client_task
$form->add_button(array(
'value' => kolab_html::escape($this->translate('submit.button')),
- 'onclick' => "kadm.user_save('$form_id')",
+ 'onclick' => "kadm.user_save()",
));
if (!$new) {
$form->add_button(array(
'value' => kolab_html::escape($this->translate('delete.button')),
- 'onclick' => "kadm.user_delete('$form_id')",
+ 'onclick' => "kadm.user_delete()",
));
}
diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php
index c239bb7..e06184f 100644
--- a/lib/locale/en_US.php
+++ b/lib/locale/en_US.php
@@ -71,6 +71,7 @@ $LANG['user.smtp-recipients.desc'] = 'Restrict allowed recipients of SMTP messag
$LANG['user.uid'] = 'Unique identity (UID)';
$LANG['user.password'] = 'Password';
$LANG['user.password-confirm'] = 'Confirm password';
+$LANG['user.password.mismatch'] = 'Passwords do not match!';
$LANG['user.homeserver'] = 'Mailbox home server';
$LANG['group.add'] = 'Add Group';