Esempio n. 1
0
 /**
  * returns the summary of all costs for this project
  * @return float costs
  */
 function getCosts()
 {
     $taskInst = new task();
     $taskInst->filterProjectId = $this->id;
     $sum = 0;
     $list = $taskInst->getList();
     while ($element = current($list)) {
         $taskInst->activate($element);
         $sum += $taskInst->getCosts();
         next($list);
     }
     return $sum;
 }
Esempio n. 2
0
    ?>
      <th><nobr>days left</nobr></th>
    <?php 
}
?>
    <th>percentage</th>
    <th>&nbsp;</th>
  </tr>

<?php 
$taskInst = new task();
$order = "finish";
if (tool::securePost('order')) {
    $order = tool::securePost('order');
}
$list = $taskInst->getList($order);
if ($order == "plannedhours") {
    $listByHour = array();
    while ($element = current($list)) {
        $taskInst->activate($element);
        if (!$taskInst->isDone() && $taskInst->statusId != TASK_STATUS_WAITING && $taskInst->plannedHours && $taskInst->plannedHours != "0") {
            $diff = $taskInst->plannedHours * 60 * 60 - $taskInst->getSummary();
            $listByHour[$diff] = $taskInst->id;
        }
        next($list);
    }
    ksort($listByHour);
    while (list($diff, $id) = each($listByHour)) {
        $taskInst->activate($id);
        ?>
<tr class="light" onmouseover="this.style.backgroundColor='#fafafa'" onmouseout="this.style.backgroundColor=''"><?php 
Esempio n. 3
0
            } else {
                $seen[] = $element;
                echo "<option value=\"" . $element . "\">/ " . implode(" / ", $taskInst->treeName($element)) . "\n";
            }
        }
        next($list);
    }
    if (!in_array("0", $seen)) {
        echo "<option value=\"0\"> /\n";
    }
} else {
    ?>
<option value="0">/<?php 
    $taskInst2 = new task();
    $taskInst2->filterProjectId = $projectMount;
    $list = $taskInst2->getList();
    while ($element = current($list)) {
        echo "<option value=\"" . $element . "\">/ " . implode(" / ", $taskInst2->treeName($element)) . "\n";
        next($list);
    }
}
?>
          </select>
          </td>
        </tr><tr>
          <td><?php 
echo $lang['common_subject'];
?>
:&nbsp;</td>
          <td><input type="text" name="subject" value="<?php 
echo $taskInst->subject;
Esempio n. 4
0
    $boxInst = new box();
    $boxInst->setTitle($lang['home_queryTask']);
    $boxInst->setBgColor("#f8f8f8");
    $boxInst->addContent("<form name=\"form3\" onsubmit=\"javascript:openwindow('" . $toolInst->encodeUrl("index.php?content=taskdetails.php&view=details&taskid='+document.form3.taskid.value+'") . "','500','500')\">");
    $boxInst->addContent("&nbsp;" . $lang['common_ID'] . " " . $lang['common_task'] . ": <input type=\"text\" name=\"taskid\" size=\"" . $htmlconfig['text_size4'] . "\">");
    $boxInst->addContent("<input type=\"button\" value=\"" . $lang['common_search'] . "\" onclick=\"javascript:openwindow('" . $toolInst->encodeUrl("index.php?content=taskdetails.php&view=details&taskid='+document.form3.taskid.value+'") . "','500','500')\">");
    $boxInst->addContent("</form>");
    $boxInst->get();
}
if ($loginInst->hasAccess("task")) {
    // create box with open tasks
    $taskInst = new task();
    $taskInst->filterStatusId = TASK_STATUS_DONE;
    $taskInst->filterInvertStatus = 1;
    $taskInst->filterUserId = $loginInst->id;
    $list = $taskInst->getList("priority", "DESC");
    $boxInst = new box();
    $boxInst->setTitle($lang['home_myOpenTasks']);
    $boxInst->setBgColor("#f8f8f8");
    if ($taskInst->matches > 0) {
        $boxInst->addContent("<table border=0 cellpadding=2 cellspacing=0 width=100%>");
        $boxInst->addContent("<tr><th>" . $lang['common_priority'] . "</th><th>" . $lang['common_type'] . "</th><th>" . $lang['common_subject'] . "</th></tr>");
        while ($element = current($list)) {
            $taskInst->activate($element);
            $projectInst = new project($taskInst->projectId);
            if ($projectInst->isAvailable()) {
                $projectInst = new project($taskInst->projectId);
                $boxInst->addContent("<tr><td valign=top class=" . $taskInst->getPriorityStyle() . ">" . $taskInst->getPriorityName() . "</td>");
                $boxInst->addContent("<td valign=top class=" . $taskInst->getTypeStyle() . ">" . $taskInst->getTypeName() . "</td>");
                $boxInst->addContent("<td class=list><a href=\"javascript:openwindow('" . $toolInst->encodeUrl("index.php?content=taskdetails.php&view=details&taskid=" . $element) . "',width='500',height='500')\" title=\"" . $lang['common_showTaskdetails'] . "\">");
                $boxInst->addContent(substr($projectInst->name . ": " . $taskInst->subject, 0, 50));
Esempio n. 5
0
</td>
  </tr>
</table>

<?php 
# order
$order = "priority";
if (tool::secureGet('order')) {
    $order = tool::secureGet('order');
}
if (tool::secureGet('desc') == "DESC") {
    $desc = "";
} else {
    $desc = "DESC";
}
$list = $taskInst->getList($order, $desc);
if ($taskInst->matches > 0) {
    #######################################################################
    ## show existing tasks
    ?>
    <br>
    <table border="0" cellpadding="2" cellspacing="1" width="96%" bgcolor="#ffffff">
      <tr>
        <th colspan="6"><?php 
    echo $taskInst->matches;
    ?>
 <?php 
    echo $lang['project_tasksUntilNow'];
    ?>
</th>
      </tr><tr>
Esempio n. 6
0
            } else {
                echo "<td colspan=\"2\" class=\"" . $taskInst->getStatusStyle() . "\">" . $taskInst->getStatusName() . "</td>\n";
            }
            echo "<td width=\"100%\">&nbsp;</td>\n";
            echo "</tr>\n";
            next($taskList);
            $count = $taskDepth;
            processTask(++$count, $taskInst->childs());
        }
    }
    // now we create a tasklist, containing only the root tasks
    $childs = array();
    $taskInst = new task();
    $taskInst->filterProjectId = tool::securePost('id');
    $taskInst->filterMountId = 0;
    processTask(1, $taskInst->getList());
    ?>
  <tr class="dark">
    <td align="right" colspan="<?php 
    echo $max + 5;
    ?>
"><b>average</b></td>
    <?php 
    $percent = 100;
    if ($rows > 0) {
        $percent = $toolInst->numberRound($sumPercentage / $rows, 2);
    }
    if ($percent > 100) {
        ?>
<td align="right" class="rmred"><?php 
    } elseif ($percent > 80) {