[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/modules/notebook/ -> index.php (source)

   1  <?php /* $Id: index.php 40 2008-02-11 12:11:44Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/links/index.php $ */
   2  if (!defined('W2P_BASE_DIR')) {
   3      die('You should not access this file directly.');
   4  }
   5  
   6  $AppUI->savePlace();
   7  
   8  // retrieve any state parameters
   9  if (isset($_REQUEST['note_status'])) {
  10      $AppUI->setState('NoteIdxStatus', w2PgetParam($_REQUEST, 'note_status', null));
  11  }
  12  
  13  $note_status = $AppUI->getState('NoteIdxStatus') !== null ? $AppUI->getState('NoteIdxStatus') : -1;
  14  
  15  if (isset($_REQUEST['company_id'])) {
  16      $AppUI->setState('NoteIdxCompany', w2PgetParam($_REQUEST, 'company_id', null));
  17  }
  18  
  19  $company_id = $AppUI->getState('NoteIdxCompany') !== null ? $AppUI->getState('NoteIdxCompany') : 0;
  20  
  21  if (isset($_REQUEST['project_id'])) {
  22      $AppUI->setState('NoteIdxProject', w2PgetParam($_REQUEST, 'project_id', null));
  23  }
  24  
  25  $project_id = $AppUI->getState('NoteIdxProject') !== null ? $AppUI->getState('NoteIdxProject') : 0;
  26  
  27  if (w2PgetParam($_GET, 'tab', -1) != -1) {
  28      $AppUI->setState('NoteIdxTab', w2PgetParam($_GET, 'tab'));
  29  }
  30  $tab = $AppUI->getState('NoteIdxTab') !== null ? $AppUI->getState('NoteIdxTab') : 0;
  31  $active = intval(!$AppUI->getState('NoteIdxTab'));
  32  
  33  require_once ($AppUI->getModuleClass('companies'));
  34  
  35  // get the list of visible companies
  36  $extra = array('from' => 'notes', 'where' => 'companies.company_id = note_company');
  37  
  38  $company = new CCompany();
  39  $companies = $company->getAllowedRecords($AppUI->user_id, 'companies.company_id,company_name', 'company_name', null, $extra, 'companies');
  40  $companies = arrayMerge(array('0' => $AppUI->_('All', UI_OUTPUT_JS)), $companies);
  41  
  42  require_once ($AppUI->getModuleClass('projects'));
  43  
  44  // get the list of visible companies
  45  $extra = array('from' => 'notes', 'where' => 'projects.project_id = note_project');
  46  
  47  $project = new CProject();
  48  $projects = $project->getAllowedRecords($AppUI->user_id, 'projects.project_id,project_name', 'project_name', null, $extra, 'projects');
  49  $projects = arrayMerge(array('0' => $AppUI->_('All', UI_OUTPUT_JS)), $projects);
  50  
  51  $status = w2PgetSysVal('NoteStatus');
  52  $status = arrayMerge(array('-1' => $AppUI->_('All', UI_OUTPUT_JS)), $status);
  53  
  54  // setup the title block
  55  $titleBlock = new CTitleBlock('Notebook', 'notebook.png', $m, $m . '.' . $a);
  56  $titleBlock->addCell($AppUI->_('Search') . ':');
  57  $titleBlock->addCell('<input type="text" class="text" size="12" name="search" onchange="document.searchfilter.submit();" value=' . "'$search'" . 'title="' . $AppUI->_('Search in name and description fields', UI_OUTPUT_JS) . '"/>', '', '<form action="?m=notebook" method="post" id="searchfilter">', '</form>');
  58  $titleBlock->addCell($AppUI->_('Company') . ':');
  59  $titleBlock->addCell(arraySelect($companies, 'company_id', 'onchange="document.pickCompany.submit()" size="1" class="text"', $company_id), '', '<form name="pickCompany" action="?m=notebook" method="post">', '</form>');
  60  $titleBlock->addCell($AppUI->_('Project') . ':');
  61  $titleBlock->addCell(arraySelect($projects, 'project_id', 'onchange="document.pickProject.submit()" size="1" class="text"', $project_id), '', '<form name="pickProject" action="?m=notebook" method="post">', '</form>');
  62  $titleBlock->addCell($AppUI->_('Status') . ':');
  63  $titleBlock->addCell(arraySelect($status, 'note_status', 'onchange="document.pickStatus.submit()" size="1" class="text"', $note_status), '', '<form name="pickStatus" action="?m=notebook" method="post">', '</form>');
  64  if ($canEdit) {
  65      $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new note') . '">', '', '<form action="?m=notebook&a=addedit" method="post">', '</form>');
  66  }
  67  $titleBlock->show();
  68  
  69  $note_types = w2PgetSysVal('NoteCategory');
  70  if ($tab != -1) {
  71      array_unshift($note_types, 'All Notes');
  72  }
  73  array_map(array($AppUI, '_'), $note_types);
  74  
  75  $tabBox = new CTabBox('?m=notebook', W2P_BASE_DIR . '/modules/notebook/', $tab);
  76  
  77  $i = 0;
  78  
  79  foreach ($note_types as $note_type) {
  80      $tabBox->add('index_table', $note_type);
  81      ++$i;
  82  }
  83  
  84  $tabBox->show();
  85  
  86  ?>


Generated: Fri Jan 9 03:00:02 2009 Cross-referenced by PHPXref 0.7