mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
58
apps/atlbiomed/modules/unprocessed/actions/actions.class.php
Executable file
58
apps/atlbiomed/modules/unprocessed/actions/actions.class.php
Executable 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
|
||||
}
|
3
apps/atlbiomed/modules/unprocessed/config/view.yml
Executable file
3
apps/atlbiomed/modules/unprocessed/config/view.yml
Executable file
@ -0,0 +1,3 @@
|
||||
all:
|
||||
stylesheets: [process]
|
||||
javascripts: [scriptaculous/lib/prototype, process]
|
11
apps/atlbiomed/modules/unprocessed/templates/_device.php
Executable file
11
apps/atlbiomed/modules/unprocessed/templates/_device.php
Executable 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 } ?>
|
||||
|
57
apps/atlbiomed/modules/unprocessed/templates/_device_changed.php
Executable file
57
apps/atlbiomed/modules/unprocessed/templates/_device_changed.php
Executable 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\"
|
||||
}";
|
||||
?>
|
||||
|
||||
|
70
apps/atlbiomed/modules/unprocessed/templates/_process_match.php
Executable file
70
apps/atlbiomed/modules/unprocessed/templates/_process_match.php
Executable 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>
|
86
apps/atlbiomed/modules/unprocessed/templates/_process_no_match.php
Executable file
86
apps/atlbiomed/modules/unprocessed/templates/_process_no_match.php
Executable 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>
|
||||
|
77
apps/atlbiomed/modules/unprocessed/templates/_process_partial_match.php
Executable file
77
apps/atlbiomed/modules/unprocessed/templates/_process_partial_match.php
Executable 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>
|
3
apps/atlbiomed/modules/unprocessed/templates/deviceIdChangedSuccess.php
Executable file
3
apps/atlbiomed/modules/unprocessed/templates/deviceIdChangedSuccess.php
Executable file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include_partial('device_changed',array('oldDevice'=>$oldDevice, 'newDevice'=>$newDevice))
|
||||
?>
|
2
apps/atlbiomed/modules/unprocessed/templates/getDevicesSuccess.php
Executable file
2
apps/atlbiomed/modules/unprocessed/templates/getDevicesSuccess.php
Executable file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
include_partial('device',array('devices'=>$devices)); ?>
|
63
apps/atlbiomed/modules/unprocessed/templates/indexSuccess.php
Executable file
63
apps/atlbiomed/modules/unprocessed/templates/indexSuccess.php
Executable 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));
|
||||
?>
|
Reference in New Issue
Block a user