It's not possible to delete any group that has at least 1 member since
'group still has members' shows up and one cannot remove all members from
the group. This can be solved by adding additional empty <option
value=""></option> in page 'Admin Root/group' (lines around 102 or so):

/* old code */
 <h3>Members:</h3>
 <? if ($action) { ?>
 <select name="members[]" multiple size="10">
 <?   if ($p = mgd_list_persons())

        $m = mgd_list_members($group->id);
        if ($m) $m->fetch();
        while ($p->fetch())

          if ($m && $p->id == $m->uid) { ?>
   <option value="&(p.id);" selected>&(p.rname);</option>
 <?         $m->fetch();
          } else { ?>
   <option value="&(p.id);">&(p.rname);</option>
 <?        }
        }
      } ?>
 </select>
 <? } else { ?>
/* */

/* new code */
 <h3>Members:</h3>
 <? if ($action) { ?>
 <select name="members[]" multiple size="10">
 <?   if ($p = mgd_list_persons())

        $m = mgd_list_members($group->id);
        if ($m) $m->fetch();
        while ($p->fetch())

          if ($m && $p->id == $m->uid) { ?>
   <option value="&(p.id);" selected>&(p.rname);</option>
 <?         $m->fetch();
          } else { ?>
   <option value="&(p.id);">&(p.rname);</option>
 <?        }
        }
      } ?>
 <option value=""></option>  # this line was added
 </select>
 <? } else { ?>
/* */

Solving this leads us to another problem :(

Seems that mgd_delete_group() doesn't do its job. Even though no more
persons are members of given group, mgd_delete_group() fails do delete the
group and returns false. That leads to looping the user in the 'Do you
really want to delete this group record?' page.

Vanja


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to