[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/items/views/ -> _item_list_track.view.php (source)

   1  <?php
   2  /**

   3   * This file implements the post browsing in tracker mode

   4   *

   5   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.

   6   * See also {@link http://sourceforge.net/projects/evocms/}.

   7   *

   8   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}.

   9   * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.

  10   *

  11   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)

  12   *

  13   * @package admin

  14   *

  15   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  16   * @author fplanque: Francois PLANQUE.

  17   *

  18   * @version $Id: _item_list_track.view.php,v 1.3 2007/09/26 20:26:36 fplanque Exp $

  19   */
  20  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  21  
  22  /**

  23   * @var Blog

  24   */
  25  global $Blog;
  26  /**

  27   * @var ItemList2

  28   */
  29  global $ItemList;
  30  
  31  global $edit_item_url, $delete_item_url;
  32  
  33  
  34  if( $highlight = param( 'highlight', 'integer', NULL ) )
  35  {    // There are lines we want to highlight:
  36      $result_fadeout = array( 'post_ID' => array($highlight) );
  37  }
  38  else
  39  {    // Nothing to highlight
  40      $result_fadeout = NULL;
  41  }
  42  
  43  
  44  // Display title depending on selection params:

  45  echo $ItemList->get_filter_title( '<h2>', '</h2>', '<br />', NULL, 'htmlbody' );
  46  
  47  /*

  48      **

  49       * Callback to add filters on top of the result set

  50       *

  51      function filter_on_post_title( & $Form )

  52      {

  53          global $pagenow, $post_filter;

  54  

  55          $Form->hidden( 'filter_on_post_title', 1 );

  56          $Form->text( 'post_filter', $post_filter, 20, T_('Task title'), '', 60 );

  57      }

  58      $ItemList->filters_callback = 'filter_on_post_title';

  59  */
  60  
  61  
  62  $ItemList->title = T_('Task list');
  63  
  64  
  65  $ItemList->cols[] = array(
  66                          'th' => /* TRANS: abbrev for Priority */ T_('P'),
  67                          'order' => 'priority',
  68                          'th_class' => 'shrinkwrap',
  69                          'td_class' => 'center tskst_$post_pst_ID$',
  70                          'td' => '$post_priority$',
  71                      );
  72  
  73  
  74  /**

  75   * Task title

  76   */
  77  function task_title_link( $Item )
  78  {
  79      global $current_User;
  80  
  81      $col = '';
  82  
  83      $Item->get_Blog();
  84    if( $Item->Blog->allowcomments != 'never' )
  85      {    // The current blog can have comments:
  86          $nb_comments = generic_ctp_number($Item->ID, 'feedback');
  87          $col .= '<a href="?ctrl=items&amp;blog='.$Item->blog_ID.'&amp;p='.$Item->ID.'"
  88                          title="'.sprintf( T_('%d feedbacks'), $nb_comments ).'" class="">';
  89          if( $nb_comments )
  90          {
  91              $col .= get_icon( 'comments' );
  92          }
  93          else
  94          {
  95              $col .= get_icon( 'nocomment' );
  96          }
  97          $col .= '</a> ';
  98      }
  99  
 100      $col .= '<a href="?ctrl=items&amp;blog='.$Item->blog_ID.'&amp;p='.$Item->ID.'" class="" title="'.
 101                                  T_('Edit this task...').'">'.$Item->dget('title').'</a></strong>';
 102  
 103      return $col;
 104  }
 105  $ItemList->cols[] = array(
 106                          'th' => T_('Task'),
 107                          'order' => 'title',
 108                          'td_class' => 'tskst_$post_pst_ID$',
 109                          'td' => '<strong lang="@get(\'locale\')@">%task_title_link( {Obj} )%</strong>',
 110                      );
 111  
 112  
 113  /**

 114   * Visibility:

 115   */
 116  function item_visibility( $Item )
 117  {
 118      // Display publish NOW button if current user has the rights:

 119      $r = $Item->get_publish_link( ' ', ' ', get_icon( 'publish' ), '#', '' );
 120  
 121      // Display deprecate if current user has the rights:

 122      $r .= $Item->get_deprecate_link( ' ', ' ', get_icon( 'deprecate' ), '#', '' );
 123  
 124      return $r;
 125  }
 126  $ItemList->cols[] = array(
 127                          'th' => T_('Visibility'),
 128                          'order' => 'status',
 129                          'th_class' => 'shrinkwrap',
 130                          'td_class' => 'shrinkwrap',
 131                          'td' => '%item_visibility( {Obj} )%',
 132                  );
 133  $ItemList->cols[] = array(
 134                          'th' => T_('Visibility'),
 135                          'order' => 'status',
 136                          'th_class' => 'shrinkwrap',
 137                          'td_class' => 'tskst_$post_pst_ID$ nowrap',
 138                          'td' => '@get( \'t_status\' )@',
 139                  );
 140  
 141  
 142  $ItemList->cols[] = array(
 143                          'th' => T_('Status'),
 144                          'order' => 'pst_ID',
 145                          'th_class' => 'shrinkwrap',
 146                          'td_class' => 'tskst_$post_pst_ID$ nowrap',
 147                          'td' => '@get(\'t_extra_status\')@',
 148                      );
 149  
 150  $ItemList->cols[] = array(
 151                          'th' => T_('Type'),
 152                          'order' => 'ptyp_ID',
 153                          'th_class' => 'shrinkwrap',
 154                          'td_class' => 'tskst_$post_pst_ID$ nowrap',
 155                          'td' => '@get(\'t_type\')@',
 156                      );
 157  
 158  $ItemList->cols[] = array(
 159                          'th' => T_('ID'),
 160                          'order' => 'ID',
 161                          'th_class' => 'shrinkwrap',
 162                          'td_class' => 'tskst_$post_pst_ID$ shrinkwrap',
 163                          'td_class' => 'center',
 164                          'td' => '$post_ID$',
 165                      );
 166  
 167  $ItemList->cols[] = array(
 168                          'th' => T_('Assigned'),
 169                          'order' => 'assigned_user_ID',
 170                          'th_class' => 'shrinkwrap',
 171                          'td' => '@get(\'t_assigned_to\')@',
 172                      );
 173  
 174  
 175  /**

 176   * Deadline

 177   */
 178  /*

 179  function deadline( $date )

 180  {

 181      global $localtimenow;

 182  

 183      $timestamp = mysql2timestamp( $date );

 184  

 185       if( $timestamp <= 0 )

 186      {

 187          return '&nbsp;';    // IE needs that crap in order to display cell border :/

 188      }

 189  

 190      $output = mysql2localedate( $date );

 191  

 192      if( $timestamp < $localtimenow )

 193      {

 194          $output =  '<span class="past_deadline">! '.$output.'</span>';

 195      }

 196  

 197      return $output;

 198  }

 199  $ItemList->cols[] = array(

 200                          'th' => T_('Deadline'),

 201                          'order' => 'post_datedeadline',

 202                          'td_class' => 'center tskst_$post_pst_ID$',

 203                          'td' => '%deadline( #post_datedeadline# )%',

 204                      );

 205  */
 206  
 207  $ItemList->cols[] = array(
 208      'th' => /* TRANS: abbrev for info */ T_('i'),
 209      'order' => 'datemodified',
 210      'default_dir' => 'D',
 211      'th_class' => 'shrinkwrap',
 212      'td_class' => 'shrinkwrap',
 213      'td' => '@history_info_icon()@',
 214  );
 215  
 216  
 217  
 218  /**

 219   * Edit Actions:

 220   */
 221  function item_edit_actions( $Item )
 222  {
 223      // Display edit button if current user has the rights:

 224      $r = $Item->get_edit_link( ' ', ' ', get_icon( 'edit' ), '#', '' );
 225  
 226      // Display delete button if current user has the rights:

 227      $r .= $Item->get_delete_link( ' ', ' ', get_icon( 'delete' ), '#', '', false );
 228  
 229      return $r;
 230  }
 231  $ItemList->cols[] = array(
 232          'th' => T_('Act.'),
 233          'td_class' => 'shrinkwrap',
 234          'td' => '%item_edit_actions( {Obj} )%',
 235      );
 236  
 237  if( $ItemList->is_filtered() )
 238  {    // List is filtered, offer option to reset filters:
 239      $ItemList->global_icon( T_('Reset all filters!'), 'reset_filters', '?ctrl=items&amp;blog='.$Blog->ID.'&amp;filter=reset', T_('Reset filters') );
 240  }
 241  
 242  if( $current_User->check_perm( 'blog_post_statuses', 'edit', false, $Blog->ID ) )
 243  {    // We have permission to add a post with at least one status:
 244      $ItemList->global_icon( T_('Create a new task...'), 'new', '?ctrl=items&amp;action=new&amp;blog='.$Blog->ID, T_('New task').' &raquo;', 3 ,4 );
 245  }
 246  
 247  
 248  // EXECUTE the query now:

 249  $ItemList->restart();
 250  
 251  // Initialize funky display vars now:

 252  global $postIDlist, $postIDarray;
 253  $postIDlist = $ItemList->get_page_ID_list();
 254  $postIDarray = $ItemList->get_page_ID_array();
 255  
 256  // DISPLAY table now:

 257  $ItemList->display( NULL, $result_fadeout );
 258  
 259  
 260  /*

 261   * $Log: _item_list_track.view.php,v $

 262   * Revision 1.3  2007/09/26 20:26:36  fplanque

 263   * improved ItemList filters

 264   *

 265   * Revision 1.2  2007/09/08 20:23:04  fplanque

 266   * action icons / wording

 267   *

 268   * Revision 1.1  2007/06/25 11:00:31  fplanque

 269   * MODULES (refactored MVC)

 270   *

 271   * Revision 1.16  2007/05/28 01:33:22  fplanque

 272   * permissions/fixes

 273   *

 274   * Revision 1.15  2007/04/26 00:11:07  fplanque

 275   * (c) 2007

 276   *

 277   * Revision 1.14  2007/03/21 02:21:37  fplanque

 278   * item controller: highlight current (step 2)

 279   *

 280   * Revision 1.13  2006/12/12 02:53:57  fplanque

 281   * Activated new item/comments controllers + new editing navigation

 282   * Some things are unfinished yet. Other things may need more testing.

 283   *

 284   * Revision 1.12  2006/12/07 22:29:26  fplanque

 285   * reorganized menus / basic dashboard

 286   */
 287  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics