[OGo-Developer] Task & kind
Adam Tauno Williams
developer@opengroupware.org
Mon, 05 Nov 2007 18:05:33 -0500
--=-fBcl5wBXhbMKLCTLpGBU
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
> > Tasks also have a "kind" field, but tasks with a kind other than NULL
> > are always filtered out of todo/delegated lists. It looks like this
> > "kind" field was used by some now obsolete features ("Root Process"?).
> > Would it be safe / acceptable now to 'liberate' this field [1]?
> Looking at the source it seems that the "kind IS NULL" constraint is
> embedded rather deeply. Not sure whether it would be dangerous to
> relax that ... And then, I'm not sure what we need 'kind' for.
> [I don't remember what it was good for]
> In a legacy DB I could find those:
> => SELECT DISTINCT(kind) FROM job;
> kind
> -------------------
> 00_process
> 01_root_milestone
> 01_root_process
> (4 rows)
> So it seems to be related to the "milestone" stuff which I mostly
> removed.
That is pretty much what I assumed. Anyway, I've plucked the
restriction out of at least the Logic bits, and so far.... by servers
are still chugging away.
I've tested the task lists in webui (todo, delegated, archived) and
listing the tasks vi the project viewer.
--=-fBcl5wBXhbMKLCTLpGBU
Content-Disposition: attachment; filename=removeKindAndControlFiltersFromTaskLogic.patch
Content-Type: text/x-patch; name=removeKindAndControlFiltersFromTaskLogic.patch; charset=utf-8
Content-Transfer-Encoding: 7bit
Index: LSFilterArchivedJobCommand.m
===================================================================
--- LSFilterArchivedJobCommand.m (revision 2045)
+++ LSFilterArchivedJobCommand.m (working copy)
@@ -45,16 +45,8 @@
enumerator = [[self jobList] objectEnumerator];
while ((job = [enumerator nextObject])) {
- BOOL isControlJob = NO;
- id ctrlJob = nil;
NSString *jobStatus = [job valueForKey:@"jobStatus"];
- ctrlJob = [job valueForKey:@"isControlJob"];
-
- if (ctrlJob != nil) {
- isControlJob = [ctrlJob boolValue];
- }
-
if (([[job valueForKey:@"creatorId"] isEqual:[self creatorId]]) &&
([jobStatus isEqualToString:LSJobArchived])) {
[filteredJobs addObject:job];
Index: LSFilterToDoListJobCommand.m
===================================================================
--- LSFilterToDoListJobCommand.m (revision 2045)
+++ LSFilterToDoListJobCommand.m (working copy)
@@ -46,17 +46,9 @@
enumerator = [[self jobList] objectEnumerator];
while ((job = [enumerator nextObject])) {
- BOOL isControlJob = NO;
- id ctrlJob = nil;
NSString *jobStatus = [job valueForKey:@"jobStatus"];
- ctrlJob = [job valueForKey:@"isControlJob"];
- if (ctrlJob != nil) {
- isControlJob = [ctrlJob boolValue];
- }
-
- if (!isControlJob &&
- ([[job valueForKey:@"executantId"] isEqual:[self executantId]]) &&
+ if (([[job valueForKey:@"executantId"] isEqual:[self executantId]]) &&
(![jobStatus isEqualToString:LSJobArchived]) &&
(![jobStatus isEqualToString:LSJobDone])) {
[filteredJobs addObject:job];
Index: LSFetchPrivateJobsCommand.m
===================================================================
--- LSFetchPrivateJobsCommand.m (revision 2045)
+++ LSFetchPrivateJobsCommand.m (working copy)
@@ -38,16 +38,14 @@
initWithEntity:[self destinationEntity]
qualifierFormat:
@"((%A IS NULL) AND (%A <> '%@') AND "
- @"(%A <> '%@') AND ((%A IS NULL) OR (%A = 0)) "
- @"OR ((%A = '%@') AND (%A = %A))) AND "
- @"(%A IS NULL)",
+ @"(%A <> '%@') "
+ @"OR ((%A = '%@') AND (%A = %A)))"
@"projectId",
@"jobStatus", LSJobArchived,
@"jobStatus", LSJobDone,
- @"isControlJob", @"isControlJob",
@"jobStatus", LSJobDone,
@"creatorId", @"executantId",
- @"kind", nil] autorelease];
+ nil] autorelease];
return [self _checkConjoinWithQualifier:qualifier];
}
Index: LSFetchArchivedJobsCommand.m
===================================================================
--- LSFetchArchivedJobsCommand.m (revision 2045)
+++ LSFetchArchivedJobsCommand.m (working copy)
@@ -37,11 +37,9 @@
qualifier = [[[EOSQLQualifier allocWithZone:[self zone]]
initWithEntity:[self destinationEntity]
qualifierFormat:
- @"(%A = '%@') AND (%A IS NULL OR %A = 0) AND "
- @"(%A IS NULL)",
+ @"(%A = '%@')",
@"jobStatus", LSJobArchived,
- @"isControlJob", @"isControlJob",
- @"kind", nil] autorelease];
+ nil] autorelease];
return [self _checkConjoinWithQualifier:qualifier];
}
Index: LSFetchToDoJobsCommand.m
===================================================================
--- LSFetchToDoJobsCommand.m (revision 2045)
+++ LSFetchToDoJobsCommand.m (working copy)
@@ -117,16 +117,14 @@
qualifier = [qualifier initWithEntity:[self destinationEntity]
qualifierFormat:
@"((%A <> '%@') AND ((%A <> '%@') OR "
- @"(%A IN (%@))) AND ((%A IS NULL) OR "
- @"(%A = 0)) AND (%A IN (%@)) AND (%A IS NULL)"
- @"AND (((%A > %@) OR (%A = '%@')) AND "
+ @"(%A IN (%@))) AND "
+ @"(%A IN (%@)) AND "
+ @"(((%A > %@) OR (%A = '%@')) AND "
@"(%A < %@)))",
@"jobStatus", LSJobArchived,
@"jobStatus", LSJobDone,
@"creatorId", s,
- @"isControlJob", @"isControlJob",
@"executantId", s,
- @"kind",
@"endDate", formattedBegin,
@"jobStatus", LSJobCreated,
@"endDate", formattedEnd, nil];
@@ -134,16 +132,14 @@
else {
qualifier = [qualifier initWithEntity:[self destinationEntity]
qualifierFormat:
- @"((%A <> '%@') AND ((%A <> '%@') OR "
- @"(%A IN (%@))) AND ((%A IS NULL) OR "
- @"(%A = 0)) AND (%A IN (%@)) AND "
- @"(%A IS NULL))",
+ @"((%A <> '%@') AND "
+ @" ((%A <> '%@') OR(%A IN (%@))) AND "
+ @" (%A IN (%@)))",
@"jobStatus", LSJobArchived,
@"jobStatus", LSJobDone,
@"creatorId", s,
- @"isControlJob", @"isControlJob",
@"executantId", s,
- @"kind", nil];
+ nil];
}
return [qualifier autorelease];
}
Index: GNUmakefile
===================================================================
--- GNUmakefile (revision 2045)
+++ GNUmakefile (working copy)
@@ -10,12 +10,10 @@
LSTasks_OBJC_FILES = \
LSAllSubJobsDoneJobCommand.m \
LSAssignProjectToJobCommand.m \
- LSControlJobCommand.m \
LSDeleteJobCommand.m \
LSDeleteJobHistoryCommand.m \
LSDetachProjectFromJobCommand.m \
LSFetchArchivedJobsCommand.m \
- LSFetchControlJobsCommand.m \
LSFetchDelegatedJobsCommand.m \
LSFetchJobCommand.m \
LSFetchJobExecutantCommand.m \
@@ -26,7 +24,6 @@
LSFetchProjectToRootJobCommand.m \
LSFetchToDoJobsCommand.m \
LSFilterArchivedJobCommand.m \
- LSFilterControlJobCommand.m \
LSFilterDelegatedJobCommand.m \
LSFilterJobCommand.m \
LSFilterToDoListJobCommand.m \
Index: LSFetchProjectJobsCommand.m
===================================================================
--- LSFetchProjectJobsCommand.m (revision 2045)
+++ LSFetchProjectJobsCommand.m (working copy)
@@ -64,16 +64,14 @@
initWithEntity:[self destinationEntity]
qualifierFormat:
@"((%A IS NOT NULL) AND (%A <> '%@') AND "
- @"(%A <> '%@') AND ((%A IS NULL) OR (%A = 0)) "
- @"OR ((%A = '%@') AND (%A = %A))) AND "
- @"(%A IS NULL)",
+ @"(%A <> '%@') "
+ @"OR ((%A = '%@') AND (%A = %A)))"
@"projectId",
@"jobStatus", LSJobArchived,
@"jobStatus", LSJobDone,
- @"isControlJob", @"isControlJob",
@"jobStatus", LSJobDone,
@"creatorId", @"executantId",
- @"kind", nil] autorelease];
+ nil] autorelease];
return [self _checkConjoinWithQualifier:qualifier];
}
Index: LSFetchJobsForExecutantCommand.m
===================================================================
--- LSFetchJobsForExecutantCommand.m (revision 2045)
+++ LSFetchJobsForExecutantCommand.m (working copy)
@@ -78,13 +78,10 @@
qualifier = [[EOSQLQualifier allocWithZone:[self zone]]
initWithEntity:[self destinationEntity]
qualifierFormat:
- @"((%A <> '%@') AND ((%A IS NULL) OR "
- @"(%A = 0)) AND (%A IN (%@)) AND "
- @"(%A IS NULL))",
+ @"((%A <> '%@') AND (%A IN (%@))",
@"jobStatus", LSJobArchived,
- @"isControlJob", @"isControlJob",
@"executantId", s,
- @"kind", nil];
+ nil];
return AUTORELEASE(qualifier);
}
Index: commands.plist
===================================================================
--- commands.plist (revision 2045)
+++ commands.plist (working copy)
@@ -7,7 +7,6 @@
new = { class = "LSNewJobCommand"; };
delete = { class = "LSDeleteJobCommand"; };
jobaction = { class = "LSJobActionCommand"; };
- controljob = { class = "LSControlJobCommand"; };
setcreator = {
class = "LSDBFetchRelationCommand";
init = {
@@ -79,14 +78,12 @@
init = { entity = "Job"; };
};
"filter-todolist" = { class = "LSFilterToDoListJobCommand"; };
- "filter-controljobs" = { class = "LSFilterControlJobCommand"; };
"filter-delegatedjobs" = { class = "LSFilterDelegatedJobCommand"; };
"filter-archivedjobs" = { class = "LSFilterArchivedJobCommand"; };
"getparentjobs" = { class = "LSGetParentJobsCommand"; };
"get-todo-jobs" = { class = "LSFetchToDoJobsCommand"; };
"get-private-jobs" = { class = "LSFetchPrivateJobsCommand"; };
"get-archived-jobs" = { class = "LSFetchArchivedJobsCommand"; };
- "get-control-jobs" = { class = "LSFetchControlJobsCommand"; };
"get-delegated-jobs" = { class = "LSFetchDelegatedJobsCommand"; };
"get-executant-jobs" = { class = "LSFetchJobsForExecutantCommand";};
"remove-waste-jobs" = { class = "LSRemoveWasteJobsCommand"; };
Index: bundle-info.plist
===================================================================
--- bundle-info.plist (revision 2045)
+++ bundle-info.plist (working copy)
@@ -15,18 +15,15 @@
{ name = "job::allsubjobs-done"; },
{ name = "job::assign-to-project"; },
{ name = "job::check-duration"; },
- { name = "job::controljob"; },
{ name = "job::delete"; },
{ name = "job::detach-from-project"; },
{ name = "job::extended-search"; },
{ name = "job::filter-archivedjobs"; },
- { name = "job::filter-controljobs"; },
{ name = "job::filter-delegatedjobs"; },
{ name = "job::filter-todolist"; },
{ name = "job::get"; },
{ name = "job::get-archived-jobs"; },
{ name = "job::get-by-globalid"; },
- { name = "job::get-control-jobs"; },
{ name = "job::get-delegated-jobs"; },
{ name = "job::get-duration"; },
{ name = "job::get-executant-jobs"; },
@@ -69,12 +66,10 @@
{ name = LSTasksCommands; },
{ name = LSAllSubJobsDoneJobCommand; },
{ name = LSAssignProjectToJobCommand; },
- { name = LSControlJobCommand; },
{ name = LSDeleteJobCommand; },
{ name = LSDeleteJobHistoryCommand; },
{ name = LSDetachProjectFromJobCommand; },
{ name = LSFetchArchivedJobsCommand; },
- { name = LSFetchControlJobsCommand; },
{ name = LSFetchDelegatedJobsCommand; },
{ name = LSFetchJobCommand; },
{ name = LSFetchJobExecutantCommand; },
@@ -85,7 +80,6 @@
{ name = LSFetchProjectToRootJobCommand; },
{ name = LSFetchToDoJobsCommand; },
{ name = LSFilterArchivedJobCommand; },
- { name = LSFilterControlJobCommand; },
{ name = LSFilterDelegatedJobCommand; },
{ name = LSFilterJobCommand; },
{ name = LSFilterToDoListJobCommand; },
Index: LSFetchDelegatedJobsCommand.m
===================================================================
--- LSFetchDelegatedJobsCommand.m (revision 2045)
+++ LSFetchDelegatedJobsCommand.m (working copy)
@@ -37,13 +37,10 @@
qualifier = [[[EOSQLQualifier allocWithZone:[self zone]]
initWithEntity:[self destinationEntity]
qualifierFormat:
- @"(%A <> '%@') AND "
- @"((%A IS NULL) OR (%A = 0)) AND"
- @"(%A <> %A) AND (%A IS NULL)",
+ @"(%A <> '%@') AND (%A <> %A)",
@"jobStatus", LSJobArchived,
- @"isControlJob", @"isControlJob",
@"creatorId", @"executantId",
- @"kind", nil] autorelease];
+ nil] autorelease];
return [self _checkConjoinWithQualifier:qualifier];
}
Index: LSFetchProjectToJobCommand.m
===================================================================
--- LSFetchProjectToJobCommand.m (revision 2045)
+++ LSFetchProjectToJobCommand.m (working copy)
@@ -53,9 +53,7 @@
qualifier = [[EOSQLQualifier allocWithZone:[self zone]]
initWithEntity:[self destinationEntity]
- qualifierFormat:
- @"((%A IS NULL) OR (%A = 0)) AND (%A IS NULL)",
- @"isControlJob", @"isControlJob", @"kind", nil];
+ qualifierFormat:@"(1 = 1)", nil];
[qualifier conjoinWithQualifier:[super _qualifier]];
return AUTORELEASE(qualifier);
}
Index: LSFilterDelegatedJobCommand.m
===================================================================
--- LSFilterDelegatedJobCommand.m (revision 2045)
+++ LSFilterDelegatedJobCommand.m (working copy)
@@ -45,16 +45,9 @@
enumerator = [[self jobList] objectEnumerator];
while ((job = [enumerator nextObject])) {
- BOOL isControlJob = NO;
- id ctrlJob = nil;
NSString *jobStatus = [job valueForKey:@"jobStatus"];
- ctrlJob = [job valueForKey:@"isControlJob"];
- if (ctrlJob != nil) {
- isControlJob = [ctrlJob boolValue];
- }
- if (!isControlJob &&
- ([[job valueForKey:@"creatorId"] isEqual:[self creatorId]]) &&
+ if (([[job valueForKey:@"creatorId"] isEqual:[self creatorId]]) &&
(![jobStatus isEqualToString:LSJobArchived]) &&
(![jobStatus isEqualToString:LSJobDone])) {
[filteredJobs addObject:job];
--=-fBcl5wBXhbMKLCTLpGBU--