summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 44f2065)
raw | patch | inline | side by side (parent: 44f2065)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 20 Apr 2010 13:46:41 +0000 (13:46 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 20 Apr 2010 13:46:41 +0000 (13:46 +0000) |
-Multi edit still missing
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17744 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17744 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/groups/class_group.inc | patch | blob | history | |
gosa-core/plugins/admin/groups/generic.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc
index ac7ebe894a93bd2c5cdd5056d139f546868753cb..330718c50e9417921cadabd00199af8b558247f6 100644 (file)
$this->baseSelector->setHeight(300);
$this->baseSelector->update(true);
+ // Prepare lists
+ $this->memberList = new sortableListing();
+ $this->memberList->setDeleteable(true);
+ $this->memberList->setInstantDelete(true);
+ $this->memberList->setEditable(false);
+ $this->memberList->setWidth("100%");
+ $this->memberList->setHeight("300px");
+ $this->memberList->setHeader(array('~',_("Given name"),_("Surename"),_("Uid")));
+ $this->memberList->setColspecs(array('20px','*','*','*','20px'));
+ $this->memberList->setDefaultSortColumn(1);
+
$this->reload(TRUE);
}
}
/* Delete user from group */
- if (isset($_POST['del_users']) && isset($_POST['members']) && preg_match("/w/",$this->getacl("memberUid"))){
- foreach ($_POST['members'] as $value){
+ $this->memberList->save_object();
+ $action = $this->memberList->getAction();
+ if($action['action'] == 'delete' && preg_match("/w/",$this->getacl("memberUid"))){
+ foreach ($action['targets'] as $id){
+ $value = $this->memberList->getKey($id);
unset ($this->members["$value"]);
$this->removeUser($value);
}
/* Members and users */
- $smarty->assign("members", $this->members);
+ $this->memberList->setAcl($this->getacl("memberUid"));
+ $data = $lData = array();
+
+ foreach($this->members as $uid => $member){
+
+ $data[$uid] = $member;
+ $givenName = $sn = _("Unknown");
+ if(isset($member['sn'][0])) $sn = $member['sn'][0];
+ if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
+
+ $image = image('images/false.png');
+ if(isset($member['sn'])){
+ $image = image('plugins/users/images/select_user.png');
+ }
+
+ $lData[$uid] = array('data' => array($image,$sn, $givenName, $uid));
+ }
+
+ $this->memberList->setListData($data,$lData);
+ $this->memberList->update();
+
+ $smarty->assign("memberList", $this->memberList->render());
/* Checkboxes */
foreach (array("force_gid", "smbgroup") as $val){
}else{
while($attrs = $ldap->fetch()){
$this->dnMapping[$attrs['uid'][0]] = $attrs['dn'];
- $this->members[$attrs['uid'][0]] = $this->createResultName($attrs);
- $this->allusers[$attrs['uid'][0]]= $this->createResultName($attrs);
+ $this->members[$attrs['uid'][0]] = $attrs;
+ $this->allusers[$attrs['uid'][0]]= $atrts;
}
}
}
$ldap->search("(&(objectClass=gosaAccount)(|".$filter."))",array("dn", "uid","sn","givenName"));
while($attrs = $ldap->fetch()){
$this->dnMapping[$attrs['uid'][0]] = $attrs['dn'];
- $this->members[$attrs['uid'][0]] = $this->createResultName($attrs);
- $this->allusers[$attrs['uid'][0]]= $this->createResultName($attrs);
+ $this->members[$attrs['uid'][0]] = $attrs;
+ $this->allusers[$attrs['uid'][0]]= $attrs;
}
}
count($this->memberUid) < $this->config->get_cfg_value("ldapFilterNestingLimit")){
foreach ($this->memberUid as $value){
if(!isset($this->members[$value])){
- $this->members[$value] = _("! unknown UID")." [".$value."]";
+ $this->members[$value] = "";
}
}
}else{
foreach ($this->memberUid as $value){
- $this->members[$value] = $value;
+ $this->members[$value] = "";
}
}
-
- /* Sort lists */
- natcasesort($this->members);
- reset($this->members);
}
diff --git a/gosa-core/plugins/admin/groups/generic.tpl b/gosa-core/plugins/admin/groups/generic.tpl
index 5e4c64ade37dde90b4453549106bbcdbb49559e0..0df8e52d17e61ab055f45da0f62a0d8d06ba5056 100644 (file)
<td style="width:50%">
<b><LABEL for="members">{t}Group members{/t}</LABEL></b>
<br>
-{render acl=$memberUidACL}
{if $multiple_support}
+{render acl=$memberUidACL}
<select style="width:100%; height:380px;" id="members" name="members[]" size=15 multiple>
{foreach from=$memberUid_All item=name key=key}
<option value="{$key}">{$name} ({t}In all groups{/t})</option>
<option value="{$key}" style='color: #888888; background: #DDDDDD;background-color: #DDDDDD;'>{$name} ({t}Not in all groups{/t})</option>
{/foreach}
</select>
+{/render}
{else}
- <select style="width:100%; height:380px;" id="members" name="members[]" size=15 multiple>
- {html_options options=$members}
- <option disabled> </option>
- </select>
+ {render acl=$memberUidACL}
+ {$memberList}
+ {/render}
{/if}
-{/render}
<br>
{render acl=$memberUidACL}
<button type='submit' name='edit_membership'>{msgPool type=addButton}</button>