X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=licom.cgi;h=70e1e723c5bfb08c3360c02a7034db13a0c7c027;hb=5f2d1b06439017be5f85c250982b01a4befae508;hp=f0dfd12840145e3fff0aed689e265d919e7a97d7;hpb=328bdcb841ecaa72c69379e6ccd7165f44e7c2e4;p=licom.git diff --git a/licom.cgi b/licom.cgi index f0dfd12..70e1e72 100755 --- a/licom.cgi +++ b/licom.cgi @@ -1,5 +1,21 @@ #!/usr/bin/perl +# LiCoM - Lightweight contact manager +# Copyright (c) 2005-2006 Florian octo Forster +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; only version 2 of the License is applicable. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software # Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + use strict; use warnings; use lib (qw(lib)); @@ -109,85 +125,60 @@ sub action_browse $group = shift if (@_); $group ||= ''; - return (''); - - my @all; - if ($group) - { - @all = LiCoM::Person->search ([[group => $group]]); - } - else - { - @all = LiCoM::Person->search (); - } - if (!$group) { - my @nogroup = (); - my %groups = (); - for (@all) - { - my $person = $_; - my @g = $person->get ('group'); - - $groups{$_} = (defined ($groups{$_}) ? $groups{$_} + 1 : 1) for (@g); - - push (@nogroup, $person) if (!@g); - } - @all = @nogroup; + my @groups = LiCoM::Group->all (); print qq(\t\t

Contact Groups

\n\t\t\n\n); - } - - if ($group) - { - print qq(\t\t

Contact Group "$group"

\n); + print < + +EOF } else { - print qq(\t\t

Contacts without a group

\n); - } - - print qq(\t\t\n\n); + my $group_obj = LiCoM::Group->load ($group); + my $group_esc = uri_escape ($group_obj->name ()); + my @member_names = $group_obj->get_members (); + + print qq(\t\t

Contact Group "$group"

\n), + qq(\t\t