[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> bug_sponsorship_list_view_inc.php (source)

   1  <?php
   2  # Mantis - a php based bugtracking system
   3  
   4  # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   5  # Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   6  
   7  # Mantis is free software: you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation, either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Mantis is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
  19  
  20      # --------------------------------------------------------
  21      # $Id: bug_sponsorship_list_view_inc.php,v 1.16.2.1 2007-10-13 22:32:55 giallu Exp $
  22      # --------------------------------------------------------
  23  ?>
  24  <?php
  25      # This include file prints out the list of users sponsoring the current
  26      # bug.    $f_bug_id must be set to the bug id
  27  
  28      $t_core_path = config_get( 'core_path' );
  29  
  30      require_once( $t_core_path . 'sponsorship_api.php' );
  31      require_once( $t_core_path . 'collapse_api.php' );
  32  
  33      #
  34      # Determine whether the sponsorship section should be shown.
  35      #
  36  
  37      if ( ( config_get( 'enable_sponsorship' ) == ON ) && ( access_has_bug_level( config_get( 'view_sponsorship_total_threshold' ), $f_bug_id ) ) ) {
  38          $t_sponsorship_ids = sponsorship_get_all_ids( $f_bug_id );
  39  
  40          $t_sponsorships_exist = count( $t_sponsorship_ids ) > 0;
  41          $t_can_sponsor = !bug_is_readonly( $f_bug_id ) && !current_user_is_anonymous();
  42  
  43          $t_show_sponsorships = $t_sponsorships_exist || $t_can_sponsor;
  44      } else {
  45          $t_show_sponsorships = false;
  46      }
  47  
  48      #
  49      # Sponsorship Box
  50      #
  51  
  52      if ( $t_show_sponsorships ) {
  53  ?>
  54  
  55  <a name="sponsorships" id="sponsorships"></a> <br />
  56  
  57  <?php
  58      collapse_open( 'sponsorship' );
  59  ?>
  60  
  61  <table class="width100" cellspacing="1">
  62      <tr>
  63          <td width="50" rowspan="3">
  64              <img src="images/dollars.gif" alt="<?php echo lang_get( 'sponsor_verb' ) ?>" border="0" />
  65          </td>
  66          <td class="form-title" colspan="2">
  67              <?php collapse_icon( 'sponsorship' ); ?>
  68          <?php
  69              echo lang_get( 'users_sponsoring_bug' );
  70  
  71              $t_details_url = lang_get( 'sponsorship_process_url' );
  72              if ( !is_blank( $t_details_url ) ) {
  73                  echo '&nbsp;[<a href="' . $t_details_url . '" target="_blank">'
  74                      . lang_get( 'sponsorship_more_info' ) . '</a>]';
  75              }
  76          ?>
  77          </td>
  78      </tr>
  79  
  80  <?php
  81      if ( $t_can_sponsor ) {
  82  ?>
  83      <tr class="row-1">
  84          <td class="category" width="15%"><?php echo lang_get( 'sponsor_issue' ) ?></td>
  85          <td>
  86              <form method="post" action="bug_set_sponsorship.php">
  87                  <?php echo sponsorship_get_currency() ?>
  88                  <input type="hidden" name="bug_id" value="<?php echo $f_bug_id ?>" size="4" />
  89                  <input type="text" name="amount" value="<?php echo config_get( 'minimum_sponsorship_amount' )  ?>" size="4" />
  90                  <input type="submit" class="button" name="sponsor" value="<?php echo lang_get( 'sponsor_verb' ) ?>" />
  91              </form>
  92          </td>
  93      </tr>
  94  <?php
  95      }
  96  
  97      $t_total_sponsorship = bug_get_field( $f_bug_id, 'sponsorship_total' );
  98      if ( $t_total_sponsorship > 0 ) {
  99  ?>
 100      <tr class="row-2">
 101          <td class="category" width="15%"><?php echo lang_get( 'sponsors_list' ) ?></td>
 102          <td>
 103          <?php
 104              echo sprintf( lang_get( 'total_sponsorship_amount' ),
 105                  sponsorship_format_amount( $t_total_sponsorship ) );
 106  
 107              if ( access_has_bug_level( config_get( 'view_sponsorship_details_threshold' )
 108                  , $f_bug_id ) ) {
 109                  echo '<br /><br />';
 110                  $i = 0;
 111                  foreach ( $t_sponsorship_ids as $id ) {
 112                      $t_sponsorship = sponsorship_get( $id );
 113                      $t_date_added = date( config_get( 'normal_date_format' )
 114                          , $t_sponsorship->date_submitted );
 115  
 116                      echo ($i > 0) ? '<br />' : '';
 117                      $i++;
 118  
 119                      echo $t_date_added . ': ';
 120                      print_user( $t_sponsorship->user_id );
 121                      echo ' (' . sponsorship_format_amount( $t_sponsorship->amount ) . ')';
 122                      if ( access_has_bug_level( config_get( 'handle_sponsored_bugs_threshold' ), $f_bug_id ) ) {
 123                          echo ' ' . get_enum_element( 'sponsorship', $t_sponsorship->paid );
 124                      }
 125                  }
 126              }
 127          ?>
 128          </td>
 129          </tr>
 130  <?php
 131          }
 132  ?>
 133  </table>
 134  
 135  <?php
 136      collapse_closed( 'sponsorship' );
 137  ?>
 138  
 139  <table class="width100" cellspacing="1">
 140      <tr>
 141          <td class="form-title">
 142  <?php
 143              collapse_icon( 'sponsorship' );
 144              echo lang_get( 'users_sponsoring_bug' );
 145  
 146              $t_details_url = lang_get( 'sponsorship_process_url' );
 147              if ( !is_blank( $t_details_url ) ) {
 148                  echo '&nbsp;[<a href="' . $t_details_url . '" target="_blank">'
 149                      . lang_get( 'sponsorship_more_info' ) . '</a>]';
 150              }
 151  ?>
 152  
 153  <?php
 154      $t_total_sponsorship = bug_get_field( $f_bug_id, 'sponsorship_total' );
 155      if ( $t_total_sponsorship > 0 ) {
 156          echo ' <span style="font-weight: normal;">(';
 157          echo sprintf( lang_get( 'total_sponsorship_amount' ),
 158              sponsorship_format_amount( $t_total_sponsorship ) );
 159          echo ')</span>';
 160      }
 161  ?>
 162          </td>
 163      </tr>
 164  </table>
 165  
 166  <?php
 167      collapse_end( 'sponsorship' );
 168  } # If sponsorship enabled
 169  ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics