Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset Cloning #68

Open
wants to merge 6 commits into
base: 3.0-trunk
Choose a base branch
from
Open

Asset Cloning #68

wants to merge 6 commits into from

Conversation

tbrumm
Copy link
Contributor

@tbrumm tbrumm commented Sep 2, 2014

Hi Bradley,
hope the code is fine so far and you like it

Torsten

Add Clone Asset tot he Menu
Clone an Asset fromexsisting Asset
Subroutine to clone an asset
@btb
Copy link
Member

btb commented Sep 2, 2014

Thanks Torsten,
There is cloning code in Asset/Display.html, which works, but is incomplete. Could you either update that code or remove it? Also the Clone method should just go into Asset.pm

Brad

@tbrumm
Copy link
Contributor Author

tbrumm commented Sep 4, 2014

Hi Brad,
is there code already? OK, will check it and sent another Pull request.

Thanks

Torsten

moved code from asset_local.pm to general asset.pm
Moved to general File
@tbrumm
Copy link
Contributor Author

tbrumm commented Sep 4, 2014

Hi Brad,
changed the sub routine from Asset_local.pm to Asset.pm, but this part: (There is cloning code in Asset/Display.html) i cant find inside that file....can you pls point me to this? (possibly i'm not wake enough).

@btb
Copy link
Member

btb commented Sep 4, 2014

My mistake. It should be in Asset/Create.html
It's closely modeled on the cloning code in Ticket/Create.html

RT's _Overlay.pm mechanism was never meant to be used by distributed
extensions, and causes problems when used that way. Instead the code should
be loaded when the extension itself is loaded.

-Brad

On Sep 3, 2014, at 11:57 PM, Torsten Brumm [email protected] wrote:

Hi Brad,
changed the sub routine from Asset_local.pm to Asset.pm, but this part:
(There is cloning code in Asset/Display.html) i cant find inside that
file....can you pls point me to this? (possibly i'm not wake enough).


Reply to this email directly or view it on GitHub
#68 (comment)
.

Clone Asset Parts removed from Create HTML

Uncommented Transaction Customfields also cleaned from Code
@tbrumm
Copy link
Contributor Author

tbrumm commented Sep 4, 2014

OK, removed from Create HTML all Clone Parts, no idea where they are from.

@btb
Copy link
Member

btb commented Sep 4, 2014

After looking again, I think I mostly like the old method better - I've been using it for years already, it's just not exposed in the menus. This callback to Elements/Tabs/Privileged works, we could just make it part of the default menu.

<%perl>
my $request_path = $HTML::Mason::Commands::r->path_info;

    if ( $request_path =~ m{^/AssetTracker/Asset/} ) {
        if ( ( $DECODED_ARGS->{'id'} || '' ) =~ /^(\d+)$/ ) {
            my $id  = $1;
            my $Asset = RTx::AssetTracker::Asset->new( $session{'CurrentUser'} );
            $Asset->Load($id);

            my $actions = PageMenu()->child( actions => title => loc('Actions'), sort_order  => 95 );
            $actions->child( 'clone' =>
                title => 'Clone',
                path => "/AssetTracker/Asset/Create.html?Type=" . $Asset->Type . "&CloneAsset=" . $Asset->id,
            );
        }
    }
</%perl>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants