Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -27,13 +27,14 @@ class _Blog extends Core
|
||||
* @brief Application
|
||||
*/
|
||||
public $app = 'blog';
|
||||
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
@@ -45,8 +46,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blogs',
|
||||
'step_method' => 'convertBlogs',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'blog_blogs',
|
||||
@@ -57,8 +58,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_entries',
|
||||
'step_method' => 'convertBlogEntries',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_entries' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_entries' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertBlogs' ),
|
||||
'link_type' => 'blog_entries',
|
||||
@@ -69,8 +70,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_comments',
|
||||
'step_method' => 'convertBlogComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertBlogEntries' ),
|
||||
'link_type' => 'bog_comments',
|
||||
@@ -81,8 +82,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_rss_import',
|
||||
'step_method' => 'convertBlogRssImport',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_rss_import' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_rss_import' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertBlogs' ),
|
||||
'link_type' => 'blog_rss_import',
|
||||
@@ -93,8 +94,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_blogs',
|
||||
'step_method' => 'convertClubBlogs',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertClubs' ),
|
||||
'link_type' => 'core_club_blogs'
|
||||
@@ -105,8 +106,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_blog_entries',
|
||||
'step_method' => 'convertClubBlogEntries',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(blog_entries)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(blog_entries)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubBlogs' ),
|
||||
'link_type' => 'core_club_blogs_entries',
|
||||
@@ -118,8 +119,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_blog_comments',
|
||||
'step_method' => 'convertClubBlogComments',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(blog_comments)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(blog_comments)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubBlogEntries' ),
|
||||
'link_type' => 'core_club_blogs_comments',
|
||||
@@ -131,8 +132,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1<>? AND id2 IS NULL', 'blog_Entries', 0 ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1<>? AND id2 IS NULL', 'blog_Entries', 0 ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => array( 'convertBlogEntries', 'convertBlogComments' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -143,6 +144,12 @@ class _Blog extends Core
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ class _Calendar 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();
|
||||
|
||||
@@ -42,8 +43,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_calendars',
|
||||
'step_method' => 'convertCalendarCalendars',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_calendars' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_calendars' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'calendar_calendars',
|
||||
@@ -54,8 +55,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_venues',
|
||||
'step_method' => 'convertCalendarVenues',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_venues' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_venues' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarCalendars' ),
|
||||
'link_type' => 'calendar_venues',
|
||||
@@ -66,8 +67,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_events',
|
||||
'step_method' => 'convertCalendarEvents',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_events' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_events' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertCalendarCalendars' ),
|
||||
'link_type' => 'calendar_events',
|
||||
@@ -79,8 +80,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_comments',
|
||||
'step_method' => 'convertCalendarComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_event_comments',
|
||||
@@ -92,8 +93,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_reviews',
|
||||
'step_method' => 'convertCalendarReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_event_reviews',
|
||||
@@ -105,8 +106,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_rsvps',
|
||||
'step_method' => 'convertCalendarRsvps',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_rsvp' )->first(),
|
||||
'source_rows' => $this->sofrware->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_rsvp' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_event_rsvp',
|
||||
@@ -117,8 +118,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_feeds',
|
||||
'step_method' => 'convertCalendarFeeds',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_import_feeds' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_import_feeds' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarCalendars' ),
|
||||
'link_type' => 'calendar_import_feeds',
|
||||
@@ -129,8 +130,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_reminders',
|
||||
'step_method' => 'convertCalendarReminders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reminders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reminders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_reminders',
|
||||
@@ -141,10 +142,10 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments', array( "location_key=?", 'calendar_Events' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'calendar_Calendar' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarEvents', 'convertCalendarComments', 'convertCalendarReviews' ),
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'core_attachments',
|
||||
);
|
||||
break;
|
||||
@@ -152,7 +153,13 @@ class _Calendar extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -210,9 +217,13 @@ class _Calendar extends Core
|
||||
case 'convertCalendarReminders':
|
||||
$return['convertCalendarReminders'] = array( 'calender_reminders' => NULL );
|
||||
break;
|
||||
|
||||
case 'convertAttachments':
|
||||
$return['convertAttachments'] = array( 'core_attachments' => array( "location_key=?", 'calendar_Events' ) );
|
||||
$attachIds = array();
|
||||
foreach( \IPS\Db::i()->select( 'attachment_id', 'core_attachments_map', array( 'location_key=?', 'calendar_Calendar' ) ) AS $attachment )
|
||||
{
|
||||
$attachIds[] = $attachment;
|
||||
}
|
||||
$return['convertAttachments'] = array( 'core_attachments' => \IPS\Db::i()->in( 'attach_id', $attachIds ), 'core_attachments_map' => array( "location_key=?", 'calendar_Calendar' ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -321,6 +332,8 @@ class _Calendar extends Core
|
||||
|
||||
\IPS\Lang::saveCustom( 'calendar', "calendar_calendar_{$inserted_id}", $name );
|
||||
\IPS\Lang::saveCustom( 'calendar', "calendar_calendar_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'calendar', 'perm_type' => 'calendar', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['cal_club_id'] )
|
||||
{
|
||||
@@ -1318,13 +1331,14 @@ class _Calendar extends Core
|
||||
$map['id1_type'] = 'calendar_events';
|
||||
$map['id1_from_parent'] = FALSE;
|
||||
$map['id2_from_parent'] = FALSE;
|
||||
|
||||
/* Some set up */
|
||||
if ( !isset( $info['id3'] ) )
|
||||
if ( !isset( $map['id3'] ) )
|
||||
{
|
||||
$info['id3'] = NULL;
|
||||
$map['id3'] = NULL;
|
||||
}
|
||||
|
||||
if ( is_null( $info['id3'] ) OR $info['id3'] != 'review' )
|
||||
if ( is_null( $map['id3'] ) OR $map['id3'] != 'review' )
|
||||
{
|
||||
$map['id2_type'] = 'calendar_event_comments';
|
||||
}
|
||||
|
||||
@@ -37,16 +37,17 @@ class _Cms extends Core
|
||||
{
|
||||
return parent::getPostConversionInformation() . \IPS\Member::loggedIn()->language()->addToStack( 'convert_cms_info_message' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
switch( $k )
|
||||
@@ -60,8 +61,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_blocks',
|
||||
'step_method' => 'convertCmsBlocks',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_blocks' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_blocks' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_blocks',
|
||||
@@ -72,8 +73,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_containers',
|
||||
'step_method' => 'convertCmsContainers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_containers' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_containers' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_containers',
|
||||
@@ -89,8 +90,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_databases',
|
||||
'step_method' => 'convertCmsDatabases',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_databases' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_databases' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'cms_databases',
|
||||
@@ -101,8 +102,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_database_categories',
|
||||
'step_method' => 'convertCmsDatabaseCategories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_categories' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_categories' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCmsDatabases' ),
|
||||
'link_type' => 'cms_database_categories',
|
||||
@@ -114,7 +115,10 @@ class _Cms extends Core
|
||||
$links = array();
|
||||
foreach( \IPS\Db::i()->select( 'database_id', 'cms_databases' ) AS $database )
|
||||
{
|
||||
$count += \IPS\Db::i()->select( 'COUNT(*)', "cms_custom_database_{$database}" )->first();
|
||||
if( $rowCounts )
|
||||
{
|
||||
$count += \IPS\Db::i()->select( 'COUNT(*)', "cms_custom_database_{$database}" )->first();
|
||||
}
|
||||
$links[] = "cms_custom_database_{$database}";
|
||||
}
|
||||
|
||||
@@ -128,7 +132,7 @@ class _Cms extends Core
|
||||
'step_title' => 'convert_cms_database_records',
|
||||
'step_method' => 'convertCmsDatabaseRecords',
|
||||
'ips_rows' => $count,
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCmsDatabases' ),
|
||||
'link_type' => $links,
|
||||
@@ -140,8 +144,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_database_comments',
|
||||
'step_method' => 'convertCmsDatabaseComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCmsDatabaseRecords' ),
|
||||
'link_type' => 'cms_database_comments',
|
||||
@@ -153,8 +157,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_database_reviews',
|
||||
'step_method' => 'convertCmsDatabaseReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCmsDatabaseRecords' ),
|
||||
'link_type' => 'cms_database_reviews',
|
||||
@@ -166,8 +170,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_folders',
|
||||
'step_method' => 'convertCmsFolders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_folders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_folders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_folders',
|
||||
@@ -184,8 +188,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_media',
|
||||
'step_method' => 'convertCmsMedia',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'cms_media',
|
||||
@@ -196,8 +200,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_media_folders',
|
||||
'step_method' => 'convertCmsMediaFolders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media_folders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media_folders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_media_folders',
|
||||
@@ -214,8 +218,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_pages',
|
||||
'step_method' => 'convertCmsPages',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_pages' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_pages' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'cms_pages',
|
||||
@@ -232,8 +236,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( \IPS\Db::i()->in( 'id3', $in ) . " AND location_key=?", 'cms_Records' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( \IPS\Db::i()->in( 'id3', $in ) . " AND location_key=?", 'cms_Records' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
#'dependencies' => array( 'convertCmsDatabaseRecords', 'convertCmsDatabaseComments', 'convertCmsDatabaseReviews' ),
|
||||
'dependencies' => array( 'convertCmsDatabaseRecords' ), //TODO dear code reviewer... please review this part.. i had to remove it for my further work
|
||||
@@ -245,6 +249,12 @@ class _Cms extends Core
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -546,6 +556,8 @@ class _Cms extends Core
|
||||
$inserted_id = \IPS\Db::i()->insert( 'cms_pages', $info );
|
||||
$this->software->app->addLink( $inserted_id, $id, 'cms_pages' );
|
||||
\IPS\Lang::saveCustom( 'cms', "cms_page_{$inserted_id}", $info['page_name'] );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'pages', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
return $inserted_id;
|
||||
}
|
||||
@@ -730,6 +742,8 @@ class _Cms extends Core
|
||||
|
||||
\IPS\Lang::saveCustom( 'cms', "content_block_name_{$inserted_id}", $name );
|
||||
\IPS\Lang::saveCustom( 'cms', "content_block_name_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'blocks', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
return $inserted_id;
|
||||
}
|
||||
@@ -1060,6 +1074,8 @@ class _Cms extends Core
|
||||
|
||||
$inserted_id = \IPS\Db::i()->insert( 'cms_databases', $info );
|
||||
$this->software->app->addLink( $inserted_id, $id, 'cms_databases' );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'databases', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
/* And now fields */
|
||||
$validFields = array_merge( static::$fieldTypes, \IPS\cms\Fields::$additionalFieldTypes, array( 'Youtube', 'Spotify', 'Soundcloud' ) );
|
||||
@@ -1297,6 +1313,8 @@ class _Cms extends Core
|
||||
\IPS\Lang::saveCustom( 'cms', "content_field_{$fieldInsertedId}", $fieldName );
|
||||
\IPS\Lang::saveCustom( 'cms', "content_field_{$fieldInsertedId}_desc", $fieldDesc );
|
||||
$this->software->app->addLink( $fieldInsertedId, $fieldId, 'cms_database_fields' );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'fields', 'perm_type_id' => $fieldInsertedId, 'perm_view' => '' ) );
|
||||
|
||||
if ( $haveTitleField AND $titleField == 0 )
|
||||
{
|
||||
@@ -1777,6 +1795,7 @@ class _Cms extends Core
|
||||
$this->software->app->addLink( $inserted_id, $id, 'cms_database_categories' );
|
||||
|
||||
\IPS\Db::i()->update( 'cms_database_categories', array( "category_parent_id" => $inserted_id ), array( "category_conv_parent=? AND category_conv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'categories', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
\IPS\Lang::saveCustom( 'cms', "content_cat_name_{$inserted_id}", $info['category_name'] );
|
||||
\IPS\Lang::saveCustom( 'cms', "content_cat_name_{$inserted_id}_desc", $desc );
|
||||
|
||||
@@ -29,9 +29,10 @@ class _Core extends \IPS\convert\Library
|
||||
/**
|
||||
* 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();
|
||||
|
||||
@@ -43,8 +44,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_acronyms',
|
||||
'step_method' => 'convertAcronyms',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_acronyms' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_acronyms' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_acronyms',
|
||||
@@ -64,8 +65,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_administrators',
|
||||
'step_method' => 'convertAdministrators',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_admin_permission_rows' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_admin_permission_rows' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_administrators',
|
||||
@@ -76,8 +77,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_announcements',
|
||||
'step_method' => 'convertAnnouncements',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_announcements' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_announcements' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_announcements',
|
||||
@@ -88,8 +89,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -100,8 +101,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_banfilters',
|
||||
'step_method' => 'convertBanfilters',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_banfilters' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_banfilters' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_banfilters',
|
||||
@@ -112,8 +113,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[$k] = array(
|
||||
'step_title' => 'convert_custom_bbcode',
|
||||
'step_method' => 'convertCustomBbcode',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'custom_bbcode' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'custom_bbcode' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_bbcode',
|
||||
@@ -124,8 +125,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_dname_changes',
|
||||
'step_method' => 'convertDnameChanges',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=? AND log_type=?', 'core', 'display_name' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=? AND log_type=?', 'core', 'display_name' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_dname_changes',
|
||||
@@ -136,8 +137,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_edit_history',
|
||||
'step_method' => 'convertEditHistory',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_edit_history' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_edit_history' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_edit_history',
|
||||
@@ -148,8 +149,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_emoticons',
|
||||
'step_method' => 'convertEmoticons',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_emoticons' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_emoticons' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_emoticons',
|
||||
@@ -160,8 +161,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_groups',
|
||||
'step_method' => 'convertGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_groups',
|
||||
@@ -172,8 +173,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_ignored_users',
|
||||
'step_method' => 'convertIgnoredUsers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ignored_users' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ignored_users' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_ignored_users',
|
||||
@@ -184,8 +185,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_leader_groups',
|
||||
'step_method' => 'convertLeaderGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_leader_groups',
|
||||
@@ -211,8 +212,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_leaders',
|
||||
'step_method' => 'convertLeaders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_leaders',
|
||||
@@ -223,8 +224,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_ranks',
|
||||
'step_method' => 'convertRanks',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_ranks' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_ranks' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_member_ranks',
|
||||
@@ -235,8 +236,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_reactions',
|
||||
'step_method' => 'convertReactions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reactions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reactions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_reactions',
|
||||
@@ -247,8 +248,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_statuses',
|
||||
'step_method' => 'convertStatuses',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_updates' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_updates' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_member_status_updates',
|
||||
@@ -259,8 +260,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_status_replies',
|
||||
'step_method' => 'convertStatusReplies',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_replies' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_replies' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers', 'convertStatuses' ),
|
||||
'link_type' => 'core_member_status_replies',
|
||||
@@ -284,8 +285,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_members',
|
||||
'step_method' => 'convertMembers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_members',
|
||||
@@ -296,8 +297,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_member_history',
|
||||
'step_method' => 'convertMemberHistory',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_member_history',
|
||||
@@ -308,8 +309,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_warn_actions',
|
||||
'step_method' => 'convertWarnActions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_actions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_actions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_members_warn_actions',
|
||||
@@ -320,8 +321,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_warn_reasons',
|
||||
'step_method' => 'convertWarnReasons',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_reasons' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_reasons' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_members_warn_reasons',
|
||||
@@ -332,8 +333,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_private_messages',
|
||||
'step_method' => 'convertPrivateMessages',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_topics' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_topics' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => array( 'core_message_topics', 'core_message_topic_user_map' ),
|
||||
@@ -344,8 +345,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_private_message_replies',
|
||||
'step_method' => 'convertPrivateMessageReplies',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_posts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_posts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertPrivateMessages' ),
|
||||
'link_type' => array( 'core_message_posts' ),
|
||||
@@ -357,8 +358,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_moderators',
|
||||
'step_method' => 'convertModerators',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_moderators' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_moderators' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_members',
|
||||
@@ -369,8 +370,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_profile_field_groups',
|
||||
'step_method' => 'convertProfileFieldGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_pfields_groups',
|
||||
@@ -388,8 +389,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_profile_fields',
|
||||
'step_method' => 'convertProfileFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_data' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_data' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_pfields_data',
|
||||
@@ -400,8 +401,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_profanity_filters',
|
||||
'step_method' => 'convertProfanityFilters',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_profanity_filters' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_profanity_filters' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_profanity_filters',
|
||||
@@ -412,8 +413,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_question_and_answers',
|
||||
'step_method' => 'convertQuestionAndAnswers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_question_and_answer' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_question_and_answer' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_question_and_answer',
|
||||
@@ -424,8 +425,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_report_comments',
|
||||
'step_method' => 'convertReportComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_rc_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_rc_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_report_comments',
|
||||
@@ -436,8 +437,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_reputation_levels',
|
||||
'step_method' => 'convertReputationLevels',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reputation_levels' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reputation_levels' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_reputation_levels',
|
||||
@@ -448,8 +449,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_clubs',
|
||||
'step_method' => 'convertClubs',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_clubs'
|
||||
@@ -460,8 +461,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_members',
|
||||
'step_method' => 'convertClubMembers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs_memberships' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs_memberships' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertClubs' ),
|
||||
'link_type' => 'core_clubs_memberships'
|
||||
@@ -471,7 +472,13 @@ class _Core extends \IPS\convert\Library
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -764,7 +771,7 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
if ( isset( $info['row_updated'] ) )
|
||||
{
|
||||
if ( $info['row_update'] instanceof \IPS\DateTIme )
|
||||
if ( $info['row_update'] instanceof \IPS\DateTime )
|
||||
{
|
||||
$info['row_updated'] = $info['row_updated']->getTimestamp();
|
||||
}
|
||||
@@ -893,7 +900,7 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
if ( !isset( $info['announce_page_location'] ) )
|
||||
{
|
||||
$info['announce_page_location'] = 'sidebar';
|
||||
$info['announce_page_location'] = array( 'sidebar' );
|
||||
}
|
||||
elseif( !is_array( $info['announce_page_location'] ) )
|
||||
{
|
||||
@@ -1047,16 +1054,17 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
$info['attach_location'] = (string) $file;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$this->software->app->log( 'attachment_creation_fail', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
catch( \ErrorException $e )
|
||||
{
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Log::log( array( 'exception' => $e, 'file' => $info ), 'converter_attachment_fail' );
|
||||
$this->software->app->log( 'attachment_creation_fail_exception', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( $file === NULL )
|
||||
{
|
||||
@@ -1090,14 +1098,14 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
$info['attach_thumb_location'] = (string) $thumbnail;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$this->software->app->log( 'attachment_thumb_creation_fail', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
}
|
||||
catch( \ErrorException $e )
|
||||
{
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$this->software->app->log( 'attachment_thumb_creation_fail', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1674,7 +1682,6 @@ class _Core extends \IPS\convert\Library
|
||||
$filepathx2 = NULL;
|
||||
}
|
||||
$filex2 = \IPS\File::create( 'core_Emoticons', $info['filenamex2'], $filedatax2, 'emoticons', FALSE, NULL, static::$obscureFilenames );
|
||||
unset( $info['filenamex2'] );
|
||||
$info['image_2x'] = (string) $filex2;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
@@ -1686,7 +1693,8 @@ class _Core extends \IPS\convert\Library
|
||||
$info['image_2x'] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
unset( $info['filenamex2'] );
|
||||
|
||||
if ( $haveID )
|
||||
{
|
||||
$id = $info['id'];
|
||||
@@ -3209,7 +3217,7 @@ class _Core extends \IPS\convert\Library
|
||||
$photo = \IPS\File::create( 'core_Profile', $profilePhotoName, $profileFileData );
|
||||
$info['pp_photo_type'] = 'custom';
|
||||
$info['pp_main_photo'] = (string) $photo;
|
||||
$info['pp_thumb_photo'] = (string) $photo->thumbnail( 'core_Profile', \IPS\PHOTO_THUMBNAIL_SIZE, \IPS\PHOTO_THUMBNAIL_SIZE );
|
||||
$info['pp_thumb_photo'] = (string) $photo->thumbnail( 'core_Profile', \IPS\PHOTO_THUMBNAIL_SIZE, \IPS\PHOTO_THUMBNAIL_SIZE, TRUE );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
@@ -4359,7 +4367,7 @@ class _Core extends \IPS\convert\Library
|
||||
'friend_only' => NULL,
|
||||
);
|
||||
|
||||
$permId = \IPS\Db::i()->insert( 'core_permission_index', $perm );
|
||||
$permId = \IPS\Db::i()->replace( 'core_permission_index', $perm );
|
||||
$perm['perm_id'] = $permId;
|
||||
}
|
||||
|
||||
@@ -4545,16 +4553,16 @@ class _Core extends \IPS\convert\Library
|
||||
$name = $info['pf_name'];
|
||||
unset( $info['pf_name'] );
|
||||
}
|
||||
|
||||
if ( !isset( $info['pf_desc'] ) )
|
||||
|
||||
if ( !isset( $info['pf_desc'] ) OR empty( $info['pf_desc'] ) )
|
||||
{
|
||||
$desc = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$desc = $info['pf_desc'];
|
||||
unset( $info['pf_desc'] );
|
||||
}
|
||||
unset( $info['pf_desc'] );
|
||||
|
||||
if ( isset( $info['pf_content'] ) )
|
||||
{
|
||||
@@ -4613,47 +4621,38 @@ class _Core extends \IPS\convert\Library
|
||||
{
|
||||
$info['pf_format'] = NULL;
|
||||
}
|
||||
|
||||
if ( isset( $info['pf_group_id'] ) )
|
||||
|
||||
/* !Profile Field Group */
|
||||
try
|
||||
{
|
||||
try
|
||||
if ( isset( $info['pf_group_id'] ) )
|
||||
{
|
||||
$info['pf_group_id'] = $this->software->app->getLink( $info['pf_group_id'], 'core_pfields_groups' );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
/* Create an orphan group */
|
||||
$info['pf_group_id'] = $this->convertProfileFieldGroup( array(
|
||||
'pf_group_id' => '__orphaned__',
|
||||
'pf_group_name' => 'Converted',
|
||||
) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
else
|
||||
{
|
||||
$info['pf_group_id'] = $this->software->app->getLink( '__orphaned__', 'core_pfields_groups' );
|
||||
}
|
||||
|
||||
/* Make sure it exists */
|
||||
try
|
||||
{
|
||||
\IPS\Db::i()->select( 'pf_group_id', 'core_pfields_groups', array( 'pf_group_id=?', $info['pf_group_id'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
/* Delete the relation if it no longer exists */
|
||||
$this->software->app->deleteLink( '__orphaned__', 'core_pfields_groups' );
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
/* Make sure it exists */
|
||||
try
|
||||
{
|
||||
$info['pf_group_id'] = $this->convertProfileFieldGroup( array(
|
||||
'pf_group_id' => '__orphaned__',
|
||||
'pf_group_name' => 'Converted',
|
||||
) );
|
||||
\IPS\Db::i()->select( 'pf_group_id', 'core_pfields_groups', array( 'pf_group_id=?', $info['pf_group_id'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
/* Delete the relation if it no longer exists */
|
||||
$this->software->app->deleteLink( '__orphaned__', 'core_pfields_groups' );
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
/* Create an orphan group */
|
||||
$info['pf_group_id'] = $this->convertProfileFieldGroup( array(
|
||||
'pf_group_id' => '__orphaned__',
|
||||
'pf_group_name' => 'Converted',
|
||||
) );
|
||||
}
|
||||
|
||||
if ( !isset( $info['pf_search_type'] ) )
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@ class _Forums 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 );
|
||||
@@ -46,8 +47,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_forums',
|
||||
'step_method' => 'convertForumsForums',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'forums_forums',
|
||||
@@ -58,8 +59,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_topics',
|
||||
'step_method' => 'convertForumsTopics',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topics' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topics' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'forums_topics',
|
||||
@@ -70,8 +71,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_posts',
|
||||
'step_method' => 'convertForumsPosts',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
'link_type' => 'forums_posts',
|
||||
@@ -83,8 +84,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_archive_posts',
|
||||
'step_method' => 'convertForumsArchivePosts',
|
||||
'ips_rows' => \IPS\forums\Topic\ArchivedPost::db()->select( 'COUNT(*)', 'forums_archive_posts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\forums\Topic\ArchivedPost::db()->select( 'COUNT(*)', 'forums_archive_posts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
'link_type' => 'forums_posts',
|
||||
@@ -95,8 +96,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_topic_multimods',
|
||||
'step_method' => 'convertForumsTopicMultimods',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topic_mmod' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topic_mmod' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'forums_topic_mmod',
|
||||
@@ -107,8 +108,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_rss_imports',
|
||||
'step_method' => 'convertForumsRssImports',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_import' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_import' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'forums_rss_import',
|
||||
@@ -119,8 +120,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_rss_imported',
|
||||
'step_method' => 'convertForumsRssImported',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_imported' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_imported' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsTopics', 'convertForumsRssImports' ),
|
||||
'link_type' => 'forums_rss_imported',
|
||||
@@ -131,8 +132,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_question_ratings',
|
||||
'step_method' => 'convertForumsQuestionRatings',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_question_ratings' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_question_ratings' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
'link_type' => 'forums_question_ratings',
|
||||
@@ -143,8 +144,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_answer_ratings',
|
||||
'step_method' => 'convertForumsAnswerRatings',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_answer_ratings' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_answer_ratings' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsPosts' ),
|
||||
'link_type' => 'forums_answer_ratings',
|
||||
@@ -155,8 +156,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'forums_Forums' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'forums_Forums' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 50,
|
||||
'dependencies' => array( 'convertForumsPosts' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -167,8 +168,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_forums',
|
||||
'step_method' => 'convertClubForums',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums', array( "club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums', array( "club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'core_club_forums'
|
||||
@@ -179,8 +180,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_topics',
|
||||
'step_method' => 'convertClubTopics',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'COUNT(tid)', 'forums_topics', array( 'forum_id IN ( ' . (string) \IPS\Db::i()->select( 'id', 'forums_forums', array( "club_id IS NOT NULL" ) ) . ')' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(tid)', 'forums_topics', array( 'forum_id IN ( ' . (string) \IPS\Db::i()->select( 'id', 'forums_forums', array( "club_id IS NOT NULL" ) ) . ')' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubForums' ),
|
||||
'link_type' => 'core_club_topics'
|
||||
@@ -191,10 +192,10 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_posts',
|
||||
'step_method' => 'convertClubPosts',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'COUNT(pid)', 'forums_forums', array( "club_id IS NOT NULL" ) )
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(pid)', 'forums_forums', array( "club_id IS NOT NULL" ) )
|
||||
->join( 'forums_topics', 'forums_topics.forum_id=forums_forums.id')
|
||||
->join( 'forums_posts', 'forums_posts.topic_id=forums_topics.tid')->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
->join( 'forums_posts', 'forums_posts.topic_id=forums_topics.tid'),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubTopics' ),
|
||||
'link_type' => 'core_club_posts'
|
||||
@@ -204,6 +205,12 @@ class _Forums extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -211,17 +218,18 @@ class _Forums extends Core
|
||||
/**
|
||||
* Get method from menu rows - abstracted to allow 'fake' entries not in menuRows()
|
||||
*
|
||||
* @param string $method Method requested
|
||||
* @param string $method Method requested
|
||||
* @param bool $rowCount Count local rows
|
||||
* @return array
|
||||
*/
|
||||
public function getMethodFromMenuRows( $method )
|
||||
public function getMethodFromMenuRows( $method, $rowCount=FALSE )
|
||||
{
|
||||
if( $method == 'convertForumsBoards' )
|
||||
{
|
||||
$method = 'convertForumsForums';
|
||||
}
|
||||
|
||||
return parent::getMethodFromMenuRows( $method );
|
||||
return parent::getMethodFromMenuRows( $method, $rowCount );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -824,6 +832,7 @@ class _Forums extends Core
|
||||
\IPS\Lang::saveCustom( 'forums', "forums_forum_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->update( 'forums_forums', array( "parent_id" => $inserted_id ), array( "conv_parent=? AND conv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'forums', 'perm_type' => 'forum', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['club_id'] )
|
||||
{
|
||||
|
||||
@@ -28,9 +28,10 @@ class _Gallery 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 );
|
||||
@@ -43,8 +44,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryCategories',
|
||||
'step_title' => 'convert_gallery_categories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'gallery_categories',
|
||||
@@ -63,8 +64,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryAlbums',
|
||||
'step_title' => 'convert_gallery_albums',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_albums' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_albums' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'gallery_albums',
|
||||
@@ -75,8 +76,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryAlbumComments',
|
||||
'step_title' => 'convert_gallery_album_comments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryAlbums' ),
|
||||
'link_type' => 'gallery_album_comments',
|
||||
@@ -88,8 +89,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryAlbumReviews',
|
||||
'step_title' => 'convert_gallery_album_reviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryAlbums' ),
|
||||
'link_type' => 'gallery_album_reviews',
|
||||
@@ -114,8 +115,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryImages',
|
||||
'step_title' => 'convert_gallery_images',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'gallery_images',
|
||||
@@ -127,8 +128,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryComments',
|
||||
'step_title' => 'convert_gallery_comments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryImages' ),
|
||||
'link_type' => 'gallery_comments',
|
||||
@@ -140,8 +141,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryReviews',
|
||||
'step_title' => 'convert_gallery_reviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryImages' ),
|
||||
'link_type' => 'gallery_reviews',
|
||||
@@ -153,8 +154,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_categories',
|
||||
'step_method' => 'convertClubGalleryCategories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertGalleryImages' ),
|
||||
'link_type' => 'core_club_gallery_categories'
|
||||
@@ -165,8 +166,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_images',
|
||||
'step_method' => 'convertClubGalleryImages',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(category_count_imgs)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(category_count_imgs)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertClubGalleryCategories' ),
|
||||
'link_type' => 'core_club_gallery_images'
|
||||
@@ -177,8 +178,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_comments',
|
||||
'step_method' => 'convertClubGalleryComments',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(category_count_comments)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(category_count_comments)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubGalleryImages' ),
|
||||
'link_type' => 'core_club_gallery_comments'
|
||||
@@ -189,8 +190,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_reviews',
|
||||
'step_method' => 'convertClubGalleryReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews', array( \IPS\Db::i()->in( 'review_image_id', \IPS\Db::i()->select( 'image_id', 'gallery_images', array( \IPS\Db::i()->in( 'image_category_id', \IPS\Db::i()->select( 'category_id', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ) ) ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews', array( \IPS\Db::i()->in( 'review_image_id', \IPS\Db::i()->select( 'image_id', 'gallery_images', array( \IPS\Db::i()->in( 'image_category_id', \IPS\Db::i()->select( 'category_id', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ) ) ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubGalleryImages' ),
|
||||
'link_type' => 'core_club_gallery_reviews'
|
||||
@@ -213,8 +214,8 @@ class _Gallery 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=?", 'gallery_Images' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'gallery_Images' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -224,7 +225,13 @@ class _Gallery extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -384,10 +391,18 @@ class _Gallery extends Core
|
||||
$info['category_cover_img_id'] = 0;
|
||||
$info['category_last_img_id'] = 0;
|
||||
$info['category_last_img_date'] = 0;
|
||||
|
||||
if ( !isset( $info['category_sort_options'] ) OR !in_array( $info['category_sort_options'], array( 'updated', 'rating', 'num_comments' ) ) )
|
||||
|
||||
/* Album Sort Order */
|
||||
$sortOrders = array( 'album_last_img_date', 'album_last_comment', 'album_rating_aggregate', 'album_comments','album_reviews', 'album_name', 'album_count_comments', 'album_count_imgs' );
|
||||
if ( !isset( $info['category_sort_options'] ) OR !in_array( $info['category_sort_options'], $sortOrders ) )
|
||||
{
|
||||
$info['category_sort_options'] = NULL;
|
||||
$info['category_sort_options'] = 'album_last_img_date';
|
||||
}
|
||||
|
||||
/* Image Sort Order */
|
||||
if ( !isset( $info['category_sort_options_img'] ) OR !in_array( $info['category_sort_options_img'], array( 'updated', 'last_comment', 'title', 'rating', 'date', 'num_comments', 'num_reviews', 'views' ) ) )
|
||||
{
|
||||
$info['category_sort_options_img'] = 'updated';
|
||||
}
|
||||
|
||||
/* One Defaults */
|
||||
@@ -445,6 +460,7 @@ class _Gallery extends Core
|
||||
\IPS\Lang::saveCustom( 'gallery', "gallery_category_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->update( 'gallery_categories', array( "category_parent_id" => $inserted_id ), array( "category_conv_parent=? AND category_conv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'gallery', 'perm_type' => 'category', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['category_club_id'] )
|
||||
{
|
||||
|
||||
@@ -28,9 +28,10 @@ class _Nexus extends \IPS\convert\Library
|
||||
/**
|
||||
* 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 );
|
||||
@@ -43,8 +44,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customer_fields',
|
||||
'step_method' => 'convertNexusCustomerFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_fields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_fields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_customer_fields'
|
||||
@@ -61,8 +62,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customers',
|
||||
'step_method' => 'convertNexusCustomers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customers' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customers' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'nexus_customers',
|
||||
@@ -73,8 +74,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customer_addresses',
|
||||
'step_method' => 'convertNexusCustomerAddresses',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_addresses' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_addresses' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'link_type' => 'nexus_customer_addresses',
|
||||
@@ -85,8 +86,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customer_history',
|
||||
'step_method' => 'convertNexusCustomerHistory',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=?', 'nexus' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=?', 'nexus' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'link_type' => 'nexus_customer_history',
|
||||
@@ -97,8 +98,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_alternate_contacts',
|
||||
'step_method' => 'convertNexusAlternateContacts',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_alternate_contacts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_alternate_contacts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'link_type' => 'nexus_alternate_contacts'
|
||||
@@ -109,8 +110,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_notes',
|
||||
'step_method' => 'convertNexusNotes',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_notes' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_notes' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'linK_type' => 'nexus_notes'
|
||||
@@ -121,8 +122,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_package_groups',
|
||||
'step_method' => 'convertNexusPackageGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_package_groups'
|
||||
@@ -133,8 +134,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_package_fields',
|
||||
'step_method' => 'convertNexusPackageFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_fields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_fields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_package_fields'
|
||||
@@ -155,8 +156,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_packages',
|
||||
'step_method' => 'convertNexusPackages',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'nexus_packages',
|
||||
@@ -168,8 +169,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_reviews',
|
||||
'step_method' => 'convertNexusReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_reviews' )->first(),
|
||||
'source_rows' => $this->software->sourceRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertNexusPackages' ),
|
||||
'link_type' => 'nexus_reviews',
|
||||
@@ -181,8 +182,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_coupons',
|
||||
'step_method' => 'convertNexusCoupons',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_coupons' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_coupons' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusPackages' ),
|
||||
'link_type' => 'nexus_coupons'
|
||||
@@ -193,8 +194,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_invoices',
|
||||
'step_method' => 'convertNexusInvoices',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_invoices' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_invoices' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusPackages' ),
|
||||
'link_type' => 'nexus_invoices',
|
||||
@@ -205,8 +206,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_transactions',
|
||||
'step_method' => 'convertNexusTransactions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusInvoices' ),
|
||||
'link_type' => 'nexus_transactions',
|
||||
@@ -217,8 +218,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_purchases',
|
||||
'step_method' => 'convertNexusPurchases',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusPackages', 'convertNexusInvoices' ),
|
||||
'link_type' => 'nexus_purchases'
|
||||
@@ -229,8 +230,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_fraud_rules',
|
||||
'step_method' => 'convertNexusFraudRules',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_fraud_rules' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_fraud_rules' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_fraud_rules',
|
||||
@@ -241,8 +242,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_departments',
|
||||
'step_method' => 'convertNexusSupportDepartments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_departments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_departments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusPackages' ),
|
||||
);
|
||||
@@ -252,8 +253,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_fields',
|
||||
'step_method' => 'convertNexusSupportFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_fields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_fields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusSupportDepartments' ),
|
||||
'link_type' => 'nexus_support_fields',
|
||||
@@ -264,8 +265,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_statuses',
|
||||
'step_method' => 'convertNexusSupportStatuses',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_statuses' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_statuses' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_support_statuses',
|
||||
@@ -276,8 +277,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_severities',
|
||||
'step_method' => 'convertNexusSupportSeverities',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_severities' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_severities' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusSupportDepartments' ),
|
||||
'link_type' => 'nexus_support_severities'
|
||||
@@ -288,8 +289,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_stock_actions',
|
||||
'step_method' => 'convertNexusSupportStockActions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_stock_actions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_stock_actions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusSupportDepartments' ),
|
||||
'link_type' => 'nexus_support_stock_actions'
|
||||
@@ -300,8 +301,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_requests',
|
||||
'step_method' => 'convertNexusSupportRequests',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_requests' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_requests' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusSupportDepartments', 'convertNexusSupportFields' ),
|
||||
'link_type' => 'nexus_support_requests',
|
||||
@@ -313,8 +314,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_replies',
|
||||
'step_method' => 'convertNexusSupportReplies',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_replies' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_replies' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusSupportRequests' ),
|
||||
'link_type' => 'nexus_support_replies',
|
||||
@@ -326,6 +327,12 @@ class _Nexus extends \IPS\convert\Library
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -1168,6 +1175,7 @@ class _Nexus extends \IPS\convert\Library
|
||||
't_fraud_blocked' => 0,
|
||||
't_currency' => $currency,
|
||||
't_partial_refund' => 0.000,
|
||||
't_credit' => 0.000,
|
||||
't_auth' => NULL,
|
||||
't_billing_agreement' => NULL
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user