Skip to content
Snippets Groups Projects
Commit d0c6685c authored by Ruud Overeem's avatar Ruud Overeem
Browse files

Bug 1284: Attempt to set start and stoptijd when state is set to active,...

Bug 1284: Attempt to set start and stoptijd when state is set to active, finished or aborted is set.
parent 13c194b5
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,10 @@ CREATE OR REPLACE FUNCTION setTreeState(INT4, INT4, INT2) ...@@ -46,7 +46,10 @@ CREATE OR REPLACE FUNCTION setTreeState(INT4, INT4, INT2)
vAuthToken ALIAS FOR $1; vAuthToken ALIAS FOR $1;
vUserID INT4; vUserID INT4;
TThardware CONSTANT INT2 := 10; TThardware CONSTANT INT2 := 10;
TTVIC CONSTANT INT2 := 30;
TSactive CONSTANT INT2 := 600; TSactive CONSTANT INT2 := 600;
TSfinished CONSTANT INT2 := 1000;
TSaborted CONSTANT INT2 := 1100;
TSobsolete CONSTANT INT2 := 1200; TSobsolete CONSTANT INT2 := 1200;
BEGIN BEGIN
...@@ -117,6 +120,22 @@ CREATE OR REPLACE FUNCTION setTreeState(INT4, INT4, INT2) ...@@ -117,6 +120,22 @@ CREATE OR REPLACE FUNCTION setTreeState(INT4, INT4, INT2)
END; END;
END IF; END IF;
-- add timeinfo to VIC trees
IF vTreeType = TTVIC THEN
BEGIN
IF $3 = TSactive THEN
UPDATE OTDBtree
SET starttime = now()
WHERE treeid = $2;
END IF;
IF $3 = TSfinished OR $3 = TSaborted THEN
UPDATE OTDBtree
SET stoptime = now()
WHERE treeid = $2;
END IF;
END;
END IF;
RETURN TRUE; RETURN TRUE;
END; END;
' LANGUAGE plpgsql; ' LANGUAGE plpgsql;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment