Changeset 8846
- Timestamp:
- 02/17/10 15:15:05 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.7/amp_conf/htdocs/admin/page.modules.php
r8766 r8846 206 206 207 207 switch ($action) { 208 case 'force_upgrade': 208 209 case 'upgrade': 209 210 case 'downloadinstall': … … 305 306 306 307 $actionstext = array(); 308 $force_actionstext = array(); 307 309 $errorstext = array(); 308 310 foreach ($moduleaction as $module => $action) { … … 317 319 switch ($action) { 318 320 case 'upgrade': 321 case 'force_upgrade': 319 322 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 320 323 if (is_array($errors = module_checkdepends($modules_online[$module]))) { … … 324 327 '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'); 325 328 } else { 326 $actionstext[] = sprintf(_("%s %s will be upgraded to online version %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']); 329 switch ( version_compare_freepbx($modules[$module]['dbversion'], $modules_online[$module]['version'])) { 330 case '-1': 331 $actionstext[] = sprintf(_("%s %s will be upgraded to online version %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']); 332 break; 333 case '0': 334 $force_actionstext[] = sprintf(_("%s %s will be re-installed to online version %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']); 335 break; 336 default: 337 $force_actionstext[] = sprintf(_("%s %s will be downgraded to online version %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']); 338 } 327 339 } 328 340 } … … 408 420 echo "</ul>"; 409 421 } 410 if (count($actionstext) > 0) {422 if (count($actionstext) > 0 || count($force_actionstext) > 0) { 411 423 if (count($errorstext) > 0) { 412 424 echo "<h4>"._("You may confirm the remaining selection and then try the again for the listed issues once the required dependencies have been met:")."</h4>\n"; … … 414 426 echo "<h4>"._("Please confirm the following actions:")."</h4>\n"; 415 427 } 416 echo "<ul>\n"; 417 foreach ($actionstext as $text) { 418 echo "\t<li>".$text."</li>\n"; 419 } 420 echo "</ul>"; 428 if (count($actionstext)) { 429 echo "<h5>"._("Upgrades, installs, enables and disables:")."</h5>\n"; 430 echo "<ul>\n"; 431 foreach ($actionstext as $text) { 432 echo "\t<li>".$text."</li>\n"; 433 } 434 echo "</ul>"; 435 } 436 if (count($force_actionstext)) { 437 echo "<h5>"._("Forced downgrades and re-installs:")."</h5>\n"; 438 echo "<ul>\n"; 439 foreach ($force_actionstext as $text) { 440 echo "\t<li>".$text."</li>\n"; 441 } 442 echo "</ul>"; 443 } 421 444 echo "\t<input type=\"button\" value=\""._("Confirm")."\" name=\"process\" onclick=\"process_module_actions(moduleActions);\" />"; 422 445 } else { … … 698 721 if (isset($modules_online[$name]['version'])) { 699 722 $vercomp = version_compare_freepbx($modules_local[$name]['version'], $modules_online[$name]['version']); 700 if ( $vercomp < 0) {701 if (!EXTERNAL_PACKAGE_MANAGEMENT) {723 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 724 if ($vercomp < 0) { 702 725 echo '<input type="radio" id="upgrade_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="upgrade" /> '. 703 726 '<label for="upgrade_'.prep_id($name).'">'.sprintf(_('Download and Upgrade to %s'), $modules_online[$name]['version']).'</label> <br />'; 704 } 727 } else { 728 $force_msg = ($vercomp == 0 ? sprintf(_('Force Download and Install %s'), $modules_online[$name]['version']) : sprintf(_('Force Download and Downgrade to %s'), $modules_online[$name]['version'])); 729 echo '<input type="radio" id="force_upgrade_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="force_upgrade" /> '. 730 '<label for="force_upgrade_'.prep_id($name).'">'.$force_msg.'</label> <br />'; 731 } 705 732 } 706 733 }
