home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / files / index.php < prev   
Encoding:
PHP Script  |  2003-12-09  |  1.5 KB  |  47 lines

  1. <?php /* FILES $Id: index.php,v 1.27 2003/12/09 00:17:16 gregorerhardt Exp $ */
  2. $AppUI->savePlace();
  3.  
  4. // retrieve any state parameters
  5. if (isset( $_REQUEST['project_id'] )) {
  6.     $AppUI->setState( 'FileIdxProject', $_REQUEST['project_id'] );
  7. }
  8. $project_id = $AppUI->getState( 'FileIdxProject' ) !== NULL ? $AppUI->getState( 'FileIdxProject' ) : 0;
  9.  
  10. require_once( $AppUI->getModuleClass( 'projects' ) );
  11.  
  12. // get the list of visible companies
  13. $extra = array(
  14.     'from' => 'files',
  15.     'where' => 'AND project_id = file_project'
  16. );
  17.  
  18. $project = new CProject();
  19. $projects = $project->getAllowedRecords( $AppUI->user_id, 'project_id,project_name', 'project_name', null, $extra );
  20. $projects = arrayMerge( array( '0'=>$AppUI->_('All') ), $projects );
  21.  
  22. // setup the title block
  23. $titleBlock = new CTitleBlock( 'Files', 'folder5.png', $m, "$m.$a" );
  24. $titleBlock->addCell( $AppUI->_('Filter') . ':' );
  25. $titleBlock->addCell(
  26.     arraySelect( $projects, 'project_id', 'onChange="document.pickProject.submit()" size="1" class="text"', $project_id ), '',
  27.     '<form name="pickProject" action="?m=files" method="post">', '</form>'
  28. );
  29. if ($canEdit) {
  30.     $titleBlock->addCell(
  31.         '<input type="submit" class="button" value="'.$AppUI->_('new file').'">', '',
  32.         '<form action="?m=files&a=addedit" method="post">', '</form>'
  33.     );
  34. }
  35. $titleBlock->show();
  36. ?>
  37. <table cellspacing="0" cellpadding="0" border="0" width="100%">
  38. <tr>
  39.     <td>
  40. <?php
  41.     $showProject = true;
  42.     require( "{$AppUI->cfg['root_dir']}/modules/files/index_table.php" );
  43. ?>
  44.     </td>
  45. </tr>
  46. </table>
  47.