Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
00bd14b6
Commit
00bd14b6
authored
Aug 18, 2017
by
bbaer
Browse files
Merge remote-tracking branch 'origin/feature_4144' into feature_4144
parents
361a7430
95e8b2d5
Changes
2
Show whitespace changes
Inline
Side-by-side
doc/PROTOCOL.md
View file @
00bd14b6
...
...
@@ -318,7 +318,7 @@ Server Response
: The response contains a [Minimal Response].
### Record
(s)
delete
### Record delete
Request the deletion of the record identified by the SIP. The SIP might contain a SIP_TABLE and/or a SIP_FORM.
If both are specified, SIP_FORM will be taken. With SIP_FORM, the tableName is derived from the form.
...
...
@@ -353,6 +353,43 @@ URL Parameters
Server Response
: The response contains at least a [Minimal Response]. In addition, a [Typeahead dict],
### Record lock
Request, extend or release a lock for a record, identified by the SIP. The SIP contain a SIP_FORM and a SIP_R (record id).
To detect record change at time of 'record lock' or 'record save', a MD5 hash is provided from the server
and needs to pass back to dirty.php as well.
Request
: api/dirty.php
Request Method
: GET
URL Parameters
:
`s=<SIP>`
(form, r)
:
`action=lock`
,
`action=extend`
,
`action=release>`
:
`recordHashMd5=<value of hidden form element 'recordHashMd5'>`
Server Response
: The response contains an [Lock Response].
### Lock Response
Asynchronous request (read AJAX) initiated by the Client receive a
JSON Response from the server (extended [Minimal Response]) containing:
{
"status": "success"|"error"|"conflict"|"conflict_allow_force",
"message": "<message>"
}
`status`
indicates how the request has been fullfiled by the server.
On
`"success"`
, the Client display nothing to the user.
On one of
`"error"|"conflict"|"conflict_allow_force"`
the Client must display
`"<message>"`
to the user.
On
`"conflict"`
the Client opens the alert as modal dialog (user can't change anything on the form) with a 'reload current
form' button.
On
`"conflict_allow_force"`
the Client opens the alert non-modal (default).
## Glossary
SIP
...
...
extension/qfq/qfq/QuickFormQuery.php
View file @
00bd14b6
...
...
@@ -274,13 +274,23 @@ class QuickFormQuery {
$answer
=
$dirty
->
checkDirtyAndRelease
(
$formMode
,
$this
->
formSpec
[
F_RECORD_LOCK_TIMEOUT_SECONDS
],
$this
->
formSpec
[
F_DIRTY_MODE
],
$this
->
formSpec
[
F_TABLE_NAME
],
$recordId
,
true
);
//
i
n case of a conflict, return immediately
//
I
n case of a conflict, return immediately
if
(
$answer
[
API_STATUS
]
!=
API_ANSWER_STATUS_SUCCESS
)
{
$answer
[
API_STATUS
]
=
API_ANSWER_STATUS_ERROR
;
return
$answer
;
}
}
// FORM_LOAD: if there is an foreign exclusive record lock - show form in F_MODE_READONLY mode.
if
(
$formMode
===
FORM_LOAD
)
{
$dirty
=
new
Dirty
();
$recordDirty
=
array
();
$rcLockFound
=
$dirty
->
getCheckDirty
(
$this
->
formSpec
[
F_TABLE_NAME
],
$recordId
,
$recordDirty
,
$msg
);
if
((
$rcLockFound
==
LOCK_FOUND_CONFLICT
||
$rcLockFound
==
LOCK_FOUND_OWNER
)
&&
$recordDirty
[
F_DIRTY_MODE
]
==
DIRTY_MODE_EXCLUSIVE
)
{
$this
->
formSpec
[
F_MODE
]
=
F_MODE_READONLY
;
}
}
if
(
$formMode
===
FORM_DELETE
)
{
$build
=
new
Delete
();
...
...
@@ -936,7 +946,7 @@ class QuickFormQuery {
unset
(
$data
[
API_ELEMENT_UPDATE
]);
}
if
(
count
(
$data
)
>
0
){
if
(
count
(
$data
)
>
0
)
{
$collect
[
API_FORM_UPDATE
][]
=
$data
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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