Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9bef361c
Commit
9bef361c
authored
Sep 24, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checks to prevent moving uncommitted sessions and drafts
parent
1ff51999
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
7 deletions
+45
-7
lib/python/Products/OFSP/Draft.py
lib/python/Products/OFSP/Draft.py
+23
-3
lib/python/Products/OFSP/Session.py
lib/python/Products/OFSP/Session.py
+11
-2
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+11
-2
No files found.
lib/python/Products/OFSP/Draft.py
View file @
9bef361c
...
...
@@ -46,10 +46,12 @@ class Draft(Persistent, Implicit, SimpleItem.Item):
self
.
__allow_groups__
=
uf
def
icon
(
self
):
return
getattr
(
self
.
aq_parent
.
aq_base
,
self
.
_refid
).
icon
try
:
return
getattr
(
self
.
aq_parent
.
aq_base
,
self
.
_refid
).
icon
except
:
return
'p_/broken'
def
manage_options
(
self
):
return
getattr
(
self
.
aq_parent
.
aq_base
,
self
.
_refid
).
manage_options
try
:
return
getattr
(
self
.
aq_parent
.
aq_base
,
self
.
_refid
).
manage_options
except
:
return
()
def
title
(
self
):
return
'draft of '
+
self
.
_refid
...
...
@@ -95,6 +97,24 @@ class Draft(Persistent, Implicit, SimpleItem.Item):
if
REQUEST
:
REQUEST
[
'RESPONSE'
].
redirect
(
REQUEST
[
'URL2'
]
+
'/manage_main'
)
def
_notifyOfCopyTo
(
self
,
container
,
isMove
=
0
):
if
isMove
and
self
.
nonempty
():
raise
'Copy Error'
,
(
"You cannot copy a %s object with <b>unapproved</b> changes.
\
n
"
"You must <b>approve</b> the changes first."
%
self
.
meta_type
)
def
_postCopy
(
self
,
container
,
op
=
0
):
try
:
session
=
self
.
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
session
,
'/'
)
if
l
>=
0
:
session
=
session
[:
l
]
self
.
_session
=
"%s/%s"
%
(
session
,
self
.
id
)
finally
:
if
0
:
raise
'Copy Error'
,
(
"This object can only be copied through the web.<p>"
)
def
getdraft
(
ob
,
session
):
if
hasattr
(
ob
,
'aq_parent'
):
...
...
lib/python/Products/OFSP/Session.py
View file @
9bef361c
"""Session object"""
__version__
=
'$Revision: 1.2
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
1
$'
[
11
:
-
2
]
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
...
...
@@ -114,6 +114,12 @@ class Session(Persistent,Implicit,RoleManager,Item):
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
def
_notifyOfCopyTo
(
self
,
container
,
isMove
=
0
):
if
isMove
and
self
.
nonempty
():
raise
'Copy Error'
,
(
"You cannot copy a %s object with <b>unsaved</b> changes.
\
n
"
"You must <b>save</b> the changes first."
%
self
.
meta_type
)
import
__init__
...
...
@@ -123,6 +129,9 @@ __init__.need_license=1
##############################################################################
#
# $Log: Session.py,v $
# Revision 1.21 1998/09/24 20:13:40 jim
# Added checks to prevent moving uncommitted sessions and drafts
#
# Revision 1.20 1998/09/24 19:21:52 jim
# added Draft objects
#
...
...
lib/python/Products/OFSP/Version.py
View file @
9bef361c
"""Session object"""
__version__
=
'$Revision: 1.2
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
1
$'
[
11
:
-
2
]
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
...
...
@@ -114,6 +114,12 @@ class Session(Persistent,Implicit,RoleManager,Item):
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
def
_notifyOfCopyTo
(
self
,
container
,
isMove
=
0
):
if
isMove
and
self
.
nonempty
():
raise
'Copy Error'
,
(
"You cannot copy a %s object with <b>unsaved</b> changes.
\
n
"
"You must <b>save</b> the changes first."
%
self
.
meta_type
)
import
__init__
...
...
@@ -123,6 +129,9 @@ __init__.need_license=1
##############################################################################
#
# $Log: Version.py,v $
# Revision 1.21 1998/09/24 20:13:40 jim
# Added checks to prevent moving uncommitted sessions and drafts
#
# Revision 1.20 1998/09/24 19:21:52 jim
# added Draft objects
#
...
...
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