summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-03-22 11:42:35 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-03-22 11:42:35 (GMT)
commit1f2c4ec5addba60c4a18194921f7a400df6e9a72 (patch)
tree97411fa58ee35d3700488f53f3fd5a8d7dfdd413
parent872efd8546d41e1d779a9eb73ec45c86a4a3068d (diff)
parent4d901b663d456917c163e4968383e1b99ad96e18 (diff)
downloadkolab-wap-1f2c4ec5addba60c4a18194921f7a400df6e9a72.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/kolab-wap
-rw-r--r--lib/client/kolab_client_task_group.php48
-rw-r--r--public_html/skins/default/templates/group.html4
-rw-r--r--public_html/skins/default/templates/user.html2
-rw-r--r--public_html/skins/default/ui.js8
4 files changed, 45 insertions, 17 deletions
diff --git a/lib/client/kolab_client_task_group.php b/lib/client/kolab_client_task_group.php
index 821d438..dd6e0e4 100644
--- a/lib/client/kolab_client_task_group.php
+++ b/lib/client/kolab_client_task_group.php
@@ -61,7 +61,6 @@ class kolab_client_task_group extends kolab_client_task
'page' => $page,
);
-/*
// search parameters
if (!empty($_POST['search'])) {
$search = self::get_input('search', 'POST', true);
@@ -84,7 +83,7 @@ class kolab_client_task_group extends kolab_client_task
$post['search'] = $search_request;
$post['search_operator'] = 'OR';
}
-*/
+
// get groups list
$result = $this->api->post('groups.list', null, $post);
$count = (int) $result->get('count');
@@ -178,14 +177,6 @@ class kolab_client_task_group extends kolab_client_task
}
/**
- * Group search action.
- */
- public function search_form()
- {
- return '';
- }
-
- /**
* Groups adding (form) action.
*/
public function action_add()
@@ -219,6 +210,7 @@ class kolab_client_task_group extends kolab_client_task
'gidnumber' => 'system',
'mail' => 'system',
'uniquemember' => 'system',
+ 'memberurl' => 'system',
);
// Prepare fields
@@ -323,4 +315,40 @@ $fields['debug'] = array(
return $_SESSION['group_types'];
}
+
+ /**
+ * Users search form.
+ *
+ * @return string HTML output of the form
+ */
+ public function search_form()
+ {
+ $form = new kolab_form(array('id' => 'search-form'));
+
+ $form->add_section('criteria', kolab_html::escape($this->translate('search.criteria')));
+ $form->add_element(array(
+ 'section' => 'criteria',
+ 'label' => $this->translate('search.field'),
+ 'name' => 'field',
+ 'type' => kolab_form::INPUT_SELECT,
+ 'options' => array(
+ 'cn' => kolab_html::escape($this->translate('search.name')),
+ 'mail' => kolab_html::escape($this->translate('search.email')),
+ ),
+ ));
+ $form->add_element(array(
+ 'section' => 'criteria',
+ 'label' => $this->translate('search.method'),
+ 'name' => 'method',
+ 'type' => kolab_form::INPUT_SELECT,
+ 'options' => array(
+ 'both' => kolab_html::escape($this->translate('search.contains')),
+ 'exact' => kolab_html::escape($this->translate('search.is')),
+ 'prefix' => kolab_html::escape($this->translate('search.prefix')),
+ ),
+ ));
+
+ return $form->output();
+ }
+
}
diff --git a/public_html/skins/default/templates/group.html b/public_html/skins/default/templates/group.html
index fafcc01..0360bec 100644
--- a/public_html/skins/default/templates/group.html
+++ b/public_html/skins/default/templates/group.html
@@ -1,9 +1,8 @@
<div id="toc" class="group">
-<!--
<div id="search">
<div class="searchinput">
<input type="text" id="searchinput" name="search" value="{$engine->translate('search')}" />
- <script type="text/javascript">search_init()</script>
+ <script type="text/javascript">search_init('group')</script>
<span class="searchactions">
<span id="search-details" title="{$engine->translate('search.criteria')}" onclick="search_details()"></span>
<span id="search-reset" title="{$engine->translate('search.reset')}" onclick="search_reset()"></span>
@@ -11,7 +10,6 @@
</div>
<div class="searchdetails">{$engine->search_form()}</div>
</div>
--->
<div id="grouplist"></div>
</div>
<div class="vsplitter">&nbsp;</div>
diff --git a/public_html/skins/default/templates/user.html b/public_html/skins/default/templates/user.html
index 0e7dd8f..1c5e732 100644
--- a/public_html/skins/default/templates/user.html
+++ b/public_html/skins/default/templates/user.html
@@ -2,7 +2,7 @@
<div id="search">
<div class="searchinput">
<input type="text" id="searchinput" name="search" value="{$engine->translate('search')}" />
- <script type="text/javascript">search_init()</script>
+ <script type="text/javascript">search_init('user')</script>
<span class="searchactions">
<span id="search-details" title="{$engine->translate('search.criteria')}" onclick="search_details()"></span>
<span id="search-reset" title="{$engine->translate('search.reset')}" onclick="search_reset()"></span>
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index 80be561..3e90153 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -24,8 +24,10 @@
/**
* Search form events
*/
-function search_init()
+function search_init(task)
{
+ kadm.env.search_task = task;
+
$('#searchinput').addClass('inactive')
.blur(function() {
if (this.value == '')
@@ -36,7 +38,7 @@ function search_init()
var props = kadm.serialize_form('#search-form');
props.search = this.value;
- kadm.command('user.list', props);
+ kadm.command(kadm.env.search_task + '.list', props);
}
})
.focus(function() {
@@ -51,7 +53,7 @@ function search_reset()
input.val(kadm.t('search')).addClass('inactive');
- kadm.command('user.list', {search: ''});
+ kadm.command(kadm.env.search_task + '.list', {search: ''});
}
function search_details()