"; } echo "
$activeid. $acname
".
$project_comment
."
Тип проекта: $actionid. $acname
Локомотив серии: $loco_type № $loco_number
Депо приписки: $depo
Депо обслуживания: $depos
";
echo "Созданные задачи:
";
// $tasks = GetTasksForProject($activeid);
$tasks = $proj->getTasks();
// ПОЛУЧЕНИЕ XML НАЧАЛО
$parents = $entityManager->getRepository('Task')->findBy(array('parent_id' => 0, 'input_id' => $activeid), array('id' => 'DESC'));
$tasktypesIds = GrabTasktypesIDs();
$array_children = [];
$array_parent = [];
foreach ($parents as $parent) {
if (!in_array(intval($parent->type), $tasktypesIds)) {
continue;
}
$status = GetTaskStatus($parent->id);
if ($status == 5) {
$array_parent[$parent->id] = $parent;
$children = $entityManager->getRepository('Task')->findBy(array('parent_id' => $parent->id));
$array_children[$parent->id] = $children;
}
}
$array_type = [];
$array_id = [];
$_SESSION['array_children'] = $array_children;
$_SESSION['array_parent'] = $array_parent;
$arrayTasksId = [];
foreach ($tasks as $task) {
$type = $task->type;
$id = $task->id;
$_SESSION['actid'] = $id;
foreach ($array_children as $parent_id => $children) {
if ($id == $parent_id) {
foreach ($children as $res1) {
$array_type[] = $res1->type;
$array_id[] = $res1->id;
}
}
}
$xmltype = implode(',', $array_type);
$xmlid = implode(',', $array_id);
$name = GetTaskNameAndDesc($type)[0];
$sortTask = GetTaskStatus($id);
if ($task->parent_id == '0') {
// echo $task->id;
$arrayTasksId[] = $id;
//echo "$id [$sort]. $name
";
echo "$id. $name
";
echo $task->text . "
";
// if ($task->getAccount() != null) {
if ($sortTask < 5 && $sortTask > 1) {
if ($task->status == 2) {
$sname = "Выдана";
$ass = "[".TimeString($task->assigned)."]";
}
else if ($task->status == 3) {
$sname = "Принята";
$ass = "[выдана: ".TimeString($task->assigned)."]";;
}
$sname = "$sname $ass: ";
}
else if ($sortTask <= 1)
$sname = "Не выдана ";
else
$sname = "Выполнена: ";
if ($task->getAccount() != null) {
$assignee_names_parent = $task->getAccount()->name;
echo "$sname $assignee_names_parent
";
}
else
echo "$sname
";
// }
}
}
// echo "
Доступные типы задач:
";
//
// foreach ($types as $type) {
// //if ($type['main_task']) {
// if ($type->main_task) {
// echo "[Главная] ";
// $sort = '1';
// }
// $tid = $type->GetId();
// $tname = $type->name;
// echo "$tid. $tname";
// echo '
';
// }
echo "";
$sections = $proj->getSections();
$numDM = 0;
foreach ($sections as $section)
{
$dm = $section->diagnostic_map;
if ($dm != null && $dm != '00000000-0000-0000-0000-000000000000')
{
$numDM++;
}
}
$sizes = sizeof($sections);
if ($sizes > 0 && $numDM == $sizes)
$disabled = "";
else
$disabled = "disabled";
if ($disabled) {
echo "Нет полных данных от АСУ СГ по секциям локомотива из данного проекта
";
echo "
";
}
else {
echo "
";
}
if (intval($sort) < 5) {
echo "
";
}
echo '';
echo '