From: Chris W. <la...@us...> - 2004-12-05 08:51:52
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/whats_new/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16278/pkg/whats_new/OpenInteract2/Action Modified Files: WhatsNew.pm Log Message: update packages to move as many messages as possible out of code and into message files; use new add_status/add_error shortcuts Index: WhatsNew.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/OpenInteract2/Action/WhatsNew.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WhatsNew.pm 25 Sep 2004 18:20:32 -0000 1.5 --- WhatsNew.pm 5 Dec 2004 08:51:24 -0000 1.6 *************** *** 32,47 **** my @where = ( 'posted_on >= ?', 'posted_on <= ?' ); my @values = ( $then->strftime( $format ), $now->strftime( $format ) ); ! if ( $request->auth_is_admin ) { push @where, 'active = ?'; push @values, 'yes'; } my $iter = eval { ! OpenInteract2::WhatsNew->fetch_iterator( ! { where => join( ' AND ', @where ), ! value => \@values, ! order => 'posted_on DESC' } ) }; if ( $@ ) { ! $self->param_add( error_msg => "Cannot fetch new items: $@" ); } else { --- 32,50 ---- my @where = ( 'posted_on >= ?', 'posted_on <= ?' ); my @values = ( $then->strftime( $format ), $now->strftime( $format ) ); ! ! # non admins only see active items ! if ( ! $request->auth_is_admin ) { push @where, 'active = ?'; push @values, 'yes'; } my $iter = eval { ! OpenInteract2::WhatsNew->fetch_iterator({ ! where => join( ' AND ', @where ), ! value => \@values, ! order => 'posted_on DESC', ! }) }; if ( $@ ) { ! $self->add_error_key( 'whats_new.error.fetch_multiple', $@ ); } else { |