Task Validation
- Shifted test for priority values from Att.cpp to Task.cpp.
This commit is contained in:
@@ -952,6 +952,15 @@ void Task::validate () const
|
|||||||
if (has ("wait") &&
|
if (has ("wait") &&
|
||||||
getStatus () == Task::recurring)
|
getStatus () == Task::recurring)
|
||||||
throw std::string (STRING_TASK_VALID_WAIT_RECUR);
|
throw std::string (STRING_TASK_VALID_WAIT_RECUR);
|
||||||
|
|
||||||
|
if (has ("priority"))
|
||||||
|
{
|
||||||
|
std::string priority - get ("priority");
|
||||||
|
if (priority != "H" &&
|
||||||
|
priority != "M" &&
|
||||||
|
priority != "L")
|
||||||
|
throw format (STRING_TASK_VALID_PRIORITY, priority);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -420,6 +420,7 @@
|
|||||||
#define STRING_TASK_VALID_UNTIL "You cannot specify an until date for a non-recurring task."
|
#define STRING_TASK_VALID_UNTIL "You cannot specify an until date for a non-recurring task."
|
||||||
#define STRING_TASK_VALID_RECUR "A recurrence value must be valid."
|
#define STRING_TASK_VALID_RECUR "A recurrence value must be valid."
|
||||||
#define STRING_TASK_VALID_WAIT_RECUR "You cannot create a task that is both waiting and recurring."
|
#define STRING_TASK_VALID_WAIT_RECUR "You cannot create a task that is both waiting and recurring."
|
||||||
|
#define STRING_TASK_VALID_PRIORITY "Priority values may be 'H', 'M' or 'L', not '{1}'."
|
||||||
|
|
||||||
|
|
||||||
// Taskmod
|
// Taskmod
|
||||||
|
|||||||
Reference in New Issue
Block a user