Пример #1
0
        $taskInst->stop();
        $taskInst->update();
    }
} elseif (tool::securePost('action') == "save") {
    // start job
    $jobInst->fill(tool::securePostAll());
    $jobInst->taskId = $taskInst->id;
    $jobInst->start = $toolInst->timestampToSec(tool::securePost('startyear'), tool::securePost('startmonth'), tool::securePost('startday'), tool::securePost('starthour'), tool::securePost('startmin'));
    $saveflags = 0;
    // handle job flags
    if (tool::securePost('privatejob') == "1") {
        $saveflags += JOB_FLAG_PRIVATE;
    }
    $jobInst->flags = $saveflags;
    $jobId = $jobInst->start();
    $jobInst->activate($jobId);
} elseif (tool::securePost('action') == "deleteattach") {
    $attachment = new attachment(tool::securePost('id'));
    $attachment->delete();
    // we need to reload the task to clear the attachment member in this object
    $taskInst->activate($taskInst->id);
}
if (tool::securePost('action') == "delete") {
    $jobInst->activate(tool::securePost('id'));
    $jobInst->delete();
}
if (tool::securePost('action') == "edit") {
    $status = 1;
    $jobInst->activate(tool::securePost('id'));
}
#######################################################################
Пример #2
0
 if ($toolInst->getTime("Y", $dayToShow) != $toolInst->getTime("Y")) {
     $jobInst->filterCurrentlyRunning = "1";
 }
 if ($toolInst->getTime("m", $dayToShow) != $toolInst->getTime("m")) {
     $jobInst->filterCurrentlyRunning = "1";
 }
 if ($toolInst->getTime("d", $dayToShow) != $toolInst->getTime("d")) {
     $jobInst->filterCurrentlyRunning = "1";
 }
 $list = $jobInst->getList();
 if ($jobInst->matches > 0) {
     $boxInst->addContent("<table border=0 cellpadding=2 cellspacing=0 width=100%>");
     $boxInst->addContent("<tr><th>" . $lang['common_task'] . "</th><th>" . $lang['common_comment'] . "</th><th class=right>" . $lang['common_start'] . "</th><th class=right>" . $lang['common_stop'] . "</th><th class=right>" . $lang['common_used'] . "</th></tr>");
     $sum = 0;
     while ($element = current($list)) {
         $jobInst->activate($element);
         $taskInst = new task($jobInst->taskId);
         $projectInst = new project($taskInst->projectId);
         $boxInst->addContent("<tr><td class=list><a href=\"javascript:openwindow('" . $toolInst->encodeUrl("index.php?content=taskdetails.php&view=details&taskid=" . $taskInst->id) . "',width='500',height='500')\" title=\"" . $lang['common_showTaskdetails'] . "\">" . substr($projectInst->name . ": " . $taskInst->subject, 0, 40) . "...</a></td>");
         $boxInst->addContent("<td class=list>" . substr($jobInst->comment, 0, 50) . "...</td>");
         $boxInst->addContent("<td class=list align=right>" . $toolInst->getTime("H:i", $jobInst->start) . "</td>");
         if ($jobInst->id == $jobInst->getOpenJob()) {
             $boxInst->addContent("<td class=list align=right>running</td>");
         } else {
             $boxInst->addContent("<td class=list align=right>" . $toolInst->getTime("H:i", $jobInst->stop) . "</td>");
         }
         $boxInst->addContent("<td class=list align=right>" . $toolInst->formatTime($jobInst->getSummary()) . "</td></tr>");
         $sum += $jobInst->getSummary();
         next($list);
     }
     $boxInst->addContent("<tr><td colspan=4 class=list align=right><b>" . $lang['common_summary'] . "&nbsp;</b></td><td class=list align=right><b>" . $toolInst->formatTime($sum) . "</b></td></tr>");