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
b0234a57
Commit
b0234a57
authored
Jul 10, 2017
by
Carsten Rose
Browse files
Feature #3981 / Record Locking
Fixed some 'unknown index' issues - deny save in a first version works.
parent
a0cd3709
Changes
2
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Constants.php
View file @
b0234a57
...
...
@@ -1101,4 +1101,5 @@ const DIRTY_MODE_READONLY = 'readonly';
const
DIRTY_MODE_OVERWRITE
=
'overwrite'
;
const
DIRTY_MODE_NONE
=
'none'
;
const
DIRTY_QFQ_USER_SESSION_COOKIE
=
'qfqUserSessionCookie'
;
const
DIRTY_FE_USER
=
'feUser'
;
\ No newline at end of file
const
DIRTY_FE_USER
=
'feUser'
;
const
DIRTY_REMOTE_ADDRESS
=
'remoteAddress'
;
\ No newline at end of file
extension/qfq/qfq/form/Dirty.php
View file @
b0234a57
...
...
@@ -97,7 +97,7 @@ class Dirty {
// No dirty record found.
$answer
=
$this
->
writeDirty
(
$this
->
client
[
SIP_SIP
],
$recordId
,
$tableName
,
$formDirtyMode
,
$feUser
);
}
else
{
$answer
=
$this
->
conflict
(
$recordDirty
,
$formDirtyMode
,
$feUser
);
$answer
=
$this
->
conflict
(
$recordDirty
,
$formDirtyMode
);
}
return
$answer
;
...
...
@@ -114,7 +114,7 @@ class Dirty {
*/
private
function
getRecordDirty
(
$tableName
,
$recordId
)
{
$recordDirty
=
$this
->
db
->
sql
(
"SELECT
id, sip, feUser, qfqUserSessionCookie, dirtyMode
FROM Dirty AS d WHERE d.tableName LIKE ? AND recordId=? "
,
$recordDirty
=
$this
->
db
->
sql
(
"SELECT
*
FROM Dirty AS d WHERE d.tableName LIKE ? AND recordId=? "
,
ROW_EXPECT_0_1
,
[
$tableName
,
$recordId
]);
return
$recordDirty
;
...
...
@@ -126,10 +126,10 @@ class Dirty {
* @param $currentFormDirtyMode
* @return array
*/
private
function
conflict
(
array
$recordDirty
,
$currentFormDirtyMode
,
$feUser
)
{
private
function
conflict
(
array
$recordDirty
,
$currentFormDirtyMode
)
{
$status
=
API_ANSWER_STATUS_CONFLICT
;
$at
=
"at "
.
$recordDirty
[
COLUMN_CREATED
]
.
" from "
.
$recordDirty
[
CLIENT
_REMOTE_ADDRESS
];
$at
=
"at "
.
$recordDirty
[
COLUMN_CREATED
]
.
" from "
.
$recordDirty
[
DIRTY
_REMOTE_ADDRESS
];
if
(
$this
->
client
[
CLIENT_COOKIE_QFQ
]
==
$recordDirty
[
DIRTY_QFQ_USER_SESSION_COOKIE
])
{
$msg
=
"The record has already been tagged for editing by you (maybe in another browser tab)
$at
!"
;
...
...
@@ -137,10 +137,10 @@ class Dirty {
}
else
{
if
(
empty
(
$
feUser
))
{
if
(
empty
(
$
recordDirty
[
DIRTY_FE_USER
]
))
{
$msgUser
=
"another user"
;
}
else
{
$msgUser
=
"user '
$
feUser
'"
;
$msgUser
=
"user '
$
recordDirty[DIRTY_FE_USER]
'"
;
}
$msg
=
"The record has already been tagged for editing by
$msgUser
at
$at
."
;
...
...
@@ -207,7 +207,7 @@ class Dirty {
return
;
}
$at
=
"at "
.
$recordDirty
[
COLUMN_CREATED
]
.
" from "
.
$recordDirty
[
CLIENT
_REMOTE_ADDRESS
];
$at
=
"at "
.
$recordDirty
[
COLUMN_CREATED
]
.
" from "
.
$recordDirty
[
DIRTY
_REMOTE_ADDRESS
];
$msgUser
=
(
empty
(
$recordDirty
[
DIRTY_FE_USER
]))
?
"another user"
:
"user '
$recordDirty[DIRTY_FE_USER]
'"
;
// Check if the record is timed out
...
...
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