$activeid. $acname
";
echo "
Тип проекта: $actionid. $acname
Локомотив серии: $loco_type № $loco_number
Депо приписки: $depo
Депо обслуживания: $depos
Доступные типы задач:
";
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 "
Созданные задачи:
";
$tasks = GetTasksForProject($activeid);
// ПОЛУЧЕНИЕ XML НАЧАЛО
$parents = $entityManager->getRepository('Task')->findBy(array('parent_id' => 0), 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];
$sort = GetTaskStatus($id);
if ($task['parent_id'] == '0') {
$arrayTasksId[] = $id;
echo "$id [$sort]. $name
";
http://corp.prmsys.net/index.php?act=tasks&activeid=679&scroll=0
}
}
echo '
Локомотивы
Новая задача:
'; echo "- ';
foreach( $arResult['locomotiveList'] as $loco )
{
$project = $loco['obj'];
$project_id = $project->id;
$urgent = $project->urgent;
if (!$urgent)
$makeurgent = "Назначить приоритетным";
else
$makeurgent = "Снять приоритетность";
echo '
-
' . $loco['obj']->loco_type .' ['. $loco['obj']->loco_number.'] Выполнено задач: '.$loco["countDone"]['done'].' из '. $loco["countDone"]['all'] .'
'; echo '