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

Implemented record details view and search.

parent 3b49c402
No related branches found
No related tags found
No related merge requests found
Showing
with 160 additions and 40 deletions
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
<controllerFile controllerName="AllUsers"> <controllerFile controllerName="AllUsers">
<actionMethod actionName="index"/> <actionMethod actionName="index"/>
</controllerFile> </controllerFile>
<controllerFile controllerName="Search">
<actionMethod actionName="index"/>
</controllerFile>
</controllersDirectory> </controllersDirectory>
<formsDirectory enabled="false"/> <formsDirectory enabled="false"/>
<layoutsDirectory enabled="false"/> <layoutsDirectory enabled="false"/>
...@@ -74,6 +77,9 @@ ...@@ -74,6 +77,9 @@
<viewControllerScriptsDirectory forControllerName="AllUsers"> <viewControllerScriptsDirectory forControllerName="AllUsers">
<viewScriptFile forActionName="index"/> <viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory> </viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Search">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory> </viewScriptsDirectory>
<viewHelpersDirectory/> <viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/> <viewFiltersDirectory enabled="false"/>
......
<?php
class SearchController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$query = $this->_getParam('q');
$terms = preg_split('/[\s]+/', $query);
$where = '%' . implode('%', $terms) . '%';
$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('o.nuid LIKE ?', $where)
->orWhere('o.username LIKE ?', $where)
->order('m.migrate_status');
$this->view->records = $db->query($select)->fetchAll();
$this->view->query = $query;
}
}
<?php <?php
$this->headLink()->appendStylesheet($this->baseUrl('/css/default.css')); $this->headLink()->appendStylesheet($this->baseUrl('/css/default.css'));
$this->headLink()->headLink(array('rel' => 'search', 'href' => $this->baseUrl('search')));
$this->headScript()->appendFile($this->baseUrl('/js/default.js')); $this->headScript()->appendFile($this->baseUrl('/js/default.js'));
$this->layout()->siteTitle = 'Email Migration Workflow'; $this->layout()->siteTitle = 'Email Migration Workflow';
......
...@@ -17,15 +17,11 @@ ...@@ -17,15 +17,11 @@
<td><?php echo $this->escape($record['migrate_status']); ?></td> <td><?php echo $this->escape($record['migrate_status']); ?></td>
<td><?php echo $this->escape($record['username']); ?></td> <td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></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> <td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr> </tr>
<tr> <tr>
<td colspan="100"> <td colspan="100">
More details here! <?php echo $this->partial('details.phtml', $record); ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
......
...@@ -28,15 +28,11 @@ ...@@ -28,15 +28,11 @@
<td><?php echo $this->escape($record['username']); ?></td> <td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></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_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> <td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr> </tr>
<tr> <tr>
<td colspan="100"> <td colspan="100">
More details here! <?php echo $this->partial('details.phtml', $record); ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
......
<div>
<div class="grid4">
<dl>
<dt>Request Time</dt>
<dd><?php echo $this->escape($this->request_time); ?></dd>
<dt>Last Change</dt>
<dd><?php echo $this->escape($this->lastchange); ?></dd>
<dt>Status</dt>
<dd><?php echo $this->escape($this->status); ?></dd>
<dt>Details</dt>
<dd><?php echo $this->escape($this->details); ?></dd>
<dt>Migration</dt>
<dd><?php echo $this->escape($this->migration); ?></dd>
<dt>NUID</dt>
<dd><?php echo $this->escape($this->nuid); ?></dd>
<dt>Vmail Choice</dt>
<dd><?php echo $this->escape($this->vmail_choice); ?></dd>
</dl>
</div>
<div class="grid4">
<dl>
<dt>Migrate Status</dt>
<dd><?php echo $this->escape($this->migrate_status); ?></dd>
<dt>Unarchive Time</dt>
<dd><?php echo $this->escape($this->unarchive_time); ?></dd>
<dt>Binary Tree Migrate Time</dt>
<dd><?php echo $this->escape($this->bt_migrate_time); ?></dd>
<dt>Quest Migrate Time</dt>
<dd><?php echo $this->escape($this->qst_migrate_time); ?></dd>
<dt>Stored Time</dt>
<dd><?php echo $this->escape($this->stored_time); ?></dd>
<dt>Mail File Size</dt>
<dd><?php echo $this->escape($this->mailfilesize); ?></dd>
</dl>
</div>
<div class="grid3">
<dl>
<dt>Notes DN</dt>
<dd><?php echo $this->escape($this->notes_dn); ?></dd>
<dt>Notes Host</dt>
<dd><?php echo $this->escape($this->notes_host); ?></dd>
<dt>Notes Mailfile</dt>
<dd><?php echo $this->escape($this->notes_mailfile); ?></dd>
<dt>Archive Mailfile</dt>
<dd><?php echo $this->escape($this->archive_mailfile); ?></dd>
<dt>Next Step</dt>
<dd><?php echo $this->escape($this->next_step); ?></dd>
</dl>
</div>
</div>
<div class="clear">
<div class="grid11">
<dl>
<dt>Notes</dt>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { ?>
<dd><?php echo $this->formTextarea('edit[' . $this->nuid . '][notes]', $this->notes); ?>
<?php } else { ?>
<dd><?php echo $this->escape($this->notes); ?></dd>
<?php } ?>
</dl>
</div>
</div>
...@@ -28,15 +28,11 @@ ...@@ -28,15 +28,11 @@
<td><?php echo $this->escape($record['username']); ?></td> <td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['notes_host']); ?></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['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> <td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr> </tr>
<tr> <tr>
<td colspan="100"> <td colspan="100">
More details here! <?php echo $this->partial('details.phtml', $record); ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
......
...@@ -30,15 +30,11 @@ ...@@ -30,15 +30,11 @@
<td><?php echo $this->escape($record['nuid']); ?></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_dn']); ?></td>
<td><?php echo $this->escape($record['mailfilesize']); ?></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> <td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr> </tr>
<tr> <tr>
<td colspan="100"> <td colspan="100">
More details here! <?php echo $this->partial('details.phtml', $record); ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
......
<?php $this->layout()->pageTitle = 'Search results for "' . $this->escape($this->query) . '"'; ?>
<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>
<td><?php echo $this->escape($record['notes']); ?></td>
</tr>
<tr>
<td colspan="100">
<?php echo $this->partial('details.phtml', $record); ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (Application_Model_DbTable_MigrateRoles::currentUserCanEdit()) { echo $this->formSubmit('submit', 'Update Records'); } ?>
</form>
...@@ -34,15 +34,11 @@ ...@@ -34,15 +34,11 @@
<td><?php echo $this->escape($record['notes_host']); ?></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['notes_mailfile']); ?></td>
<td><?php echo $this->escape($record['archive_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> <td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr> </tr>
<tr> <tr>
<td colspan="100"> <td colspan="100">
More details here! <?php echo $this->partial('details.phtml', $record); ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
......
...@@ -26,15 +26,11 @@ ...@@ -26,15 +26,11 @@
<?php } ?> <?php } ?>
<td><?php echo $this->escape($record['username']); ?></td> <td><?php echo $this->escape($record['username']); ?></td>
<td><?php echo $this->escape($record['nuid']); ?></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> <td><?php echo $this->escape($record['notes']); ?></td>
<?php } ?>
</tr> </tr>
<tr> <tr>
<td colspan="100"> <td colspan="100">
More details here! <?php echo $this->partial('details.phtml', $record); ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
......
...@@ -33,10 +33,6 @@ abstract class Emw_Controller_Action extends Zend_Controller_Action ...@@ -33,10 +33,6 @@ abstract class Emw_Controller_Action extends Zend_Controller_Action
$row->save(); $row->save();
} }
$baseUrl = $this->view->baseUrl(); $this->_redirect($_SERVER['HTTP_REFERER']);
$targetUrl = $this->view->url(array('action' => 'index'));
$targetUrl = substr($targetUrl, strlen($baseUrl));
$this->_redirect($targetUrl);
} }
} }
\ No newline at end of file
@CHARSET "UTF-8"; @CHARSET "UTF-8";
textarea { textarea {
height: 1.5em; height: 4em;
width: 95%; width: 95%;
} }
td[colspan] {
/*display: none;*/
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment