Changeset 10253 for trunk/gsdl/perllib/classify/DateList.pm
- Timestamp:
- 2005-07-19T16:18:25+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/DateList.pm
r10218 r10253 43 43 use sorttools; 44 44 45 use strict; 46 no strict 'refs'; # allow filehandles to be variables and viceversa 47 45 48 sub BEGIN { 46 @ ISA = ('BasClas');49 @DateList::ISA = ('BasClas'); 47 50 } 48 51 … … 88 91 my $self = (defined $hashArgOptLists)? new BasClas($classifierslist,$inputargs,$hashArgOptLists): new BasClas($classifierslist,$inputargs); 89 92 93 if ($self->{'info_only'}) { 94 # don't worry about any options etc 95 return bless $self, $class; 96 } 97 90 98 # Manually set $self parameters. 91 99 $self->{'list'} = {}; … … 172 180 # classifications, unless nogroup is specified 173 181 if ((scalar @$classlistref) <= 39 && !$self->{'nogroup'}) { 174 foreach $subOID (@$classlistref) {182 foreach my $subOID (@$classlistref) { 175 183 push (@{$classifyinfo->{'contains'}}, {'OID'=>$subOID}); 176 184 } … … 184 192 if (!$self->{'nogroup'}) { # hlist of year+month pairs 185 193 # single level of classifications 186 foreach $classification (@$classlistref) {194 foreach my $classification (@$classlistref) { 187 195 my $date = $self->{'list'}->{$classification}; 188 196 $date =~ s/^(\d\d\d\d)(\d\d).*$/$1 _textmonth$2_/; … … 196 204 197 205 } else { # don't group - individual years and months 198 foreach $classification (@$classlistref) {206 foreach my $classification (@$classlistref) { 199 207 my $date = $self->{'list'}->{$classification}; 200 208 $date =~ s/^(\d\d\d\d)(\d\d).*$/$1 _textmonth$2_/; … … 223 231 push (@{$yearclassify->{'contains'}}, $monthclassify); 224 232 225 foreach $subsubOID233 foreach my $subsubOID 226 234 (@{$classhash->{$subclass}->{$subsubclass}}) { 227 235 push (@{$monthclassify->{'contains'}}, … … 236 244 # not by month 237 245 # first split up the list into separate year classifications 238 foreach $classification (@$classlistref) {246 foreach my $classification (@$classlistref) { 239 247 my $date = $self->{'list'}->{$classification}; 240 248 $date =~ s/^(\d\d\d\d).*$/$1/; … … 248 256 $classhash = $self->compactlist ($classhash); 249 257 } 250 foreach $subclass (sort keys %$classhash) {258 foreach my $subclass (sort keys %$classhash) { 251 259 my $tempclassify = $self->get_entry($subclass, "DateList"); 252 foreach $subsubOID (@{$classhash->{$subclass}}) {260 foreach my $subsubOID (@{$classhash->{$subclass}}) { 253 261 push (@{$tempclassify->{'contains'}}, {'OID'=>$subsubOID}); 254 262 }
Note:
See TracChangeset
for help on using the changeset viewer.