summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-07-10 11:55:01 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-07-10 11:55:01 (GMT)
commitb3b383932b19f3a82d1235f3867439651cac4350 (patch)
tree25241d14d0c8958896d078061f8180e884e06339
parent2fea14959bfb2827526d3791d3c8b6a9749dd3bb (diff)
downloadkolab-wap-b3b383932b19f3a82d1235f3867439651cac4350.tar.gz
Fixed maxcount attribute check
-rw-r--r--lib/kolab_client_task.php5
-rw-r--r--lib/locale/en_US.php2
-rw-r--r--public_html/js/kolab_admin.js2
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 8d5d0b3..9baefc2 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -731,6 +731,7 @@ class kolab_client_task
if (!empty($field['maxlength'])) {
$result['data-maxlength'] = $field['maxlength'];
}
+$field['maxcount'] = 2;
if (!empty($field['maxcount'])) {
$result['data-maxcount'] = $field['maxcount'];
}
@@ -915,7 +916,7 @@ class kolab_client_task
// See if "administrators" (those who can delete and add back on the entry
// level) may override the automatically generated contents of auto_form_fields.
$admin_auto_fields_rw = $this->config_get('admin_auto_fields_rw', false);
-
+/*
foreach ($fields as $idx => $field) {
if (!array_key_exists($idx, $attribute_rights)) {
// If the entry level rights contain 'add' and 'delete', well, you're an admin
@@ -940,7 +941,7 @@ class kolab_client_task
}
}
}
-
+*/
// Register list of auto-generated fields
$this->output->set_env('auto_fields', $auto_fields);
// Register list of disabled fields
diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php
index 39bc8e3..389e303 100644
--- a/lib/locale/en_US.php
+++ b/lib/locale/en_US.php
@@ -25,7 +25,7 @@ $LANG['domain.type_id'] = 'Standard Domain';
$LANG['error'] = 'Error';
$LANG['form.required.empty'] = 'Some of the required fields are empty!';
-$LANG['form.maxcount.exceeded'] = 'Maximum count of field items exceeded!';
+$LANG['form.maxcount.exceeded'] = 'Maximum count of items exceeded!';
$LANG['group.add'] = 'Add Group';
$LANG['group.add.success'] = 'Group created successfully.';
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index 8488132..8859cc4 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -853,7 +853,7 @@ function kolab_admin()
span = $(this.parentNode.parentNode),
maxcount = $('textarea[name="'+name+'"]').attr('data-maxcount');
- if (maxcount && maxcount <= ('input', span).length) {
+ if (maxcount && maxcount <= span.parent().children().length) {
alert(kadm.t('form.maxcount.exceeded'));
return;
}