summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-03-22 09:33:32 (GMT)
committerAleksander Machniak <alec@alec.pl>2012-03-22 09:33:32 (GMT)
commita70979b8555b6c009c882766fb434884c9371dc9 (patch)
tree76a3d72a636139b1a45dfdc7662c4a3c177f325f
parent5d0cf20bd602428c5ed79f2807ebf12f9d15c19d (diff)
downloadkolab-wap-a70979b8555b6c009c882766fb434884c9371dc9.tar.gz
Unify 'dn' item usage
-rw-r--r--lib/client/kolab_client_task_group.php8
-rw-r--r--lib/client/kolab_client_task_user.php4
-rw-r--r--lib/kolab_client_task.php5
3 files changed, 9 insertions, 8 deletions
diff --git a/lib/client/kolab_client_task_group.php b/lib/client/kolab_client_task_group.php
index 2882163..7d0dc77 100644
--- a/lib/client/kolab_client_task_group.php
+++ b/lib/client/kolab_client_task_group.php
@@ -170,7 +170,7 @@ class kolab_client_task_group extends kolab_client_task
$result = $this->api->get('group.info', array('group' => $id));
$group = $result->get($id);
- $group['group'] = $id;
+ $group['dn'] = $id;
$output = $this->group_form(null, $group);
$this->output->set_object('taskcontent', $output);
@@ -216,7 +216,7 @@ class kolab_client_task_group extends kolab_client_task
// Prepare fields
list($fields, $types, $type) = $this->form_prepare('group', $data);
- $add_mode = empty($data['group']);
+ $add_mode = empty($data['dn']);
$accttypes = array();
foreach ($types as $idx => $elem) {
@@ -254,7 +254,7 @@ class kolab_client_task_group extends kolab_client_task
}
// Members (get member names)
- if (!empty($data['group'])) {
+ if (!$add_mode) {
// find members attribute name
foreach (array('member', 'uniquemember') as $attr) {
if (isset($fields[$attr]) && isset($data[$attr])) {
@@ -262,7 +262,7 @@ class kolab_client_task_group extends kolab_client_task
}
}
if (!empty($attr_name)) {
- $result = $this->api->get('group.members_list', array('group' => $data['group']));
+ $result = $this->api->get('group.members_list', array('group' => $data['dn']));
$list = (array) $result->get('list');
$data[$attr_name] = $this->parse_members($list);
}
diff --git a/lib/client/kolab_client_task_user.php b/lib/client/kolab_client_task_user.php
index d53318d..2f5d05a 100644
--- a/lib/client/kolab_client_task_user.php
+++ b/lib/client/kolab_client_task_user.php
@@ -169,7 +169,7 @@ class kolab_client_task_user extends kolab_client_task
$id = $this->get_input('id', 'POST');
$result = $this->api->get('user.info', array('user' => $id));
$user = $result->get($id);
- $user['user'] = $id;
+ $user['dn'] = $id;
$output = $this->user_form(null, $user);
$this->output->set_object('taskcontent', $output);
@@ -247,7 +247,7 @@ class kolab_client_task_user extends kolab_client_task
// Prepare fields
list($fields, $types, $type) = $this->form_prepare('user', $data, array('userpassword2'));
- $add_mode = empty($data['user']);
+ $add_mode = empty($data['dn']);
$accttypes = array();
foreach ($types as $idx => $elem) {
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index a9c835e..d8c3fd8 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -646,7 +646,7 @@ class kolab_client_task
{
$types = (array) $this->{$name . '_types'}();
$form_id = $attribs['id'];
- $add_mode = empty($data[$name]);
+ $add_mode = empty($data['dn']);
$event_fields = array();
$auto_fields = array();
@@ -746,6 +746,7 @@ class kolab_client_task
}
else {
// Add debug information
+ ksort($data);
$debug = kolab_html::escape(print_r($data, true));
$debug = preg_replace('/(^Array\n\(|\n*\)$|\t)/', '', $debug);
$debug = str_replace("\n ", "\n", $debug);
@@ -869,7 +870,7 @@ class kolab_client_task
'onclick' => "kadm.{$name}_save()",
));
- if ($data[$name]) {
+ if (!empty($data['dn'])) {
$id = $data[$name];
$form->add_button(array(
'value' => kolab_html::escape($this->translate('delete.button')),