Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -28,12 +28,12 @@ class _Downloads extends Core
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
|
||||
foreach( $this->getConvertableItems() as $k => $v )
|
||||
{
|
||||
@@ -43,8 +43,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsCfields',
|
||||
'step_title' => 'convert_downloads_cfields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_cfields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_cfields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'downloads_cfields',
|
||||
@@ -62,8 +62,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsCategories',
|
||||
'step_title' => 'convert_downloads_categories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'downloads_categories',
|
||||
@@ -85,8 +85,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsFiles',
|
||||
'step_title' => 'convert_downloads_files',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'downloads_files',
|
||||
@@ -98,8 +98,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsComments',
|
||||
'step_title' => 'convert_downloads_comments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertDownloadsFiles' ),
|
||||
'link_type' => 'downloads_comments',
|
||||
@@ -111,8 +111,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsReviews',
|
||||
'step_title' => 'convert_downloads_reviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertDownloadsFiles' ),
|
||||
'link_type' => 'downloads_reviews',
|
||||
@@ -124,8 +124,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_categories',
|
||||
'step_method' => 'convertClubDownloadsCategories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories', array( "cclub_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubs' ),
|
||||
'link_type' => 'core_club_downloads_categories',
|
||||
@@ -136,8 +136,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_files',
|
||||
'step_method' => 'convertClubDownloadsFiles',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertClubDownloadsCategories' ),
|
||||
'link_type' => 'core_club_downloads_files'
|
||||
@@ -148,8 +148,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_comments',
|
||||
'step_method' => 'convertClubDownloadsComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments', array( \IPS\Db::i()->in( 'comment_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments', array( \IPS\Db::i()->in( 'comment_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubDownloadsFiles' ),
|
||||
'link_type' => 'core_club_downloads_comments',
|
||||
@@ -160,8 +160,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_reviews',
|
||||
'step_method' => 'convertClubDownloadsReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files_reviews', array( \IPS\Db::i()->in( 'review_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files_reviews', array( \IPS\Db::i()->in( 'review_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubDownloadsFiles' ),
|
||||
'link_type' => 'core_club_downloads_reviews',
|
||||
@@ -172,8 +172,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertAttachments',
|
||||
'step_title' => 'convert_attachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'downloads_Downloads' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'downloads_Downloads' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertDownloadsFiles', 'convertDownloadsComments', 'convertDownloadsReviews' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -183,7 +183,13 @@ class _Downloads extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -222,7 +228,11 @@ class _Downloads extends Core
|
||||
break;
|
||||
|
||||
case 'convertDownloadsFiles':
|
||||
$return['convertDownloadsFiles'] = array( 'downloads_files' => NULL, 'downloads_files_records' => NULL );
|
||||
$return['convertDownloadsFiles'] = array(
|
||||
'downloads_files' => NULL,
|
||||
'downloads_files_records' => NULL,
|
||||
'core_tags' => array( 'tag_meta_app=? AND tag_meta_area=?', 'downloads', 'downloads' )
|
||||
);
|
||||
break;
|
||||
|
||||
case 'convertDownloadsComments':
|
||||
@@ -700,12 +710,12 @@ class _Downloads extends Core
|
||||
|
||||
$inserted_id = \IPS\Db::i()->insert( 'downloads_categories', $info );
|
||||
$this->software->app->addLink( $inserted_id, $id, 'downloads_categories' );
|
||||
|
||||
|
||||
|
||||
\IPS\Lang::saveCustom( 'downloads', "downloads_category_{$inserted_id}", $name );
|
||||
\IPS\Lang::saveCustom( 'downloads', "downloads_category_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->update( 'downloads_categories', array( "cparent" => $inserted_id ), array( "cconv_parent=? AND cconv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'downloads', 'perm_type' => 'category', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['cclub_id'] )
|
||||
{
|
||||
@@ -1281,7 +1291,7 @@ class _Downloads extends Core
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$this->software->app->log( 'download_review_missing_image', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['review_id'] );
|
||||
$this->software->app->log( 'download_review_missing_file', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['review_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user