[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/modules/tasks/ -> ae_depend.php (source)

   1  <?php /* $Id: ae_depend.php 135 2008-04-04 13:49:13Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/tasks/ae_depend.php $ */
   2  if (!defined('W2P_BASE_DIR')) {
   3      die('You should not access this file directly.');
   4  }
   5  
   6  // $Id: ae_depend.php 135 2008-04-04 13:49:13Z pedroix $

   7  global $AppUI, $w2Pconfig, $task_parent_options, $loadFromTab;
   8  global $can_edit_time_information, $obj;
   9  global $durnTypes, $task_project, $task_id, $tab;
  10  
  11  //Time arrays for selects

  12  $start = intval(w2PgetConfig('cal_day_start'));
  13  $end = intval(w2PgetConfig('cal_day_end'));
  14  $inc = intval(w2PgetConfig('cal_day_increment'));
  15  if ($start === null) {
  16      $start = 8;
  17  }
  18  if ($end === null) {
  19      $end = 17;
  20  }
  21  if ($inc === null) {
  22      $inc = 15;
  23  }
  24  $hours = array();
  25  for ($current = $start; $current < $end + 1; $current++) {
  26      if ($current < 10) {
  27          $current_key = '0' . $current;
  28      } else {
  29          $current_key = $current;
  30      }
  31  
  32      if (stristr($AppUI->getPref('TIMEFORMAT'), '%p')) {
  33          //User time format in 12hr

  34          $hours[$current_key] = ($current > 12 ? $current - 12 : $current);
  35      } else {
  36          //User time format in 24hr

  37          $hours[$current_key] = $current;
  38      }
  39  }
  40  
  41  // Pull tasks dependencies

  42  $deps = false;
  43  if ($deps) {
  44      $q = new DBQuery;
  45      $q->addTable('tasks');
  46      $q->addQuery('task_id, task_name');
  47      $q->addWhere('task_id IN (' . $deps . ')');
  48  } else {
  49      $q = new DBQuery;
  50      $q->addTable('tasks', 't');
  51      $q->addTable('task_dependencies', 'td');
  52      $q->addQuery('t.task_id, t.task_name');
  53      $q->addWhere('td.dependencies_task_id = ' . (int)$task_id);
  54      $q->addWhere('t.task_id = td.dependencies_req_task_id');
  55  }
  56  $taskDep = $q->loadHashList();
  57  $q->clear();
  58  
  59  ?>
  60  <form name="dependFrm" action="?m=tasks&a=addedit&task_project=<?php echo $task_project; ?>" method="post">
  61  <input name="dosql" type="hidden" value="do_task_aed" />
  62  <input name="task_id" type="hidden" value="<?php echo $task_id; ?>" />
  63  <input name="sub_form" type="hidden" value="1" />
  64  <table width="100%" border="0" cellpadding="4" cellspacing="0" class="std">
  65              <?php
  66  if ($can_edit_time_information) {
  67  ?>
  68              <tr>
  69                  <td align="center" nowrap="nowrap" colspan="3"><b><?php echo $AppUI->_('Dependency Tracking'); ?></b></td>
  70              </tr>
  71              <tr>
  72                  <td align="right" nowrap="nowrap"><?php echo $AppUI->_('On'); ?></td>
  73                  <td nowrap="nowrap">
  74                      <input type="radio" name="task_dynamic" value="31" <?php if ($obj->task_dynamic > '20')
  75          echo "checked" ?> />
  76                  </td>
  77              </tr>
  78              <tr>
  79                  <td align="right" nowrap="nowrap"><?php echo $AppUI->_('Off'); ?></td>
  80                  <td id="no_dyn" nowrap="nowrap">
  81                      <input type="radio" name="task_dynamic" value="0" <?php if ($obj->task_dynamic == '0' || $obj->task_dynamic == '11')
  82          echo "checked" ?> />
  83                  </td>
  84  </tr>
  85  <tr>
  86      <td align="right" nowrap="nowrap"><label for="task_dynamic"><?php echo $AppUI->_('Dynamic Task'); ?></label></td>
  87      <td nowrap="nowrap">
  88          <input type="checkbox" name="task_dynamic" id="task_dynamic" value="1" <?php if ($obj->task_dynamic == "1")
  89          echo 'checked="checked"' ?> />
  90      </td>
  91  </tr>
  92  <tr>
  93      <td align="right" nowrap="nowrap"><label for="task_dynamic_nodelay"><?php echo $AppUI->_('Do not track this task'); ?></label></td>
  94      <td>
  95          <input type="checkbox" name="task_dynamic_nodelay" id="task_dynamic_nodelay" value="1" <?php if (($obj->task_dynamic > '10') && ($obj->task_dynamic < 30))
  96          echo 'checked="checked"' ?> />
  97      </td>
  98              </tr>
  99              <?php
 100  } else {
 101  ?>
 102              <tr>
 103                      <td colspan="2"><?php echo $AppUI->_('Only the task owner, project owner, or system administrator is able to edit time related information.'); ?></td>
 104                  </tr>
 105              <?php
 106  } // end of can_edit_time_information

 107  
 108  ?>
 109              <tr>
 110                  <td><?php echo $AppUI->_('All Tasks'); ?>:</td>
 111                  <td><?php echo $AppUI->_('Task Dependencies'); ?>:</td>
 112              </tr>
 113              <tr>
 114                  <td>
 115                      <select name="all_tasks" class="text" style="width:220px" size="10" class="text" multiple="multiple">
 116                          <?php echo str_replace('selected', '', $task_parent_options); // we need to remove selected added from task_parent options ?>

 117                      </select>
 118                  </td>
 119                  <td>
 120                      <?php echo arraySelect($taskDep, 'task_dependencies', 'style="width:220px" size="10" class="text" multiple="multiple" ', null); ?>
 121                  </td>
 122              </tr>
 123              <tr>
 124                  <td colspan="2">
 125                  <input type="checkbox" name="set_task_start_date" id="set_task_start_date" /><label for="set_task_start_date"><?php echo $AppUI->_('Set task start date based on dependency'); ?></label>
 126                  </td>
 127              </tr>
 128              <tr>
 129                  <td align="right"><input type="button" class="button" value="&gt;" onclick="addTaskDependency(document.dependFrm, document.datesFrm)" /></td>
 130                  <td align="left"><input type="button" class="button" value="&lt;" onclick="removeTaskDependency(document.dependFrm, document.datesFrm)" /></td>
 131              </tr>
 132          </table>
 133  <input type="hidden" name="hdependencies" />
 134  </form>
 135  <script language="javascript">
 136      subForm.push( new FormDefinition(<?php echo $tab; ?>, document.dependFrm, checkDepend, saveDepend));
 137  </script>


Generated: Thu Jan 8 03:00:03 2009 Cross-referenced by PHPXref 0.7