Version 5.0.0 beta 10
This commit is contained in:
1 parent
56979f8ee8
commit
264eeb97e0
325 files changed
+6442
-1849
No files matched your search
@@ -308,6 +308,11 @@ class Package extends Model
|
||||
{
|
||||
Lang::deleteCustom( 'nexus', "nexus_package_{$this->id}{$suffix}" );
|
||||
}
|
||||
|
||||
foreach( [ 'pkg-assoc', 'pkg', 'pkg-pg' ] as $id3 )
|
||||
{
|
||||
SystemFile::unclaimAttachments( 'nexus_Admin', $this->_id, null, $id3 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,6 +362,23 @@ class Package extends Model
|
||||
Lang::saveCustom( 'nexus', static::$titleLangPrefix . $id . $suffix, iterator_to_array( Db::i()->select( 'word_custom, lang_id', 'core_sys_lang_words', array( 'word_key=?', static::$titleLangPrefix . $oldId . $suffix ) )->setKeyField( 'lang_id' )->setValueField('word_custom') ) );
|
||||
}
|
||||
|
||||
/* If the description had attachments, link them */
|
||||
$attachmentMappings = [];
|
||||
foreach( Db::i()->select( '*', 'core_attachments_map', [
|
||||
[ 'location_key=?', 'nexus_Admin' ],
|
||||
[ 'id1=?', $oldId ],
|
||||
[ 'id2 is null' ],
|
||||
[ Db::i()->in( 'id3', [ 'pkg-assoc', 'pkg', 'pkg-pg' ] ) ]
|
||||
] ) as $attachment )
|
||||
{
|
||||
$attachment['id1'] = $this->_id;
|
||||
$attachmentMappings[] = $attachment;
|
||||
}
|
||||
if( count( $attachmentMappings ) )
|
||||
{
|
||||
Db::i()->insert( 'core_attachments_map', $attachmentMappings );
|
||||
}
|
||||
|
||||
Db::i()->insert( 'nexus_package_base_prices', Db::i()->select( "{$id} AS id, " . implode( ',', array_map( function( $val )
|
||||
{
|
||||
return "`{$val}`";
|
||||
@@ -2504,7 +2526,11 @@ class Package extends Model
|
||||
}
|
||||
else
|
||||
{
|
||||
$customFieldsForm->addDummy( $field->_title, $field->displayValue( $value ) );
|
||||
$customFieldValue = $field->displayValue( $value );
|
||||
if( $customFieldValue )
|
||||
{
|
||||
$customFieldsForm->addDummy( $field->_title, $customFieldValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !$editable )
|
||||
@@ -2624,7 +2650,7 @@ class Package extends Model
|
||||
case 'reactivate':
|
||||
if( !$purchase->cancelled OR ( $purchase->cancelled AND !$purchase->can_reactivate ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'package_cannot_reactivate_error', '2S437/1', 403, '' );
|
||||
Output::i()->error( 'package_cannot_reactivate_error', '2S437/1', 403, '' );
|
||||
}
|
||||
|
||||
$currency = $purchase->original_invoice->currency;
|
||||
|
||||
Reference in new issue
Block a user