Ticket #85: filter_context_comment.patch

File filter_context_comment.patch, 1.7 KB (added by dimadin, 17 months ago)
  • gp-includes/things/translation.php

     
    9999                } elseif ( 'no' == gp_array_get( $filters, 'warnings' ) ) { 
    100100                        $where[] = 't.warnings IS NULL'; 
    101101                } 
    102          
     102                if ( 'yes' == gp_array_get( $filters, 'with_context' ) ) { 
     103                        $where[] = 'o.context IS NOT NULL'; 
     104                } 
     105                if ( 'yes' == gp_array_get( $filters, 'with_comment' ) ) { 
     106                        $where[] = 'o.comment IS NOT NULL AND o.comment <> ""'; 
     107                } 
     108 
    103109                if ( gp_array_get( $filters, 'user_login' ) ) { 
    104110                        $user = GP::$user->by_login( $filters['user_login'] ); 
    105111                        // do not return any entries if the user doesn't exist 
  • gp-templates/translations.php

     
    6868                                ), gp_array_get( $filters, 'translated', 'either' ) ); 
    6969                        ?> 
    7070                </dd> 
    71                  
     71 
     72                <dd> 
     73                        <input type="checkbox" name="filters[with_comment]" value="yes" id="filters[with_comment][yes]" <?php gp_checked( 'yes' == gp_array_get( $filters, 'with_comment' ) ); ?>><label for='filters[with_comment][yes]'><?php _e( 'With comment' ); ?></label><br /> 
     74                        <input type="checkbox" name="filters[with_context]" value="yes" id="filters[with_context][yes]" <?php gp_checked( 'yes' == gp_array_get( $filters, 'with_context' ) ); ?>><label for='filters[with_context][yes]'><?php _e( 'With context' ); ?></label> 
     75                </dd> 
     76 
    7277                <dt><label><?php _e('Status:'); ?></label></dt> 
    7378                <dd> 
    7479                        <?php echo gp_radio_buttons('filters[status]', //TODO: show only these, which user is allowed to see afterwards