Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
druid-public
headwork
Commits
abdde1cc
Commit
abdde1cc
authored
Jun 19, 2021
by
GROSS-AMBLARD David
Browse files
Fixes the use of nodetip as a transition destination in Artifact.php
parent
0d00bf5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
artifacts.php
View file @
abdde1cc
...
...
@@ -120,44 +120,46 @@ function updateonce($conn, $artifact, $artifactid, $count)
$actions
=
''
;
foreach
(
$stateinfo
as
$dest
=>
$v
)
{
debug
(
"checking transition
$node
->
$dest
"
);
debug
(
"node data: "
.
json_encode
(
$stateinfo
[
$dest
]));
if
(
$dest
<>
"nodetip"
){
debug
(
"checking transition
$node
->
$dest
"
);
debug
(
"node data: "
.
json_encode
(
$stateinfo
[
$dest
]));
if
(
isset
(
$artifact
[
$node
][
$dest
][
"guard"
])
){
$guard
=
$artifact
[
$node
][
$dest
][
"guard"
];
$guard
=
sugarFree
(
$guard
);
}
if
(
isset
(
$artifact
[
$node
][
$dest
][
"guard"
])
){
$guard
=
$artifact
[
$node
][
$dest
][
"guard"
];
$guard
=
sugarFree
(
$guard
);
}
if
(
$guard
==
"none"
)
$guard
=
"select true from dual"
;
if
(
preg_match
(
"/^task ([0-9]+) is answered/"
,
$guard
,
$matches
)){
$guard
=
"select true from Answered where artifact=CURRENT_ARTIFACT and id="
.
$matches
[
1
];
}
$guard
=
str_replace
(
'SESSION_USER'
,
$_SESSION
[
'id'
],
$guard
);
$guard
=
str_replace
(
"CURRENT_ARTIFACT"
,
$artifactid
,
$guard
);
$actions
=
str_replace
(
'SESSION_USER'
,
$_SESSION
[
'id'
],
$artifact
[
$node
][
$dest
][
"actions"
]);
if
(
isset
(
$artifact
[
$node
][
$dest
][
"actions"
])
){
if
(
$guard
==
"none"
)
$guard
=
"select true from dual"
;
if
(
preg_match
(
"/^task ([0-9]+) is answered/"
,
$guard
,
$matches
)){
$guard
=
"select true from Answered where artifact=CURRENT_ARTIFACT and id="
.
$matches
[
1
];
}
$guard
=
str_replace
(
'SESSION_USER'
,
$_SESSION
[
'id'
],
$guard
);
$guard
=
str_replace
(
"CURRENT_ARTIFACT"
,
$artifactid
,
$guard
);
$actions
=
str_replace
(
'SESSION_USER'
,
$_SESSION
[
'id'
],
$artifact
[
$node
][
$dest
][
"actions"
]);
}
if
(
isset
(
$_SESSION
[
'skills'
]))
{
$actions
=
str_replace
(
'SKILLS'
,
$_SESSION
[
'skills'
],
$actions
);
// TODO but actions is an array?
// TODO what for?
}
if
(
isset
(
$artifact
[
$node
][
$dest
][
"actions"
])
){
$actions
=
str_replace
(
'SESSION_USER'
,
$_SESSION
[
'id'
],
$artifact
[
$node
][
$dest
][
"actions"
]);
}
if
(
isset
(
$_SESSION
[
'skills'
]))
{
$actions
=
str_replace
(
'SKILLS'
,
$_SESSION
[
'skills'
],
$actions
);
// TODO but actions is an array?
// TODO what for?
}
//We make sure that guard and actions are not empty before sending a query to activate step
if
(
$guard
!==
''
&&
$actions
!==
''
){
//We make sure that guard and actions are not empty before sending a query to activate step
if
(
$guard
!==
''
&&
$actions
!==
''
){
$activated
=
step
(
$conn
,
$artifactid
,
$node
,
$dest
,
$guard
,
$actions
);
debug
(
"result:"
.
$activated
);
if
(
$activated
)
{
return
true
;
}
$activated
=
step
(
$conn
,
$artifactid
,
$node
,
$dest
,
$guard
,
$actions
);
debug
(
"result:"
.
$activated
);
if
(
$activated
)
{
return
true
;
}
$activated
=
step
(
$conn
,
$artifactid
,
$node
,
$dest
,
$guard
,
$actions
);
if
(
$activated
)
{
return
true
;
}
}
debug
(
"no transition from
$node
"
);
...
...
template-main.php
View file @
abdde1cc
...
...
@@ -70,7 +70,7 @@
<!-- no-repeat bottom right/20% url('projects/headwork/background.jpg'); background-color: rgb(197,205,66);"> -->
<!-- <body> -->
<nav
class=
"navbar
fixed-top
navbar-dark justify-content-between bg-dark flex-sm-row flex-column"
style=
"background-color: black;"
>
<nav
class=
"navbar navbar-dark justify-content-between bg-dark flex-sm-row flex-column"
style=
"background-color: black;"
>
<!-- Navbar content -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment