button to be coded: save and new item, using copy of previous entry

Author Message

Hardy Pottinger

Tuesday 24 February 2004 8:39:06 pm

We're coding a project that will implement a sort of database using eZPublish 3.3 as a base. We've set up a custom class, and it does most of what we want to do, but we have a spec that will likely require us to alter some code... and I wanted some input on the best way to approach it. Ideally, I'd like for us to code in a way that will have minimal impact on future upgradeability (we're still running a major site with a heavily modified version of a 2.2.1 installation... and I don't want to go there again if I don't have to).

We need a button which will save a new entry, and then create a new entry, already populated with data from the previous entry.

Can this be done without modifying the kernel?

Thanks for whatever guidance you can provide!

Hardy Pottinger

Wednesday 25 February 2004 11:12:50 pm

An update, I managed to sort of get what I want with a one-line entry in an overide form for this particular class (design/foobar/override/templates/edit_foobar_entry.tpl). I just drop this in the form with the buttons at the end of the template:

<input type="checkbox" name="RedirectURI" value={concat("/content/copy/",$object.id,"/")} /> save and copy

If you check the box and click submit, you save the original entry and are then redirected to the "do you want the current version or all versions?" intermediate page of the copy process, which is silly, at least in this case... But at least I'm close.

Anyone have any ideas of how to skip this intermediate copy screen? I've tried hard-coding some GET parameters, but it looks like that's not going to work.

If I figure it out first I'll let you know.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:32:37
Script start
Timing: Jan 18 2025 22:32:37
Module start 'layout'
Timing: Jan 18 2025 22:32:37
Module start 'content'
Timing: Jan 18 2025 22:32:38
Module end 'content'
Timing: Jan 18 2025 22:32:38
Script end

Main resources:

Total runtime1.0239 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.6094152.6563
Module start 'layout' 0.00610.0041 742.265639.5078
Module start 'content' 0.01021.0122 781.7734458.9609
Module end 'content' 1.02240.0015 1,240.73448.0938
Script end 1.0239  1,248.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00550.5378160.0003
Check MTime0.00300.2887160.0002
Mysql Total
Database connection0.00090.085210.0009
Mysqli_queries0.973795.0947520.0187
Looping result0.00050.0500500.0000
Template Total0.983696.120.4918
Template load0.00530.514120.0026
Template processing0.978395.547320.4892
Template load and register function0.00010.013210.0001
states
state_id_array0.00190.188010.0019
state_identifier_array0.00190.181820.0009
Override
Cache load0.00480.4697150.0003
Sytem overhead
Fetch class attribute can translate value0.00050.049110.0005
Fetch class attribute name0.00150.151030.0005
XML
Image XML parsing0.00210.201110.0021
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00230.2287160.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs