Projects
Kolab:16
kolab-webadmin
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
kolab-webadmin-3.2.12.tar.gz/lib/client/kolab_client_task_settings.php
Changed
@@ -166,7 +166,7 @@ } /** - * Groups list action. + * Object types list action. */ public function action_type_list() { @@ -342,12 +342,50 @@ } /** - * Group information (form) action. + * Object type information (form) action. */ public function action_type_info() { - $id = $this->get_input('id', 'POST'); - $data = array(); + $id = $this->get_input('id', 'POST'); + $result = $this->read_type_data($id); + + $output = $this->type_form($result['attribs'], $result['data']); + + $this->output->set_object('taskcontent', $output); + } + + /** + * Object type adding (form) action. + */ + public function action_type_add() + { + if ($clone_id = $this->get_input('clone_id', 'POST')) { + $result = $this->read_type_data($clone_id); + $data = $result['data']; + + unset($data['id'], $data['is_default'], $data['key'], $data['name']); + } + + if (empty($data)) { + $data = $this->get_input('data', 'POST'); + + if (empty($data['type'])) { + $data['type'] = self::get_input('type', 'POST'); + if (empty($data['type']) || !in_array($data['type'], $this->object_types)) { + $data['type'] = 'user'; + } + } + } + + $output = $this->type_form(null, $data, true); + + $this->output->set_object('taskcontent', $output); + } + + private function read_type_data($id, $clone = false) + { + $data = array(); + $attribs = array(); list($type, $idx) = explode(':', $id); @@ -364,30 +402,20 @@ $data['objectclass'] = $data['attributes']['fields']['objectclass']; unset($data['attributes']['fields']['objectclass']); - } - - $output = $this->type_form(null, $data); - - $this->output->set_object('taskcontent', $output); - } - - /** - * Groups adding (form) action. - */ - public function action_type_add() - { - $data = $this->get_input('data', 'POST'); - if (empty($data['type'])) { - $data['type'] = self::get_input('type', 'POST'); - if (empty($data['type']) || !in_array($data['type'], $this->object_types)) { - $data['type'] = 'user'; + // enable Clone button + if (!$clone) { + $caps_actions = $this->get_capability('actions'); + if (!empty($caps_actions['type.add'])) { + $attribs = array('clone-button' => 'settings.type_clone'); + } } } - $output = $this->type_form(null, $data, true); - - $this->output->set_object('taskcontent', $output); + return array( + 'data' => $data, + 'attribs' => $attribs, + ); } /** @@ -395,6 +423,10 @@ */ private function type_form($attribs, $data = array()) { + if (!is_array($attribs)) { + $attribs = array(); + } + if (empty($attribs['id'])) { $attribs['id'] = 'type-form'; }
View file
kolab-webadmin-3.2.12.tar.gz/lib/kolab_api_service.php
Changed
@@ -707,9 +707,11 @@ } // Get the domain information for expansion later - $auth = Auth::get_instance(); + $auth = Auth::get_instance(); $domain_info = $auth->domain_info($_SESSION['user']->get_domain()); - $domain_info = $domain_info[key($domain_info)]; + $domain_info = empty($domain_info) ? null : $domain_info[key($domain_info)]; + + $dba = 'inetdomainbasedn'; $dna = $this->conf->get('domain_name_attribute'); if (empty($dna)) { @@ -721,8 +723,6 @@ $domain = $domain[0]; } - $dba = 'inetdomainbasedn'; - if (empty($domain_info[$dba])) { $this->base_dn = 'dc=' . implode(',dc=', explode('.', $domain)); } else {
View file
kolab-webadmin-3.2.12.tar.gz/lib/kolab_client_task.php
Changed
@@ -1474,10 +1474,11 @@ $form->add_button(array( 'value' => kolab_html::escape($this->translate('button.submit')), 'onclick' => "kadm.command('{$name}.save')", + 'class' => 'submit', )); } - // add delete button + // add Delete button if ($this->is_deletable($data)) { $id = $data['id']; $form->add_button(array( @@ -1486,6 +1487,15 @@ )); } + // add Clone button + if (!empty($attribs['clone-button'])) { + $id = $data['id']; + $form->add_button(array( + 'value' => kolab_html::escape($this->translate('button.clone')), + 'onclick' => "kadm.command('{$attribs['clone-button']}', '{$id}')", + )); + } + $ac_min_len = $this->config_get('autocomplete_min_length', 1, Conf::INT); $this->output->set_env('form_id', $attribs['id']); @@ -1631,12 +1641,42 @@ $attrs = $this->get_search_attribs($field); $search_request = array(); - foreach ($attrs as $attr) { - $search_request[$attr] = array( - 'value' => $search, - 'type' => $method, + // Support attribute=value searches + if ($task != 'settings' && preg_match('/^([a-z0-9]+)([~<>]*=)(.+)$/i', $search, $m)) { + $search_attr = $m[1]; + $search_type = $m[2]; + $search_value = $m[3]; + + if ($search_value === '*') { + $search_type = 'exists'; + $search_value = ''; + } + else if ($search_value[0] === '*' && $search_value[strlen($search_value)-1] === '*') { + $search_type = 'both'; + $search_value = substr($search_value, 1, -1); + } + else if ($search_value[0] === '*') { + $search_type = 'suffix'; + $search_value = substr($search_value, 1); + } + else if ($search_value[strlen($search_value)-1] === '*') { + $search_type = 'prefix'; + $search_value = substr($search_value, 0, -1); + } + + $search_request[$search_attr] = array( + 'value' => $search_value, + 'type' => $search_type, ); } + else { + foreach ($attrs as $attr) { + $search_request[$attr] = array( + 'value' => $search, + 'type' => $method, + ); + } + } } else if (!empty($_POST['search_request'])) { $search_request = self::get_input('search_request', 'POST');
View file
kolab-webadmin-3.2.12.tar.gz/lib/locale/en_US.php
Changed
@@ -115,6 +115,7 @@ $LANG['attribute.validate.extended'] = 'extended'; $LANG['button.cancel'] = 'Cancel'; +$LANG['button.clone'] = 'Clone'; $LANG['button.delete'] = 'Delete'; $LANG['button.ok'] = 'OK'; $LANG['button.save'] = 'Save';
View file
kolab-webadmin-3.2.12.tar.gz/public_html/js/kolab_admin.js
Changed
@@ -2595,6 +2595,11 @@ this.http_post('settings.type_add', {type: $('#type_list_filter').val()}); }; + this.settings_type_clone = function(id) + { + this.http_post('settings.type_add', {type: $('#type_list_filter').val(), clone_id: id}); + }; + this.settings_type_list = function(props) { if (!props) @@ -3433,13 +3438,7 @@ if (str.charAt(0) == '"') str = str.replace(/^"/, '').replace(/"$/, '') - .replace(/\\(.?)/g, function(s, n1) { - switch (n1) { - case '\\': - return '\\'; - return n1; - } - }); + .replace(/\\(.?)/g, function(s, n1) { return n1; }); return str; };
View file
kolab-webadmin-3.2.12.tar.gz/public_html/skins/default/style.css
Changed
@@ -385,7 +385,6 @@ #searchinput { border: none; background-color: white; - margin-top: 2px; } #searchinput:focus { @@ -510,6 +509,10 @@ white-space: nowrap; } +.formbuttons .submit { + font-weight: bold; +} + .formbuttons input { margin: 5px; }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.