Skip to content
Snippets Groups Projects
Commit 3758a28a authored by Tim Steiner's avatar Tim Steiner
Browse files

Mostly functional at this point.

parent 66e5276d
No related branches found
No related tags found
No related merge requests found
Showing
with 653 additions and 16 deletions
......@@ -15,10 +15,35 @@
<controllerFile controllerName="User">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Unarchive">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="BtMigrate">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="QuestMigrate">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="LongTermStorage">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="UserContact">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="AllUsers">
<actionMethod actionName="index"/>
</controllerFile>
</controllersDirectory>
<formsDirectory enabled="false"/>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<modelsDirectory>
<dbTableDirectory>
<dbTableFile dbTableName="MigrateJobs"/>
<dbTableFile dbTableName="MigrateRoles"/>
<dbTableFile dbTableName="NotesMigration"/>
<dbTableFile dbTableName="Office365Jobs"/>
</dbTableDirectory>
</modelsDirectory>
<modulesDirectory enabled="false"/>
<viewsDirectory>
<viewScriptsDirectory>
......@@ -31,6 +56,24 @@
<viewControllerScriptsDirectory forControllerName="User">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Unarchive">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="BtMigrate">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="QuestMigrate">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="LongTermStorage">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="UserContact">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="AllUsers">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/>
......
......@@ -21,6 +21,7 @@ resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.layout.layout = "unl_wdn"
resources.view.helperPath.Unl_View_Helper = Unl/View/Helper
autoloaderNamespaces.unl = "Unl_"
autoloaderNamespaces.emw = "Emw_"
unl.cas.controller = user
[staging : production]
......
<?php
class AllUsersController extends Emw_Controller_Action
{
public function indexAction()
{
$db = $migrateJobsTable = Application_Model_DbTable_MigrateJobs::getInstance()->getDefaultAdapter();
$select = $db->select()
->from(array('o' => 'office365jobs'))
->join(array('m' => 'migratejobs'), 'o.nuid = m.nuid')
->join(array('n' => 'notes_migration'), 'o.nuid = n.nuid')
->order('m.migrate_status');
$this->view->records = $db->query($select)->fetchAll();
}
}
<?php
class BtMigrateController extends Emw_Controller_Action
{
public function indexAction()
{
$db = Application_Model_DbTable_MigrateJobs::getInstance()->getDefaultAdapter();
$select = $db->select()
->from(array('o' => 'office365jobs'))
->join(array('m' => 'migratejobs'), 'o.nuid = m.nuid')
->joinLeft(array('n' => 'notes_migration'), 'o.nuid = n.nuid')
->where('m.migrate_status IN(?)', array(
Application_Model_DbTable_MigrateJobs::STATUS_UNARCHIVED,
Application_Model_DbTable_MigrateJobs::STATUS_BT_WIP,
))
->orWhere('n.nuid IS NULL AND migrate_status = ?', Application_Model_DbTable_MigrateJobs::STATUS_ACTIVATED)
->order('o.lastchange');
$this->view->records = $db->query($select)->fetchAll();
$this->view->statusOptions = array(
Application_Model_DbTable_MigrateJobs::STATUS_UNARCHIVED => 'Unassigned',
Application_Model_DbTable_MigrateJobs::STATUS_BT_WIP => 'Active',
Application_Model_DbTable_MigrateJobs::STATUS_DECRYPTED => 'Step Finished',
);
}
}
......@@ -10,7 +10,35 @@ class IndexController extends Zend_Controller_Action
public function indexAction()
{
// action body
switch (Application_Model_DbTable_MigrateRoles::getCurrentRole()) {
case Application_Model_DbTable_MigrateRoles::ROLE_UNARCHIVE:
$this->_redirect('unarchive');
break;
case Application_Model_DbTable_MigrateRoles::ROLE_BTMIGRATE:
$this->_redirect('bt-migrate');
break;
case Application_Model_DbTable_MigrateRoles::ROLE_QMIGRATE:
$this->_redirect('quest-migrate');
break;
case Application_Model_DbTable_MigrateRoles::ROLE_STORAGE:
$this->_redirect('long-term-storage');
break;
case Application_Model_DbTable_MigrateRoles::ROLE_CUSTSERV:
$this->_redirect('user-contact');
break;
case Application_Model_DbTable_MigrateRoles::ROLE_ADMIN:
case Application_Model_DbTable_MigrateRoles::ROLE_READALL:
$this->_redirect('all-users');
break;
default:
break;
}
}
......
<?php
class LongTermStorageController extends Emw_Controller_Action
{
public function indexAction()
{
$db = $migrateJobsTable = Application_Model_DbTable_MigrateJobs::getInstance()->getDefaultAdapter();
$select = $db->select()
->from(array('o' => 'office365jobs'))
->join(array('m' => 'migratejobs'), 'o.nuid = m.nuid')
->joinLeft(array('n' => 'notes_migration'), 'o.nuid = n.nuid')
->where('m.migrate_status IN(?)', array(
Application_Model_DbTable_MigrateJobs::STATUS_MIGRATED,
Application_Model_DbTable_MigrateJobs::STATUS_N10_WIP,
))
->order('m.qst_migrate_time');
$this->view->records = $db->query($select)->fetchAll();
$this->view->statusOptions = array(
Application_Model_DbTable_MigrateJobs::STATUS_MIGRATED => 'Unassigned',
Application_Model_DbTable_MigrateJobs::STATUS_N10_WIP => 'Active',
Application_Model_DbTable_MigrateJobs::STATUS_COMPLETE => 'Step Finished',
);
}
}
<?php
class QuestMigrateController extends Emw_Controller_Action
{
public function indexAction()
{
$db = $migrateJobsTable = Application_Model_DbTable_MigrateJobs::getInstance()->getDefaultAdapter();
$select = $db->select()
->from(array('o' => 'office365jobs'))
->join(array('m' => 'migratejobs'), 'o.nuid = m.nuid')
->joinLeft(array('n' => 'notes_migration'), 'o.nuid = n.nuid')
->where('m.migrate_status IN(?)', array(
Application_Model_DbTable_MigrateJobs::STATUS_DECRYPTED,
Application_Model_DbTable_MigrateJobs::STATUS_QST_WIP,
))
->order('m.bt_migrate_time');
$this->view->records = $db->query($select)->fetchAll();
$this->view->statusOptions = array(
Application_Model_DbTable_MigrateJobs::STATUS_DECRYPTED => 'Unassigned',
Application_Model_DbTable_MigrateJobs::STATUS_QST_WIP => 'Active',
Application_Model_DbTable_MigrateJobs::STATUS_MIGRATED => 'Step Finished',
);
}
}
<?php
class UnarchiveController extends Emw_Controller_Action
{
public function indexAction()
{
$db = $migrateJobsTable = Application_Model_DbTable_MigrateJobs::getInstance()->getDefaultAdapter();
$select = $db->select()
->from(array('o' => 'office365jobs'))
->join(array('m' => 'migratejobs'), 'o.nuid = m.nuid')
->joinLeft(array('n' => 'notes_migration'), 'o.nuid = n.nuid')
->orWhere('n.nuid IS NOT NULL AND m.migrate_status = ?', Application_Model_DbTable_MigrateJobs::STATUS_ACTIVATED)
->orWhere('m.migrate_status = ?', Application_Model_DbTable_MigrateJobs::STATUS_UA_WIP)
->order('o.lastchange');
$this->view->records = $db->query($select)->fetchAll();
$this->view->statusOptions = array(
Application_Model_DbTable_MigrateJobs::STATUS_ACTIVATED => 'Unassigned',
Application_Model_DbTable_MigrateJobs::STATUS_UA_WIP => 'Active',
Application_Model_DbTable_MigrateJobs::STATUS_UNARCHIVED => 'Step Finished',
);
}
}
<?php
class UserContactController extends Emw_Controller_Action
{
public function indexAction()
{
$db = $migrateJobsTable = Application_Model_DbTable_MigrateJobs::getInstance()->getDefaultAdapter();
$select = $db->select()
->from(array('o' => 'office365jobs'))
->join(array('m' => 'migratejobs'), 'o.nuid = m.nuid')
->joinLeft(array('n' => 'notes_migration'), 'o.nuid = n.nuid')
->where('m.migrate_status IN(?)', array(
Application_Model_DbTable_MigrateJobs::STATUS_COMPLETE,
Application_Model_DbTable_MigrateJobs::STATUS_NOTIFIED,
))
->order('m.stored_time');
$this->view->records = $db->query($select)->fetchAll();
$this->view->statusOptions = array(
Application_Model_DbTable_MigrateJobs::STATUS_COMPLETE => 'Unassigned',
Application_Model_DbTable_MigrateJobs::STATUS_NOTIFIED => 'Active',
//Application_Model_DbTable_MigrateJobs::STATUS_NOTIFIED => 'Step Finished',
);
}
}
<?php
$this->headLink()->appendStylesheet($this->baseUrl('/css/default.css'));
$this->headScript()->appendFile($this->baseUrl('/js/default.js'));
$this->layout()->siteTitle = 'Email Migration Workflow';
$this->layout()->siteAbbreviation = 'EMW';
$this->layout()->intermediateBreadcrumbs = array(
......@@ -14,14 +17,28 @@ $navLinks = array();
if (Zend_Auth::getInstance()->hasIdentity()) {
$navLinks[] = array(
'text' => 'Alpha',
'href' => 'alpha',
'children' => array(
array(
'text' => 'Bravo',
'href' => 'alpha/bravo',
),
),
'text' => 'All Users',
'href' => 'all-users',
);
$navLinks[] = array(
'text' => 'Unarchive',
'href' => 'unarchive',
);
$navLinks[] = array(
'text' => 'BT Migrate',
'href' => 'bt-migrate',
);
$navLinks[] = array(
'text' => 'Quest Migrate',
'href' => 'quest-migrate',
);
$navLinks[] = array(
'text' => 'Long Term Storage',
'href' => 'long-term-storage',
);
$navLinks[] = array(
'text' => 'User Contact',
'href' => 'user-contact',
);
} else {
......
<?php
class Application_Model_DbTable_MigrateJobs extends Unl_Db_Table_Abstract
{
const STATUS_ACTIVATED = '10_ACTIVATED';
const STATUS_UA_WIP = '20_UA_WIP';
const STATUS_UNARCHIVED = '30_UNARCHIVED';
const STATUS_BT_WIP = '40_BT_WIP';
const STATUS_DECRYPTED = '50_DECRYPTED';
const STATUS_QST_WIP = '60_QST_WIP';
const STATUS_MIGRATED = '70_MIGRATED';
const STATUS_N10_WIP = '80_N10_WIP';
const STATUS_COMPLETE = '90_COMPLETE';
const STATUS_NOTIFIED = '95_NOTIFIED';
protected $_name = 'migratejobs';
protected $_primary = 'nuid';
}
<?php
class Application_Model_DbTable_MigrateRoles extends Unl_Db_Table_Abstract
{
const ROLE_NONE = 'none';
const ROLE_ADMIN = 'admin';
const ROLE_READALL = 'readall';
const ROLE_UNARCHIVE = 'unarchive';
const ROLE_BTMIGRATE = 'btmigrate';
const ROLE_QMIGRATE = 'qmigrate';
const ROLE_STORAGE = 'storage';
const ROLE_CUSTSERV = 'custserv';
protected $_name = 'migrateroles';
protected $_primary = 'username';
static public function getCurrentRole()
{
static $role = NULL;
if ($role) {
return $role;
}
if (!Zend_Auth::getInstance()->hasIdentity()) {
$role = self::ROLE_NONE;
return $role;
}
$select = self::getInstance()->select()
->where('username = ?', Zend_Auth::getInstance()->getIdentity());
$record = self::getInstance()->fetchRow($select);
if (!$record) {
$role = self::ROLE_NONE;
return $role;
}
$role = $record->role;
return $role;
}
static public function currentUserCanView()
{
$role = self::getCurrentRole();
if (!in_array($role, array(self::ROLE_NONE))) {
return TRUE;
}
return FALSE;
}
static public function currentUserCanEdit()
{
$role = self::getCurrentRole();
if (!in_array($role, array(self::ROLE_NONE, self::ROLE_READALL))) {
return TRUE;
}
return FALSE;
}
}
<?php
class Application_Model_DbTable_NotesMigration extends Unl_Db_Table_Abstract
{
protected $_name = 'notes_migration';
protected $_primary = 'nuid';
}
<?php
class Application_Model_DbTable_Office365Jobs extends Unl_Db_Table_Abstract
{
const STATUS_NEW = 'NEW';
const STATUS_SUCCESS1 = 'SUCCESS1';
const STATUS_SUCCESS2 = 'SUCCESS2';
const STATUS_NOTIFIED = 'NOTIFIED';
const STATUS_ERROR = 'ERROR';
protected $_name = 'office365jobs';
protected $_primary = 'nuid';
}
<?php $this->layout()->pageTitle = 'All Users'; ?>
<form method="post" action="<?php echo $this->baseUrl('all-users/post'); ?>">
<table class="zentable cool">
<thead>
<tr>
<th>Status</th>
<th>Username</th>
<th>NUID</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->records as $record) { ?>
<tr>
<td><?php echo $this->escape($record['migrate_status']); ?></td>
<td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></td>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formTextarea('edit[' . $record['nuid'] . '][notes]', $record['notes']); ?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr>
<tr>
<td colspan="100">
More details here!
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
<?php $this->layout()->pageTitle = 'BT Migrate'; ?>
<form method="post" action="<?php echo $this->baseUrl('bt-migrate/post'); ?>">
<table class="zentable cool">
<thead>
<tr>
<th>Status</th>
<th>Username</th>
<th>NUID</th>
<th>Notes DN</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->records as $record) { ?>
<tr>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formSelect(
'edit[' . $record['nuid'] . '][status]',
$record['migrate_status'],
NULL,
$this->statusOptions
);?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['migrate_status']); ?></td>
<?php } ?>
<td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></td>
<td><?php echo $this->escape($record['notes_dn']); ?></td>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formTextarea('edit[' . $record['nuid'] . '][notes]', $record['notes']); ?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr>
<tr>
<td colspan="100">
More details here!
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
<?php $this->layout()->pageTitle = 'Long Term Storage'; ?>
<form method="post" action="<?php echo $this->baseUrl('long-term-storage/post'); ?>">
<table class="zentable cool">
<thead>
<tr>
<th>Status</th>
<th>Username</th>
<th>Notes Host</th>
<th>Notes Mailfile</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->records as $record) { ?>
<tr>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formSelect(
'edit[' . $record['nuid'] . '][status]',
$record['migrate_status'],
NULL,
$this->statusOptions
);?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['migrate_status']); ?></td>
<?php } ?>
<td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['notes_host']); ?></td>
<td><?php echo $this->escape($record['notes_mailfile']); ?></td>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formTextarea('edit[' . $record['nuid'] . '][notes]', $record['notes']); ?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr>
<tr>
<td colspan="100">
More details here!
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
<?php $this->layout()->pageTitle = 'Quest Migrate'; ?>
<form method="post" action="<?php echo $this->baseUrl('quest-migrate/post'); ?>">
<table class="zentable cool">
<thead>
<tr>
<th>Status</th>
<th>Username</th>
<th>NUID</th>
<th>Notes DN</th>
<th>Mailfile Size</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->records as $record) { ?>
<tr>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formSelect(
'edit[' . $record['nuid'] . '][status]',
$record['migrate_status'],
NULL,
$this->statusOptions
);?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['migrate_status']); ?></td>
<?php } ?>
<td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></td>
<td><?php echo $this->escape($record['notes_dn']); ?></td>
<td><?php echo $this->escape($record['mailfilesize']); ?></td>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formTextarea('edit[' . $record['nuid'] . '][notes]', $record['notes']); ?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr>
<tr>
<td colspan="100">
More details here!
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
<?php $this->layout()->pageTitle = 'Unarchive'; ?>
<form method="post" action="<?php echo $this->baseUrl('unarchive/post'); ?>">
<table class="zentable cool">
<thead>
<tr>
<th>Status</th>
<th>Username</th>
<th>NUID</th>
<th>Notes DN</th>
<th>Notes Host</th>
<th>Notes Mailfile</th>
<th>Archive Mailfile</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->records as $record) { ?>
<tr>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formSelect(
'edit[' . $record['nuid'] . '][status]',
$record['migrate_status'],
NULL,
$this->statusOptions
);?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['migrate_status']); ?></td>
<?php } ?>
<td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></td>
<td><?php echo $this->escape($record['notes_dn']); ?></td>
<td><?php echo $this->escape($record['notes_host']); ?></td>
<td><?php echo $this->escape($record['notes_mailfile']); ?></td>
<td><?php echo $this->escape($record['archive_mailfile']); ?></td>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formTextarea('edit[' . $record['nuid'] . '][notes]', $record['notes']); ?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr>
<tr>
<td colspan="100">
More details here!
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
<?php $this->layout()->pageTitle = 'User Contact'; ?>
<form method="post" action="<?php echo $this->baseUrl('user-contact/post'); ?>">
<table class="zentable cool">
<thead>
<tr>
<th>Status</th>
<th>Username</th>
<th>NUID</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->records as $record) { ?>
<tr>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formSelect(
'edit[' . $record['nuid'] . '][status]',
$record['migrate_status'],
NULL,
$this->statusOptions
);?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['migrate_status']); ?></td>
<?php } ?>
<td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></td>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<td><?php echo $this->formTextarea('edit[' . $record['nuid'] . '][notes]', $record['notes']); ?></td>
<?php } else { ?>
<td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr>
<tr>
<td colspan="100">
More details here!
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment