Skip to content

Instantly share code, notes, and snippets.

@bdgeorge
Created March 13, 2012 09:21
Show Gist options
  • Save bdgeorge/2027795 to your computer and use it in GitHub Desktop.
Save bdgeorge/2027795 to your computer and use it in GitHub Desktop.
Mockup of advanced controls
<?php
/**
* Netzarbeiter
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this Module to
* newer versions in the future.
*
* @category Netzarbeiter
* @package Netzarbeiter_GroupsCatalog2
* @copyright Copyright (c) 2012 Vinai Kopp http://netzarbeiter.com
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* @var $this Netzarbeiter_GroupsCatalog2_Block_Adminhtml_System_Tools_Migration */
?>
<style type="text/css">
ol { margin-left:25px; list-style-type: decimal; }
.content-box { padding-bottom: 20px; }
</style>
<div class="content-header">
<table cellspacing="0">
<tr>
<td style="width:50%;"><h3><?php echo $this->__('Netzarbeiter Groups Catalog 2 Migration (BETA)') ?></h3></td>
</tr>
</table>
</div>
<?php if ($this->isGroupsCatalogInstallResourcePresent()): ?>
<div class="content-box">
<h3><?php echo $this->__('Migration Steps:') ?></h3>
<ol>
<li><?php echo $this->__('<strong>You</strong> create a <strong>backup</strong>!') ?></li>
<li><?php echo $this->__('Remove any attribute models for the old GroupsCatalog extension') ?><span class="required">*</span></li>
<li><?php echo $this->__('Deactivate the old GroupsCatalog extension') ?><span class="required">*</span></li>
<li><?php echo $this->__('Migrate extension settings and build new GroupsCatalog2 index') ?><span class="required">*</span></li>
<li><?php echo $this->__("Clean up the database from relict's of the old extension") ?><span class="required">*</span></li>
<li><?php echo $this->__("Remove files from old GroupsCatalog extension") ?></li>
</ol>
<br/>
<span class="required">*</span> <?php echo $this->__('These steps can be done with the help of this assistant'); ?><br/>
<br/>
<span class="notice-msg"><?php echo $this->__("You are responsible for using this assistant! Don't blame anybody but yourself if you don't have a backup or are unable to restore!") ?></span>
</div>
<?php endif; ?>
<div class="content-box">
<h3><?php echo $this->__('Status') ?></h3>
<?php if ($this->isGroupsCatalogActive()): ?>
<?php echo $this->__('The old GroupsCatalog Extension is <strong>installed and active</strong>.'); ?>
<?php elseif ($this->isGroupsCatalogInstalled()): ?>
<?php echo $this->__('The old GroupsCatalog Extension is <strong>installed</strong>, but inactive.'); ?>
<?php else: ?>
<?php echo $this->__('The old GroupsCatalog Extension is not installed.') ?><br/>
<?php endif; ?>
</div>
<?php if ($this->isGroupsCatalogInstallResourcePresent()): ?>
<div class="content-box">
<h3><?php echo $this->__('Take Action') ?></h3>
<?php
/*
Zend_Debug::dump($this->areAttributeModelsSpecified(), 'areAttributeModelsSpecified');
Zend_Debug::dump($this->isGroupsCatalogActive(), 'isGroupsCatalogActive');
Zend_Debug::dump($this->isGroupsCatalogInstalled(), 'isGroupsCatalogInstalled');
Zend_Debug::dump($this->isGroupsCatalogAttributeAvailable(), 'isGroupsCatalogAttributeAvailable');
Zend_Debug::dump($this->isGroupsCatalogConfigurationAvailable(), 'isGroupsCatalogConfigurationAvailable');
*/
?>
<?php if ($this->isGroupsCatalogInstalled() || true)://BGE ?>
<form action="<?php echo $this->getUrl('*/*/doStep') ?>">
<?php if ($this->areAttributeModelsSpecified()): ?>
<?php echo $this->__("Next Step: unset the backend and source models from the attributes of the old GroupsCatalog extension") ?>
<input type="hidden" name="migration_step" value="unsetAttributeModels"/>
<?php elseif ($this->isGroupsCatalogActive()): ?>
<?php echo $this->__('Next Step: deactivate the old GroupsCatalog extension') ?>
<input type="hidden" name="migration_step" value="deactivateModule"/>
<?php elseif ( ($this->isGroupsCatalogInstalled() || true) && $this->isGroupsCatalogAttributeAvailable()): ?>
<?php echo $this->__('Next Step: migrate system configuration and catalog data') ?>
<input type="hidden" name="migration_step" value="migrateData"/>
<?php elseif ($this->isGroupsCatalogConfigurationAvailable()): ?>
<?php echo $this->__("Next Step: clean up relicts of the old GroupsCatalog extension from the database") ?>
<input type="hidden" name="migration_step" value="cleanupDb"/>
<?php else: ?>
<?php echo $this->__('Next Step: you now can safely remove all files from the old GroupsCatalog extension') ?>
<input type="hidden" name="migration_step" value="removeFiles"/>
<?php endif; ?>
<br/>
<button type="submit"><?php echo $this->__('Go') ?></button>
</form>
<?php else: ?>
<?php echo $this->__('The old GroupsCatalog module was completely removed, migration should be complete') ?>
<?php endif; ?>
</div>
<div class="content-box" style="position:relative;">
<h3><?php echo $this->__('Advanced Migration Tools') ?></h3>
<div style="position:absolute;top:2px;left:200px;border:1px solid #ccc;padding:2px;"> show/hide control</div>
<p><?php echo $this->__('Use these tools to migrate a database if the files for Groups Catalog are not installed.') ?></p>
<div class="grid">
<div class="hor-scroll">
<table class="data" cellspacing="0">
<colgroup>
<col width="20">
<col width="">
<col width="100">
<col width="100">
</colgroup>
<thead>
<tr class="headings">
<th>Step</th>
<th>Description</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Unset the backend and source models from the attributes of the old GroupsCatalog extension</td>
<td><span class="grid-severity-notice"><span>Complete</span></span></td>
<td><button disabled="disabled" class="disabled" style="width:80px" type="submit"><?php echo $this->__('Unset') ?></button></td>
</tr>
<tr>
<td>2</td>
<td>Deactivate the old GroupsCatalog extension</td>
<td><span class="grid-severity-notice"><span>Complete</span></span></td>
<td><button disabled="disabled" class="disabled" style="width:80px" type="submit"><?php echo $this->__('Deactivate') ?></button></td>
</tr>
<tr>
<td>3</td>
<td>Unset the backend and source models from the attributes of the old GroupsCatalog extension</td>
<td><span class="grid-severity-critical"><span>Unset Required</span></span></td>
<td><button type="submit" style="width:80px" ><?php echo $this->__('Unset') ?></button></td>
</tr>
<tr>
<td>4</td>
<td>Migrate system configuration and catalog data</td>
<td><span class="grid-severity-critical"><span>Migration Required</span></span></td>
<td><button type="submit" style="width:80px" ><?php echo $this->__('Migrate') ?></button></td>
</tr>
<tr>
<td>5</td>
<td>Remove all files from the old GroupsCatalog extension
<p style="font-style:italic;background:#efefef;border:1px solid #ccc; padding:1em;"> When they click the delete button animate a list of remaining files into visibility here</p>
</td>
<td><span class="grid-severity-critical"><span>Deletion Required</span></span></td>
<td><button style="width:80px" type="submit"><?php echo $this->__('Delete') ?></button></button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment