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
dfa721ab
Commit
dfa721ab
authored
Aug 03, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed permission problems and split join and save views
parent
96c8bda2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
32 deletions
+54
-32
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+17
-9
lib/python/Products/OFSP/version.dtml
lib/python/Products/OFSP/version.dtml
+0
-23
lib/python/Products/OFSP/versionEnd.dtml
lib/python/Products/OFSP/versionEnd.dtml
+37
-0
No files found.
lib/python/Products/OFSP/Version.py
View file @
dfa721ab
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Version object"""
__version__
=
'$Revision: 1.3
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
...
...
@@ -110,25 +110,32 @@ class Version(Persistent,Implicit,RoleManager,Item):
""" """
meta_type
=
'Version'
manage_options
=
({
'label'
:
'Join/Leave'
,
'action'
:
'manage_main'
},
{
'label'
:
'Properties'
,
'action'
:
'manage_editForm'
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
)
manage_options
=
(
{
'label'
:
'Join/Leave'
,
'action'
:
'manage_main'
},
{
'label'
:
'Save/Discard'
,
'action'
:
'manage_end'
},
{
'label'
:
'Properties'
,
'action'
:
'manage_editForm'
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
)
__ac_permissions__
=
(
(
'View management screens'
,
(
'manage'
,
'manage_editForm'
,
''
)),
(
'Change Versions'
,
(
'manage_edit'
,)),
(
'Join/leave Versions'
,
(
'enter'
,
'leave'
,
'leave_another'
)),
(
'Save/discard Version changes'
,
(
'save'
,
'discard'
)),
(
'Join/leave Versions'
,
(
'manage_main'
,
'enter'
,
'leave'
,
'leave_another'
)),
(
'Save/discard Version changes'
,
(
'manage_end'
,
'save'
,
'discard'
)),
)
cookie
=
''
index_html
=
None
# Ugh.
def
__init__
(
self
,
id
,
title
,
REQUEST
):
self
.
id
=
id
self
.
title
=
title
manage
=
manage_main
=
Globals
.
HTMLFile
(
'version'
,
globals
())
manage_main
=
Globals
.
HTMLFile
(
'version'
,
globals
())
manage_end
=
Globals
.
HTMLFile
(
'versionEnd'
,
globals
())
manage_editForm
=
Globals
.
HTMLFile
(
'versionEdit'
,
globals
())
def
title_and_id
(
self
):
...
...
@@ -208,7 +215,7 @@ class Version(Persistent,Implicit,RoleManager,Item):
if
REQUEST
is
not
None
:
REQUEST
[
'RESPONSE'
].
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
def
discard
(
self
,
REQUEST
=
None
):
def
discard
(
self
,
remark
=
''
,
REQUEST
=
None
):
'Discard changes made during the version'
try
:
db
=
self
.
_p_jar
.
db
()
except
:
...
...
@@ -216,6 +223,7 @@ class Version(Persistent,Implicit,RoleManager,Item):
Globals
.
VersionBase
[
self
.
cookie
].
abort
()
else
:
# ZODB 3
get_transaction
().
note
(
remark
)
db
.
abortVersion
(
self
.
cookie
)
if
REQUEST
is
not
None
:
...
...
lib/python/Products/OFSP/version.dtml
View file @
dfa721ab
...
...
@@ -40,29 +40,6 @@
<input type=submit value="Start Working in <!--#var title_or_id-->">
</form>
<!--#endif-->
<!--#if nonempty-->
<hr>
<p><form action=save>
You can make work done in <!--#var title_and_id--> permanent by
entering a remark in the space below and then
clicking on the "Save" button.<br>
<textarea name=remark rows=10 cols=50></textarea><br>
<input type=submit value="Save">
</form>
<hr>
<p><form action=discard>
You can throw away work done in <!--#var title_and_id--> by
clicking on the "Discard" button.
<input type=submit value="Discard">
</form>
<!--#endif-->
</body> </html>
...
...
lib/python/Products/OFSP/versionEnd.dtml
0 → 100644
View file @
dfa721ab
<HTML><HEAD><TITLE><dtml-var title_or_id></TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<dtml-var manage_tabs>
<h2>Save or discard work done in a sesssion</h2>
<dtml-if nonempty>
<form action="&dtml-URL1;">
To save work done in version
<dtml-var id><dtml-if Zope-Version><dtml-if "_vars['Zope-Version'] != cookie">
<strong>to version
<em><dtml-var Zope-Version></em></strong></dtml-if></dtml-if>,
click on the "Save" button. To discard work done in
version <dtml-var id>, click on the "Discard" button.
In either case, enter a comment to document the reason for
saving or discarding the version.<br>
<textarea name=remark rows=10 cols=50></textarea><br>
<input type=submit name="save:method" value="Save">
<input type=submit name="discard:method" value="Discard">
</form>
<dtml-else>
No unsaved work has been done in this version.
</dtml-if>
</body> </html>
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