From 478ca3adc4794c9e55b1c61c92b67fff326298d8 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sun, 13 Jan 2002 19:52:47 +0000 Subject: [PATCH] Upgrade API version to 0.9.15.001, add post-install dependency failure test to detection class and applications.php --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 7 ++++++ setup/applications.php | 30 +++++++++++++++++++++---- setup/inc/class.setup_detection.inc.php | 12 ++++++++-- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index ccd22f1834..ba103853c3 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -14,7 +14,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi'; - $setup_info['phpgwapi']['version'] = '0.9.13.017'; + $setup_info['phpgwapi']['version'] = '0.9.15.001'; $setup_info['phpgwapi']['versions']['current_header'] = '1.19'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 9e82061f48..f541c7375f 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -413,4 +413,11 @@ $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.13.017'; return $GLOBALS['setup_info']['phpgwapi']['currentver']; } + + $test[] = '0.9.13.017'; + function phpgwapi_upgrade0_9_13_017() + { + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.15.001'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } ?> diff --git a/setup/applications.php b/setup/applications.php index 52e157d25f..c04238534c 100644 --- a/setup/applications.php +++ b/setup/applications.php @@ -263,9 +263,19 @@ $notables = $HTTP_GET_VARS['notables']; $setup_tpl->set_var('description',lang('Problem resolution'). ':'); $setup_tpl->pparse('out','header'); - if ($badinstall) + + if($HTTP_GET_VARS['post']) { - echo $setup_info[$resolve]['title'] . ' ' . lang('is broken') . ' '; + echo '"' . $setup_info[$resolve]['title'] . '" ' . lang('may be broken') . ' '; + echo lang('because an application it depends upon was upgraded'); + echo '
'; + echo lang('to a version it does not know about') . '.'; + echo '
'; + echo lang('However, the application may still work') . '.'; + } + elseif ($HTTP_GET_VARS['badinstall']) + { + echo '"' . $setup_info[$resolve]['title'] . '" ' . lang('is broken') . ' '; echo lang('because of a failed upgrade or install') . '.'; echo '
'; echo lang('Some or all of its tables are missing') . '.'; @@ -276,11 +286,11 @@ { if($setup_info[$resolve]['enabled']) { - echo $setup_info[$resolve]['title'] . ' ' . lang('is broken') . ' '; + echo '"' . $setup_info[$resolve]['title'] . '" ' . lang('is broken') . ' '; } else { - echo $setup_info[$resolve]['title'] . ' ' . lang('is disabled') . ' '; + echo '"' . $setup_info[$resolve]['title'] . '" ' . lang('is disabled') . ' '; } if (!$notables) @@ -464,6 +474,18 @@ $setup_tpl->set_var('resolution','' . lang('Possible Solutions') . ''); $status = lang('Dependency Failure') . ':' . $depstring . $value['status']; break; + case 'P': + $setup_tpl->set_var('bg_color','FFCCFF'); + $depstring = parsedep($value['depends']); + $depstring .= ')'; + $setup_tpl->set_var('instimg','dep.gif'); + $setup_tpl->set_var('instalt',lang('Post-install Dependency Failure')); + $setup_tpl->set_var('install',' '); + $setup_tpl->set_var('remove',' '); + $setup_tpl->set_var('upgrade',' '); + $setup_tpl->set_var('resolution','' . lang('Possible Solutions') . ''); + $status = lang('Post-install Dependency Failure') . ':' . $depstring . $value['status']; + break; default: $setup_tpl->set_var('instimg','incomplete.gif'); $setup_tpl->set_var('instalt',lang('Not Completed')); diff --git a/setup/inc/class.setup_detection.inc.php b/setup/inc/class.setup_detection.inc.php index fed600a256..4205584597 100755 --- a/setup/inc/class.setup_detection.inc.php +++ b/setup/inc/class.setup_detection.inc.php @@ -96,6 +96,7 @@ R upgrade in pRogress C upgrade Completed successfully D Dependency failure + P Post-install dependency failure F upgrade Failed V Version mismatch at end of upgrade (Not used, proposed only) M Missing files at start of upgrade (Not used, proposed only) @@ -169,9 +170,16 @@ if ($setup_info['depends'][$depkey]['status'] == False) { /* Only set this if it has not already failed to upgrade - Milosch */ - if (!( ($setup_info[$key]['status'] == 'F') || ($setup_info[$key]['status'] == 'C') )) + if ($setup_info[$key]['status'] != 'F' )//&& $setup_info[$key]['status'] != 'C') { - $setup_info[$key]['status'] = 'D'; + if($setup_info[$key]['status'] == 'C') + { + $setup_info[$key]['status'] = 'P'; + } + else + { + $setup_info[$key]['status'] = 'D'; + } } } }