diff --git a/DataBaseLMS/databaselms.cpp b/DataBaseLMS/databaselms.cpp index 9eb4060..b4dd8c2 100644 --- a/DataBaseLMS/databaselms.cpp +++ b/DataBaseLMS/databaselms.cpp @@ -783,6 +783,44 @@ int DataBaseLMS::deleteTaskFIM(int id_task) return 0; } + //Выгребаем все malfunction для этой задачи + queryStr = QString("SELECT malfunctions.malfunction_id " + "FROM public.malfunctions JOIN public.tasks_fim ON tasks_fim.task_id = malfunctions.task_fim_malf " + "WHERE malfunctions.task_fim_malf = %1 " + "ORDER BY malfunctions.malfunction_id ASC").arg( + id_task); + QSqlQuery queryMalf = QSqlQuery(*db); + + if(queryExec(queryStr, &queryMalf)) + { + while (queryMalf.next()) + {//Неисправность + int malfunction_id = 0; + + malfunction_id = queryMalf.value(0).toString().toInt(); + + if(malfunction_id) + { + queryStr = QString("DELETE FROM public.malf_sign " + "WHERE malf_malf_sign = %1 ").arg( + malfunction_id); + + QSqlQuery querySign = QSqlQuery(*db); + if(!queryExec(queryStr, &querySign)) + { + resBool = db->rollback(); + return 0; + } + } + }; + } + else + { + resBool = db->rollback(); + return 0; + } + + queryStr = QString("DELETE FROM public.malfunctions " "WHERE task_fim_malf = %1 ").arg( QString::number(id_task)); diff --git a/InstructorsAndTrainees/tasks/ammtaskswidget.cpp b/InstructorsAndTrainees/tasks/ammtaskswidget.cpp index 8db648a..9866334 100644 --- a/InstructorsAndTrainees/tasks/ammtaskswidget.cpp +++ b/InstructorsAndTrainees/tasks/ammtaskswidget.cpp @@ -94,13 +94,13 @@ void AMMtasksWidget::resizeEvent(QResizeEvent *event) treeWidget->setColumnWidth(ColumnsTree::clmn_ID, 50); treeWidget->setColumnWidth(ColumnsTree::clmn_code, 250); - treeWidget->setColumnWidth(ColumnsTree::clmn_status, 100); + treeWidget->setColumnWidth(ColumnsTree::clmn_status, 110); int widthPMorDM; if(type == TypeList::listCommon) widthPMorDM = width - (250 + 10); else - widthPMorDM = width - (400 + 10); + widthPMorDM = width - (410 + 10); treeWidget->setColumnWidth(ColumnsTree::clmn_PMorDM, widthPMorDM); } diff --git a/InstructorsAndTrainees/tasks/ammtaskswidget.ui b/InstructorsAndTrainees/tasks/ammtaskswidget.ui index 31c259b..609d678 100644 --- a/InstructorsAndTrainees/tasks/ammtaskswidget.ui +++ b/InstructorsAndTrainees/tasks/ammtaskswidget.ui @@ -49,7 +49,7 @@ - Active + Аvailable diff --git a/InstructorsAndTrainees/tasks/dialogchecktask.cpp b/InstructorsAndTrainees/tasks/dialogchecktask.cpp index 92b1f06..b47f3fb 100644 --- a/InstructorsAndTrainees/tasks/dialogchecktask.cpp +++ b/InstructorsAndTrainees/tasks/dialogchecktask.cpp @@ -65,7 +65,12 @@ void DialogCheckTask::outReport(FIMReport report) ui->plainText->appendHtml(str); //Result - str = QString("

%1

").arg(item.procedure.result); + str = item.procedure.result; + if(str == "viewed") + str = tr("viewed"); + else if(str == "completed") + str = tr("completed"); + str = QString("

%1

").arg(str); ui->plainText->appendHtml(str); //Text diff --git a/InstructorsAndTrainees/tasks/dialogchecktask.ui b/InstructorsAndTrainees/tasks/dialogchecktask.ui index cc7f81f..044b15f 100644 --- a/InstructorsAndTrainees/tasks/dialogchecktask.ui +++ b/InstructorsAndTrainees/tasks/dialogchecktask.ui @@ -53,10 +53,16 @@ + + + 0 + 0 + + 0 - 500 + 0 @@ -79,7 +85,7 @@
- Wrong + Failed @@ -105,7 +111,7 @@ - Right + Completed @@ -124,19 +130,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/InstructorsAndTrainees/tasks/fimtaskswidget.cpp b/InstructorsAndTrainees/tasks/fimtaskswidget.cpp index 0ece978..84fb28a 100644 --- a/InstructorsAndTrainees/tasks/fimtaskswidget.cpp +++ b/InstructorsAndTrainees/tasks/fimtaskswidget.cpp @@ -28,6 +28,7 @@ FIMtasksWidget::FIMtasksWidget(ConnectorToServer* connectorToServer, TypeList ty treeWidget = new QTreeWidget(); ui->horizontalLayout_1->addWidget(treeWidget); + //treeWidget->setMinimumSize(400, 400); connect(treeWidget, &QTreeWidget::currentItemChanged, this, &FIMtasksWidget::on_treeWidget_currentItemChanged); @@ -92,13 +93,13 @@ void FIMtasksWidget::resizeEvent(QResizeEvent *event) int width = treeWidget->width(); treeWidget->setColumnWidth(ColumnsTree::clmn_ID, 50); - treeWidget->setColumnWidth(ColumnsTree::clmn_status, 100); + treeWidget->setColumnWidth(ColumnsTree::clmn_status, 110); int widthTitle; if(type == TypeList::listCommon) widthTitle = width - (0 + 10); else - widthTitle = width - (150 + 10); + widthTitle = width - (160 + 10); treeWidget->setColumnWidth(ColumnsTree::clmn_Title, widthTitle); } @@ -249,24 +250,27 @@ void FIMtasksWidget::fillTree() itemTask->setText(0, task->title); itemTask->setText(1, QString::number(task->id)); - itemTask->setText(2, task->status); //itemTask->setFlags(itemTask->flags() | Qt::ItemIsUserCheckable); //itemTask->setCheckState(0, Qt::Checked); if(task->status == "completed") { + itemTask->setText(2, tr("completed")); itemTask->setIcon(2, QIcon(QStringLiteral(":/resources/icons/circleGreen.png"))); } else if(task->status == "failed") { + itemTask->setText(2, tr("failed")); itemTask->setIcon(2, QIcon(QStringLiteral(":/resources/icons/circleRed.png"))); } else if(task->status == "checkup") { + itemTask->setText(2, tr("checkup")); itemTask->setIcon(2, QIcon(QStringLiteral(":/resources/icons/circleYellow.png"))); } else { + itemTask->setText(2, tr("new")); itemTask->setIcon(2, QIcon(QStringLiteral(":/resources/icons/circleGray.png"))); } diff --git a/InstructorsAndTrainees/tasks/tasktreepreparation.cpp b/InstructorsAndTrainees/tasks/tasktreepreparation.cpp index 956d8c9..41c4da9 100644 --- a/InstructorsAndTrainees/tasks/tasktreepreparation.cpp +++ b/InstructorsAndTrainees/tasks/tasktreepreparation.cpp @@ -251,23 +251,26 @@ void TaskTreePreparation::slot_prepareListItemsForTrainee(QList list item->setText(ColumnsTree::clmn_PMorDM, text); item->setText(ColumnsTree::clmn_code, code); - item->setText(ColumnsTree::clmn_ID, ID); - item->setText(ColumnsTree::clmn_status, status); + item->setText(ColumnsTree::clmn_ID, ID); if(status == "completed") { + item->setText(ColumnsTree::clmn_status, tr("completed")); item->setIcon(ColumnsTree::clmn_status, QIcon(QStringLiteral(":/resources/icons/circleGreen.png"))); } else if(status == "failed") { + item->setText(ColumnsTree::clmn_status, tr("failed")); item->setIcon(ColumnsTree::clmn_status, QIcon(QStringLiteral(":/resources/icons/circleRed.png"))); } else if(status == "checkup") { + item->setText(ColumnsTree::clmn_status, tr("checkup")); item->setIcon(ColumnsTree::clmn_status, QIcon(QStringLiteral(":/resources/icons/circleYellow.png"))); } else { + item->setText(ColumnsTree::clmn_status, tr("new")); item->setIcon(ColumnsTree::clmn_status, QIcon(QStringLiteral(":/resources/icons/circleGray.png"))); } diff --git a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm index 43be936..52e5ba6 100644 Binary files a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm and b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm differ diff --git a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts index 31107af..88e1f0b 100644 --- a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts +++ b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts @@ -6,34 +6,67 @@ Form - Форма + Форма - + + Аvailable + Доступные + + + + Check + Проверить + + + + Delete + Удалить + + + Task AMM Задача AMM - + DM code DM код - - + + ID - ID + ID - + + + Status + Статус + + + PM/DM - + PM/DM - + Code Код + + + Attention! + Внимание! + + + + The deletion will be irrevocable. +Delete it anyway? + Удаление будет безвозвратным. +Всё равно удалить? + DialogAuthorizationInstructor @@ -59,6 +92,62 @@ Пароль + + DialogCheckTask + + + Form + Форма + + + + Task + Задача + + + + Completion Report + Отчет о выполнении + + + + Failed + Неверно + + + + Completed + Выполнена + + + + viewed + Просмотрено + + + + completed + Выполнена + + + + + Attention! + Внимание! + + + + Change task status? +The status will be set: 'failed' + Изменить статус задачи? Будет установлен статус 'неверно' + + + + Change task status? +The status will be set: 'completed' + Изменить статус задачи? Будет установлен статус 'выполнена' + + DialogEditGroup @@ -419,24 +508,77 @@ The changes will not be accepted. Form - Форма + Форма - + + Check + Проверить + + + + Delete + Удалить + + + + completed + выполнена + + + + failed + неверно + + + + checkup + на проверке + + + + new + новая + + + Task FIM Задача FIM - - + + ID - ID + ID - + + + Status + Статус + + + Title Заголовок + + + Attention! + Внимание! + + + + The deletion will be irrevocable. +Delete it anyway? + Удаление будет безвозвратным. +Всё равно удалить? + + + + Check Task + Проверка задачи + InstructorsAndTraineesWidget @@ -468,7 +610,7 @@ The changes will not be accepted. Update StyleSheet - + Обновить стиль @@ -478,12 +620,12 @@ The changes will not be accepted. AMM - + FIM - + @@ -492,52 +634,62 @@ The changes will not be accepted. - - - + + + Authorization Instructor Авторизация инструктора - + none нет - - + + Deauthorization Instructor Деавторизация инструктора - + Attention! Внимание! - + The file could not be opened Файл не может быть открыт - + Instructor deauthorization Деавторизация инструктора - + Error! Ошибка! - - + + Warning! + Внимание! + + + + The server is disabled + Сервер отключен + + + + Instructor authorization Авторизация инструктора - + Invalid login or password! Неправильный логин или пароль! @@ -599,7 +751,7 @@ The changes will not be accepted. Form - Форма + Форма @@ -614,12 +766,12 @@ The changes will not be accepted. Tab 1 - + Tab 2 - + @@ -627,12 +779,12 @@ The changes will not be accepted. Form - Форма + Форма TextLabel - + @@ -684,31 +836,54 @@ The changes will not be accepted. RecognizeSystem - + Attention! - Внимание! + Внимание! - + The file could not be opened - + Файл не может быть открыт - + You cannot delete the basic version! - + You cannot delete the active version - + This name already exists + + TaskTreePreparation + + + completed + выполнено + + + + failed + неверно + + + + checkup + на проверке + + + + new + новая + + TraineesView @@ -789,7 +964,7 @@ The changes will not be accepted. Delete - + Удалить @@ -869,12 +1044,12 @@ The changes will not be accepted. Инструкторы - + Editor of Instructors Редактор инструкторов - + Editor of instructors Редактор инструкторов @@ -888,12 +1063,12 @@ The changes will not be accepted. Обучаемые - + Editor of Trainees Редактор обучаемых - + Editor of trainees Редактор обучаемых @@ -903,7 +1078,7 @@ The changes will not be accepted. Form - Форма + Форма