diff --git a/DownloadInfo.h b/DownloadInfo.h index 7de20a47..45d6a624 100644 --- a/DownloadInfo.h +++ b/DownloadInfo.h @@ -263,7 +263,8 @@ public: psSkipped, psFailure, psSuccess, - psRepairPossible + psRepairPossible, + psManual }; enum EUnpackStatus @@ -311,6 +312,7 @@ private: char* m_szQueuedFilename; bool m_bDeleted; bool m_bParCleanup; + bool m_bParManual; bool m_bCleanupDisk; bool m_bUnpackCleanedUpDisk; NZBInfoList* m_Owner; diff --git a/Options.cpp b/Options.cpp index cf813250..20e94f3b 100644 --- a/Options.cpp +++ b/Options.cpp @@ -140,7 +140,6 @@ static const char* OPTION_WARNINGTARGET = "WarningTarget"; static const char* OPTION_ERRORTARGET = "ErrorTarget"; static const char* OPTION_DEBUGTARGET = "DebugTarget"; static const char* OPTION_DETAILTARGET = "DetailTarget"; -static const char* OPTION_LOADPARS = "LoadPars"; static const char* OPTION_PARCHECK = "ParCheck"; static const char* OPTION_PARREPAIR = "ParRepair"; static const char* OPTION_PARSCAN = "ParScan"; @@ -185,6 +184,7 @@ static const char* OPTION_NZBLOGKIND = "NZBLogKind"; static const char* OPTION_RETRYONCRCERROR = "RetryOnCrcError"; static const char* OPTION_ALLOWREPROCESS = "AllowReProcess"; static const char* OPTION_POSTPROCESS = "PostProcess"; +static const char* OPTION_LOADPARS = "LoadPars"; const char* BoolNames[] = { "yes", "no", "true", "false", "1", "0", "on", "off", "enable", "disable", "enabled", "disabled" }; const int BoolValues[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; @@ -500,8 +500,7 @@ Options::Options(int argc, char* argv[]) m_iWriteLogKind = 0; m_bCreateLog = false; m_szLogFile = NULL; - m_eLoadPars = lpAll; - m_bParCheck = false; + m_eParCheck = pcManual; m_bParRepair = false; m_eParScan = psLimited; m_szScriptOrder = NULL; @@ -849,8 +848,7 @@ void Options::InitDefault() SetOption(OPTION_ERRORTARGET, "both"); SetOption(OPTION_DEBUGTARGET, "none"); SetOption(OPTION_DETAILTARGET, "both"); - SetOption(OPTION_LOADPARS, "one"); - SetOption(OPTION_PARCHECK, "no"); + SetOption(OPTION_PARCHECK, "auto"); SetOption(OPTION_PARREPAIR, "yes"); SetOption(OPTION_PARSCAN, "limited"); SetOption(OPTION_SCRIPTORDER, ""); @@ -1058,7 +1056,6 @@ void Options::InitOptions() m_bSaveQueue = (bool)ParseEnumValue(OPTION_SAVEQUEUE, BoolCount, BoolNames, BoolValues); m_bDupeCheck = (bool)ParseEnumValue(OPTION_DUPECHECK, BoolCount, BoolNames, BoolValues); m_bCreateLog = (bool)ParseEnumValue(OPTION_CREATELOG, BoolCount, BoolNames, BoolValues); - m_bParCheck = (bool)ParseEnumValue(OPTION_PARCHECK, BoolCount, BoolNames, BoolValues); m_bParRepair = (bool)ParseEnumValue(OPTION_PARREPAIR, BoolCount, BoolNames, BoolValues); m_bStrictParName = (bool)ParseEnumValue(OPTION_STRICTPARNAME, BoolCount, BoolNames, BoolValues); m_bReloadQueue = (bool)ParseEnumValue(OPTION_RELOADQUEUE, BoolCount, BoolNames, BoolValues); @@ -1088,10 +1085,10 @@ void Options::InitOptions() const int OutputModeCount = 7; m_eOutputMode = (EOutputMode)ParseEnumValue(OPTION_OUTPUTMODE, OutputModeCount, OutputModeNames, OutputModeValues); - const char* LoadParsNames[] = { "none", "one", "all", "1", "0" }; - const int LoadParsValues[] = { lpNone, lpOne, lpAll, lpOne, lpNone }; - const int LoadParsCount = 5; - m_eLoadPars = (ELoadPars)ParseEnumValue(OPTION_LOADPARS, LoadParsCount, LoadParsNames, LoadParsValues); + const char* ParCheckNames[] = { "auto", "force", "manual", "yes", "no" }; // yes/no for compatibility with older versions + const int ParCheckValues[] = { pcAuto, pcForce, pcManual, pcForce, pcAuto }; + const int ParCheckCount = 5; + m_eParCheck = (EParCheck)ParseEnumValue(OPTION_PARCHECK, ParCheckCount, ParCheckNames, ParCheckValues); const char* ParScanNames[] = { "limited", "full", "auto" }; const int ParScanValues[] = { psLimited, psFull, psAuto }; @@ -2397,7 +2394,7 @@ bool Options::SetOptionString(const char * option) optvalue[1000] = '\0'; if (strlen(optname) > 0) { - ConvertOldOptionName(optname, sizeof(optname)); + ConvertOldOption(optname, sizeof(optname), optvalue, sizeof(optvalue)); if (!ValidateOptionName(optname)) { @@ -2479,7 +2476,9 @@ bool Options::ValidateOptionName(const char * optname) ConfigError("Option \"%s\" is obsolete, ignored, use \"%s\" instead", optname, OPTION_PROCESSLOGKIND); return true; } - if (!strcasecmp(optname, OPTION_RETRYONCRCERROR) || !strcasecmp(optname, OPTION_ALLOWREPROCESS)) + if (!strcasecmp(optname, OPTION_RETRYONCRCERROR) || + !strcasecmp(optname, OPTION_ALLOWREPROCESS) || + !strcasecmp(optname, OPTION_LOADPARS)) { ConfigWarn("Option \"%s\" is obsolete, ignored", optname); return true; @@ -2496,7 +2495,7 @@ bool Options::ValidateOptionName(const char * optname) void Options::CheckOptions() { #ifdef DISABLE_PARCHECK - if (m_bParCheck) + if (m_eParCheck != pcManual) { LocateOptionSrcPos(OPTION_PARCHECK); ConfigError("Invalid value for option \"%s\": program was compiled without parcheck-support", OPTION_PARCHECK); @@ -2678,7 +2677,7 @@ bool Options::LoadConfig(OptEntries* pOptEntries) optvalue[1024-1] = '\0'; if (strlen(optname) > 0) { - ConvertOldOptionName(optname, sizeof(optname)); + ConvertOldOption(optname, sizeof(optname), optvalue, sizeof(optvalue)); OptEntry* pOptEntry = new OptEntry(); pOptEntry->SetName(optname); @@ -2735,7 +2734,7 @@ bool Options::SaveConfig(OptEntries* pOptEntries) optvalue[1024-1] = '\0'; if (strlen(optname) > 0) { - ConvertOldOptionName(optname, sizeof(optname)); + ConvertOldOption(optname, sizeof(optname), optvalue, sizeof(optvalue)); OptEntry *pOptEntry = pOptEntries->FindOption(optname); if (pOptEntry) @@ -2777,36 +2776,47 @@ bool Options::SaveConfig(OptEntries* pOptEntries) return true; } -void Options::ConvertOldOptionName(char *szOption, int iBufLen) +void Options::ConvertOldOption(char *szOption, int iOptionBufLen, char *szValue, int iValueBufLen) { // for compatibility with older versions accept old option names if (!strcasecmp(szOption, "$MAINDIR")) { - strncpy(szOption, "MainDir", iBufLen); + strncpy(szOption, "MainDir", iOptionBufLen); } if (!strcasecmp(szOption, "ServerIP")) { - strncpy(szOption, "ControlIP", iBufLen); + strncpy(szOption, "ControlIP", iOptionBufLen); } if (!strcasecmp(szOption, "ServerPort")) { - strncpy(szOption, "ControlPort", iBufLen); + strncpy(szOption, "ControlPort", iOptionBufLen); } if (!strcasecmp(szOption, "ServerPassword")) { - strncpy(szOption, "ControlPassword", iBufLen); + strncpy(szOption, "ControlPassword", iOptionBufLen); } if (!strcasecmp(szOption, "PostPauseQueue")) { - strncpy(szOption, "ScriptPauseQueue", iBufLen); + strncpy(szOption, "ScriptPauseQueue", iOptionBufLen); } - szOption[iBufLen-1] = '\0'; + if (!strcasecmp(szOption, "ParCheck") && !strcasecmp(szValue, "yes")) + { + strncpy(szValue, "force", iValueBufLen); + } + + if (!strcasecmp(szOption, "ParCheck") && !strcasecmp(szValue, "no")) + { + strncpy(szValue, "auto", iValueBufLen); + } + + szOption[iOptionBufLen-1] = '\0'; + szOption[iValueBufLen-1] = '\0'; } bool Options::LoadConfigTemplates(ConfigTemplates* pConfigTemplates) diff --git a/Options.h b/Options.h index 4b8eeb14..74417e20 100644 --- a/Options.h +++ b/Options.h @@ -80,11 +80,11 @@ public: omColored, omNCurses }; - enum ELoadPars + enum EParCheck { - lpNone, - lpOne, - lpAll + pcAuto, + pcForce, + pcManual }; enum EParScan { @@ -271,8 +271,7 @@ private: int m_iLogBufferSize; bool m_bCreateLog; char* m_szLogFile; - ELoadPars m_eLoadPars; - bool m_bParCheck; + EParCheck m_eParCheck; bool m_bParRepair; EParScan m_eParScan; char* m_szDefScript; @@ -373,7 +372,7 @@ private: void ConfigError(const char* msg, ...); void ConfigWarn(const char* msg, ...); void LocateOptionSrcPos(const char *szOptionName); - void ConvertOldOptionName(char *szOption, int iBufLen); + void ConvertOldOption(char *szOption, int iOptionBufLen, char *szValue, int iValueBufLen); static bool CompareScripts(Script* pScript1, Script* pScript2); void LoadScriptDir(ScriptList* pScriptList, const char* szDirectory, bool bIsSubDir); void BuildScriptDisplayNames(ScriptList* pScriptList); @@ -434,8 +433,7 @@ public: int GetLogBufferSize() { return m_iLogBufferSize; } bool GetCreateLog() { return m_bCreateLog; } const char* GetLogFile() { return m_szLogFile; } - ELoadPars GetLoadPars() { return m_eLoadPars; } - bool GetParCheck() { return m_bParCheck; } + EParCheck GetParCheck() { return m_eParCheck; } bool GetParRepair() { return m_bParRepair; } EParScan GetParScan() { return m_eParScan; } const char* GetScriptOrder() { return m_szScriptOrder; } diff --git a/ParCoordinator.cpp b/ParCoordinator.cpp index 6b64e704..156d02cd 100644 --- a/ParCoordinator.cpp +++ b/ParCoordinator.cpp @@ -120,10 +120,7 @@ void ParCoordinator::PausePars(DownloadQueue* pDownloadQueue, NZBInfo* pNZBInfo) if (pFileInfo->GetNZBInfo() == pNZBInfo) { g_pQueueCoordinator->GetQueueEditor()->LockedEditEntry(pDownloadQueue, pFileInfo->GetID(), false, - (g_pOptions->GetLoadPars() == Options::lpOne || - (g_pOptions->GetLoadPars() == Options::lpNone && g_pOptions->GetParCheck())) - ? QueueEditor::eaGroupPauseExtraPars : QueueEditor::eaGroupPauseAllPars, - 0, NULL); + QueueEditor::eaGroupPauseExtraPars, 0, NULL); break; } } diff --git a/PrePostProcessor.cpp b/PrePostProcessor.cpp index ca9ab88f..ddf428c1 100644 --- a/PrePostProcessor.cpp +++ b/PrePostProcessor.cpp @@ -241,7 +241,7 @@ void PrePostProcessor::NZBAdded(DownloadQueue* pDownloadQueue, NZBInfo* pNZBInfo pNZBInfo = MergeGroups(pDownloadQueue, pNZBInfo); } - if (g_pOptions->GetLoadPars() != Options::lpAll) + if (g_pOptions->GetParCheck() != Options::pcForce) { m_ParCoordinator.PausePars(pDownloadQueue, pNZBInfo); } @@ -262,7 +262,7 @@ void PrePostProcessor::NZBDownloaded(DownloadQueue* pDownloadQueue, NZBInfo* pNZ pPostInfo->SetNZBInfo(pNZBInfo); pPostInfo->SetInfoName(pNZBInfo->GetName()); - if (pNZBInfo->GetParStatus() == NZBInfo::psNone && !g_pOptions->GetParCheck()) + if (pNZBInfo->GetParStatus() == NZBInfo::psNone && g_pOptions->GetParCheck() == Options::pcManual) { pNZBInfo->SetParStatus(NZBInfo::psSkipped); } @@ -492,7 +492,8 @@ void PrePostProcessor::CheckPostQueue() if (!pPostInfo->GetWorking()) { #ifndef DISABLE_PARCHECK - if (pPostInfo->GetRequestParCheck() && pPostInfo->GetNZBInfo()->GetParStatus() <= NZBInfo::psSkipped) + if (pPostInfo->GetRequestParCheck() && pPostInfo->GetNZBInfo()->GetParStatus() <= NZBInfo::psSkipped && + g_pOptions->GetParCheck() != Options::pcManual) { pPostInfo->GetNZBInfo()->SetParStatus(NZBInfo::psNone); pPostInfo->SetRequestParCheck(false); @@ -500,6 +501,27 @@ void PrePostProcessor::CheckPostQueue() pPostInfo->GetNZBInfo()->GetScriptStatuses()->Clear(); DeletePostThread(pPostInfo); } + else if (pPostInfo->GetRequestParCheck() && pPostInfo->GetNZBInfo()->GetParStatus() <= NZBInfo::psSkipped && + g_pOptions->GetParCheck() == Options::pcManual) + { + pPostInfo->SetRequestParCheck(false); + pPostInfo->GetNZBInfo()->SetParStatus(NZBInfo::psManual); + DeletePostThread(pPostInfo); + + FileInfo* pFileInfo = GetQueueGroup(pDownloadQueue, pPostInfo->GetNZBInfo()); + if (pFileInfo) + { + info("Downloading all remaining files for manual par-check for %s", pPostInfo->GetNZBInfo()->GetName()); + g_pQueueCoordinator->GetQueueEditor()->LockedEditEntry(pDownloadQueue, pFileInfo->GetID(), false, QueueEditor::eaGroupResume, 0, NULL); + pPostInfo->SetStage(PostInfo::ptFinished); + pPostInfo->GetNZBInfo()->SetPostProcess(false); + } + else + { + info("There are no par-files remain for download for %s", pPostInfo->GetNZBInfo()->GetName()); + pPostInfo->SetStage(PostInfo::ptQueued); + } + } else if (pPostInfo->GetRequestParRename()) { pPostInfo->GetNZBInfo()->SetRenameStatus(NZBInfo::rsNone); @@ -602,7 +624,8 @@ void PrePostProcessor::StartJob(DownloadQueue* pDownloadQueue, PostInfo* pPostIn bool bUnpack = g_pOptions->GetUnpack() && (pPostInfo->GetNZBInfo()->GetUnpackStatus() == NZBInfo::usNone); bool bParFailed = pPostInfo->GetNZBInfo()->GetParStatus() == NZBInfo::psFailure || - pPostInfo->GetNZBInfo()->GetParStatus() == NZBInfo::psRepairPossible; + pPostInfo->GetNZBInfo()->GetParStatus() == NZBInfo::psRepairPossible || + pPostInfo->GetNZBInfo()->GetParStatus() == NZBInfo::psManual; bool bCleanup = !bUnpack && pPostInfo->GetNZBInfo()->GetCleanupStatus() == NZBInfo::csNone && @@ -615,6 +638,7 @@ void PrePostProcessor::StartJob(DownloadQueue* pDownloadQueue, PostInfo* pPostIn pPostInfo->GetNZBInfo()->GetMoveStatus() == NZBInfo::msNone && pPostInfo->GetNZBInfo()->GetUnpackStatus() != NZBInfo::usFailure && pPostInfo->GetNZBInfo()->GetParStatus() != NZBInfo::psFailure && + pPostInfo->GetNZBInfo()->GetParStatus() != NZBInfo::psManual && strlen(g_pOptions->GetInterDir()) > 0 && !strncmp(pPostInfo->GetNZBInfo()->GetDestDir(), g_pOptions->GetInterDir(), strlen(g_pOptions->GetInterDir())); @@ -623,7 +647,9 @@ void PrePostProcessor::StartJob(DownloadQueue* pDownloadQueue, PostInfo* pPostIn if (bUnpack && bParFailed) { - warn("Skipping unpack due to par-failure for %s", pPostInfo->GetInfoName()); + warn("Skipping unpack due to %s for %s", + pPostInfo->GetNZBInfo()->GetParStatus() == NZBInfo::psManual ? "required par-repair" : "par-failure", + pPostInfo->GetInfoName()); pPostInfo->GetNZBInfo()->SetUnpackStatus(NZBInfo::usSkipped); bUnpack = false; } diff --git a/ScriptController.cpp b/ScriptController.cpp index 3ad7229d..bf44a90c 100644 --- a/ScriptController.cpp +++ b/ScriptController.cpp @@ -856,7 +856,7 @@ void PostScriptController::PrepareParams(const char* szScriptName) strncpy(szNZBName, m_pPostInfo->GetNZBInfo()->GetName(), 1024); szNZBName[1024-1] = '\0'; - int iParStatus[] = { 0, 0, 1, 2, 3 }; + int iParStatus[] = { 0, 0, 1, 2, 3, 4 }; char szParStatus[10]; snprintf(szParStatus, 10, "%i", iParStatus[m_pPostInfo->GetNZBInfo()->GetParStatus()]); szParStatus[10-1] = '\0'; diff --git a/XmlRpc.cpp b/XmlRpc.cpp index 317b90ab..05285f34 100644 --- a/XmlRpc.cpp +++ b/XmlRpc.cpp @@ -1859,7 +1859,7 @@ void HistoryXmlCommand::Execute() "\"Text\" : \"%s\"\n" "}"; - const char* szParStatusName[] = { "NONE", "NONE", "FAILURE", "SUCCESS", "REPAIR_POSSIBLE" }; + const char* szParStatusName[] = { "NONE", "NONE", "FAILURE", "SUCCESS", "REPAIR_POSSIBLE", "MANUAL" }; const char* szUnpackStatusName[] = { "NONE", "NONE", "FAILURE", "SUCCESS" }; const char* szMoveStatusName[] = { "NONE", "FAILURE", "SUCCESS" }; const char* szScriptStatusName[] = { "NONE", "UNKNOWN", "FAILURE", "SUCCESS" }; diff --git a/nzbget.conf b/nzbget.conf index 5966e46b..73bf8510 100644 --- a/nzbget.conf +++ b/nzbget.conf @@ -861,54 +861,33 @@ UpdateInterval=200 ############################################################################## ### PAR CHECK/REPAIR ### -# How many par2-files to load (one, all, none). +# Whether and how par-verification must be performed (auto, force, manual). # -# One - only one main par2-file must be downloaded and other must be paused; -# All - all par2-files must be downloaded; -# None - all par2-files must be automatically paused. +# Auto - par-check is performed when needed. One par2-file is always +# downloaded. Additional par2-files are downloaded if needed +# for repair. Repair is performed if the option +# is enabled; +# Force - force par-check for every download (even undamaged). All +# par2-files are always downloaded. Repair is performed if +# the option is enabled; +# Manual - par-check is skipped. One par2-file is always +# downloaded. If a damaged download is detected, all +# par2-files are downloaded but neithet par-check nor par-repair +# take place. The download can be then repaired manually +# (possibly on another, faster computer). # -# Paused files remain in queue and can be unpaused by parchecker when needed. -LoadPars=one +# NOTE: The option must be set to "no", otherwise the +# par-checker may not find renamed files and fail. +ParCheck=auto -# Force par-verification (yes, no). +# Automatic par-repair after par-verification (yes, no). # -# Force par-check for every download. When set to "no" the par-check is -# performed only if the unpacker or the post-processing script detect a -# damaged download. -# -# To download only needed par2-files (smart par-files loading) set also -# the option to "one". If option is set to "all", -# all par2-files will be downloaded before verification and repair starts. -# The option must be set to "no", otherwise the par-checker -# may not find renamed files and fail. -ParCheck=no - -# Automatic par-repair (yes, no). -# -# If option is enabled and is not, the program -# only verifies downloaded files and downloads needed par2-files, but does -# not start repair-process. This is useful if computer does not have -# enough CPU power, since repairing of large files may take too much -# resources and time on a slow computers. +# If option is set to "Auto" or "Force" this option defines +# if the download must be repaired when needed. The option can be +# disabled if computer does not have enough CPU power, since repairing +# may take too much resources and time on a slow computers. ParRepair=yes -# What files should be scanned during par-verification (limited, -# full, auto). -# -# limited - scan only files belonging to the par-set; -# full - scan all files in the directory. This helps if the -# files were renamed after creating of par-set. -# auto - a limited scan is performed first. If the par-checker -# detects missing files, it scans other files in the -# directory until all required files are found. -# -# NOTE: for par-check/repair NZBGet uses library libpar2. The last and -# widely used version 0.2 of the library has few bugs, sometimes causing -# a crash of the program. This is especially true when using "full" or -# "auto" par-scan. NZBGet is supplied with patches addressing these -# issues. Please apply the patches to libpar2 and recompile it. -ParScan=auto - # What files should be scanned during par-verification (limited, # full, auto). # @@ -1092,6 +1071,7 @@ SevenZipCmd=7z # 1 = checked and failed to repair; # 2 = checked and successfully repaired; # 3 = checked and can be repaired but repair is disabled; +# 4 = par-check needed but skipped (option ParCheck=manual); # NZBPP_UNPACKSTATUS - result of unpack: # 0 = unpack is disabled or was skipped due to nzb-file # properties or due to errors during par-check; diff --git a/ppscripts/EMail.py b/ppscripts/EMail.py index 589791b1..8038bcd6 100755 --- a/ppscripts/EMail.py +++ b/ppscripts/EMail.py @@ -105,13 +105,17 @@ for optname in required_options: sys.exit(POSTPROCESS_ERROR) # Check par and unpack status for errors. -Failure = os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_UNPACKSTATUS'] == '1'; -if Failure: +success=False +if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_UNPACKSTATUS'] == '1': subject = 'Failure for "%s"' % (os.environ['NZBPP_NZBNAME']) text = 'Download of "%s" has failed.' % (os.environ['NZBPP_NZBNAME']) +elif os.environ['NZBPP_PARSTATUS'] == '4': + subject = 'Damaged for "%s"' % (os.environ['NZBPP_NZBNAME']) + text = 'Download of "%s" requires par-repair.' % (os.environ['NZBPP_NZBNAME']) else: subject = 'Success for "%s"' % (os.environ['NZBPP_NZBNAME']) text = 'Download of "%s" has successfully completed.' % (os.environ['NZBPP_NZBNAME']) + success=True # NZBPP_PARSTATUS - result of par-check: # 0 = not checked: par-check is disabled or nzb-file does @@ -119,7 +123,8 @@ else: # 1 = checked and failed to repair; # 2 = checked and successfully repaired; # 3 = checked and can be repaired but repair is disabled. -parStatus = { '0': 'skipped', '1': 'failed', '2': 'repaired', '3': 'repairable' } +# 4 = par-check needed but skipped (option ParCheck=manual); +parStatus = { '0': 'skipped', '1': 'failed', '2': 'repaired', '3': 'repairable', '4': 'manual' } text += '\nPar-Status: %s' % parStatus[os.environ['NZBPP_PARSTATUS']] # NZBPP_UNPACKSTATUS - result of unpack: @@ -145,7 +150,7 @@ if os.environ['NZBPO_BROKENLOG'] == 'yes': # add post-processing log if os.environ['NZBPO_POSTPROCESSLOG'] == 'Always' or \ - (os.environ['NZBPO_POSTPROCESSLOG'] == 'OnFailure' and Failure): + (os.environ['NZBPO_POSTPROCESSLOG'] == 'OnFailure' and not success): # To get the post-processing log we connect to NZBGet via XML-RPC # and call method "postqueue", which returns the list of post-processing job. # The first item in the list is current job. This item has a field 'Log', diff --git a/webui/history.js b/webui/history.js index fe46ba54..029a4801 100644 --- a/webui/history.js +++ b/webui/history.js @@ -27,13 +27,13 @@ * 1) History tab; * 2) History edit dialog. */ - + /*** HISTORY TAB AND EDIT HISTORY DIALOG **********************************************/ - + var History = (new function($) { 'use strict'; - + // Controls var $HistoryTable; var $HistoryTabBadge; @@ -53,7 +53,7 @@ var History = (new function($) $HistoryTabBadge = $('#HistoryTabBadge'); $HistoryTabBadgeEmpty = $('#HistoryTabBadgeEmpty'); $HistoryRecordsPerPage = $('#HistoryRecordsPerPage'); - + historyEditDialog.init(); var recordsPerPage = UISettings.read('HistoryRecordsPerPage', 10); @@ -115,7 +115,11 @@ var History = (new function($) { if (hist.ParStatus == 'FAILURE' || hist.UnpackStatus == 'FAILURE' || hist.MoveStatus == 'FAILURE' || hist.ScriptStatus == 'FAILURE') { - hist.status = 'failure'; + hist.status = 'failure'; + } + else if (hist.ParStatus == 'MANUAL') + { + hist.status = 'damaged'; } else { @@ -248,6 +252,10 @@ var History = (new function($) case 'repairable': case 'REPAIR_POSSIBLE': return '' + prefix + 'repairable'; + case 'manual': + case 'MANUAL': + case 'damaged': + return '' + prefix + status + ''; case 'none': case 'NONE': return '' + prefix + 'none'; @@ -325,14 +333,14 @@ var History = (new function($) notification = null; } } - + function editClick() { var histid = $(this).attr('histid'); $(this).blur(); historyEditDialog.showModal(histid); } - + /*** EDIT HISTORY DIALOG *************************************************************************/ var historyEditDialog = new function() @@ -346,7 +354,7 @@ var History = (new function($) this.init = function() { $HistoryEditDialog = $('#HistoryEditDialog'); - + $('#HistoryEdit_Delete').click(itemDelete); $('#HistoryEdit_Return').click(itemReturn); $('#HistoryEdit_Reprocess').click(itemReprocess);