Index: openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml,v diff -u -r1.47.2.2 -r1.47.2.3 --- openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 12 May 2019 19:47:10 -0000 1.47.2.2 +++ openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 24 May 2019 17:42:53 -0000 1.47.2.3 @@ -38,6 +38,7 @@ L�schen best�tigen? L�sche diese Seite ... Details + Duplizieren Bearbeiten Kategorienbaum bearbeiten bearbeiten Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v diff -u -r1.71.2.1 -r1.71.2.2 --- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 21 Mar 2019 16:36:44 -0000 1.71.2.1 +++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 24 May 2019 17:42:53 -0000 1.71.2.2 @@ -39,6 +39,7 @@ Confirm delete? Delete this page ... Detail Link + Duplicate Edit Edit Category Tree edit tags Index: openacs-4/packages/xowiki/catalog/xowiki.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.es_ES.ISO-8859-1.xml,v diff -u -r1.16 -r1.16.2.1 --- openacs-4/packages/xowiki/catalog/xowiki.es_ES.ISO-8859-1.xml 7 Aug 2017 23:48:30 -0000 1.16 +++ openacs-4/packages/xowiki/catalog/xowiki.es_ES.ISO-8859-1.xml 24 May 2019 17:42:53 -0000 1.16.2.1 @@ -38,6 +38,7 @@ �Confirma la eliminaci�n? Borrar esta p�gina Detalles + Duplicar Editar Editar categor�a editar tags Index: openacs-4/packages/xowiki/catalog/xowiki.it_IT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.it_IT.ISO-8859-1.xml,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/xowiki/catalog/xowiki.it_IT.ISO-8859-1.xml 28 Feb 2019 16:25:38 -0000 1.3.2.1 +++ openacs-4/packages/xowiki/catalog/xowiki.it_IT.ISO-8859-1.xml 24 May 2019 17:42:53 -0000 1.3.2.2 @@ -39,6 +39,7 @@ Confermi la cancellazione? Elimina questa pagina... Link Dettaglio + Duplicare Edita Edita Albero di Categorie edita tag Index: openacs-4/packages/xowiki/tcl/folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/folder-procs.tcl,v diff -u -r1.55.2.7 -r1.55.2.8 --- openacs-4/packages/xowiki/tcl/folder-procs.tcl 12 May 2019 19:40:37 -0000 1.55.2.7 +++ openacs-4/packages/xowiki/tcl/folder-procs.tcl 24 May 2019 17:42:53 -0000 1.55.2.8 @@ -555,7 +555,7 @@ {manage-categories 1} {object_id $package_id} }] - set columns {objects edit object_type name last_modified mod_user delete} + set columns {objects edit object_type name last_modified mod_user duplicate delete} foreach column $columns {set ::hidden($column) 0 } if {[info exists hide]} { foreach column $hide { @@ -582,12 +582,16 @@ -url $::__xowiki_folder_link } } + # The "-html" options are currently ignored in the YUI # DataTable. Not sure, it can be integrated in the traditional way. # HiddenField create ID AnchorField create edit -CSSclass edit-item-button -label "" \ -hide $::hidden(edit) + AnchorField create duplicate -CSSclass copy-item-button \ + -hide $::hidden(duplicate) \ + -label "" if {$::__xowiki_with_publish_status} { ImageAnchorField create publish_status -orderby publish_status.src -src "" \ -width 8 -height 8 -border 0 -title "Toggle Publish Status" \ @@ -651,10 +655,12 @@ -edit.href [export_vars -base $page_link {{m edit} return_url}] \ -edit.title #xowiki.edit# \ -mod_user [::xo::get_user_name [$c set creation_user]] \ + -duplicate "" \ + -duplicate.href [export_vars -base $page_link {{m duplicate} return_url}] \ + -duplicate.title #xowiki.duplicate# \ -delete "" \ -delete.href [export_vars -base $page_link {{m delete} return_url}] \ -delete.title #xowiki.delete# - if {$::__xowiki_with_publish_status} { # TODO: this should get some architectural support if {[$c set publish_status] eq "ready"} { Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.332.2.11 -r1.332.2.12 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 12 May 2019 19:55:44 -0000 1.332.2.11 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 24 May 2019 17:42:53 -0000 1.332.2.12 @@ -1986,7 +1986,7 @@ -parameter PreferredCSSToolkit \ -default bootstrap] } - + Package proc lookup_side_wide_page {-name:required} { return [::xo::db::CrClass lookup -name $name -parent_id -100] } @@ -2736,6 +2736,7 @@ delete-revision {{package_id admin}} delete {{package_id admin}} bulk-delete {{package_id admin}} + duplicate {{package_id write}} save-tags login popular-tags login create-new {{parent_id create}} @@ -2796,6 +2797,7 @@ delete-revision swa delete swa bulk-delete swa + duplicate {{package_id write}} save-tags login popular-tags login create-new {{parent_id create}} @@ -2849,6 +2851,7 @@ delete-revision swa delete swa bulk-delete swa + duplicate {{parent_id create}} save-tags login popular-tags login create-new {{parent_id create}} @@ -2929,6 +2932,7 @@ delete-revision swa delete swa bulk-delete swa + duplicate {{parent_id create}} save-tags login popular-tags login create-new {{parent_id create}} Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.368.2.15 -r1.368.2.16 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 12 May 2019 19:55:44 -0000 1.368.2.15 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 24 May 2019 17:42:53 -0000 1.368.2.16 @@ -145,22 +145,22 @@ to the return_url of the calling page. } { - set package_id ${:package_id} set clipboard [::xowiki::clipboard get] set item_ids [::xowiki::exporter include_needed_objects $clipboard] set content [::xowiki::exporter marshall_all -mode copy $item_ids] + ad_try { namespace eval ::xo::import $content } on error {errMsg} { :msg "Error: $errMsg\n$::errorInfo" return } set folder_id [expr {[:is_folder_page] ? ${:item_id} : ${:parent_id}}] - set msg [::$package_id import -replace 0 -create_user_ids 1 \ + set msg [::${:package_id} import -replace 0 -create_user_ids 1 \ -parent_id $folder_id -objects $item_ids] util_user_message -html -message $msg ::xowiki::clipboard clear - ::$package_id returnredirect [:query_parameter "return_url" [::xo::cc url]] + ::${:package_id} returnredirect [:query_parameter "return_url" [::xo::cc url]] } # @@ -178,10 +178,49 @@ ns_conn close ::xowiki::clipboard clear ad_script_abort - #${:package_id} returnredirect [:query_parameter "return_url" [::xo::cc url]] } # + # Externally callable method: duplicate + # + Page ad_instproc www-duplicate {} { + + This web-callable method duplcated the current object. It uses the + same mechanisms as the clipboard-copy operation. + + After a adding elements to the clipboard, redirect either to the + return_url of the calling page (as handled by www-clipboard-copy) + + } { + ::xowiki::clipboard clear + ::xowiki::clipboard add [list ${:item_id}] + + if {![regexp {^(.*[-]copy-)\d+} ${:name} . stem]} { + set stem ${:name}-copy- + } + set new_name [::xowiki::autoname new -name $stem -parent_id ${:package_id}] + set old_name ${:name} + + ad_try { + set :name $new_name + # + # Call whatever clipboard-copy is doing.... + # + :www-clipboard-copy + + } finally { + # + # Restore the actual object + # + set :name $old_name + # + # To be on the save side, flush the cache + # + ::xo::xotcl_object_cache flush ${:item_id} + } + } + + # # Externally callable method: create-new #