readded packages system
This commit is contained in:
parent
22d3404b30
commit
3671e3f29d
10 changed files with 125 additions and 57 deletions
|
|
@ -97,6 +97,16 @@ sub getBox {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub duplicate {
|
||||
my $self = shift;
|
||||
my $newAsset = $self->SUPER::duplicate(shift);
|
||||
my $newStorage = $self->getStorageLocation->copy;
|
||||
$newAsset->update({storageId=>$newStorage->getId,olderVersions=>''});
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getEditForm ()
|
||||
|
|
|
|||
|
|
@ -166,21 +166,15 @@ sub confirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 duplicate ( [ pageId ] )
|
||||
=head2 duplicate ( asset )
|
||||
|
||||
Duplicates this wobject with a new wobject Id. Returns the new wobject Id.
|
||||
|
||||
B<NOTE:> This method is meant to be extended by all sub-classes.
|
||||
|
||||
=head3 pageId
|
||||
|
||||
If specified the wobject will be duplicated to this pageId, otherwise it will be duplicated to the clipboard.
|
||||
Extends the Asset duplicate method to also duplicate meta data.
|
||||
|
||||
=cut
|
||||
|
||||
sub duplicate {
|
||||
my $self = shift;
|
||||
my $newAsset = $self->SUPER::duplicate();
|
||||
my $newAsset = $self->SUPER::duplicate(shift);
|
||||
WebGUI::MetaData::MetaDataDuplicate($self->getId, $newAsset->getId);
|
||||
return $newAsset;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ sub definition {
|
|||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my $self = shift;
|
||||
my $newAsset = $self->SUPER::duplicate;
|
||||
my $newAsset = $self->SUPER::duplicate(shift);
|
||||
my (%dataField, %dataTab, $sthField, $sthTab, $newTabId);
|
||||
tie %dataTab, 'Tie::CPHash';
|
||||
tie %dataField, 'Tie::CPHash';
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ sub definition {
|
|||
#-------------------------------------------------------------------
|
||||
sub duplcate {
|
||||
my $self = shift;
|
||||
my $newAsset = $self->SUPER::duplicate;
|
||||
my $newAsset = $self->SUPER::duplicate(shift);
|
||||
my $sth = WebGUI::SQL->read("select * from Poll_answer where assetId=".quote($self->getId));
|
||||
while (my $data = $sth->hashRef) {
|
||||
$newAsset->setVote($data->{answer}, $data->{userId}, $data->{ipAddress});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue