diff --git a/.zfproject.xml b/.zfproject.xml index c4d759bc6c608a78c4767e4e168324e689cf0e63..83d10eb8205f3f13180fc514e47d425764d0d75b 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -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"/> diff --git a/application/configs/application.ini.sample b/application/configs/application.ini.sample index 9006316d5f78001d2ba13ddfea05f861322e9238..4d4bbd9fbbc1e050db4de51567d33d9901ce094d 100644 --- a/application/configs/application.ini.sample +++ b/application/configs/application.ini.sample @@ -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] diff --git a/application/controllers/AllUsersController.php b/application/controllers/AllUsersController.php new file mode 100644 index 0000000000000000000000000000000000000000..d343f651b18ac4239c2c11c95b014c0a124ef00e --- /dev/null +++ b/application/controllers/AllUsersController.php @@ -0,0 +1,18 @@ +<?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(); + } + +} diff --git a/application/controllers/BtMigrateController.php b/application/controllers/BtMigrateController.php new file mode 100644 index 0000000000000000000000000000000000000000..f687072ba724c5e5722f3d133d03b152802c5d82 --- /dev/null +++ b/application/controllers/BtMigrateController.php @@ -0,0 +1,28 @@ +<?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', + ); + } + +} diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index 0c4fe03f9e3fb1f3853e9403e6375caea6337577..ead69e1f5bed4a21997d5005fcf75b8edfa6b070 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -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; + } } diff --git a/application/controllers/LongTermStorageController.php b/application/controllers/LongTermStorageController.php new file mode 100644 index 0000000000000000000000000000000000000000..d243f94e0bcd0730e1159d2fd4e36371e3ed4f0d --- /dev/null +++ b/application/controllers/LongTermStorageController.php @@ -0,0 +1,28 @@ +<?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', + ); + } + +} + diff --git a/application/controllers/QuestMigrateController.php b/application/controllers/QuestMigrateController.php new file mode 100644 index 0000000000000000000000000000000000000000..02f581e6c26659144f5f9c5a295cab14caf28b50 --- /dev/null +++ b/application/controllers/QuestMigrateController.php @@ -0,0 +1,28 @@ +<?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', + ); + } + +} + diff --git a/application/controllers/UnarchiveController.php b/application/controllers/UnarchiveController.php new file mode 100644 index 0000000000000000000000000000000000000000..df24a059afb9ac8ce74bd80af5f93c85f6ed04fc --- /dev/null +++ b/application/controllers/UnarchiveController.php @@ -0,0 +1,26 @@ +<?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', + ); + } + +} + diff --git a/application/controllers/UserContactController.php b/application/controllers/UserContactController.php new file mode 100644 index 0000000000000000000000000000000000000000..1e405a70767e44e8634f8da86ab5ce0b81481ec8 --- /dev/null +++ b/application/controllers/UserContactController.php @@ -0,0 +1,28 @@ +<?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', + ); + } + +} + diff --git a/application/layouts/scripts/unl_wdn.phtml b/application/layouts/scripts/unl_wdn.phtml index b90fb3a084b6574865c0c014ec41cea023a7e9a8..74673f73bcf74c593f4de1c8fc30a5e7a17c0d8d 100644 --- a/application/layouts/scripts/unl_wdn.phtml +++ b/application/layouts/scripts/unl_wdn.phtml @@ -1,5 +1,8 @@ <?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( @@ -12,25 +15,39 @@ $this->layout()->intermediateBreadcrumbs = array( $navLinks = array(); if (Zend_Auth::getInstance()->hasIdentity()) { - + + $navLinks[] = array( + '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' => 'Alpha', - 'href' => 'alpha', - 'children' => array( - array( - 'text' => 'Bravo', - 'href' => 'alpha/bravo', - ), - ), + 'text' => 'User Contact', + 'href' => 'user-contact', ); } else { - $navLinks[] = array( - 'text' => 'Login', - 'href' => 'user/login', - ); - + $navLinks[] = array( + 'text' => 'Login', + 'href' => 'user/login', + ); + } $this->layout()->navLinks = $navLinks; diff --git a/application/models/DbTable/MigrateJobs.php b/application/models/DbTable/MigrateJobs.php new file mode 100644 index 0000000000000000000000000000000000000000..fc27c1e02fd2fc84dd02bbc192a9049d734dbe4e --- /dev/null +++ b/application/models/DbTable/MigrateJobs.php @@ -0,0 +1,21 @@ +<?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'; + + +} + diff --git a/application/models/DbTable/MigrateRoles.php b/application/models/DbTable/MigrateRoles.php new file mode 100644 index 0000000000000000000000000000000000000000..cab76c7696fe4b639c3f76a4020234debc41a047 --- /dev/null +++ b/application/models/DbTable/MigrateRoles.php @@ -0,0 +1,61 @@ +<?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; + } +} + diff --git a/application/models/DbTable/NotesMigration.php b/application/models/DbTable/NotesMigration.php new file mode 100644 index 0000000000000000000000000000000000000000..b3408011175ce33fcb5b292e5581677268e26c2e --- /dev/null +++ b/application/models/DbTable/NotesMigration.php @@ -0,0 +1,11 @@ +<?php + +class Application_Model_DbTable_NotesMigration extends Unl_Db_Table_Abstract +{ + + protected $_name = 'notes_migration'; + protected $_primary = 'nuid'; + + +} + diff --git a/application/models/DbTable/Office365Jobs.php b/application/models/DbTable/Office365Jobs.php new file mode 100644 index 0000000000000000000000000000000000000000..0bed326bb7153cdb2888ae85541449368dd83df2 --- /dev/null +++ b/application/models/DbTable/Office365Jobs.php @@ -0,0 +1,16 @@ +<?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'; + + +} + diff --git a/application/views/scripts/all-users/index.phtml b/application/views/scripts/all-users/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ab2a2680f2c7dc9691f59c1beab13cdbd19aa774 --- /dev/null +++ b/application/views/scripts/all-users/index.phtml @@ -0,0 +1,37 @@ +<?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> diff --git a/application/views/scripts/bt-migrate/index.phtml b/application/views/scripts/bt-migrate/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..67d5ed8defe3d1b5d4bf5c81eec2a02d1fcf9272 --- /dev/null +++ b/application/views/scripts/bt-migrate/index.phtml @@ -0,0 +1,48 @@ +<?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> diff --git a/application/views/scripts/long-term-storage/index.phtml b/application/views/scripts/long-term-storage/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..7a02dfe0df4cf6ec65829200784720225855d237 --- /dev/null +++ b/application/views/scripts/long-term-storage/index.phtml @@ -0,0 +1,48 @@ +<?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> diff --git a/application/views/scripts/quest-migrate/index.phtml b/application/views/scripts/quest-migrate/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..72c22e662a678424e2d0c3ccb139ab21da56ca19 --- /dev/null +++ b/application/views/scripts/quest-migrate/index.phtml @@ -0,0 +1,50 @@ +<?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> diff --git a/application/views/scripts/unarchive/index.phtml b/application/views/scripts/unarchive/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d859ac9a2c852b255fdb36d8d1702e2003f9b533 --- /dev/null +++ b/application/views/scripts/unarchive/index.phtml @@ -0,0 +1,54 @@ +<?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> diff --git a/application/views/scripts/user-contact/index.phtml b/application/views/scripts/user-contact/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b87eebf5b22b3513271442b3960c4fc70c2420a2 --- /dev/null +++ b/application/views/scripts/user-contact/index.phtml @@ -0,0 +1,46 @@ +<?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> diff --git a/library/Emw/Controller/Action.php b/library/Emw/Controller/Action.php new file mode 100644 index 0000000000000000000000000000000000000000..2b01ac18b7c5c16d4c4c936f62744e5109e7757d --- /dev/null +++ b/library/Emw/Controller/Action.php @@ -0,0 +1,42 @@ +<?php + +abstract class Emw_Controller_Action extends Zend_Controller_Action +{ + public function init() + { + if (!Application_Model_DbTable_MigrateRoles::currentUserCanView()) { + throw new Zend_Controller_Action_Exception('Access Denied'); + } + } + + public function postAction() + { + if (!Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { + throw new Zend_Controller_Action_Exception('Access Denied'); + } + + $migrateJobsTable = Application_Model_DbTable_MigrateJobs::getInstance(); + $in = $this->_getAllParams(); + foreach ($in['edit'] as $nuid => $data) { + $row = $migrateJobsTable->find($nuid); + if ($row->count() == 0) { + continue; + } + $row = $row->current(); + + if (isset($data['status'])) { + $row->migrate_status = $data['status']; + } + if (isset($data['notes'])) { + $row->notes = $data['notes']; + } + $row->save(); + } + + $baseUrl = $this->view->baseUrl(); + $targetUrl = $this->view->url(array('action' => 'index')); + $targetUrl = substr($targetUrl, strlen($baseUrl)); + + $this->_redirect($targetUrl); + } +} \ No newline at end of file diff --git a/public/css/default.css b/public/css/default.css new file mode 100644 index 0000000000000000000000000000000000000000..e9e818c0157cff2b730ee7142bb2e8ca950f558a --- /dev/null +++ b/public/css/default.css @@ -0,0 +1,10 @@ +@CHARSET "UTF-8"; + +textarea { + height: 1.5em; + width: 95%; +} + +td[colspan] { + /*display: none;*/ +} \ No newline at end of file diff --git a/public/js/default.js b/public/js/default.js new file mode 100644 index 0000000000000000000000000000000000000000..8e18d9752c55a465b18c59655e4a3a0710ebca01 --- /dev/null +++ b/public/js/default.js @@ -0,0 +1,13 @@ +(function() { + + WDN.jQuery(function() { + WDN.jQuery('td[colspan]').parent().hide() + WDN.jQuery('.zentable tbody tr').click(function(event) { + if (event.target.nodeName != 'TD' && event.target.nodName != 'TR') { + return; + } + WDN.jQuery(this).next().toggle('slow'); + }); + }); + +})();