X-Git-Url: http://git.wpitchoune.net/gitweb/?p=www.git;a=blobdiff_plain;f=www%2Fptask%2Ffiles%2Fpatches%2Ftask_2.2.0_timesheet.patch;fp=www%2Fptask%2Ffiles%2Fpatches%2Ftask_2.2.0_timesheet.patch;h=afc2e56448ca6729a177c69ea07d8116ca32a25d;hp=0000000000000000000000000000000000000000;hb=79913bc0cc2be12b5b49acd0f2f41e435cae3d3e;hpb=cf1d5b645870b42afd2065452431cc9dca952706 diff --git a/www/ptask/files/patches/task_2.2.0_timesheet.patch b/www/ptask/files/patches/task_2.2.0_timesheet.patch new file mode 100644 index 0000000..afc2e56 --- /dev/null +++ b/www/ptask/files/patches/task_2.2.0_timesheet.patch @@ -0,0 +1,33 @@ +diff --git a/src/commands/CmdTimesheet.cpp b/src/commands/CmdTimesheet.cpp +index 32a7e12..0bd9336 100644 +--- a/src/commands/CmdTimesheet.cpp ++++ b/src/commands/CmdTimesheet.cpp +@@ -59,6 +59,8 @@ int CmdTimesheet::execute (std::string& output) + std::vector all = context.tdb2.all_tasks (); + context.tdb2.commit (); + ++ std::string prj = context.config.get("project"); ++ + // What day of the week does the user consider the first? + int weekStart = Date::dayOfWeek (context.config.get ("weekstart")); + if (weekStart != 0 && weekStart != 1) +@@ -108,6 +110,9 @@ int CmdTimesheet::execute (std::string& output) + // If task completed within range. + if (task->getStatus () == Task::completed) + { ++ if (!prj.empty() && task->get("project") != prj) ++ continue ; ++ + Date compDate (task->get_date ("end")); + if (compDate >= start && compDate < end) + { +@@ -163,7 +168,8 @@ int CmdTimesheet::execute (std::string& output) + { + // If task started within range, but not completed withing range. + if (task->getStatus () == Task::pending && +- task->has ("start")) ++ task->has ("start") && ++ (prj.empty() || task->get("project") == prj)) + { + Date startDate (task->get_date ("start")); + if (startDate >= start && startDate < end)