initial commit

This commit is contained in:
Chris Sewell
2012-11-28 03:55:08 -05:00
parent 7adb399b2e
commit cf140a2e97
3247 changed files with 492437 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
indexSuccess:
stylesheets: [/css/clientManager]
javascripts: [/js/clientManager, /js/scriptaculous/lib/prototype]

View File

@ -0,0 +1,42 @@
<div class='regularCont'>
<div class='innerCont'><table border="0">
<tr>
<td style='width: 100px'>Report
</td>
<td style='width: 100px'>Status
</td>
<td style='width: 200px'>
Date
</td>
<td >
Action
</td>
</tr>
<?php
foreach($finalReport as $report){
?>
<tr>
<td>
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View</a>
</td>
<td>
<?php print ucwords($report->getPassFail()); ?>
</td>
<td>
<?php print $report->formattedDate(); ?>
</td>
<td>
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
</td>
</tr>
<?php
}
if(empty($finalReport)){
?>
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
<?php
}
?>
</table>
</div>
</div>

View File

@ -0,0 +1,42 @@
<div class='regularCont'>
<div class='innerCont'><table border="0">
<tr>
<td style='width: 100px'>Report
</td>
<td style='width: 100px'>Status
</td>
<td style='width: 200px'>
Date
</td>
<td >
Action
</td>
</tr>
<?php
foreach($finalReport as $report){
?>
<tr>
<td>
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View</a>
</td>
<td>
<?php print ucwords($report->getPassFail()); ?>
</td>
<td>
<?php print $report->formattedDate(); ?>
</td>
<td>
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
</td>
</tr>
<?php
}
if(empty($finalReport)){
?>
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
<?php
}
?>
</table>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,63 @@
fillin:
enabled: true
fields:
client_identification:
required:
msg: Please enter a client identification before continuing
sfStringValidator:
client_name:
required:
msg: Please enter a client name before continuing
sfStringValidator:
min: 5
min_error: Client name does not meet acceptable parameters (5 character min)
max: 50
max_error: Clint name exceeds acceptable parameters (50 characters max)
address:
required:
msg: Please enter an address.
city:
required:
msg: Please enter a city.
state:
required:
msg: Please select a state.
zip:
required:
msg: Please enter a zip code.
sfStringValidator:
min: 5
min_error: You have submitted an incomplete zip code. Please enter a valid zip code.
max: 5
max_error: Please submit a 5-digit zip code.
email:
sfEmailValidator:
strict: true
email_error: Please enter a valid email address (name@domain.extension)
phone:
sfStringValidator:
min: 12
min_error: Please enter a valid telephone number (e.g. 555-555-5555).
max: 17
max_error: Please enter a valid telephone number.
ext:
sfStringValidator:
max: 5
max_error: Please enter a valid extention.
# freq_month:
# required:
# msg: Please select month to start maintainence.
# sfStringValidator:
# min: 2
# min_error: Please select a month to start Maintainence.

View File

@ -0,0 +1,34 @@
fillin:
enabled: true
fields:
new_device_name:
required:
msg: Please enter a device description
new_manufacturer:
required:
msg: Please enter a device manufacturer
new_model_number:
required:
msg: Please enter a model number
new_serial_number:
required:
msg: Please enter a serial number
new_location:
required:
msg: Please enter where the device is located
new_frequency:
required:
msg: Please select a maintainance frequency
new_status:
required:
msg: Please select a status for the device

View File

@ -0,0 +1,21 @@
<?php
/**
* dashboard actions.
*
* @package atlbiomed
* @subpackage dashboard
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class dashboardActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$this->date = date('Y-m-d');
}
}

View File

@ -0,0 +1,3 @@
indexSuccess:
javascripts: [/js/scheduler]
stylesheets: [/css/email.css]

View File

@ -0,0 +1,146 @@
<?php use_helper('Javascript'); ?>
<?php use_helper('Object'); ?>
<?php
$api_key = sfConfig::get('app_google_maps_api_key');
echo javascript_include_tag('http://maps.google.com/maps?file=api&amp;v=2&amp;key='.$api_key); ?>
<!-- Javascript Calander -->
<?php
echo javascript_include_tag('jscalendar/calendar');
echo javascript_include_tag('jscalendar/lang/calendar-en');
echo javascript_tag("
Event.observe(window, 'load', initFunctions, false);
function initFunctions(evt)
{
showFlatCalendar();
load()
}"); ?>
<?php echo javascript_tag("
var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;
function setActiveStyleSheet(link, title)
{
var i, a, main;
for(i=0; (a = document.getElementsByTagName('link')[i]); i++)
{
if(a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
{
a.disabled = true;
if(a.getAttribute('title') == title) a.disabled = false;
}
}
if (oldLink) oldLink.style.fontWeight = 'normal';
oldLink = link;
link.style.fontWeight = 'bold';
return false;
}
function isDisabled(date)
{
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY);
}
function flatSelected(cal, date)
{
document.getElementById('date').value = date;
var el = document.getElementById('display_date');
el.innerHTML = date;".
remote_function(array(
'update' => 'techDisplay',
'url' => 'scheduler/populateTechDisplay',
'with' => '"date=" + date')).";"."
}
function showFlatCalendar()
{".
//initiate TechDisplay
remote_function(array(
'update' => 'techDisplay',
'url' => 'scheduler/populateTechDisplay',
'with' => '"date='.$date.'"')).";"."
var parent = document.getElementById('display');
// construct a calendar giving only the 'selected' handler.
var cal = new Calendar(0, null, flatSelected);
// hide week numbers
cal.weekNumbers = false;
// We want some dates to be disabled; see function isDisabled above
//cal.setDisabledHandler(isDisabled);
//cal.setDateFormat('%A, %B %e');
// this call must be the last as it might use data initialized above; if
// we specify a parent, as opposite to the 'showCalendar' function above,
// then we create a flat calendar -- not popup. Hidden, though, but...
cal.create(parent);
// ... we can show it here.
cal.show();
}
"); ?>
<!--////////////////Map stuff///////////////-->
<?php echo javascript_tag("
function load()
{
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById('map'));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
xmlhttp.overrideMimeType('text/xml');
} else if (window.ActiveXObject)
{
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
}
"); ?>
<?php echo input_hidden_tag('date', $date); ?>
<div id = 'emailPopUp' style='display:none'>
</div>
<div id="leftCol">
<div id="dashMap">
<div id="map" style="width: 350px; height: 250px"></div>
</div>
<div id="dashTech">
<div id="techDisplay">
</div>
</div>
<div id="rightCol">
<div id="dashCal">
<div id="display"></div>
<div id="preview"></div>
</div>
<div id="dashPendingJobs">
</div>
</div>

View File

@ -0,0 +1,20 @@
<?php
/**
* faq actions.
*
* @package atlbiomed
* @subpackage faq
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class faqActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
}
}

View File

@ -0,0 +1 @@
<h2>Content for this page coming soon.</h2>

View File

@ -0,0 +1,180 @@
<?php
/**
* maps actions.
*
* @package atlbiomed
* @subpackage maps
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class mapsActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
// default view values
$this->bogusWorkOrder = new Workorder();
$this->bogusWorkOrder->setJobStatusId('');
$this->bogusWorkOrder->setJobTypeId('');
$this->bogusWorkOrder->setTech('');
$this->technicians = array();
foreach(UserPeer::getUserByType(1) as $tech)
{
$this->technicians[$tech->getId()] = $tech->getDisplayName();
}
$this->dateFilter = date('Y-m-d');
$this->dateFilterType = 'day';
$this->markers = array();
if ($this->getRequestParameter('viewMode', 0) == 1)
{
// show all clients
foreach(ClientPeer::doSelect(new Criteria()) as $client)
{
$title = $client->getClientIdentification() . ' - ' . $client->getClientName();
$address = $client->getAddress() . ' ' .
$client->getCity() . ' ' .
$client->getState() . ' ' .
$client->getZip();
$content = $address . '<br />' .
'ATTN: ' . $client->getAttn() . '<br />' .
'Phone: ' . $client->getPhone();
if(!$client->getLocation())
$this->markers[] = new GMapMarker($address, '', '',$title, $content, 'green');
else
$this->markers[] = new GMapMarker($address,
$client->getLocation()->getLatitude(),
$client->getLocation()->getLongitude(), $title, $content, 'green');
}
}
else
{
// show jobs
$jobDate = date('Ymd');
$usersWithWork = new Criteria();
$workorders = new Criteria();
if($this->getRequest()->getMethod() == sfRequest::POST)
{
$this->dateFilter = $this->getRequestParameter('jobDate');
$this->dateFilterType = $this->getRequestParameter('dateFilterType');
if($this->getRequestParameter('technicianId') != '')
{
$usersWithWork->add(UserPeer::ID, $this->getRequestParameter('technicianId'));
$workorders->add(WorkorderTechPeer::USER_ID, $this->getRequestParameter('technicianId'));
$workorders->addJoin(WorkorderPeer::ID, WorkorderTechPeer::WORKORDER_ID, Criteria::INNER_JOIN);
$this->bogusWorkOrder->setTech($this->getRequestParameter('technicianId'));
}
if($this->getRequestParameter('job_status_id') != '')
{
$usersWithWork->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$workorders->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$this->bogusWorkOrder->setJobStatusId($this->getRequestParameter('job_status_id'));
}
if($this->getRequestParameter('job_type_id') != '')
{
$workorders->add(WorkorderPeer::JOB_TYPE_ID, $this->getRequestParameter('job_type_id'));
$this->bogusWorkOrder->setJobTypeId($this->getRequestParameter('job_type_id'));
}
}
$usersWithWork->addJoin(UserPeer::ID, WorkorderPeer::TECH);
$usersWithWork->setDistinct(true);
if ($this->dateFilterType == 'day')
{
$usersWithWork->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
$workorders->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
}
else if ($this->dateFilterType == 'month')
{
$year = substr($this->getRequestParameter('jobDate'), 0, 4);
$month = substr($this->getRequestParameter('jobDate'), 5, 2);
$start = $year . '-' . $month . '-01';
$end = $year . '-' . $month . '-31'; // easy check, even for months without 31 days since all dates are
// strings in our database
$usersWithWork->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
$workorders->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
}
else
{
// week from the selected date
$start = date('Y-m-d', strtotime($this->getRequestParameter('jobDate')));
$end = date('Y-m-d', strtotime('+7 days', strtotime($this->getRequestParameter('jobDate'))));
//$this->renderText($start . $end); return sfView::NONE;
$usersWithWork->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
$workorders->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
}
$techs = UserPeer::doSelect($usersWithWork);
$orders = WorkorderPeer::doSelect($workorders);
foreach($orders as $order)
{
$findTech = create_function('$tech', 'return $tech->getId() ==' . $order->getTech() . ';');
$theTech = array_filter($techs, $findTech);
if(isset($theTech) && count($theTech) == 1)
{
$address = $order->getClient()->getAddress() . ' ' .
$order->getClient()->getCity() . ' ' .
$order->getClient()->getState() . ' ' .
$order->getClient()->getZip();
$jobDate = $order->getJobDate();
$tech = array_pop($theTech);
$content = 'Contact: ' . $order->getClient()->getAttn() . '<br />' .
'Phone: ' . $order->getClient()->getPhone() . '<br />' .
'City: ' . $order->getClient()->getCity() . ', ' . $order->getClient()->getState() . '<br/><span class="red">';
if($order->getClient()->getAnesthesia() != null){
$content .= $order->getClient()->getAnesthesia();
}
if($order->getClient()->getAnesthesia() != null && $order->getClient()->getMedgas() != null){
$content .= '&nbsp;&frasl;&nbsp;';
}
if($order->getClient()->getMedgas() != null){
$content .= $order->getClient()->getMedgas();
}
$content .= '</span><br/><br/>' .
'<a href="/index.php/scheduler/index/mode/edit/ticket/' .$order->getId().'" >Schedule</a>';
if(!$order->getClient()->getLocation())
$this->markers[] = new GMapMarker($address, '', '',$order->getClient()->getClientName(), $content, 'green');
else
$this->markers[] = new GMapMarker($address,
$order->getClient()->getLocation()->getLatitude(),
$order->getClient()->getLocation()->getLongitude(),
$order->getClient()->getClientName(), $content, 'green');
}
unset($theTech);
}
}
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* Defines components for the map actions, namely the ability to easily print a technician
* map.
*
* @author Ciphent
**/
class mapsComponents extends sfComponents
{
/**
* Displays the google map for all technicians. You can only have one instance of this component on a page.
*
* Call it as so: include_component('maps', 'displayTechnicianMap', array('markers' => array(elements of type GMapMarer))
*
**/
public function executeDisplayTechnicianMap()
{
$map = new GoogleMap('map');
$map->includeDefaultLocation()->setWidth($this->mapwidth)->addMarkers($this->markers);
$map->setHeight($this->mapheight);
$this->map = $map;
}
}

View File

@ -0,0 +1,3 @@
all:
is_secure: off
credentials: Office

View File

@ -0,0 +1,2 @@
all:
javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype]

View File

@ -0,0 +1,19 @@
<?php use_helper('Javascript') ?>
<div><h2>Mon:<img src='/images/pins/pin_red1.png' /> Tue:<img src='/images/pins/pin_blue1.png' /> Wed: <img src='/images/pins/pin_orange1.png' /> Thu:<img src='/images/pins/pin_green1.png' /> Fri: <img src='/images/pins/pin_grey1.png' /> </h2></div>
<?php
echo $map->getMapJS();
echo javascript_tag("
Event.observe(window, 'load', showMap, false);
function showMap(evt)
{
onLoad();
}
");
echo $map->getMapHtml();
?>

View File

@ -0,0 +1,6 @@
<?php echo radiobutton_tag('dateFilterType', 'month', $dateFilterType == 'month') ?>By Selected Month<br />
<?php echo radiobutton_tag('dateFilterType', 'week', $dateFilterType == 'week') ?>By Selected Week (selected day plus seven days)<br />
<?php echo radiobutton_tag('dateFilterType', 'day', $dateFilterType == 'day') ?>By Selected Day<br />
<?php echo input_date_tag('jobDate', $initialDate, 'rich=true'); ?>

View File

@ -0,0 +1,50 @@
<?php use_helper('Javascript') ?>
<?php use_helper('Object') ?>
<div class="content" style="padding: 5px;">
<div class="mapsCollapsingPanelContainer">
<?php echo form_tag('maps/index'); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Status',
'uniqueId' => 'filterByStatus',
'content' => object_select_tag($bogusWorkOrder, 'getJobStatusId', 'include_custom=All', ''))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Job Type',
'uniqueId' => 'filterByJType',
'content' => object_select_tag($bogusWorkOrder, 'getJobTypeId', 'include_custom=All', ''))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Technician',
'uniqueId' => 'filterByTechnician',
'content' => select_tag('technicianId',
options_for_select($technicians,
$bogusWorkOrder->getTech(),
'include_custom=All')))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Date',
'uniqueId' => 'filterByDate',
'content' => get_partial('mapDateFilterControl',
array('initialDate' => $dateFilter,
'dateFilterType' => $dateFilterType)))); ?>
<div class="mapsCollapsingPanelContainerControl">
<?php echo submit_tag('Filter'); ?>
</div>
<div class="mapsCollapsingPanelContainerControl">
<hr />
</div>
<div class="mapsCollapsingPanelContainerControl">
<h3><?php echo link_to('View all Client Locations', 'maps/index?viewMode=1'); ?></h3>
</div>
</form>
</div>
<div style="float: left; display: inline; border: 1px solid black;">
<?php include_component('maps', 'displayTechnicianMap', array('markers' => $markers, 'mapwidth' => '800px')); ?>
</div>
</div>

View File

@ -0,0 +1,179 @@
<?php
/**
* messages actions.
*
* @package atlbiomed
* @subpackage messages
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class messagesActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$userId = $this->getUser()->getAttribute('userId');
$user = UserPeer::retrieveByPk ($userId);
if($user){
$email = $user->getEmail();
$firstName = $user->getFirstName();
}
$signed_info = $firstName."||".$email;
if($this->getRequest()->getMethod() == sfRequest::POST && !empty($userId)){
$for = $this->getRequestParameter('for');
$name = $this->getRequestParameter('name');
$company = $this->getRequestParameter('company');
$phone = "(".$this->getRequestParameter('phone').")".$this->getRequestParameter('phone-2')."-".$this->getRequestParameter('phone-3');
$ext = "ext. ".$this->getRequestParameter('ext');
$time_to_call = $this->getRequestParameter('time_to_call');
$mobile = "(".$this->getRequestParameter('mobile').")".$this->getRequestParameter('mobile-2')."-".$this->getRequestParameter('mobile-3');
$time_to_call_mobile = $this->getRequestParameter('time_to_call_mobile');
$fax = "(".$this->getRequestParameter('fax').")".$this->getRequestParameter('fax-2')."-".$this->getRequestParameter('fax-3');
$telephoned = $this->getRequestParameter('telephoned');
$came_to_see_you = $this->getRequestParameter('came_to_see_you');
$wants_to_see_you = $this->getRequestParameter('wants_to_see_you');
$returned_your_call = $this->getRequestParameter('returned_your_call');
$please_call = $this->getRequestParameter('please_call');
$will_call_again = $this->getRequestParameter('will_call_again');
$rush = $this->getRequestParameter('rush');
$special_attention = $this->getRequestParameter('special_attention');
$callers_message = $this->getRequestParameter('callers_message');
$signed_data = explode('||',$signed_info);
//$signed = $_POST['signed'];
//$from = $_POST['signed'];
$signed = $signed_data[0];
$from = $signed_data[0];
$reply_to = $signed_data[1];
$date = "Time of call: ".date("F j, Y, g:i a");
$time = date("F j, Y, g:i a");
if($ext == 'ext. ')
$ext = '';
else $ext = $ext;
if($time_to_call != '')
$time_to_call = 'Time to call: '.$time_to_call;
if($mobile != '()-')
$mobile = 'Mobile: '.$mobile;
else $mobile = '';
if($time_to_call_mobile != '')
$time_to_call_mobile = 'Time to call mobile: '.$time_to_call_mobile;
if($fax != '()-')
$fax = 'Fax: '.$fax;
else $fax = '';
if($telephoned == 'on')
$telephoned = 'Telephoned';
else $telephoned = '';
if($came_to_see_you == 'on')
$came_to_see_you = 'Came to see you';
else $came_to_see_you = '';
if($wants_to_see_you == 'on')
$wants_to_see_you = 'Wants to see you';
else $wants_to_see_you = '';
if($returned_your_call == 'on')
$returned_your_call = 'Returned your call';
else $returned_your_call = '';
if($please_call == 'on')
$please_call = 'Please call';
else $please_call = '';
if($will_call_again == 'on')
$will_call_again = 'Will call again';
else $will_call_again = '';
if($rush == 'on')
$rush = 'Rush';
else $rush = '';
if($special_attention == 'on')
$special_attention = 'Special Attention';
else $special_attention = '';
if($callers_message != '')
$callers_message = 'Message: '.$callers_message;
if($signed != '')
$signed = 'Signed: '.$signed;
$body = "$date
Name: $name
Company: $company
Phone: $phone $ext
";
if($time_to_call != '')
$body .= $time_to_call;
if($mobile != '')
$body .= $mobile;
if($time_to_call_mobile != '')
$body .= $time_to_call_mobile;
if($fax != '')
$body .= $fax;
if($telephoned != '' || $came_to_see_you != '' || $wants_to_see_you != '' || $returned_your_call != '' || $please_call != '' || $will_call_again != '' || $rush != '' || $special_attention != '')
$body .= "
Please:
";
if($telephoned != '')
$body .= $telephoned."\n";
if($came_to_see_you != '')
$body .= $came_to_see_you."\n";
if($wants_to_see_you != '')
$body .= $wants_to_see_you."\n";
if($returned_your_call != '')
$body .= $returned_your_call."\n";
if($please_call != '')
$body .= $please_call."\n";
if($will_call_again != '')
$body .= $will_call_again."\n";
if($rush != '')
$body .= $rush."\n";
if($special_attention != '')
$body .= $special_attention."\n";
$body .= "
$callers_message
$signed";
$subject = "Important Message From " . $name ." - ". $time;
//mail($for, $subject, $body, 'from: messages@atlanticbiomedical.com');
mail($for, $subject, $body, "from: $reply_to");
$this->redirect('messages/index');
//header('Location: /messages/index.php');
}
}
}

View File

@ -0,0 +1,3 @@
indexSuccess:
stylesheets: [messages]
javascripts: ['scriptaculous/lib/prototype.js', 'scriptaculous/src/effects.js', validation, autotab]

View File

@ -0,0 +1,140 @@
<script type="text/javascript" src="/sf/prototype/js/prototype.js"></script>
<script type="text/javascript" src="/sf/calendar/calendar.js"></script>
<script type="text/javascript" src="/sf/calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="/sf/calendar/calendar-setup.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="autotab.js"></script>
<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
<script type="text/javascript" src="validation.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/client.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/user.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/theme.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/sf/calendar/skins/aqua/theme.css" />
<div id="main">
<center>
<br/>
<?php echo form_tag('messages/index', array('id'=>'test')) ?>
<fieldset>
<label for="for">For </label>
<select name="for" class="half">
<option value="allison.wolcott@atlanticbiomedical.com">Allison Wolcott</option>
<option value="caendres1@gmail.com">Carl Endres</option>
<option value="chris.endres@atlanticbiomedical.com" selected="selected">Chris Endres</option>
<!--
<option value="niles.armstrong@atlanticbiomedical.com">Niles Armstrong</option>
<option value="eric.frasse@atlanticbiomedical.com">Eric Frasse</option>
-->
<option value="ryan.foley@atlanticbiomedical.com">Ryan Foley</option>
<option value="will.turner@atlanticbiomedical.com">Will Turner</option>
<option value="kelli.kirk@atlanticbiomedical.com">Kelli Kirk</option>
</select>
<div class="form-row">
<label for="name" class="name">Name </label>
<input type="text" name="name" id="name" class="validate-name half" />
<div class="form-row-ff"></div>
</div>
<div class="form-row">
<label for="company">Company </label>
<input type="text" name="company" class="validate-company" />
<div class="form-row-ff"></div>
</div>
<div class="form-row"><span id="bug">
<label for="phone">Phone </label>
<input type="text" name="phone" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="validate-phone phone" />
<input type="text" name="phone-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="validate-phone phone" />
<input type="text" name="phone-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="validate-phone phone3" />
<label for="ext" class="ext">ext. </label>
<input type="text" name="ext" size="4" class="phone" />
<label for="time_to_call" class="time">Time To Call</label>
<input type="text" name="time_to_call" class="phone" /></span>
</div>
<span style="display:inline-block"><label for="mobile">Mobile </label>
<input type="text" name="mobile" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="mobile-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="mobile-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="phone3" />
<label for="time_to_call_mobile" class="time2">Time To Call</label>
<input type="text" name="time_to_call_mobile" class="phone" /></span>
<span style="display:inline-block"><label for="fax">Fax </label>
<input type="text" name="fax" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="fax-2" onKeyUp="return autoTab(this, 3, event);" maxlength="3" size="3" class="phone" />
<input type="text" name="fax-3" onKeyUp="return autoTab(this, 4, event);" maxlength="4" size="4" class="phone3" /></span>
<span style="display:inline-block"><div id="checkboxes">
<label for="telephoned" class="row1_label">Telephoned </label>
<input type="checkbox" name="telephoned" />
<label for="came_to_see_you" class="row2_label">Came To See You </label>
<input type="checkbox" name="came_to_see_you" />
<label for="wants_to_see_you" class="row3_label">Wants To See You </label>
<input type="checkbox" name="wants_to_see_you" />
<label for="returned_your_call" class="row1_label">Returned Your Call </label>
<input type="checkbox" name="returned_your_call" />
<label for="please_call" class="row2_label">Please Call </label>
<input type="checkbox" name="please_call" />
<label for="will_call_again" class="row3_label">Will Call Again </label>
<input type="checkbox" name="will_call_again" />
<label for="rush" class="row1_label">Rush </label>
<input type="checkbox" name="rush" />
<label for="special_attention" class="row2_label">Special Attention </label>
<input type="checkbox" name="special_attention" />
</div></span>
<div class="form-row">
<label for="callers_message" id="message">Message </label>
<textarea name="callers_message" cols="10" rows="10" class="validate-message"></textarea>
<div class="form-row-ff"></div>
</div>
<input type="submit" value="Submit Message" class="button" />
<div class="form-row">
<div class="form-row-ff"></div>
</div>
</fieldset>
</form>
<script type="text/javascript">
var valid = new Validation('test', {immediate : true});
Validation.addAllThese([
['validate-name', 'A name is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}],
['validate-company', 'A company is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}],
['validate-phone', 'A phone number is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}],
['validate-message', 'A message is required.', function(v){
return !Validation.get('IsEmpty').test(v);
}]
]);
</script>
</center><br/>
</div>

View File

@ -0,0 +1,740 @@
<?php
/**
* process actions.
*
* @package atlbiomed
* @subpackage process
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class processActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$this->client_id = '';
//populate Client Select dropdown
$m = new Criteria();
$m->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$this->clients = array();
foreach(ClientPeer::doSelect($m) as $client)
{
$this->clients[$client->getId()] = $client->getClientIdentification();
}
}
public function executeProcessUpload(){ //get all clients
$c = new Criteria();
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$clients = ClientPeer::doSelect($c);
//read and parse upload file
$processHandler = new processHandler($this->getRequest());
if($processHandler->shouldForward()){//file was already uploaded
$this->getUser()->setAttribute('fileAlreadyExist',true);
$this->redirect('/unprocessed/index?warning=yes&fn='.$processHandler->getFilename());
}
$this->partialMatch = $processHandler->getPartialMatch();
$this->noMatch = $processHandler->getNoMatch();
$this->match = $processHandler->getMatched();
$this->clients = $clients;
$this->filename = $processHandler->getFilename();
}//public
public function executeSavePartialMatch(){
$pass_fail = $this->getRequestParameter('pass_fail');
$device_id = $this->getRequestParameter('device_id');
$device_name = $this->getRequestParameter('device_name');
$serial = $this->getRequestParameter('serial');
$model = $this->getRequestParameter("model");
$manufacturer = $this->getRequestParameter('manufacturer');
$date = $this->getRequestParameter('date');
$serialize_test_data = $this->getRequestParameter('test_data');
$serialize_extra_data = $this->getRequestParameter('extra_data');
$test_data = unserialize($serialize_test_data);
$extra_data = unserialize($serialize_extra_data);
$filename = $this->getRequestParameter('filename');
$location = $this->getRequestParameter('location');
$comments = $this->getRequestParameter('comments');
$assoc_client_id = $this->getRequestParameter('assoc_client');
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $device_id);
$deviceResult = DevicePeer::doSelect($c);
if($deviceResult){
$this->changePm2Missing($deviceResult[0]->getClientId());
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::DEVICE_ID, $device_id);
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
$unprocessDevice = UnprocessedDevicesPeer::doSelect($c);
$unprocessDevice = $unprocessDevice[0];
if($unprocessDevice)
$unprocessDevice->delete();
//saving device info
$deviceResult = $deviceResult[0];
$deviceResult->setSerialNumber($serial);
$deviceResult->setStatus(strtolower($pass_fail));
$deviceResult->setLocation($location);
$deviceResult->setComments($comments);
$deviceResult->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
if($assoc_client_id > 0)
$deviceResult->setClientId($assoc_client_id);
$specificationId = $deviceResult->getSpecificationId();
$deviceResult->save();
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($deviceResult->getId());
$deviceCheckup->setClientId($deviceResult->getClientId());
$deviceCheckup->setDeviceIdentification($device_id);
$deviceCheckup->setDate($date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setTime($extra_data['time']);
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
$deviceCheckup->setDeviceTechId($extra_data['techId']);
//$deviceCheckup->setLocation($extra_data['location']);
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
$deviceCheckup->setRecNumber($extra_data['recNumber']);
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
$deviceCheckup->setRoom($extra_data['room']);
$deviceCheckup->save();
$deviceCheckup->save();
$device_test_data = new DeviceTestData();
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
$device_test_data->setName($test_data['name']);
$device_test_data->setPassFail($test_data['passFail']);
$device_test_data->setType($test_data['type']);
$device_test_data->setUnit($test_data['unit']);
$device_test_data->setValue($test_data['value']);
$device_test_data->save();
$this->changePm2Missing();
}
$c = new Criteria();
$c->add(SpecificationPeer::ID, $specificationId);
$specificationResult = SpecificationPeer::doSelect($c);
if($specificationResult){
$specificationResult = $specificationResult[0];
$specificationResult->setManufacturer($manufacturer);
$specificationResult->setModelNumber($model);
$specificationResult->setDeviceName($device_name);
$specificationResult->save();
}
return sfView::NONE;
}
public function executeSaveNoMatch(){
$option = $this->getRequestParameter('option');
$device_id = $this->getRequestParameter('device_id');
$d_device_id = $this->getRequestParameter('get_devices');
$device_name = $this->getRequestParameter('device_name');
$serial = $this->getRequestParameter('serial');
$model = $this->getRequestParameter("model");
$manufacturer = $this->getRequestParameter('manufacturer');
$pass_fail = $this->getRequestParameter('pass_fail');
$date = $this->getRequestParameter('date');
$client_id = $this->getRequestParameter('client_id');
$serialize_test_data = $this->getRequestParameter('test_data');
$serialize_extra_data = $this->getRequestParameter('extra_data');
$test_data = unserialize($serialize_test_data);
$extra_data = unserialize($serialize_extra_data);
$filename = $this->getRequestParameter('filename');
$location = $this->getRequestParameter('location');
$comments = $this->getRequestParameter('comments');
//if this is -1 use the origanal device identification
//otherwise use whatever value this is for the identifcation
$existingId = $this->getRequestParameter('existingId');
$c = new Criteria();
$c->add(UnprocessedDevicesPeer::DEVICE_ID, $device_id);
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
$unprocessDevice = UnprocessedDevicesPeer::doSelect($c);
$unprocessDevice = $unprocessDevice[0];
if($unprocessDevice)
$unprocessDevice->delete();
//add as new entry
if($option == 1){
$this->changePm2Missing($client_id);
$specification = new Specification();
$specification->setDeviceName($device_name);
$specification->setManufacturer($manufacturer);
$specification->setModelNumber($model);
$specification->save();
$specification_id = $specification->getId();
$device = new Device();
$device->setIdentification($device_id);
$device->setClientId($client_id);
$device->setSpecificationId($specification_id);
$device->setSerialNumber($serial);
$device->setLocation($location);
$device->setStatus(strtolower($pass_fail));
$device->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
$device->setComments($comments);
$device->save();
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($device->getId());
$deviceCheckup->setClientId($device->getClientId());
$deviceCheckup->setDeviceIdentification($device_id);
$deviceCheckup->setDate($date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setTime($extra_data['time']);
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
$deviceCheckup->setDeviceTechId($extra_data['techId']);
//$deviceCheckup->setLocation($extra_data['location']);
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
$deviceCheckup->setRecNumber($extra_data['recNumber']);
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
$deviceCheckup->setRoom($extra_data['room']);
$deviceCheckup->save();
$device_test_data = new DeviceTestData();
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
$device_test_data->setName($test_data['name']);
$device_test_data->setPassFail($test_data['passFail']);
$device_test_data->setType($extra_data['physicalInspection']);
$device_test_data->setUnit($test_data['unit']);
$device_test_data->setValue($test_data['value']);
$device_test_data->save();
}else{
//update existing
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $d_device_id);
$c->add(DevicePeer::CLIENT_ID, $client_id);
$device = DevicePeer::doSelect($c);
$device = $device[0];
if($device){
$specification_id = $device->getSpecificationId();
if($existingId != '-1'){
$device->setIdentification($existingId);
}
$device->setSerialNumber($serial);
$device->setLocation($location);
$device->setStatus(strtolower($pass_fail));
$device->setComments($comments);
$device->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
$device->save();
$deviceCheckup = new DeviceCheckup();
$deviceCheckup->setDeviceId($device->getId());
$deviceCheckup->setClientId($device->getClientId());
$deviceCheckup->setDeviceIdentification($d_device_id);
$deviceCheckup->setDate($date);
$deviceCheckup->setPassFail($pass_fail);
$deviceCheckup->setTime($extra_data['time']);
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
$deviceCheckup->setDeviceTechId($extra_data['techId']);
//$deviceCheckup->setLocation($extra_data['location']);
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
$deviceCheckup->setRecNumber($extra_data['recNumber']);
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
$deviceCheckup->setRoom($extra_data['room']);
$deviceCheckup->save();
$device_test_data = new DeviceTestData();
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
$device_test_data->setName($test_data['name']);
$device_test_data->setPassFail($test_data['passFail']);
$device_test_data->setType($test_data['type']);
$device_test_data->setUnit($test_data['unit']);
$device_test_data->setValue($test_data['value']);
$device_test_data->save();
}
$c= new Criteria();
$c->add(SpecificationPeer::ID,$specification_id);
$specification = SpecificationPeer::doSelect($c);
$specification = $specification[0];
if($specification){
$specification->setDeviceName($device_name);
$specification->setManufacturer($manufacturer);
$specification->setModelNumber($model);
$specification->Save();
}
}
return sfView::NONE;
}
public function executeGetDevices(){
$client_id = $this->getRequestParameter('client_id');
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->addAscendingOrderByColumn(DevicePeer::IDENTIFICATION);
$result = DevicePeer::doSelect($c);
$this->devices = $result;
}
public function executeDeviceIdChanged(){
//these info are from the uploaded file
$device_name = $this->getRequestParameter('dn');
$manufacturer = $this->getRequestParameter('man');
$model = $this->getRequestParameter('mod');
$serial = $this->getRequestParameter('ser');
//device id we want to associate to
$existing_device_id = $this->getRequestParameter('existing_device_id');
$c = new Criteria();
$c->add(DevicePeer::IDENTIFICATION, $existing_device_id);// <---------------------------------------------------
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, Criteria::LEFT_JOIN);
$result = DevicePeer::doSelect($c);
$this->oldDevice = $result[0];
$this->newDevice = array('device_name'=>$device_name, 'manufacturer'=>$manufacturer, 'model'=>$model, 'serial'=>$serial);
}
public function executeListDevices(){
$client_id = $this->getRequestParameter('client_id');
$c= new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID,Criteria::LEFT_JOIN);
$devices = DevicePeer::doSelect($c);
$this->devices = $devices;
$this->client_id = $client_id;
if($devices && $devices[0]->getClient() )
$this->contact = $devices[0]->getClient()->getAttn();
}
public function executeQuotes(){
$client_id = $this->getRequestParameter('client_id');
$checkedItemStr = $this->getRequestParameter('checkedItems'); //ids of items that were checked for update
$c= new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$devices = DevicePeer::doSelect($c);
if(!empty($checkedItemStr)){
$checkedItems = explode(',',$checkedItemStr);
for($i = 0; $i<count($devices); $i++){
if(strtolower($devices[$i]->getStatus())=='fail' and in_array($devices[$i]->getId(),$checkedItems)){
$devices[$i]->setStatus('quote');
$devices[$i]->save();
}
}
}//if
$this->devices = $devices;
$this->client_id = $client_id;
$this->setTemplate('listDevices');
}
public function executePendingRepair(){
$client_id = $this->getRequestParameter('client_id');
$checkedItemStr = $this->getRequestParameter('checkedItems'); //ids of items that were checked for update
$c= new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$devices = DevicePeer::doSelect($c);
if(!empty($checkedItemStr)){
$checkedItems = explode(',',$checkedItemStr);
for($i = 0; $i<count($devices); $i++){
if(strtolower($devices[$i]->getStatus())=='quote' and in_array($devices[$i]->getId(),$checkedItems)){
$devices[$i]->setStatus('pending repair');
$devices[$i]->save();
}
}
}
$this->devices = $devices;
$this->client_id = $client_id;
$this->setTemplate('listDevices');
}
public function executeGenerateReport(){
$client_id = $this->getRequestParameter('client_id');
$contact = trim($this->getRequestParameter('contact'),' ');
$client = ClientPeer::retrieveByPk($client_id);
if($client){
if(!empty($contact))
$contactName = $contact ;
else {
$contactName = ($client->getAddressType() == 1) ? $client->getAttn() : $client->getSecondaryAttn();
}
}
//-------------------------------------------------------------------
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, strtolower('fail'));
$totalFail = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, strtolower('pass'));
$totalPass = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, strtolower('missing'));
$totalMissing = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
$c->add(SpecificationPeer::DEVICE_NAME,'BAUMANOMETER');
$totalBp = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
$c->add(SpecificationPeer::DEVICE_NAME,'TRACE GAS N20');
$totalTrace = count(DevicePeer::doSelect($c));
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
$c->add(SpecificationPeer::DEVICE_NAME,'WALL OUTLET');
$totalOutlets = count(DevicePeer::doSelect($c));
//-------------------------------------------------------------------
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, 'missing');
$missingDevices = DevicePeer::doSelect($c);
if($missingDevices){
$report = new FinalDeviceReport();
$report->setClientId($client_id);
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
$report->setPassFail('missing');
$report->setTotalPassed($totalPass);
$report->setTotalFailed($totalFail);
$report->setTotalMissed($totalMissing);
$report->setTotalTrace($totalTrace);
$report->setTotalBp($totalBp);
$report->setTotalOutlets($totalOutlets);
$report->setContact($contactName);
$report->save();
foreach($missingDevices as $f_device){
$missing = new DevicesFailed();
$missing->setReportId($report->getId());
$missing->setClientId($f_device->getClientId());
$missing->setDeviceId($f_device->getId());
$missing->setStatus($f_device->getStatus());
$missing->save();
}//foreach
}
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID, $client_id);
$c->add(DevicePeer::STATUS, 'fail');
$failDevices = DevicePeer::doSelect($c);
if($failDevices){
//report failed
$report = new FinalDeviceReport();
$report->setClientId($client_id);
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
$report->setPassFail('fail');
$report->setTotalPassed($totalPass);
$report->setTotalFailed($totalFail);
$report->setTotalMissed($totalMissing);
$report->setTotalTrace($totalTrace);
$report->setTotalBp($totalBp);
$report->setTotalOutlets($totalOutlets);
$report->setContact($contactName);
$report->save();
foreach($failDevices as $f_device){
$fail = new DevicesFailed();
$fail->setReportId($report->getId());
$fail->setClientId($f_device->getClientId());
$fail->setDeviceId($f_device->getId());
$fail->setStatus($f_device->getStatus());
$fail->save();
}//foreach
}else{
//report passed
//in order to get contact name
$report = new FinalDeviceReport();
$report->setClientId($client_id);
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
$report->setPassFail('pass');
$report->setTotalPassed($totalPass);
$report->setTotalFailed($totalFail);
$report->setTotalMissed($totalMissing);
$report->setTotalTrace($totalTrace);
$report->setTotalBp($totalBp);
$report->setTotalOutlets($totalOutlets);
$report->setContact($contactName);
$report->save();
}
$c = new Criteria();
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$finalReport = FinalDeviceReportPeer::doSelect($c);
$this->finalReport = $finalReport;
}
public function executeGetReports(){
$client_id = $this->getRequestParameter('client_id');
$c = new Criteria();
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$finalReport = FinalDeviceReportPeer::doSelect($c);
$this->finalReport = $finalReport;
$this->setTemplate('generateReport');
}
public function executeDeleteReport(){
$client_id = $this->getRequestParameter('client_id');
$report_id = $this->getRequestParameter('id');
$c = new Criteria();
$c->add(FinalDeviceReportPeer::ID, $report_id);
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$forDelete = FinalDeviceReportPeer::doSelect($c);
if($forDelete){
$forDelete[0]->delete();
}
$c = new Criteria();
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
$finalReport = FinalDeviceReportPeer::doSelect($c);
$this->finalReport = $finalReport;
$this->setTemplate('generateReport');
}
public function executeSaveComments(){
$device_id = $this->getRequestParameter('device_id');
$comments = $this->getRequestParameter('comments');
$device = DevicePeer::retrieveByPK($device_id);
if($device){
$device->setComments($comments);
$device->save();
}
return sfView::NONE;
}
public function executeCreatePdf(){
$client_id = 0; //default val
$id = $this->getRequestParameter('id');
$c = new Criteria();
$c->add(DeviceCheckupPeer::DATE, $date);
$c->add(DeviceCheckupPeer::CLIENT_ID, $client_id);
$c->add(DeviceCheckupPeer::PASS_FAIL, 'FAIL');
$failedDevices = DeviceCheckupPeer::doSelect($c);
$c = new Criteria();
$c->add(FinalDeviceReportPeer::ID, $id);
$c->setLimit(1);
$all = FinalDeviceReportPeer::doSelect($c);
if(empty($all))
$passed = true;
elseif(strtolower($all[0]->getPassFail())=='fail'){
$passed = false;
$missing = false;
}elseif(strtolower($all[0]->getPassFail())=='pass'){
$passed = true;
$missing = false;
}elseif(strtolower($all[0]->getPassFail())=='missing'){
$missing = true;
}
if(!empty($all))
$client_id = $client_id = $all[0]->getClientId();
$c = new Criteria();
$c->add(ClientPeer::ID, $client_id);
$clientinfo = ClientPeer::doSelect($c);
define('FPDF_FONTPATH',SF_ROOT_DIR.'/web/font/');
$date = date("F d, Y", time());
$clientName = $clientinfo[0]->getClientName();
if($clientinfo[0]->getAddressType() == 1){
$address_line_1 = $clientinfo[0]->getAddress();
$address_line_2 = $clientinfo[0]->getAddress2();
$address_line_3 = $clientinfo[0]->getCity().', '.$clientinfo[0]->getState().' '.$clientinfo[0]->getZip();
//$contact = $clientinfo[0]->getAttn();
$contact = $all[0]->getContact();
}else{
$address_line_1 = $clientinfo[0]->getSecondaryAddress();
$address_line_2 = $clientinfo[0]->getSecondaryAddress2();
$address_line_3 = $clientinfo[0]->getSecondaryCity().', '.$clientinfo[0]->getSecondaryState().' '.$clientinfo[0]->getSecondaryZip();
//$contact = $clientinfo[0]->getSecondaryAttn();
$contact = $all[0]->getContact();
}
$subject = "Re: Preventive Maintenance Test Results ";
if($missing){
$line_1 = "While our technician was doing preventive maintenance on your equipment, some devices were missed. The following is a list of the equipment that were not checked:
";
$line_2 = "
We would like to schedule a time to complete the preventive maintenance on this equipment. Please call us and we will arrange for a technician to complete this work. If you have any questions, please do not hesitate to call. ";
$signer = "Chris Endres, VP";
}else{
$line_1 = "While our technician was doing preventive maintenance on your equipment, some failures were found. The following is a list of the equipment and the problems that were found:
";
$line_2 = "
We would like to schedule a time to repair this equipment. Please call us and we will arrange for a technician to perform the needed repair immediately. If you have any questions, please do not hesitate to call.";
$signer = "Chris Endres, VP";
}
$passed_line = "While our technician was doing preventive maintenance on your equipment there were no problems found. Enclosed please find the reports for all equipment tested. If you need any repairs or have any questions, please do not hesitate to call.
";
$pdf=new FPDF();
$pdf->SetMargins(30,25,30);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
//for($i=1;$i<=40;$i++)
$pdf->Cell(0,5,$date,0,1);
$pdf->Cell(0,5,"",0,1);
$pdf->Cell(0,5,$clientName,0,1);
$pdf->Cell(0,5,$address_line_1,0,1);
if(!empty($address_line_2))
$pdf->Cell(0,5,$address_line_2,0,1);
$pdf->Cell(0,5,$address_line_3,0,1);
$pdf->Cell(0,5,"",0,1);
$pdf->Cell(0,5,$subject,0,1);
$pdf->Cell(0,5,"",0,1);
$pdf->Cell(0,5,"Dear $contact,",0,1);
$pdf->Cell(0,5,"",0,1);
if($passed)
$pdf->MultiCell(0,5,$passed_line,0,1);
else{
$pdf->MultiCell(0,5,$line_1,0,1);
//search for failed device for report
if($missing){
$c = new Criteria();
$c->add(DevicesFailedPeer::CLIENT_ID, $client_id);
$c->add(DevicesFailedPeer::REPORT_ID, $id);
$c->add(DevicesFailedPeer::STATUS, 'missing');
$c->addjoin(DevicesFailedPeer::DEVICE_ID,DevicePeer::ID, Criteria::LEFT_JOIN);
$failedDevices = DevicesFailedPeer::doSelect($c);
foreach($failedDevices as $failedDevice){
$currentDevice = $failedDevice->getDevice();
if($currentDevice){
$deviceName = $currentDevice->getSpecification()->getDeviceName();
$deviceIdentification = $currentDevice->getIdentification();
$pdf->Cell(0,5," * $deviceIdentification - $deviceName",0,1);
}
}
}else{
$c = new Criteria();
$c->add(DevicesFailedPeer::CLIENT_ID, $client_id);
$c->add(DevicesFailedPeer::REPORT_ID, $id);
$c->add(DevicesFailedPeer::STATUS, 'fail');
$c->addjoin(DevicesFailedPeer::DEVICE_ID,DevicePeer::ID, Criteria::LEFT_JOIN);
$failedDevices = DevicesFailedPeer::doSelect($c);
foreach($failedDevices as $failedDevice){
$currentDevice = $failedDevice->getDevice();
if($currentDevice){
$comments = ($currentDevice->getComments()) ? '- ' . $currentDevice->getComments() : '';
$comments = strtoupper($comments);
$deviceName = $currentDevice->getSpecification()->getDeviceName();
$deviceIdentification = $currentDevice->getIdentification();
$pdf->Cell(0,5," * $deviceIdentification - $deviceName $comments",0,1);
}
}
}
$pdf->Cell(0,5," ",0,1);
$pdf->MultiCell(0,5,$line_2,0,1);
}
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5,"Sincerely, ",0,1);
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5," ",0,1);
$pdf->Cell(0,5,$signer,0,1);
//$pdf->Cell(0,5,$subject,0,1);
//$pdf->Cell(0,5,$subject,0,1);
//$pdf->Cell(0,5,$subject,0,1);
$pdf->Output();
return svView::NONE;
}
private function changePm2Missing($clientId = null){
if(empty($clientId)) return;
$c = new Criteria();
$c->add(DevicePeer::CLIENT_ID,$clientId);
$c->add(DevicePeer::STATUS,'pm scheduled');
$devices = DevicePeer::doSelect($c);
foreach($devices as $device){
$device->setStatus('missing');
$device->save();
}
}
public function executeUpdateFullMatch(){
$client_id = $this->getRequestParameter('client_id');
$device_id = $this->getRequestParameter('device_id');
if($client_id > 0){
$device = DevicePeer::retrieveByPk($device_id);
if($device){
$device->setClientId($client_id);
$device->save();
}
}
return sfView::NONE;
}
}

View File

@ -0,0 +1,11 @@
generateReportSuccess:
layout: no
listDevicesSuccess:
layout: no
deviceIdChangedSuccess:
layout: no
getDevicesSuccess:
layout: no
all:
stylesheets: [process]
javascripts: [scriptaculous/lib/prototype, process]

View File

@ -0,0 +1,11 @@
<? if(empty($devices)) {?>
<option value='-1'>No Device</option>
<? }else{?>
<option value='-2'>Select A Device</option>
<?php
}?>
<?php foreach($devices as $device) { ?>
<option value='<?print $device->getIdentification(); ?>'><?print $device->getIdentification(); ?></option>
<?php } ?>

View File

@ -0,0 +1,57 @@
<?
$oldDevice_name = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getDeviceName() : '';
$oldDevice_manufacturer = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getManufacturer() : '';
$oldDevice_serial = $oldDevice->getSerialNumber();
$oldDevice_model = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getModelNumber() : '';
?>
<?php
//$_device_name = "<select>";
if(!empty($newDevice)){
$_device_name .= "<option value='".$newDevice['device_name']."'>".$newDevice['device_name']."</option>";
if(!empty($oldDevice_name)){
$_device_name .= "<option value='$oldDevice_name'>$oldDevice_name</option>";
}
}
//$_device_name .= "</select>";
//print $_device_name;
//$_manufacturer = "<select>";
if(!empty($newDevice)){
$_manufacturer .= "<option value='".$newDevice['manufacturer']."'>".$newDevice['manufacturer']."</option>";
}
if(!empty($oldDevice_manufacturer)){
$_manufacturer .= "<option value='$oldDevice_manufacturer'>$oldDevice_manufacturer</option>";
}
//$_manufacturer .= "</select>";
//print $_manufacturer;
//$_serial ="<select>";
if(!empty($newDevice))
$_serial.= "<option value='".$newDevice['serial']."'>".$newDevice['serial']."</option>";
if(!empty($oldDevice_serial))
$_serial.= "<option value='$oldDevice_serial'>$oldDevice_serial</option>";
//$_serial.= "</select>";
//print $_serial;
//$_model = "<select>";
if(!empty($newDevice))
$_model .= "<option value='".$newDevice['model']."'>".$newDevice['model']."</option>";
if(!empty($oldDevice_model))
$_model .= "<option value='$oldDevice_model'>$oldDevice_model</option>";
//$_model .= "</select>";
//print $_model;
print "
{
serial: \"$_serial\",
model: \"$_model\",
manufacturer: \"$_manufacturer\",
device_name: \"$_device_name\"
}";
?>

View File

@ -0,0 +1,70 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Match (<a href='javascript:void(0);' onclick='toggle_matched()' id='toggle_matched_but'>Show</a>)</div>
<div class='innerCont' id='matched_cont' style='display:NONE'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>Assoc. Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($match as $partial) { ?>
<tr>
<td >
<select id='new_client_match_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='device_id_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print print $partial['device_name']; ?></option>
</select>
</td>
<td>
<select id='manufacturer_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
</td>
<td>
<select id='model_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
</td>
<td>
<select id='serial_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick="saveFullMatchUpdate(<?php print $partial['id']; ?>,<?php print $partial['random_id']; ?>)">
<input type='hidden' id='location_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,86 @@
<div class='regularCont'>
<div class='titleBar'>No Match</div>
<div class='innerCont'>
<table>
<tr>
<td class='partial_match_column_title'>Client</td>
<td class='partial_match_column_title'>Option</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title' style='width: 130px'>ID Options</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td></td>
</tr>
<?php foreach($noMatch as $partial) { ?>
<tr>
<td>
<select id='client_<?php print $partial['random_id']; ?>' onChange='updateDevices(<?php print $partial['random_id']; ?>); restoreFields(<?php print $partial['random_id']; ?>)'>
<option value='-1' selected='selected'>Select A Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='option_<?php print $partial['random_id']; ?>' onchange='optionChanged(<?php print $partial['random_id']; ?>)'>
<option value='1'>Add As New Device</option>
<option value='2'>Associate Device</option>
</select>
</td>
<td>
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 100px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
<select id='get_devices_<?php print $partial['random_id']; ?>' style='width: 100px; display:none' onChange='device_id_changed(<?php print $partial['random_id']; ?>)'>
</select>
</td>
<td>
<select id='device_id_option_<?php print $partial['random_id']; ?>' style='width: 130px' disabled='disabled'>
<option value='-1'>-Use Existing Id-</option>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print $partial['device_name']; ?></option>
</select>
<input type='hidden' id='hidden_device_name_<?php print $partial['random_id']; ?>' value='<?php print $partial['device_name']; ?>'>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
<input type='hidden' id='hidden_manufacturer_<?php print $partial['random_id']; ?>' value='<?php print $partial['manufacturer']; ?>'>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
<input type='hidden' id='hidden_model_<?php print $partial['random_id']; ?>' value='<?php print $partial['model']; ?>'>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
<input type='hidden' id='hidden_serial_<?php print $partial['random_id']; ?>' value='<?php print $partial['serial']; ?>'>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_no_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>

View File

@ -0,0 +1,77 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Partial Match</div>
<div class='innerCont'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>New Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($partialMatch as $partial) { ?>
<tr>
<td >
<select id='new_client_partial_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td >
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['device_name']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['device_name'] as $device_name) { ?>
<option value='<?php print $device_name; ?>'><?php print $device_name; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['manufacturer']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['manufacturer'] as $manufacturer) { ?>
<option value='<?php print $manufacturer; ?>'><?php print $manufacturer; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['model']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['model'] as $model) { ?>
<option value='<?php print $model; ?>'><?php print $model; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['serial']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['serial'] as $serial) { ?>
<option value='<?php print $serial; ?>'><?php print $serial; ?></option>
<?php }?>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_partial_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,3 @@
<?php
include_partial('device_changed',array('oldDevice'=>$oldDevice, 'newDevice'=>$newDevice))
?>

View File

@ -0,0 +1,78 @@
<div class='regularCont'>
<div class='innerCont'><table>
<tr>
<td style='width: 100px'>Report
</td>
<td style='width: 100px'>Status
</td>
<td style='width: 200px'>
Date
</td>
<td style='width: 50px'>
Pass
</td>
<td style='width: 50px'>
Fail
</td>
<td style='width: 50px'>
Missed
</td>
<td style='width: 50px'>
Bp
</td>
<td style='width: 50px'>
Trace
</td>
<td style='width: 50px'>
Outlets
</td>
<td style='width: 200px'>
Action
</td>
</tr>
<?php
foreach($finalReport as $report){
?>
<tr>
<td>
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View Report</a>
</td>
<td>
<?php print ucwords($report->getPassFail()); ?>
</td>
<td>
<?php print $report->formattedDate(); ?>
</td>
<td>
<?php print (int)$report->getTotalPassed(); ?>
</td>
<td>
<?php print (int)$report->getTotalFailed(); ?>
</td>
<td>
<?php print (int)$report->getTotalMissed(); ?>
</td>
<td>
<?php print (int)$report->getTotalBp(); ?>
</td>
<td>
<?php print (int)$report->getTotalTrace(); ?>
</td>
<td>
<?php print (int)$report->getTotalOutlets(); ?>
</td>
<td>
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
</td>
</tr>
<?php
}
if(empty($finalReport)){
?>
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
<?php
}
?>
</table>
</div>
</div>

View File

@ -0,0 +1,2 @@
<?php
include_partial('device',array('devices'=>$devices)); ?>

View File

@ -0,0 +1,44 @@
<div class='regularCont'>
<div class='titleBar'>New File Upload</div>
<div class='innerCont'>
<form name='uploadForm' id='uploadForm' action='process/processUpload' method='post' enctype='multipart/form-data'>
<input type='file' name='upload'>
<input type='submit' name='submit' value='Upload'>
<input type='button' name='unprocessed' value='View Unprocessed' onclick="document.location='/index.php/unprocessed/index'">
</form>
</div>
</div>
<iframe name='iframe' id='iframe' width="0" height="0" border="0" style='visibility:hidden'>
</iframe>
<div class='regularCont'>
<div class='titleBar'>Reporting</div>
<div class='innerCont'>
<table style='margin: 4px;float:left'>
<tr><td>Client</td></tr>
<tr>
<td>
<?php echo select_tag('client', options_for_select($clients, $client_id,'include_custom=Please Select a Client'), array('id'=>'current_client','onchange'=>'process_client_change()') );?>
</td>
</tr>
<tr><td>Contact</td></tr>
<tr>
<td>
<input type='text' value='' id='theContact'>
</td>
</tr>
</table>
<table style='float:left; margin-left:20px;'>
<tr><td> <div id='listedReport'></div>
</td></tr></table>
<div style='clear:both'></div>
</div>
</div>
<div id='listedDevices'>
</div>

View File

@ -0,0 +1,140 @@
<br><br>
<div class='regularCont'>
<div class='titleBar'>Client Devices</div>
<div class='innerCont'>
<div >
<? if(!empty($devices)){?>
<input type='button' value='Quote Failed Item' onclick='quoted()'>
<input type='button' value='Pending Repairs' onClick='pendingRepair()'>
<input type='button' value='Schedule Repair' onClick="scheduleRepair(<?php print $client_id;?>)">
<input type='button' value='Reschedule Missing' onClick="rescheduleMissing(<?php print $client_id;?>)">
<input type='button' value='Print Final Report' onClick="generateReport()">
<? }else{
?>
<input type='button' value='Quote Failed Item' disabled='disabled'>
<input type='button' value='Pending Repairs' disabled='disabled'>
<input type='button' value='Schedule Repair' disabled='disabled'>
<input type='button' value='Reschedule Missing' disabled='disabled'>
<input type='button' value='Print Final Report' disabled='disabled'>
<?php
} ?>
</div>
<br/>
<table style='margin-left: 30px;'>
<tr>
<td style='width: 20px; font-weight:bold'>
</td>
<td style='width:150px; font-weight:bold'>
Device Id
</td>
<td style='width:150px; font-weight:bold'>
Device
</td>
<td style='width:150px;font-weight:bold'>
Manufacturer
</td>
<td style='width:150px;font-weight:bold'>
Model
</td>
<td style='width:150px;font-weight:bold'>
Serial
</td>
<td style='width:150px;font-weight:bold'>
Location
</td>
<td style='width:150px;font-weight:bold'>
Status
</td>
<td style='width:150px;font-weight:bold'>
Comments
</td>
</tr>
<?php
$listDeviceIdAr = array();
foreach($devices as $device){
if($device->getSpecification()){
$manufacturer = $device->getSpecification()->getManufacturer();
$model = $device->getSpecification()->getModelNumber();
$d_name = $device->getSpecification()->getDeviceName();
}
$listDeviceIdAr[] = $device->getId();
?>
<tr>
<td>
<input type='checkbox' id='checkbox_<?php print $device->getId(); ?>' />
</td>
<td>
<input type='text' id='device_' value='<?php print $device->getIdentification(); ?>'/>
</td>
<td>
<input type='text' id='dd_name_' value='<?php print $d_name; ?>'/>
</td>
<td>
<input type='text' id='manufacturer_' value='<?php print $manufacturer; ?>'/>
</td>
<td>
<input type='text' id='serial_' value='<?php print $model; ?>'/>
</td>
<td>
<input type='text' id='serial_' value='<?php print $device->getSerialNumber(); ?>'/>
</td>
<td>
<input type='text' id='serial_' value='<?php print $device->getLocation(); ?>'/>
</td>
<td>
<select style='width: 140px'>
<option value='<?php print ucwords($device->getStatus()); ?>'/><?php print ucwords($device->getStatus()); ?></option>
</select>
</td>
<td>
<input type='text' id='device_comment_' value='<?php print $device->getComments(); ?>' onblur='save_comments(this,<?php print $device->getId(); ?>)'/>
</td>
</tr>
<?php }
if(empty($devices)){
?><td>
<!--checkboxes would be here -->
</td>
<tr>
<td>
<input type='checkbox' />
</td>
<td>
<input type='text' id='device_' value=' '/>
</td>
<td>
<input type='text' id='dd_name_' />
</td>
<td>
<input type='text' id='manufacturer_' />
</td>
<td>
<input type='text' id='serial_' />
</td>
<td>
<input type='text' id='serial_' />
</td>
<td>
<input type='text' id='serial_' />
</td>
<td>
<input type='text' id='device_comment_' />
</td>
</tr>
<?php
}
?>
</table>
<input type='hidden' id='hidden_device_id' value='<?php print implode(',',$listDeviceIdAr); ?>'/>
</div>
</div>
<script type='text/javascript'>
window.insertContact('<?php print $contact; ?>');
</script>

View File

@ -0,0 +1,22 @@
<div style='font-size: 13px; width: 300px; border: 1px solid black; margin-top: 30px;'>
<div style='color: #fff; background-color:#08C46E ; font-weight: bold; text-align:center'> UPLOAD STATUS </div>
<div style='padding: 5px;'>
<?php
print "<b>Filename</b>: ".$filename." <br/>";
print "<b>Total Uploaded</b>: ".(count($match)+count($partialMatch)+count($noMatch))." <br/>";
print "<b>Matched</b>: ".count($match)."<br/>";
print "<b>Partial Match</b>: ".count($partialMatch)."<br/>";
print "<b>No Match</b>: ".count($noMatch)."<br/>";
?>
</div>
</div>
<input type='hidden' name='filename' id='filename' value='<?php echo $filename; ?>'/>
<div id='test'></div>
<?php
if(!empty($match))
include_partial('process_match', array('match' => $match, 'clients'=>$clients));
if(!empty($partialMatch))
include_partial('process_partial_match', array('partialMatch' => $partialMatch));
if(!empty($noMatch))
include_partial('process_no_match', array('noMatch' => $noMatch, 'clients'=>$clients));
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
techMapSuccess:
javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype]
layout: techMap
indexSuccess:
javascripts: [/js/scheduler]
stylesheets: [/css/email.css]
sendEmailSuccess:
has_layout: off
javascripts: [/js/scheduler]
stylesheets: [/css/email.css]

View File

@ -0,0 +1,79 @@
<?php use_helper('Object'); ?>
<?php use_helper('Javascript'); ?>
<?php use_helper('DateForm'); ?>
<div class="client_select">
<?php echo form_tag('scheduler/index'); ?>
<table><tr>
<td width=50><b>Client: </b></td>
<td><?php echo $client->getClientName(); ?></td>
</tr></table>
</form>
</div>
<div class="job_details">
<?php echo form_tag('scheduler/jobScheduler', array('id' => 'jobScheduler')); ?>
<?php echo input_hidden_tag('client_select', $client->getId()); ?>
<?php echo input_hidden_tag('start_time'); ?>
<?php echo input_hidden_tag('end_time'); ?>
<?php echo input_hidden_tag('date', $date); ?>
<?php echo input_hidden_tag('workorder_id', $workorder_id); ?>
<?php echo input_hidden_tag('job_status', 'scheduled'); ?>
<?php echo input_hidden_tag('job_date', $date); ?>
<?php echo input_hidden_tag('edit', $mode); ?>
<?php echo input_hidden_tag('technician'); ?>
<table><tr>
<td>Device: </td>
<td><?php if (isset($specification_options))
{
echo select_tag('specification_select', options_for_select($specification_options, $specification_select), array(
'onChange' => 'populateDeviceMenu()'));
} else {
echo 'Please Select a Client...';
} ?></td>
</tr><tr>
<td>Device ID: </td>
<td><div id=device><?php echo select_tag('device_select', options_for_select($device_options)); ?></div></td>
</tr><tr>
<td>Reason: </td>
<td><?php echo select_tag('reason_select', objects_for_select($reason_dropdown, 'getid', 'getvalue'), $edit_workorder->getReason()); ?></td>
</tr><tr>
<td>Notes: </td>
<td><?php echo textarea_tag('notes', $edit_workorder->getRemarks() , 'size=25x3'); ?></td>
</tr></table>
</div>
<div class="tech_details">
<table><tr>
<td>Technician: </td>
<td colspan=2><div id='selectTech'><?php echo $technician->getLastName().', '.$technician->getFirstName(); ?></div></td>
</tr><tr>
<td>job date:</td>
<td><div id="display_date"><?php echo input_date_tag('job_date', $date); ?></div></td>
</tr><tr>
<td>start time: </td>
<td><?php echo input_tag('start_time_hours', $start_time_hours , array(
'size' => '2',
'maxlength' => '2')).' : '.
input_tag('start_time_minutes', $start_time_minutes, array(
'size' => '2',
'maxlength' => '2')); ?></td>
<td><?php echo radiobutton_tag('start_time_ampm[]','am', true).'am '.' '.
radiobutton_tag('start_time_ampm[]','pm', false).'pm'; ?></td>
</tr><tr>
<td>end time: </td>
<td><?php echo input_tag('end_time_hours', $end_time_hours, array(
'size' => '2',
'maxlength' => '2')).' : '.
input_tag('end_time_minutes', $end_time_minutes, array(
'size' => '2',
'maxlength' => '2')); ?></td>
<td><?php echo radiobutton_tag('end_time_ampm[]','am', true).'am '.' '.
radiobutton_tag('end_time_ampm[]','pm', false).'pm'; ?></td>
</tr><tr>
<td><?php echo button_to('Schedule New', 'scheduler/index'); ?></td>
<td><?php echo button_to('Delete Job', 'scheduler/deleteJob?id='.$edit_workorder->getId(), array('confirm' => 'Are you sure you want to delete this job?')); ?></td>
<?php // <td><?php echo button_to('Delete Job', 'scheduler/deleteJob?workorder_id='.$edit_workorder->getId(), array('onClick' => "confirm('Are you sure you want to delete this job?')")); </td> ?>
<td><?php echo submit_tag('Save Job'); ?></td>
</tr></table>
</div>
</form>

View File

@ -0,0 +1,58 @@
<?php use_helper('Javascript'); ?>
<h2>Available Technicians: </h2>
<div id="availableTechs" >
<?php
$c_count = 0;
foreach($availableTechnicians as $tech)
{
$available = $availableTimes[$tech->getId()];
if (isset($available))
{
echo '<div class="availTech">'.$tech->getFirstName().' '.$tech->getLastName().'<br />';
//parse time string
$inc = 2;
$available_minutes = $available % 100;
$available_hours = ($available - $available_minutes) / 100;
$available_hrs = $available_hours;
if($available_hours > 12) { $available_hours = $available_hours - 12; }
if($available_minutes == 0) { $available_minutes = '00'; }
$available_endhours = $available_hours + 2;
if($available_hours == 11) { $available_endhours = 1; }
if($available_hours == 12) { $available_endhours = 2; }
$s_hours = substr($tech->getStartTime(),0,2);
$s_mins = substr($tech->getStartTime(),2,2);
$e_hours = substr($tech->getEndTime(),0,2);
$e_mins = substr($tech->getEndTime(),2,2);
$available_minutes_str = (strlen($available_minutes)<2) ? "0".$available_minutes : $available_minutes;
echo link_to_function($available_hours.':'.$available_minutes_str, "selectTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$available_hrs.", ".$available_minutes_str.")");
echo " | ";
echo link_to_function('Add', "selectSTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."')");
echo " | ";
echo link_to_function('Day', "alldayTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$s_hours.", ".$s_mins.", ".$e_hours.", ".$e_mins.")");
echo " | ";
echo link_to_function('Week', "allweekTech(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".intval($s_hours).", ".$s_mins.", ".$e_hours.", ".$e_mins.")");
/*
echo " | ";echo link_to_function('MWF', "MWF_TT(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$s_hours.", ".$s_mins.", ".$e_hours.", ".$e_mins.",'mwf')");
echo " | ";echo link_to_function('TT', "MWF_TT(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', ".$s_hours.", ".$s_mins.", ".$e_hours.", ".$e_mins.",'tt')");
*/
?><br />
<input type='checkbox' value='1' id='d_m_<?php print $c_count; ?>' />M
<input type='checkbox' value='1' id='d_t_<?php print $c_count; ?>' />T
<input type='checkbox' value='1' id='d_w_<?php print $c_count; ?>' />W
<input type='checkbox' value='1' id='d_tt_<?php print $c_count; ?>' />T
<input type='checkbox' value='1' id='d_f_<?php print $c_count; ?>' />F
<?php echo link_to_function('Update', "MWF_TT(".$tech->getId().", '".$tech->getFirstName()."', '".$tech->getLastName()."', '".$s_hours."', '".$s_mins."', '".$e_hours."', '".$e_mins."','$c_count')"); ?>
</div><?php $c_count++;
}
}
?>
</div>
<div id='testing'></div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
<?php use_helper('Javascript'); ?>
<?php echo select_tag('device_select', options_for_select($device_options)); ?>

View File

@ -0,0 +1,39 @@
<?php use_helper('Javascript'); ?>
<?php echo input_hidden_tag('schedule_date'); ?>
<div id="techInfo">
<div id="techMenu" style="padding: 4px">
<?php echo "<span style='height: 100%; display:table-cell;'>"; echo link_to_function('All', "selectTechSchedule('all')"); echo "</span>";
foreach($tech_info as $tech)
{
echo "<span style='padding-top: 0px; height: 20px; display:table-cell;' id = 'tech_id_".$tech->getId()."'>";
echo link_to_function($tech->getFirstName().' '.$tech->getLastName(), "selectTechSchedule(".$tech->getId().")");
echo "</span>";
}
?>
</div>
<div class="techSchedule">
<?php
$techCount = 0;
foreach($schedules as $schedule)
{
$techCount++;
include_partial('global/technicianSchedule', array('schedule' => $schedule, 'workorderCallbackFunction' => 'populateWorkorder'));
if ($techCount % 5 == 0){
echo '</div><div class="techSchedule">';
}
}
?>
</div>
<div id="techMap" style="float:left">
<iframe frameborder="0" id="techMapDisplay"></iframe>
</div>
</div>

View File

@ -0,0 +1,26 @@
<?php use_helper('Javascript'); ?>
<?php echo input_hidden_tag('schedule_date'); ?>
<div id="techInfo">
<div class="techSchedule">
<?php
$techCount = 0;
foreach($schedules as $schedule)
{
$techCount++;
include_partial('global/technicianEmailSchedule', array('date'=>$date,'emailComment'=>$emailComment,'schedule' => $schedule, 'workorderCallbackFunction' => 'populateWorkorder','job_reason'=>$dropdowns));
if ($techCount % 5 == 0){
echo '</div><div class="techSchedule">';
}
}
?>
</div>
<div id="techMap" style="float:left">
<iframe frameborder="0" id="techMapDisplay"></iframe>
</div>
</div>

View File

@ -0,0 +1,2 @@
<?php include_component('maps', 'displayTechnicianMap', array('markers' => $markers, 'mapwidth' => '500px', 'mapheight' => '400px')); ?>

View File

@ -0,0 +1,83 @@
<?php
/**
* security actions.
*
* @package atlbiomed
* @subpackage security
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class securityActions extends sfActions
{
public function executeSecure()
{
}
/**
* Generates a random challenge string.
*
*/
private function generateChallenge()
{
return substr(preg_replace('/[\/\\\:*?"<>|.$^1]/', '', crypt(time())), 0, 16);
}
/**
* Executes index action
*
*/
public function executeIndex()
{
if($this->getRequest()->getMethod() == sfRequest::POST)
{
// check fields
$username = $this->getRequestParameter('username');
$password = $this->getRequestParameter('password');
/* $password = hash('sha256', $password);*/
// authenticate user
$c = new Criteria();
$c->add(UserPeer::USER_NAME, $username);
$c->add(UserPeer::PASSWORD, $password);
$user = UserPeer::doSelectOne($c);
if($user != null)
{
// success
$userId = $user->getId();
$this->getUser()->setAuthenticated(true);
$this->getUser()->addCredential($user->getUserType()->getTypeName());
$this->getUser()->setAttribute('name', $user->getDisplayName());
$this->getUser()->setAttribute('userId',$userId);
$this->redirect('scheduler');
}
}
$this->logoutUser();
}
public function executeLogout()
{
$this->logoutUser();
$this->redirect('security/index');
}
private function logoutUser()
{
$this->getUser()->setAuthenticated(false);
$this->getUser()->clearCredentials();
$this->getUser()->getAttributeHolder()->remove('name');
}
public function handleErrorIndex()
{
return sfView::SUCCESS;
}
}

View File

@ -0,0 +1,2 @@
all:
is_secure: off

View File

@ -0,0 +1,6 @@
indexSuccess:
javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype]
layout: noLayout
secureSuccess:
layout: noLayout

View File

@ -0,0 +1,32 @@
<?php use_helper('Validation') ?>
<?php echo form_tag('security/index'); ?>
<div class="loginForm">
<div class="loginFormInner">
<?php echo form_error('username') ?><br />
<?php echo form_error('password') ?><br />
<fieldset >
<legend>Please Log In</legend>
<div class="loginFormInnerRow">
<div>
<label for="username">Username:</label>
</div>
<div>
<?php echo input_tag('username'); ?>
</div>
</div>
<div class="loginFormInnerRow">
<div>
<label for="password">Password:</label>
</div>
<div>
<?php echo input_password_tag('password'); ?>
</div>
</div>
<div class="loginFormInnerRow">
<div></div>
<div><?php echo submit_tag('Login'); ?></div>
</div>
</fieldset>
</div>
</div>
</form>

View File

@ -0,0 +1,6 @@
<div class="secureModuleMain">
<div class="secureModuleMessage">
<?php echo image_tag('lock48'); ?>
<div>You are not authorized to view this page. Click <?php echo link_to('here', 'security/logout'); ?> to return to the application.</div>
</div>
</div>

View File

@ -0,0 +1,8 @@
fields:
username:
required:
msg: Please enter a username.
password:
required:
msg: Please enter a password.

View File

@ -0,0 +1,24 @@
<?php
/**
* support actions.
*
* @package atlbiomed
* @subpackage support
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class supportActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$c = new Criteria();
$c->add(UserPeer::USER_TYPE, 'Administrator');
$c->add(UserPeer::USER_TYPE, 'Office');
$this->administrator = UserPeer::doSelect($c);
}
}

View File

@ -0,0 +1,14 @@
<h2>Administrative Contacts</h2>
<?php
foreach($administrator as $admin)
{
echo $admin->getLastName().', '.$admin->getFirstName().' - '.mail_to($admin->getEmail(), $admin->getEmail(), 'encode=true');
?><br /><?
}
?>
<br />
<h2>Bug Reporting</h2>
Hepner, Nicholas - <?php echo mail_to('nicholas.hepner@ciphent.com', 'nicholas.hepner@ciphent.com'); ?>

View File

@ -0,0 +1,58 @@
<?php
/**
* unprocessed actions.
*
* @package atlbiomed
* @subpackage unprocessed
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class unprocessedActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$connection = Propel::getConnection();
$query = "select DISTINCT filename FROM unprocessed_devices";
$statement = $connection->prepareStatement($query);
$result = $statement->executeQuery();
while($result->next()){
$n = $result->get('filename');
$file_p = $_SERVER['DOCUMENT_ROOT'].'/uploads/spreadsheet/'.$n;
if(file_exists($file_p)){
$filenames[] = $n;
}else{
$filename_not_found[] = $file_p;
}
}//while
$this->filenamesList = $filenames;
$processFilename = $this->getRequestParameter('fn');
if(!empty($processFilename)){
$this->filenames = $filenames;
$processHandler = new processHandler();
$processHandler->loadFile($processFilename);
$c = new Criteria();
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$clients = ClientPeer::doSelect($c);
$this->partialMatch = $processHandler->getPartialMatch();
$this->noMatch = $processHandler->getNoMatch();
$this->match = $processHandler->getMatched();
$this->clients = $clients;
$this->filename = $processHandler->getFilename();
}//if
}//function
}

View File

@ -0,0 +1,3 @@
all:
stylesheets: [process]
javascripts: [scriptaculous/lib/prototype, process]

View File

@ -0,0 +1,11 @@
<? if(empty($devices)) {?>
<option value='-1'>No Device</option>
<? }else{?>
<option value='-2'>Select A Device</option>
<?php
}?>
<?php foreach($devices as $device) { ?>
<option value='<?print $device->getIdentification(); ?>'><?print $device->getIdentification(); ?></option>
<?php } ?>

View File

@ -0,0 +1,57 @@
<?
$oldDevice_name = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getDeviceName() : '';
$oldDevice_manufacturer = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getManufacturer() : '';
$oldDevice_serial = $oldDevice->getSerialNumber();
$oldDevice_model = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getModelNumber() : '';
?>
<?php
//$_device_name = "<select>";
if(!empty($newDevice)){
$_device_name .= "<option value='".$newDevice['device_name']."'>".$newDevice['device_name']."</option>";
if(!empty($oldDevice_name)){
$_device_name .= "<option value='$oldDevice_name'>$oldDevice_name</option>";
}
}
//$_device_name .= "</select>";
//print $_device_name;
//$_manufacturer = "<select>";
if(!empty($newDevice)){
$_manufacturer .= "<option value='".$newDevice['manufacturer']."'>".$newDevice['manufacturer']."</option>";
}
if(!empty($oldDevice_manufacturer)){
$_manufacturer .= "<option value='$oldDevice_manufacturer'>$oldDevice_manufacturer</option>";
}
//$_manufacturer .= "</select>";
//print $_manufacturer;
//$_serial ="<select>";
if(!empty($newDevice))
$_serial.= "<option value='".$newDevice['serial']."'>".$newDevice['serial']."</option>";
if(!empty($oldDevice_serial))
$_serial.= "<option value='$oldDevice_serial'>$oldDevice_serial</option>";
//$_serial.= "</select>";
//print $_serial;
//$_model = "<select>";
if(!empty($newDevice))
$_model .= "<option value='".$newDevice['model']."'>".$newDevice['model']."</option>";
if(!empty($oldDevice_model))
$_model .= "<option value='$oldDevice_model'>$oldDevice_model</option>";
//$_model .= "</select>";
//print $_model;
print "
{
serial: \"$_serial\",
model: \"$_model\",
manufacturer: \"$_manufacturer\",
device_name: \"$_device_name\"
}";
?>

View File

@ -0,0 +1,70 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Match (<a href='javascript:void(0);' onclick='toggle_matched()' id='toggle_matched_but'>Show</a>)</div>
<div class='innerCont' id='matched_cont' style='display:NONE'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>Assoc. Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($match as $partial) { ?>
<tr>
<td >
<select id='new_client_match_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='device_id_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print print $partial['device_name']; ?></option>
</select>
</td>
<td>
<select id='manufacturer_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
</td>
<td>
<select id='model_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
</td>
<td>
<select id='serial_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick="saveFullMatchUpdate(<?php print $partial['id']; ?>,<?php print $partial['random_id']; ?>)">
<input type='hidden' id='location_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,86 @@
<div class='regularCont'>
<div class='titleBar'>No Match</div>
<div class='innerCont'>
<table>
<tr>
<td class='partial_match_column_title'>Client</td>
<td class='partial_match_column_title'>Option</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title' style='width: 130px'>ID Options</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td></td>
</tr>
<?php foreach($noMatch as $partial) { ?>
<tr>
<td>
<select id='client_<?php print $partial['random_id']; ?>' onChange='updateDevices(<?php print $partial['random_id']; ?>); restoreFields(<?php print $partial['random_id']; ?>)'>
<option value='-1' selected='selected'>Select A Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td>
<select id='option_<?php print $partial['random_id']; ?>' onchange='optionChanged(<?php print $partial['random_id']; ?>)'>
<option value='1'>Add As New Device</option>
<option value='2'>Associate Device</option>
</select>
</td>
<td>
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 100px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
<select id='get_devices_<?php print $partial['random_id']; ?>' style='width: 100px; display:none' onChange='device_id_changed(<?php print $partial['random_id']; ?>)'>
</select>
</td>
<td>
<select id='device_id_option_<?php print $partial['random_id']; ?>' style='width: 130px' disabled='disabled'>
<option value='-1'>-Use Existing Id-</option>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_name']; ?>'><?php print $partial['device_name']; ?></option>
</select>
<input type='hidden' id='hidden_device_name_<?php print $partial['random_id']; ?>' value='<?php print $partial['device_name']; ?>'>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
</select>
<input type='hidden' id='hidden_manufacturer_<?php print $partial['random_id']; ?>' value='<?php print $partial['manufacturer']; ?>'>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
</select>
<input type='hidden' id='hidden_model_<?php print $partial['random_id']; ?>' value='<?php print $partial['model']; ?>'>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
</select>
<input type='hidden' id='hidden_serial_<?php print $partial['random_id']; ?>' value='<?php print $partial['serial']; ?>'>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_no_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>

View File

@ -0,0 +1,77 @@
<div>
<div class='regularCont'>
<div class='titleBar'>Partial Match</div>
<div class='innerCont'>
<table id='noMatchTable'>
<tr>
<td class='partial_match_column_title'>New Client</td>
<td class='partial_match_column_title'>Device ID</td>
<td class='partial_match_column_title'>Device Name</td>
<td class='partial_match_column_title'>Manufacturer</td>
<td class='partial_match_column_title'>Model</td>
<td class='partial_match_column_title'>Serial</td>
<td class='partial_match_column_title'></td>
</tr>
<?php
foreach($partialMatch as $partial) { ?>
<tr>
<td >
<select id='new_client_partial_<?php print $partial['random_id']; ?>' >
<option value='-1' selected='selected'>Existing Client</option>
<?php foreach($clients as $client) { ?>
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
<?php } ?>
</select>
</td>
<td >
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 120px'>
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
</select>
</td>
<td>
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['device_name']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['device_name'] as $device_name) { ?>
<option value='<?php print $device_name; ?>'><?php print $device_name; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['manufacturer']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['manufacturer'] as $manufacturer) { ?>
<option value='<?php print $manufacturer; ?>'><?php print $manufacturer; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['model']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['model'] as $model) { ?>
<option value='<?php print $model; ?>'><?php print $model; ?></option>
<?php }?>
</select>
</td>
<td>
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['serial']==true){ print ";border: 1px solid red";}?>'>
<?php foreach($partial['serial'] as $serial) { ?>
<option value='<?php print $serial; ?>'><?php print $serial; ?></option>
<?php }?>
</select>
</td>
<td>
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_partial_match(<?php print $partial['random_id']; ?>)'>
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
</td>
<td>
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,3 @@
<?php
include_partial('device_changed',array('oldDevice'=>$oldDevice, 'newDevice'=>$newDevice))
?>

View File

@ -0,0 +1,2 @@
<?php
include_partial('device',array('devices'=>$devices)); ?>

View File

@ -0,0 +1,63 @@
<?php
if($sf_params->get('warning')=='yes'){
?>
<div class='alreadyExist'>
This file has already been uploaded. Please select from the list of unprocessed files below.
</div>
<?php
}
?>
<div class='regularCont'>
<div class='titleBar'>Unprocessed Files</div>
<div class='innerCont'>
File Name
<select onchange='gotounprocessed()' id='processedFile'>
<option value='-1' >Please Select A File</option>
<?php
foreach($filenamesList as $_filename){
$selectedItem = ($sf_params->get('fn')==$_filename) ? "selected='selected'" : '';
print "<option value='$_filename' $selectedItem >$_filename</option>";
}
?>
</select>
</div>
</div>
<?php
if(empty($filenamesList)){
?>
<div class='alreadyExist'>
No unprocessed files were found
</div>
<?php
}
?>
<div style='font-size: 13px; width: 300px; border: 1px solid black; margin-top: 30px;'>
<div class='titleBar'>Uprocessed File</div>
<div style='padding: 5px;'>
<?php
print "<b>Filename</b>: ".$filename."<br/>";
print "<b>Total Records</b>: ".(count($match)+count($partialMatch)+count($noMatch))." <br/>";
print "<b>Matched</b>: ".count($match)."<br/>";
print "<b>Partial Match</b>: ".count($partialMatch)."<br/>";
print "<b>No Match</b>: ".count($noMatch)."<br/>";
?>
</div>
</div>
<input type='hidden' name='filename' id='filename' value='<?php echo $filename; ?>'/>
<div id='test'></div>
<?php
if(!empty($match))
include_partial('process_match', array('match' => $match, 'clients'=>$clients));
if(!empty($partialMatch))
include_partial('process_partial_match', array('partialMatch' => $partialMatch, 'clients'=>$clients));
if(!empty($noMatch))
include_partial('process_no_match', array('noMatch' => $noMatch, 'clients'=>$clients));
?>

View File

@ -0,0 +1,223 @@
<?php
/**
* userManager actions.
*
* @package atlbiomed
* @subpackage userManager
* @author nicholas hepner
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class userManagerActions extends sfActions
{
protected $user_info;
public function executeIndex()
{
//set values for start/end time radio boxes
$this->start_time_am = true;
$this->start_time_pm = false;
$this->end_time_am = true;
$this->end_time_pm = false;
$this->start_time_hours = '';
$this->start_time_minutes = '';
$this->end_time_hours = '';
$this->end_time_minutes = '';
//populate user type dropdown
$this->userTypes = UserTypePeer::doSelect(new Criteria());
//Current Users;
$this->current_user = UserPeer::doSelect(new Criteria());
//Initialize "mode"
if(!isset($this->mode))
{
$this->mode = '';
}
//Initialize "saveStatus"
if($this->getRequestParameter('saveStatus') == 'success')
{
$this->saveStatus = 'success';
} else {
$this->saveStatus = '';
}
//Initialize form values
$this->populateUser = new User();
if($this->getRequestParameter('mode') == 'edit')
{
$user_id = $this->getRequestParameter('id');
$this->populateUser = UserPeer::retrieveByPk($user_id);
//parse start/end times
$start_time = $this->populateUser->getStartTime();
$end_time = $this->populateUser->getEndTime();
$this->start_time_minutes = $start_time % 100;
$this->start_time_hours = ($start_time - $this->start_time_minutes) / 100;
$this->end_time_minutes = $end_time % 100;
$this->end_time_hours = ($end_time - $this->end_time_minutes) / 100;
if ($this->start_time_hours > 12)
{
$this->start_time_hours = $this->start_time_hours - 12;
$this->start_time_am = false;
$this->start_time_pm = true;
}
if ($this->end_time_hours > 12)
{
$this->end_time_hours = $this->end_time_hours - 12;
$this->end_time_am = false;
$this->end_time_pm = true;
}
//make minutes more visable in end production
if ($this->start_time_minutes < 10)
{
$this->start_time_minutes = '0'.$this->start_time_minutes;
}
if ($this->end_time_minutes < 10)
{
$this->end_time_minutes = '0'.$this->end_time_minutes;
}
$this->mode = 'edit';
}else{
$this->populateUser->setUserName('');
$this->populateUser->setFirstName('');
$this->populateUser->setLastName('');
$this->populateUser->setEmail('');
$this->populateUser->setPhone('');
$this->populateUser->setAddress('');
$this->populateUser->setAddress2('');
$this->populateUser->setCity('');
$this->populateUser->setState('');
$this->populateUser->setZip('');
$this->populateUser->setPassword('');
}
}
public function executeAddUser()
{
$user = new User();
if($this->getRequestParameter('mode') == 'edit')
{
$user_id = $this->getRequestParameter('id');
$user = UserPeer::retrieveByPk($user_id);
}
$user->setUserName($this->getRequestParameter('user_name'));
$user->setFirstName($this->getRequestParameter('first_name'));
$user->setLastName($this->getRequestParameter('last_name'));
$user->setEmail($this->getRequestParameter('email'));
$user->setPhone($this->getRequestParameter('phone'));
$user->setAddress($this->getRequestParameter('address'));
$user->setAddress2($this->getRequestParameter('address2'));
$user->setCity(ucfirst($this->getRequestParameter('city')));
$user->setState($this->getRequestParameter('state'));
$user->setZip($this->getRequestParameter('zip'));
$user->setPassword($this->getRequestParameter('password'));
$user->setUserTypeId($this->getRequestParameter('user_type_id'));
$user->setWeight($this->getRequestParameter('order_weight'));
$start_hrs = $this->getRequestParameter('start_time_hours');
$start_min = $this->getRequestParameter('start_time_minutes');
$start_ampm = $this->getRequestParameter('start_time_ampm');
$end_hrs = $this->getRequestParameter('end_time_hours');
$end_min = $this->getRequestParameter('end_time_minutes');
$end_ampm = $this->getRequestParameter('end_time_ampm');
if($start_ampm == 'am'){
if($start_hrs < 10){
$start_hrs = '0'.$start_hrs;
}
$start_hrs = $start_hrs;
}
if($start_ampm == 'pm'){
$start_hrs = $start_hrs + 12;
}
$start_time = $start_hrs.$start_min;
if($end_ampm == 'am'){
if($end_hrs < 10){
$end_hrs = '0'.$end_hrs;
}
$end_hrs = $end_hrs;
}
if($end_ampm == 'pm'){
$end_hrs = $end_hrs + 12;
}
$end_time = $end_hrs.$end_min;
$user->setStartTime($start_time);
$user->setEndTime($end_time);
$user->save();
$this->redirect('userManager/index?mode=edit&id='.$user->getId().'&saveStatus=success');
}
public function handleErrorAddUser()
{
$this->forward('userManager', 'index');
}
public function startEndTime($user_info)
{
$start_time_hours = $user_info['start_time_hours'];
$start_time_minutes = $user_info['start_time_minutes'];
$start_time_ampm = $user_info['start_time_ampm'];
unset($user_info['start_time_hours']);
unset($user_info['start_time_minutes']);
unset($user_info['start_time_ampm']);
if ( $start_time_ampm == 'pm' )
{
$start_time_hours = $start_time_hours + 12;
}
$user_info['start_time'] = $start_time_hours.$start_time_minutes;
$end_time_hours = $user_info['end_time_hours'];
$end_time_minutes = $user_info['end_time_minutes'];
$end_time_ampm = $user_info['end_time_ampm'];
unset($user_info['end_time_hours']);
unset($user_info['end_time_minutes']);
unset($user_info['end_time_ampm']);
$user_info['end_time'] = $end_time_hours.$end_time_minutes;
}
public function executeDeleteUser()
{
$user_id = $this->getRequestParameter('delete_user');
$user = UserPeer::retrieveByPk($user_id);
$user->delete();
$this->redirect('userManager/index');
}
}
?>

View File

@ -0,0 +1 @@
<?php include('indexSuccess.php'); ?>

View File

@ -0,0 +1,327 @@
<?php use_helper('Object'); ?>
<?php use_helper('Validation'); ?>
<?php use_helper('Javascript'); ?>
<?php
$validation_error = '';
/* echo javascript_tag("
function submitForm()
{
try { var start_time_hours = document.getElementById('start_time_hours').value; } catch(e) { var start_time_hours; }
try { var start_time_minutes = document.getElementById('start_time_minutes').value; } catch(e) { var start_time_minutes; }
try { var end_time_hours = document.getElementById('end_time_hours').value; } catch(e) { var end_time_hours; }
try { var end_time_minutes = document.getElementById('end_time_minutes').value; } catch(e) { var end_time_minutes; }
if (document.getElementById('start_time_ampm_am').checked == true)
{
var start_time_ampm = 'am';
} else {
var start_time_ampm = 'pm';
}
if (document.getElementById('end_time_ampm_am').checked == true)
{
var end_time_ampm = 'am';
} else {
var end_time_ampm = 'pm';
}
if((start_time_hours == '') || (start_time_minutes == ''))
{
if(document.getElementById('job_status').value != 'unscheduled')
{
if(confirm('You have not set a start time for this job. Would you like to submit this job as unscheduled?') == true)
{
document.getElementById('job_status').value = 'unscheduled';
} else {
return;
}
}
} else {
if ((start_time_hours > 12) || (start_time_hours < 1))
{
alert('Invalid starting hour. Please enter a valid starting hour.');
return;
}
if((start_time_minutes > 59) || (start_time_minutes < 0))
{
alert('Invalid starting minutes. Please enter a valid start time.');
return;
}
var start_time = convertTime(start_time_hours, start_time_minutes, start_time_ampm);
}
}
function getQualifications(id)
{
alert('Shit\'s Wurkin\'');
".
remote_function(array(
'update' => 'qualifications',
'url' => 'userManager/qualifications',
'with' => '"tech_id=" + id')).
" }
");*/
/* echo javascript_tag("
function getQualifications(user)
{".
remote_function(array(
'update' => 'qualifications',
'url' => 'userManager/qualifications',
'with' => '"techId=" + user'))."
} ");*/ ?>
<?php
if ($sf_request->hasErrors())
{
/*foreach($sf_request->getErrors() as $name => $error)
{
$validation_error .= $error;
// echo '-'.$error."<br />";
}
echo javascript_tag("alert('".$validation_error."');");*/
} else {
if($saveStatus == 'success')
{
echo javascript_tag("alert('User information saved successfully')");
}
}
?>
<div class="userForm">
<?php echo form_tag('userManager/addUser'); ?>
<?php echo input_hidden_tag('mode', $mode); ?>
<?php echo input_hidden_tag('id', $populateUser->getId()); ?>
<table>
<tr>
<td colspan=2><?php echo form_error('user_name'); ?></td>
</tr>
<tr>
<td width="100">User Name</td>
<td><?php echo input_tag('user_name', $populateUser->getUserName()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('first_name'); ?></td>
</tr>
<tr>
<td>First Name</td>
<td><?php echo input_tag('first_name', $populateUser->getFirstName()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('last_name'); ?></td>
</tr>
<tr>
<td>Last Name</td>
<td><?php echo input_tag('last_name', $populateUser->getLastName()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('email'); ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo input_tag('email', $populateUser->getEmail()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('verify_email'); ?></td>
</tr>
<tr>
<td>Verify Email</td>
<td><?php echo input_tag('verify_email', $populateUser->getEmail()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('phone'); ?></td>
</tr>
<tr>
<td>Phone</td>
<td><?php echo input_tag('phone', $populateUser->getPhone()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('address'); ?></td>
</tr>
<tr>
<td>Address</td>
<td><?php echo input_tag('address', $populateUser->getAddress()); ?></td>
</tr>
<tr>
<td colspan=2></td>
</tr>
<tr>
<td></td>
<td><?php echo input_tag('address_2'); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('city', $populateUser->getAddress2()); ?></td>
</tr>
<tr>
<td>City</td>
<td><?php echo input_tag('city', $populateUser->getCity()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('state'); ?></td>
</tr>
<tr>
<td>State</td>
<td><?php echo select_tag('state', options_for_select(array(
'' => 'Please Select...',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District of Columbia',
'FL' => 'Florida',
'GA' => 'Georgia',
'HI' => 'Hawaii',
'ID' => 'Idaho',
'IL' => 'Illinois',
'IN' => 'Indiana',
'IA' => 'Iowa',
'KS' => 'Kansas',
'KY' => 'Kentucky',
'LA' => 'Louisiana',
'ME' => 'Maine',
'MD' => 'Maryland',
'MA' => 'Massachusetts',
'MI' => 'Michigan',
'MN' => 'Minnesota',
'MS' => 'Mississippi',
'MO' => 'Missouri',
'MT' => 'Montana',
'NE' => 'Nebraska',
'NV' => 'Nevada',
'NH' => 'New Hampshire',
'NJ' => 'New Jersey',
'NM' => 'New Mexico',
'NY' => 'New York',
'NC' => 'North Carolina',
'ND' => 'North Dakota',
'OH' => 'Ohio',
'OK' => 'Oklahoma',
'OR' => 'Oregon',
'PA' => 'Pennsylvania',
'RI' => 'Rhode Island',
'SC' => 'South Carolina',
'SD' => 'South Dakota',
'TN' => 'Tennessee',
'TX' => 'Texas',
'UT' => 'Utah',
'VT' => 'Vermont',
'VA' => 'Virginia',
'WA' => 'Washington',
'WV' => 'West Virginia',
'WI' => 'Wisconsin',
'WY' => 'Wyoming'), $populateUser->getState())); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('zip'); ?></td>
</tr>
<tr>
<td>Zip</td>
<td><?php echo input_tag('zip', $populateUser->getZip()); ?></td>
</tr>
<tr>
<?php
if ($mode != 'edit')
{
?>
<td colspan=2><?php echo form_error('password'); ?></td>
</tr>
<tr>
<td>Password</td>
<td><?php echo input_password_tag('password', $populateUser->getPassword()); ?></td>
</tr>
<tr>
<td colspan=2><?php echo form_error('verify_password'); ?></td>
</tr>
<tr>
<td>Verify password</td>
<td><?php echo input_password_tag('verify_password', $populateUser->getPassword()); ?></td>
</tr>
<tr>
<?php
}
?>
<td colspan=2><?php echo form_error('user_type'); ?></td>
</tr>
<tr>
<td>User type</td>
<td><?php echo select_tag('user_type_id', objects_for_select($userTypes, 'getId', 'getTypeName', $populateUser->getUserTypeId()));
//select_tag('user_type_id', objects_for_select($user_type_request,'getvalue'), $populateUser->getUserTypeId()); ?> </td>
</tr>
<tr>
<td>Start time</td>
<td><?php echo input_tag('start_time_hours', $start_time_hours, array('size' => '1', 'maxlength' => '2')).' : '
.input_tag('start_time_minutes' , $start_time_minutes , array('size' => '1', 'maxlength' => '2'))
.' '.radiobutton_tag('start_time_ampm','am', $start_time_am).'am '.' '
.radiobutton_tag('start_time_ampm','pm', $start_time_pm).'pm'; ?></td>
</tr>
<tr>
<td>End Time</td>
<td><?php echo input_tag('end_time_hours', $end_time_hours, array('size' => '1', 'maxlength' => '2')).' : '
.input_tag('end_time_minutes' , $end_time_minutes , array('size' => '1', 'maxlength' => '2'))
.' '.radiobutton_tag('end_time_ampm','am', $end_time_am).'am '.' '
.radiobutton_tag('end_time_ampm','pm', $end_time_pm).'pm'; ?></td>
</tr>
<tr>
<td>Order Weight</td>
<td><?php echo select_tag('order_weight', options_for_select(array(
'' => 'Select...',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5','6' => '6','7' => '7','8' => '8','9' => '9','10' => '10','11' => '11','12' => '12',
'13' => '13','14' => '14','15' => '15','16' => '16','17' => '17','18' => '18','19' => '19','20' => '20'
), $populateUser->getWeight())); ?></td>
</tr>
<tr>
<td></td>
<td align="right"><?php echo submit_tag('Save'); ?></td>
</tr>
</table>
</form>
</div>
<div class="currentUsers">
<?php echo form_tag('userManager/deleteUser'); ?>
<!-- Display all current users -->
<table cellspacing='10'><tr>
<!-- <td></td> -->
<td><b><u>Name</u></b></td>
<td><b><u>User Type</u></b></td>
</tr><tr>
<?php foreach ($current_user as $user){ ?>
<!-- <td><?php //echo radiobutton_tag('delete_user', $user->getId(), false); ?></td> -->
<td><?php echo link_to(ucfirst($user->getLastName()).', '.ucfirst($user->getFirstName()), 'userManager/index?mode=edit&id='.$user->getId()); ?></td>
<?php // <td><?php echo link_to_function(ucfirst($user->getLastName()).', '.ucfirst($user->getFirstName()), 'getQualifications('.$user->getId().')'); </td> ?>
<td><?php echo $user->getUserType()->getTypeName(); ?></td>
</tr><tr>
<?php } ?>
</tr>
<td><?php echo button_to('New User', 'userManager/index');echo input_hidden_tag('delete_user', $populateUser->getId()); ?></td>
<td><?php echo submit_tag('Delete User'); ?></td>
</tr></table>
</form>
</div>
<div id="qualifications">
<?php
?>
</div>

View File

@ -0,0 +1 @@
Test Successful

View File

@ -0,0 +1,110 @@
fillin:
enabled: true
fields:
user_name:
required:
msg: Please enter a user name before continuing.
sfStringValidator:
min: 5
min_error: User name does not meet acceptable parameters. (5 characters minimum)
max: 50
max_error: User name exceeds acceptable parameters. (50 characters maximum)
first_name:
required:
msg: Please enter a first name before continuing.
sfStringValidator:
min: 2
min_error: First name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: First name exceeds acceptable parameters. (25 character maximum)
last_name:
required:
msg: Please enter a last name before continuing.
sfStringValidator:
min: 2
min_error: Last name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: Last name exceeds acceptable parameters. (25 character maximum)
email:
required:
msg: Please enter an email address before continuing.
sfEmailValidator:
strict: true
email_error: Please enter a valid email address (name@domain.extension)
verify_email:
required:
msg: Please verify your email address.
sfCompareValidator:
check: email
compare_error: Your email verification does not match. Please Retype your email.
phone:
required:
msg: Please enter a telephone number
sfStringValidator:
min: 10
min_error: Please enter a valid telephone number. Please include area code. (e.g. 5555555555)
max: 15
max_error: Please enter a valid telephone number.
# sfNumberValidator:
# nan_error: Please enter a valid telephone number.
address:
required:
msg: Please enter an address.
city:
required:
msg: Please enter a city.
state:
required:
msg: Please select a state.
zip:
required:
msg: Please enter a zip code.
sfStringValidator:
min: 5
min_error: You have submitted an incomplete zip code. Please enter a valid zip code.
max: 5
max_error: Please submit a 5-digit zip code.
# password:
# required:
# msg: Please enter a password.
# sfStringValidator:
# min: 8
# min_error: Password must be more than 8 characters.
# verify_password:
# required:
# msg: Please verify your password.
# sfCompareValidator:
# check: password
# compare_error: Your password verification does not match. Please retype your password.
user_type_id:
required:
msg: Please select a user type.
start_time_hours:
required:
msg: Please enter a start time for this user
start_time_minutes:
required:
msg: Please enter a start time for this user
end_time_hours:
required:
msg: Please enter an end time for this user
end_time_minutes:
required:
msg: Please enter an end time for this user.

View File

@ -0,0 +1,147 @@
fields:
user_name:
required:
msg: No user name has been entered. Please enter a user name before continuing.
sfStringValidator:
min: 5
min_error: User name does not meet acceptable parameters. (5 characters minimum)
max: 50
max_error: User name exceeds acceptable parameters. (50 characters maximum)
first_name:
required:
msg: No first name has been entered. Please enter a first name before continuing.
sfStringValidator:
min: 2
min_error: First name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: First name exceeds acceptable parameters. (25 character maximum)
last_name:
required:
msg: No last name has been entered. Please enter a last name before continuing.
sfStringValidator:
min: 2
min_error: Last name does not meet acceptable parameters. (2 character minimum)
max: 25
max_error: Last name exceeds acceptable parameters. (25 character maximum)
email:
required:
msg: No email address has been entered. Please enter an email address before continuing.
sfEmailValidator:
strict: true
email_error: Please enter a valid email address (name@domain.extension)
verify_email:
required:
msg: Please verify your email address.
sfEmailValidator:
strict: true
sfCompareValidator:
check: email
compare_error: Your email verification does not match. Please Retype your email.
phone:
required:
msg: Please enter a telephone number
sfStringValidator:
min: 10
min_error: Please enter a valid telephone number. Please include area code. (e.g. 5555555555)
max: 15
max_error: Please enter a valid telephone number.
address:
required:
msg: Please enter an address.
address_2:
city:
required:
msg: Please enter a city.
state:
required:
msg: Please select a state.
zip:
required:
msg: Please enter a zip code.
sfStringValidator:
min: 5
min_error: You have submitted an incomplete zip code. Please enter a valid zip code.
max: 5
max_error: Please submit a 5-digit zip code.
password:
required:
msg: Please enter a password.
sfStringValidator:
min: 8
min_error: Password must be more than 8 characters.
verify_password:
required:
msg: Please verify your password.
sfCompareValidator:
check: password
compare_error: Your password verification does not match. Please retype your password.
user_type:
required:
msg: Please select a user type.
start_time_hours:
required:
msg: Please enter a valid start time
sfNumberValidator:
min: 0
min_error: Please enter a valid start time
max: 2
max_error: Please enter a valid start time
start_time_minutes:
required:
msg: Please enter a valid start time
sfNumberValidator:
min: 0
min_error: Please enter a valid start time
max: 2
max_error: Please enter a valid start time
start_time_ampm:
required:
msg: Please select AM or PM for start time.
end_time_hours:
required:
msg: Please enter a valid end time.
sfNumberValidator:
min: 0
min_error: Please enter a valid end time
max: 2
max_error: Please enter a valid end time
end_time_minutes:
required:
msg: Please enter a valid end time
sfNumberValidator:
min: 0
min_error: Please enter a valid end time
max: 2
max_error: Please enter a valid end time
end_time_ampm:
required:
msg: Please select AM or PM for end time
fillin:
enabled: true
param:
skip_fields: [validate_email]
exclude_types: [password]
check_types: [text, radio]
converters:
htmlentities: [user_name, first_name, last_name, address, address_2, city, zip, password, start_time_hours, start_time_minutes, end_time_hours, end_time_minutes]

View File

@ -0,0 +1,312 @@
<?php
/**
* workOrder actions.
*
* @package atlbiomed
* @subpackage workOrder
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class workOrderActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
// default view values
$this->bogusWorkOrder = new Workorder();
$this->bogusWorkOrder->setJobStatusId('');
$this->bogusWorkOrder->setJobTypeId('');
$this->bogusWorkOrder->setTech('');
$this->bogusWorkOrder->setClientId('');
$this->technicians = array();
$this->clients = array();
$c = new Criteria();
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
$this->client_dropdown = ClientPeer::doSelect($c);
$t = new Criteria();
$t->addAscendingOrderByColumn(JobTypePeer::TYPE_NAME);
$this->jobtype_dropdown = JobTypePeer::doSelect($t);
$s = new Criteria();
$s->addAscendingOrderByColumn(JobStatusPeer::STATUS_NAME);
$this->jobstatus_dropdown = JobStatusPeer::doSelect($s);
foreach($this->client_dropdown as $client)
{
$this->clients[$client->getId()] = $client->getClientIdentification();
}
foreach(UserPeer::getUserByType(1) as $tech)
{
$this->technicians[$tech->getId()] = $tech->getDisplayName();
}
$this->dateFilter = date('Y-m-d');
$this->dateFilterType = 'day';
// show jobs
$jobDate = date('Ymd');
$usersWithWork = new Criteria();
$workorders = new Criteria();
if($this->getRequest()->getMethod() == sfRequest::POST)
{
$this->dateFilter = $this->getRequestParameter('jobDate');
$this->dateFilterType = $this->getRequestParameter('dateFilterType');
if($this->getRequestParameter('client_id') != '')
{
$workorders->add(WorkorderPeer::CLIENT_ID, $this->getRequestParameter('client_id'));
$this->bogusWorkOrder->setClientId($this->getRequestParameter('client_id'));
}
if($this->getRequestParameter('technician_id') != '')
{
$usersWithWork->add(UserPeer::ID, $this->getRequestParameter('technician_id'));
$workorders->add(WorkorderTechPeer::USER_ID, $this->getRequestParameter('technician_id'));
$workorders->addJoin(WorkorderPeer::ID, WorkorderTechPeer::WORKORDER_ID, Criteria::INNER_JOIN);
$this->bogusWorkOrder->setTech($this->getRequestParameter('technician_id'));
}
if($this->getRequestParameter('job_status_id') != '')
{
$usersWithWork->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$workorders->add(WorkorderPeer::JOB_STATUS_ID, $this->getRequestParameter('job_status_id'));
$this->bogusWorkOrder->setJobStatusId($this->getRequestParameter('job_status_id'));
}
}
$usersWithWork->addJoin(UserPeer::ID, WorkorderPeer::TECH);
$usersWithWork->setDistinct(true);
if ($this->dateFilterType == 'day')
{
$usersWithWork->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
$workorders->add(WorkorderPeer::JOB_DATE, $this->getRequestParameter('jobDate'));
}
else if ($this->dateFilterType == 'month')
{
$year = substr($this->getRequestParameter('jobDate'), 0, 4);
$month = substr($this->getRequestParameter('jobDate'), 5, 2);
$start = $year . '-' . $month . '-01';
$end = $year . '-' . $month . '-31'; // easy check, even for months without 31 days since all dates are
// strings in our database
$usersWithWork->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
$workorders->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
}
else if ($this->dateFilterType == 'year')
{
$year = substr($this->getRequestParameter('jobDate'), 0, 4);
$startMonth = "01";
$endMonth = "12";
$start = $year . '-' . $startMonth . '-01';
$end = $year . '-' . $endMonth . '-31'; // easy check, even for months without 31 days since all dates are
// strings in our database
$usersWithWork->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
$workorders->add(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL);
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_EQUAL)); // inclusive
}
else
{
// week from the selected date
$start = date('Y-m-d', strtotime($this->getRequestParameter('jobDate')));
$end = date('Y-m-d', strtotime('+7 days', strtotime($this->getRequestParameter('jobDate'))));
//$this->renderText($start . $end); return sfView::NONE;
$usersWithWork->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$usersWithWork->addAnd($usersWithWork->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
$workorders->add(WorkorderPeer::JOB_DATE, $end, Criteria::LESS_THAN); // exclusive
$workorders->addAnd($workorders->getNewCriterion(WorkorderPeer::JOB_DATE, $start, Criteria::GREATER_EQUAL));
}
$this->techs = UserPeer::doSelect($usersWithWork);
$this->orders = WorkorderPeer::doSelect($workorders);
}
public function executePopulateWorkorder()
{
$ticket = $this->getRequestParameter('ticket');
$t = new Criteria();
$t->addAscendingOrderByColumn(JobTypePeer::TYPE_NAME);
$this->jobtype_dropdown = JobTypePeer::doSelect($t);
$s = new Criteria();
$s->addAscendingOrderByColumn(JobStatusPeer::STATUS_NAME);
$this->jobstatus_dropdown = JobStatusPeer::doSelect($s);
$g = new Criteria();
$g->add(DropdownPeer::MENU, 'reason');
$g->addAscendingOrderByColumn(DropdownPeer::VALUE);
$this->reason_dropdown = DropdownPeer::doSelect($g);
$this->openWorkorder = WorkorderPeer::retrieveByPk($ticket);
$this->openClient = ClientPeer::retrieveByPk($this->openWorkorder->getClientId());
$this->openTech = UserPeer::retrieveByPk($this->openWorkorder->getTech());
$this->openDevice = DevicePeer::retrieveByPk($this->openWorkorder->getDeviceId());
$reason = $this->openWorkorder->getReason();
if (!empty($reason)){
$this->openReason = DropdownPeer::retrieveByPk($this->openWorkorder->getReason());
}
$this->type_select = $this->openWorkorder->getJobTypeId();
$this->status_select = $this->openWorkorder->getJobStatusId();
}
public function executeUpdateworkorder(){
$wid_y = $this->getRequestParameter('wid');
$invoice_num = $this->getRequestParameter('invoice_num');
$action = $this->getRequestParameter('action_taken');
$remarks_y = $this->getRequestParameter('remarks');
$job_status = $this->getRequestParameter('job_status');
$job_type = $this->getRequestParameter('job_type');
$reason_select_y = $this->getRequestParameter('reason_select');
$onsite_time = $this->getRequestParameter('onsite_time');
$travel_time = $this->getRequestParameter('travel_time');
$travel_service = $this->getRequestParameter('travel_service');
$zone_charge = $this->getRequestParameter('zone_charge');
$salestax = $this->getRequestParameter('salestax');
$shipping = $this->getRequestParameter('shipping');
$cid = $this->getRequestParameter('cid');
$name = $this->getRequestParameter('print_name');
$c = new Criteria();
$c->add(WorkorderPeer::ID,$wid_y);
$wo = WorkorderPeer::doSelectOne($c);
if(!$wo){
print "<script type='text/javascript'>alert('Unable to save data');</script>";
return sfView::NONE;
}
$c = new Criteria();
$c->add(ClientPeer::ID,$cid);
$client = ClientPeer::doSelectOne($c);
if($client){
$client->setAttn($name);
$client->save();
}
$wo->setTravelTime($travel_time);
$wo->setOnsiteTime($onsite_time);
$wo->setReason($reason_select_y);
$wo->setJobTypeId($job_type);
$wo->setJobStatusId($job_status);
$wo->setInvoice($invoice_num);
$wo->setRemarks($remarks_y);
$wo->setActionTaken($action);
$wo->setSaletax($salestax);
$wo->setServiceTravel($travel_service);
$wo->setShippingHandling($shipping);
$wo->setZoneCharge($zone_charge);
if(!empty($invoice_num))
$wo->setJobStatusId(7);
$wo->save();
print "<script type='text/javascript'>alert('Data was save successfully');</script>";
return sfView::NONE;
}
/* public function executeInformation()
{
$r = new Criteria();
$this->result = array();
$search_select = $this->getRequestParameter('search_select');
if (isset($search_select))
{
// $search_by = $this->getRequestParameter('search_by');
switch($this->search_by)
{
case 'Client':
$r->add(WorkorderPeer::CLIENT_ID, $this->getRequestParameter('search_select'));
break;
case 'Technician':
$r->add(WorkorderPeer::TECH, $this->getRequestParameter('search_select'));
break;
case 'Date':
$r->add(WorkorderPeer::DATE_RECIEVED, $this->getRequestParameter('search_select'));
break;
case 'Status':
$r->add(workorderPeer::JOB_STATUS, $this->getRequestParameter('search_select'));
break;
}
$r->addJoin(WorkorderPeer::CLIENT_ID, ClientPeer::ID);
$r->addJoin(WorkorderPeer::TECH, UserPeer::ID);
$join = new sfPropelCustomJoinHelper('Workorder');
$join->addSelectTables('Client', 'User');
$join->setHas('Workorder', 'User');
$join->setHas('Workorder', 'Client');
$this->result = $join->doSelect($r);
}
$this->redirect('workOrder/search_by/'.$search_by);
}*/
/* public function executeSelectWorkorder()
{
$search_by = $this->getRequestParameter('search_by');
$r = new Criteria();
$result = new Workorder();
switch($search_by)
{
case 'Client':
$r->add(WorkorderPeer::CLIENT_ID, $this->getRequestParameter('search_select'));
$result = WorkorderPeer::doSelect($r);
break;
case 'Technician':
$r->add(WorkorderPeer::TECH, $this->getRequestParameter('search_select'));
$result = WorkorderPeer::doSelect($r);
break;
// case 'Date':
// $r->add(WorkorderPeer::DATE, $this->getRequestParameter('search_select'
// break;
case 'Status':
$r->add(workorderPeer::STATUS, $this->getRequestParameter('search_select'));
$result = WorkorderPeer::doSelect($r);
break;
}
$this->redirect('workOrder/index?searchby='.$this->getRequestParameter('search_by'));
}*/
}

View File

@ -0,0 +1,2 @@
all:
javascripts: [workorder]

View File

@ -0,0 +1,6 @@
<?php echo radiobutton_tag('dateFilterType', 'year', $dateFilterType == 'year') ?>By Selected Year<br />
<?php echo radiobutton_tag('dateFilterType', 'month', $dateFilterType == 'month') ?>By Selected Month<br />
<?php echo radiobutton_tag('dateFilterType', 'week', $dateFilterType == 'week') ?>By Selected Week (selected day plus seven days)<br />
<?php echo radiobutton_tag('dateFilterType', 'day', $dateFilterType == 'day') ?>By Selected Day<br />
<?php echo input_date_tag('jobDate', $initialDate, 'rich=true'); ?>

View File

@ -0,0 +1,139 @@
<?php use_helper('Javascript') ?>
<?php use_helper('Object') ?>
<?php
/* Event.observe(window, 'load', initFunctions, false);
function initFunctions(evt)
{
showWorkorder();
}*/
echo javascript_tag("
function showWorkorder(id)
{".
//initiate TechDisplay
remote_function(array(
'update' => 'workOrder',
'url' => 'workOrder/populateWorkorder',
'with' => '"ticket=" + id')).";"."
}
");
?>
<?php echo javascript_tag('
function editSchedule(workorder_id)
{
window.location = "'.url_for('scheduler/index?mode=edit&ticket=').'" + "/" + workorder_id;
} ');
?>
<?php echo javascript_tag("
function saveWorkorder(id)
{
{".
remote_function(array(
'url' => 'workOrder/saveWorkorder',
'with' => '"ticket=" + id'))."
}
}"); ?>
<div class="mapsCollapsingPanelContainer">
<?php echo form_tag('workOrder/index'); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Client',
'uniqueId' => 'filterByClient',
'content' => select_tag('client_id',
options_for_select($clients,
$bogusWorkOrder->getClientId(),
'include_custom=All')))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Status',
'uniqueId' => 'filterByStatus',
'content' => object_select_tag($bogusWorkOrder, 'getJobStatusId', 'include_custom=All', ''))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Technician',
'uniqueId' => 'filterByTechnician',
'content' => select_tag('technician_id',
options_for_select($technicians,
$bogusWorkOrder->getTech(),
'include_custom=All')))); ?>
<?php include_partial('global/collapsingDivContainer',
array('title' => 'Filter by Date',
'uniqueId' => 'filterByDate',
'content' => get_partial('mapDateFilterControl',
array('initialDate' => $dateFilter,
'dateFilterType' => $dateFilterType)))); ?>
<div class="mapsCollapsingPanelContainerControl">
<?php echo submit_tag('Filter'); ?>
</div>
</form>
</div>
<div id="workOrder_content" style="padding-left:10px;">
<div id="workOrder"></div>
<?php
if (!empty($orders) )
{ ?>
<div id="searchResults">
<table class="workorder_search_results" cellpadding="3" cellspacing="1"><tr>
<td><b><u>Client ID</u></b></td>
<td><b><u>Invoice #</u></b></td>
<td><b><u>Client Name</u></b></td>
<td><b><u>Technician</u></b></td>
<td><b><u>Job Date</u></b></td>
<td><b><u>Remarks</u></b></td>
<td><b><u>Reason</u></b></td>
<td><b><u>Job Status</u></b></td>
<td><b><u>Action</u></b></td>
</tr><tr>
<?php
foreach($orders as $order)
{
$tech = UserPeer::retrieveByPk($order->getTech());
$reason = DropdownPeer::retrieveByPk($order->getReason());
if($order->getClient() != NULL){
?>
<tr>
<td><?php echo $order->getClient()->getClientIdentification(); ?></td>
<td><?php echo $order->getInvoice(); ?></td>
<td><?php echo $order->getClient()->getClientName(); ?></td>
<td><?php if(method_exists($tech,"getFirstName")) { echo $tech->getFirstName() .' '. $tech->getLastName(); } ?></td>
<td><?php echo $order->getJobDate(); ?></td>
<td><?php echo $order->getRemarks(); ?></td>
<td><?php $c = new Criteria();
$c->add(DropdownPeer::ID, $order->getReason());
$dr = DropdownPeer::doSelectOne($c);
print $dr->getValue(); ?></td>
<?php $cc=''; if($order->getJobStatusId() == 7){ $cc = "style='color:red'"; }elseif($order->getJobStatusId()== 9){ $cc = "style='color:green'"; }?>
<td><span <?php print $cc;?>> <?php echo $order->getJobStatus(); ?></span></td>
<td><?php echo link_to_function('Open', "showWorkorder(".$order->getId().")", array(
'target' => '_top'));?></td>
</tr>
<?php
}//if
}//for ?>
</tr></table></div>
<?php } ?>
</div>

View File

@ -0,0 +1,178 @@
<?php use_helper('Object'); ?>
<?php use_helper('Javascript'); ?>
<table class=tablewrapper><tr>
<td><table><tr>
<td><table><tr>
<td><b>Manufacturer: </b></td>
<td><?php //echo $workorder->getDevice()->getManufacturer(); ?></td>
</tr><tr>
<td><b>Instrument: </b></td>
<td>EKG</td>
</tr><tr>
<td><b>Model #: </b></td>
<td>BTEKG200</td>
</tr><tr>
<td><b>Serial #: </b></td>
<td>329048-9</td>
</tr></table></td>
<td><table><tr>
<td><table><tr>
<td><b>Unit ID:</b></td>
<td>2394</td>
</tr><tr>
<td><b>Customer ID:</b></td>
<td>BIOTECH</td>
</tr><tr>
<td><b>Tech Assigned:</b></td>
<td>Mike D.</td>
</tr></table></td>
<td><table><tr>
<td><b>Travel: </b></td>
<td>1</td>
</tr><tr>
<td><b>On Site: </b></td>
<td>3</td>
</tr><tr>
<td><b>Zip</b></td>
<td>93204</td>
</tr></table></td>
</tr><tr>
<td colspan=2><table><tr>
<td><b>Requested By: </b><td>
<td>Kurdt Cobain</td>
</tr></table></td>
</tr></table></td>
</tr><tr>
<td colspan=2><table><tr>
<td><b>Reason For: </b>
</tr><tr>
<td><?php echo textarea_tag('reason', '', "size=42x2"); ?></td>
</tr></table></td>
</tr></table></td>
<td><table><tr>
<td colspan=2><table><tr>
<td><b>Ticket #: </b></td>
<td><?php echo $ticket; ?></td>
</tr></table></td>
</tr><tr>
<td><table><tr>
<td><b>Recieved Date:</b></td>
</tr><tr>
<td>2/10/07</td>
</tr></table></td>
<td><table><tr>
<td><b>Completed Date:</b></td>
</tr><tr>
<td>2/10/07</td>
</tr></table></td>
</tr><tr>
<td colspan=2><table><tr>
<td><b>Name: </b></td>
<td>Muddy Waters</td>
</tr><tr>
<td><b>Address: </b></td>
<td>3897 Bo Diddly Ln. Suite 102</td>
</tr><tr>
<td><b>City:</b></td>
<td>Opry</td>
</tr><tr>
<td><b>State:</b></td>
<td>TN</td>
</tr><tr>
<td><b>Zip:</b></td>
<td>90834</td>
</tr><tr>
<td><b>Attn:</b></td>
<td>Count Basie</td>
</tr><tr>
<td><b>Phone:</b></td>
<td>8902374098</td>
</tr></table></td>
</tr></table></td>
</tr><tr>
<td colspan=2><table><tr>
<td><b>Action Taken</b></td>
</tr><tr>
<td><?php echo textarea_tag('action', '', 'size=70x4'); ?></td>
</tr></table></td>
</tr><tr>
<td colspan=2><table><tr>
<td><b>Remarks</b></td>
</tr><tr>
<td><?php echo textarea_tag('remarks', '', 'size=70x4'); ?></td>
</tr></table></td>
</tr><tr>
<td colspan=2><table><tr>
<td></td>
<td><table><tr>
<td colspan=2><table><tr>
<td><b>Job Type: </b></td>
<td><?php echo select_tag('job_type'); ?></td>
</tr><tr>
<td><b>Job Status: </b></td>
<td><?php echo select_tag('job_status'); ?></td>
</tr></table></td>
</tr><tr>
<td><table><tr>
<td><b>P.O. #: </b></td>
</tr><tr>
<td><?php echo input_tag('parts_order_number'); ?></td>
</tr></table></td>
<td><table><tr>
<td><b>Invoice: </b></td>
</tr><tr>
<td><?php echo input_tag('invoice_number'); ?></td>
</tr></table></td>
</tr></table></td>
<td><table><tr>
<td><table><tr>
<td>Subtotal: </td>
<td><?php echo input_tag('subtotal'); ?></td>
</tr><tr>
<td>Service &amp; Travel: </td>
<td><?php echo input_tag('service_travel'); ?></td>
</tr><tr>
<td>Zone Charge: </td>
<td><?php echo input_tag('zone_charge'); ?></td>
</tr><tr>
<td>Shipping &amp; Handling: </td>
<td><?php echo input_tag('shipping_handling'); ?></td>
</tr><tr>
<td>Sales Tax: </td>
<td><?php echo input_tag('sales_tax'); ?></td>
</tr><tr>
</tr></table></td>
</td></table></tr>
</td></table></tr>
</tr></table>
</div>
<div id="submitButtons">
<table class="unscheduledButtons"><tr>
<td><h2>Unscheduled</h2></td>
</tr><tr>
<td><?php echo button_to_function('Unscheduled With Parts', 'save()'); ?></td>
</tr><tr>
<td><?php echo button_to_function('Unscheduled Without Parts', 'save()'); ?></td>
</tr><table>
<table class="Pending"><tr>
<td colspan=2><h2>Pending</h2></td>
</tr><tr>
<td><?php echo button_to_function('Waiting Parts', 'save()'); ?></td>
<td><?php echo button_to_function('Waiting Quote Approval', 'save()'); ?></td>
</tr><tr>
<td><?php echo button_to_function('Reopen As Warrenty', 'save()'); ?></td>
<td><?php echo button_to_function('Next Visit', 'save()'); ?></td>
</tr></table>
<table class="completedButtons"><tr>
<td><h2>Completed</h2></td>
<tr></tr>
<td><?php echo button_to_function('Job Completed', 'save()'); ?></td>
<tr></tr>
<td><?php echo button_to_function('Repair Declined', 'save()'); ?></td>
</table>

View File

@ -0,0 +1,194 @@
<?php use_helper('Object'); ?>
<?php use_helper('Javascript'); ?>
<table id="workorder_report" border="0" cellspacing="1" cellpadding="3">
<tr class="report_row">
<td>
<table id="order_info">
<tr class="order_info_row">
<td class="order_label">MANUFACTURER:</td>
<td class="auto_enter" id="workorder_manufacturer"><?php if ($openDevice != null){echo $openDevice->getSpecification()->getManufacturer(); }?></td>
<td class="order_label">UNIT ID NO:</td>
<td class="auto_enter" id="workorder_unit_id"><?php if ($openDevice != null){ echo $openDevice->getIdentification(); }?></td>
<td class="order_label">TRAVEL:</td>
<td class="enter" id="workorder_traveltime"><?php echo input_tag('travel_time', $openWorkorder->getTravelTime(), array('size' => "4", 'MAXLENGTH' => "6")); ?></td>
</tr>
<tr class="order_info_row">
<td class="order_label">INSTRUMENT:</td>
<td class="auto_enter" id="workorder_instrument"><?php if ($openDevice != null){ echo $openDevice->getSpecification()->getDeviceName(); }?></td>
<td class="order_label">CUSTOMER ID:</td>
<td class="auto_enter" id="workorder_customer_ID"><?php echo $openClient->getClientIdentification(); ?></td>
<td class="order_label">ON SITE:</td>
<td class="enter" id="workorder_onsite"><?php echo input_tag('onsite_time', $openWorkorder->getOnsiteTime(), array('size' => "4", 'MAXLENGTH' => "6")); ?></td>
</tr>
<tr class="order_info_row">
<td class="order_label">MODEL NO:</td>
<td class="auto_enter" id="workorder_model"><?php if ($openDevice != null){ echo $openDevice->getSpecification()->getModelNumber();} ?></td>
<td class="order_label">CSR ASSIGNED:</td>
<td class="auto_enter" id="workorder_technician"> <?php echo $openTech->getLastName().", ".$openTech->getFirstName(); ?></td>
<td class="order_label">ZIP:</td>
<td class="auto_enter" id="workorder_zipcode"><?php echo $openClient->getZip(); ?></td>
</tr>
<tr class="order_info_row">
<td class="order_label">SERIAL NO:</td>
<td class="auto_enter" id="workorder_serial"><?php if ($openDevice != null){ echo $openDevice->getSerialNumber(); } ?></td>
<td class="order_label">REQUESTED BY:</td>
<td class="auto_enter" colspan="3" id="workorder_requested"><?php echo $openWorkorder->getCaller(); ?></td>
</tr>
<tr class="order_info_row">
<td class="order_label">REASON FOR CALL:</td>
<td class="auto_enter" colspan="5" id="workorder_reason"><?php echo select_tag('reason_select_y', objects_for_select($reason_dropdown, 'getid', 'getvalue', $openWorkorder->getReason())); ?></td>
</tr>
<tr class="order_info_row">
<td colspan="6"></td>
</tr>
</table>
</td>
<td>
<table id="contact_info">
<tr class="contact_info_row">
<td class="order_label">PAGE:</td>
<td class="auto_enter" id="workorder_page"></td>
<td class="order_label">OF:</td>
<td class="auto_enter" id="workorder_of"></td>
<td class="order_label">ORDER #</td>
<td class="enter" id="workorder_ticket"><?php echo $openWorkorder->getId(); ?></td>
</tr>
<tr class="contact_info_row">
<td class="order_label">RECEIVED:</td>
<td class="auto_enter" colspan="3" id="workorder_date_recieved"><?php echo $openWorkorder->getDateRecieved(); ?></td>
<td class="order_label">COMPLETED:</td>
<td class="enter" id="workorder_date_completed" ><?php echo input_tag('completed', $openWorkorder->getDateCompleted(), array('size' => "8", 'MAXLENGTH' => "10")); ?></td>
</tr>
<tr class="contact_info_row">
<td class="order_label">NAME:</td>
<td class="auto_enter" colspan="5" id="workorder_client_name"><?php echo $openClient->getClientName(); ?></td>
</tr>
<tr class="contact_info_row">
<td class="order_label">ADDRESS:</td>
<td class="auto_enter" colspan="5" id="workorder_client_address"><?php echo $openClient->getAddress(); ?><br/><?php echo $openClient->getAddress2(); ?></td>
</tr>
<tr class="contact_info_row">
<td class="order_label">CITY:</td>
<td class="auto_enter" id="workorder_client_city"><?php echo $openClient->getCity(); ?></td>
<td class="order_label">STATE:</td>
<td class="auto_enter" id="workorder_client_state"><?php echo $openClient->getState(); ?></td>
<td class="order_label">ZIP:</td>
<td class="auto_enter" id="workorder_client_zip"><?php echo $openClient->getZip(); ?></td>
</tr>
<tr class="contact_info_row">
<td class="order_label">ATTN:</td>
<td class="auto_enter" colspan="2" id="workorder_client_attn"><?php echo $openClient->getAttn(); ?></td>
<td class="order_label">PHONE:</td>
<td class="auto_enter" colspan="2" id="workorder_client_phone"><?php echo $openClient->getPhone(); ?></td>
</tr>
</table>
</td>
</tr>
<tr class="report_row">
<td colspan="2">
<table id="action_taken">
<tr>
<td class="order_label">ACTION TAKEN:</td>
<td class="enter" id="workorder_action_taken"><?php echo textarea_tag('action', $openWorkorder->getActionTaken(), 'size=90x6'); ?></td>
</tr>
</table>
</td>
</tr>
<tr class="report_row">
</tr>
<tr class="report_row">
<td colspan="2">
<table id="remarks">
<tr>
<td class="order_label">REMARKS:</td>
<td class="enter" id="workorder_remarks"><?php echo textarea_tag('remarks_y', $openWorkorder->getRemarks(), 'size=94x2'); ?></td>
</tr>
</table>
</td>
</tr>
<tr class="report_row">
<td>
<table id="lower_info">
<tr>
<td class="order_label">JOB STATUS:</td>
<td class="enter" colspan="2" id="workorder_job_status"><?php echo select_tag('job_status', objects_for_select($jobstatus_dropdown, 'getid', 'getstatusname', $status_select)); ?></td>
<td class="order_label">INVOICE #</td>
<td class="enter"><input type='invoice_num' id = 'invoice_num' value='<?php print $openWorkorder->getInvoice(); ?>'></td>
</tr>
<tr>
<td class="order_label">JOB TYPE:</td>
<td class="enter" colspan="2" id="workorder_job_type"><?php echo select_tag('job_type', objects_for_select($jobtype_dropdown, 'getid', 'gettypename', $type_select)); ?></td>
<td class="order_label">P.O. #</td>
<td class="enter"></td>
</tr>
<tr>
<td class="order_label">PRINT NAME:</td>
<td class="auto_edit" colspan="4" id="workorder_print_name"><?php echo input_tag('print_name', $openClient->getAttn()); ?></td>
</tr>
</table>
</td>
<td>
<table id="pricing_info">
<tr>
<td class="order_label">SERVICE &amp; TRAVEL:</td>
<td class="enter" id="workorder_service_travel"><?php echo '$ '. input_tag('travel_service', $openWorkorder->getServiceTravel(),
array(
'size' => "5",
'MAXLENGTH' => "9")); ?></td>
</tr>
<tr>
<td class="order_label">ZONE CHARGE:</td>
<td class="enter" id="workorder_zone_charge"><?php echo '$ '. input_tag('zone_charge_y', $openWorkorder->getZoneCharge(),
array(
'size' => "5",
'MAXLENGTH' => "9")); ?></td>
</tr>
<tr>
<td class="order_label">SALES TAX:</td>
<td class="enter" id="workorder_sales_tax"><?php echo '$ '. input_tag('salestax', $openWorkorder->getSaleTax(),
array(
'size' => "5",
'MAXLENGTH' => "9")); ?></td>
</tr>
<tr>
<td class="order_label">SHIPPING &amp; HANDLING:</td>
<td class="enter" id="workorder_shipping_handling"><?php echo '$ '. input_tag('shipping', $openWorkorder->getShippingHandling(),
array(
'size' => "5",
'MAXLENGTH' => "9")); ?></td>
</tr>
<tr>
<td class="order_label">TOTAL:</td>
<td class="enter" id="workorder_totalcost"><?php echo '$ '. input_tag('totalcost',
($openWorkorder->getServiceTravel()+$openWorkorder->getZoneCharge()
+$openWorkorder->getSaleTax()+$openWorkorder->getShippingHandling()),
array(
'size' => "5",
'MAXLENGTH' => "9",'disabled'=>"'disabled'")); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input type='hidden' value='<?php print $openWorkorder->getId(); ?>' name='wid' id='wid' />
<input type='hidden' value='<?php print $openClient->getId(); ?>' name='cid' id='cid' />
<?php
echo button_to_function('Edit Schedule', 'editSchedule('.$openWorkorder->getId().')')."&nbsp;&nbsp;";
//echo button_to_function('Save Changes', 'saveWorkorder('.$openWorkorder->getId().')');
echo button_to_function('Save Changes', 'updateWorkorder('.$openWorkorder->getId().')');
?>
</td>
</tr>
</table>
<div id='res'></div>