Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -71,6 +71,12 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
/* Do a quick parent storage check */
|
||||
\IPS\convert\Application::checkConvParent( $app->getSource()->getLibrary()->app );
|
||||
|
||||
/* Check child apps also have temporary columns */
|
||||
foreach( $app->children() as $child )
|
||||
{
|
||||
\IPS\convert\Application::checkConvParent( $child->getSource()->getLibrary()->app );
|
||||
}
|
||||
|
||||
/* Are we using the legacy UI? If not, then start converting as we already have everything we need. */
|
||||
if( !\IPS\CONVERTERS_DEV_UI )
|
||||
{
|
||||
@@ -248,15 +254,15 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
$softwareClass = $appToCheck->getSource();
|
||||
|
||||
/* Set up cache array */
|
||||
if( !isset( $_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->sw ] ) )
|
||||
if( !isset( $_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->app_id ] ) )
|
||||
{
|
||||
$_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->sw ] = array();
|
||||
$_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->app_id ] = array();
|
||||
}
|
||||
|
||||
if( !$appToCheck->parent AND $softwareClass::canConvertSettings() AND isset( $appToCheck->_session['more_info']['convertSettings'] ) AND $appToCheck->_session['more_info']['convertSettings']['convert_settings'] AND !\count( $appToCheck->_session['completed'] ) )
|
||||
{
|
||||
$method = 'convertSettings';
|
||||
$_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->sw ][ $method ] = 1;
|
||||
$_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->app_id ][ $method ] = 1;
|
||||
}
|
||||
|
||||
/* First, get all of the menu rows for this application to see if there are any (more) to run.
|
||||
@@ -266,11 +272,11 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
foreach( $menuRows as $row )
|
||||
{
|
||||
/* We need the total counts so we can show the progress bar on the multiredirect */
|
||||
if ( !isset( $_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->sw ][ $row['step_method'] ] ) )
|
||||
if ( !isset( $_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->app_id ][ $row['step_method'] ] ) )
|
||||
{
|
||||
/* Only count the rows if the cache is missing */
|
||||
$counts = $softwareClass->getLibrary()->getDatabaseRowCounts( array( $row ), FALSE, TRUE );
|
||||
$_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->sw ][ $row['step_method'] ] = $counts[0]['source_rows'];
|
||||
$_SESSION['convertCountRows'][ $masterAppId ][ $appToCheck->app_id ][ $row['step_method'] ] = $counts[0]['source_rows'];
|
||||
}
|
||||
|
||||
if( $method !== NULL )
|
||||
@@ -287,16 +293,15 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
/* We chose to convert a specific step and it's not complete */
|
||||
if( isset( \IPS\Request::i()->method ) AND $row['step_method'] == \IPS\Request::i()->method )
|
||||
{
|
||||
$method = $row['step_method'];
|
||||
|
||||
$session = $app->_session;
|
||||
if( $key = array_search( $method, $session['completed'] ) )
|
||||
if( !\in_array( $row['step_method'], $appToCheck->_session['completed'] ) )
|
||||
{
|
||||
unset( $session['completed'][ $key ] );
|
||||
$app->_session = $session;
|
||||
$method = $row['step_method'];
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check whether the dependency was set to be converted, or whether it actually converted (it may not have any source data) */
|
||||
@@ -486,6 +491,20 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
/* The function we are running on each step */
|
||||
function( $data ) use ( $app )
|
||||
{
|
||||
/* Are we reconverting using the dev ui and this is the first iteration? */
|
||||
if( $data === NULL )
|
||||
{
|
||||
if( isset( \IPS\Request::i()->method ) )
|
||||
{
|
||||
$session = $app->_session;
|
||||
if( $key = array_search( \IPS\Request::i()->method, $session['completed'] ) )
|
||||
{
|
||||
unset( $session['completed'][ $key ] );
|
||||
$app->_session = $session;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine which method we are converting */
|
||||
$convertData = $this->_getNextStep( $app );
|
||||
|
||||
@@ -601,7 +620,7 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
|
||||
$app->saveMoreInfo( \IPS\Request::i()->method, $values );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=convert&module=manage&controller=convert&do=runStep&id={$app->app_id}&per_cycle={$per_cycle}&method=" . \IPS\Request::i()->method ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=convert&module=manage&controller=convert&do=runStep&id={$app->app_id}&per_cycle={$per_cycle}&method=" . \IPS\Request::i()->method )->csrf() );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'more_info_needed' );
|
||||
|
||||
@@ -253,6 +253,7 @@ class _create extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$appsToCheck = array( $app );
|
||||
$childAppsToRemove = array();
|
||||
|
||||
foreach( $data['choose_what_to_convert'] as $application )
|
||||
{
|
||||
@@ -297,8 +298,15 @@ class _create extends \IPS\Dispatcher\Controller
|
||||
/* Can't find the table */
|
||||
catch( \IPS\convert\Exception $e )
|
||||
{
|
||||
$form->error = $e->getMessage();
|
||||
return $form;
|
||||
if( $appToCheck->sw != 'core' )
|
||||
{
|
||||
$childAppsToRemove[] = $appToCheck->sw;
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->error = $e->getMessage();
|
||||
return $form;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,6 +369,11 @@ class _create extends \IPS\Dispatcher\Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
if( \in_array( $application, $childAppsToRemove ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$childApp = clone $app;
|
||||
$childApp->parent = $app->app_id;
|
||||
|
||||
|
||||
Reference in new issue
Block a user