0.3.18
This commit is contained in:
parent
d68ffb3164
commit
9fb41a0a04
@ -39,6 +39,7 @@ Contents
|
|||||||
|
|
||||||
**Changes introduced in 0.3.17
|
**Changes introduced in 0.3.17
|
||||||
[Fix] Error when configuring managed cable connector type as ST
|
[Fix] Error when configuring managed cable connector type as ST
|
||||||
|
[Enhance] Added ability to delete managed cable from Cable Inventory
|
||||||
|
|
||||||
**Changes introduced in 0.3.17
|
**Changes introduced in 0.3.17
|
||||||
[Fix] Backup export not converting HTML code to ASCII hyphen
|
[Fix] Backup export not converting HTML code to ASCII hyphen
|
||||||
|
|||||||
@ -32,6 +32,14 @@ $( document ).ready(function() {
|
|||||||
var action = $(linkEditable).attr('data-action');
|
var action = $(linkEditable).attr('data-action');
|
||||||
var cableID = $(linkEditable).attr('data-cableID');
|
var cableID = $(linkEditable).attr('data-cableID');
|
||||||
|
|
||||||
|
if(action == 'delete') {
|
||||||
|
|
||||||
|
$(document).data('selectedCableID', cableID);
|
||||||
|
|
||||||
|
$('#modalConfirmTitle').html('Delete Cable');
|
||||||
|
$('#modalConfirmBody').html('Delete cable?');
|
||||||
|
|
||||||
|
} else {
|
||||||
var data = {
|
var data = {
|
||||||
cableID: cableID,
|
cableID: cableID,
|
||||||
action: action
|
action: action
|
||||||
@ -45,23 +53,43 @@ $( document ).ready(function() {
|
|||||||
} else if ($(responseJSON.error).size() > 0){
|
} else if ($(responseJSON.error).size() > 0){
|
||||||
displayError(responseJSON.error);
|
displayError(responseJSON.error);
|
||||||
} else {
|
} else {
|
||||||
var pill = $(linkEditable).siblings('.label-pill');
|
|
||||||
|
|
||||||
if(action == 'finalize') {
|
if(action == 'lock') {
|
||||||
$(pill).removeClass('label-danger').addClass('label-success');
|
$(linkEditable).html('<i class="fa fa-lock"></i>');
|
||||||
$(pill).html('Yes');
|
$(linkEditable).attr('data-action', 'unlock');
|
||||||
$(linkEditable).html('unFinalize');
|
$(linkEditable).attr('title', 'Unlock cable for editing');
|
||||||
$(linkEditable).attr('data-action', 'unfinalize');
|
|
||||||
$(linkEditable).attr('title', 'Allow cable properties to be edited.');
|
|
||||||
|
|
||||||
} else if(action == 'unfinalize') {
|
} else if(action == 'unlock') {
|
||||||
$(pill).removeClass('label-success').addClass('label-danger');
|
$(linkEditable).html('<i class="fa fa-unlock"></i>');
|
||||||
$(pill).html('No');
|
$(linkEditable).attr('data-action', 'lock');
|
||||||
$(linkEditable).html('Finalize');
|
$(linkEditable).attr('title', 'Lock cable for editing');
|
||||||
$(linkEditable).attr('data-action', 'finalize');
|
|
||||||
$(linkEditable).attr('title', 'Remove the ability to edit cable properties.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Delete a temlate
|
||||||
|
$('#modalConfirmBtn').click(function(){
|
||||||
|
var selectedCableID = $(document).data('selectedCableID');
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
cableID: selectedCableID,
|
||||||
|
action: 'delete'
|
||||||
|
}
|
||||||
|
|
||||||
|
data = JSON.stringify(data);
|
||||||
|
|
||||||
|
$.post("backend/process_cable-editable.php", {data:data}, function(response){
|
||||||
|
var responseJSON = JSON.parse(response);
|
||||||
|
if (responseJSON.active == 'inactive'){
|
||||||
|
window.location.replace("/");
|
||||||
|
} else if ($(responseJSON.error).size() > 0){
|
||||||
|
displayError(responseJSON.error);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$('#'+selectedCableID).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -20,15 +20,37 @@ if($_SERVER['REQUEST_METHOD'] == 'POST'){
|
|||||||
$cableID = $data['cableID'];
|
$cableID = $data['cableID'];
|
||||||
$action = $data['action'];
|
$action = $data['action'];
|
||||||
|
|
||||||
$editable = $action == 'finalize' ? 0 : 1;
|
if($action == 'lock' or $action == 'unlock') {
|
||||||
|
|
||||||
|
$editable = $action == 'lock' ? 0 : 1;
|
||||||
|
|
||||||
$qls->SQL->update('app_inventory', array('editable' => $editable), array('id' => array('=', $cableID)));
|
$qls->SQL->update('app_inventory', array('editable' => $editable), array('id' => array('=', $cableID)));
|
||||||
|
|
||||||
|
} else if($action == 'delete') {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(isset($qls->App->inventoryAllArray[$cableID])) {
|
||||||
|
$cable = $qls->App->inventoryAllArray[$cableID];
|
||||||
|
|
||||||
|
if($cable['a_object_id'] != 0 and $cable['b_object_id'] != 0) {
|
||||||
|
|
||||||
|
$qls->SQL->delete('app_inventory', array('id' => array('=', $cableID)));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$errMsg = 'Unable to delete managed cables that are connected to ports. Clear cable connection(s) and try again.';
|
||||||
|
array_push($validate->returnData['error'], $errMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo json_encode($validate->returnData);
|
echo json_encode($validate->returnData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate($data, &$validate, &$qls){
|
function validate($data, &$validate, &$qls){
|
||||||
$actionArray = array('finalize', 'unfinalize');
|
$actionArray = array('lock', 'unlock', 'delete');
|
||||||
|
|
||||||
$validate->validateID($data['cableID'], 'cable ID');
|
$validate->validateID($data['cableID'], 'cable ID');
|
||||||
|
|
||||||
|
|||||||
@ -128,6 +128,14 @@ var $qls;
|
|||||||
// Set app version to 0.3.18
|
// Set app version to 0.3.18
|
||||||
$this->qls->SQL->update('app_organization_data', array('version' => $incrementalVersion), array('id' => array('=', 1)));
|
$this->qls->SQL->update('app_organization_data', array('version' => $incrementalVersion), array('id' => array('=', 1)));
|
||||||
|
|
||||||
|
// Fix port description table
|
||||||
|
$query = $this->qls->SQL->query("SHOW COLUMNS FROM `{$this->qls->config['sql_prefix']}app_port_description` LIKE 'description'");
|
||||||
|
if(!$this->qls->SQL->num_rows($query)) {
|
||||||
|
|
||||||
|
// Add description column
|
||||||
|
$this->qls->SQL->alter('app_port_description', 'add', 'description', 'varchar(255)');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -18,9 +18,9 @@
|
|||||||
echo '<th>ID</th>';
|
echo '<th>ID</th>';
|
||||||
echo '<th>Connector</th>';
|
echo '<th>Connector</th>';
|
||||||
echo '<th>Connected</th>';
|
echo '<th>Connected</th>';
|
||||||
echo '<th>Finalized</th>';
|
|
||||||
echo '<th>Media</th>';
|
echo '<th>Media</th>';
|
||||||
echo '<th>Length</th>';
|
echo '<th>Length</th>';
|
||||||
|
echo '<th>Action</th>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo '</thead>';
|
echo '</thead>';
|
||||||
echo '<tbody>';
|
echo '<tbody>';
|
||||||
@ -30,7 +30,7 @@
|
|||||||
$lengthValue = $row['length'];
|
$lengthValue = $row['length'];
|
||||||
$length = $qls->App->calculateCableLength($mediaTypeID, $lengthValue);
|
$length = $qls->App->calculateCableLength($mediaTypeID, $lengthValue);
|
||||||
|
|
||||||
echo '<tr>';
|
echo '<tr id="'.$row['id'].'">';
|
||||||
echo '<td data-connectorID="'.$row['a_code39'].'"><a class="linkScan" href="#">'.$row['a_code39'].'</a><button class="displayBarcode pull-right btn btn-sm waves-effect waves-light btn-primary"><i class="fa fa-barcode"></i></button></td>';
|
echo '<td data-connectorID="'.$row['a_code39'].'"><a class="linkScan" href="#">'.$row['a_code39'].'</a><button class="displayBarcode pull-right btn btn-sm waves-effect waves-light btn-primary"><i class="fa fa-barcode"></i></button></td>';
|
||||||
echo '<td>'.$connectorTable[$row['a_connector']]['name'].'</td>';
|
echo '<td>'.$connectorTable[$row['a_connector']]['name'].'</td>';
|
||||||
if($row['a_object_id'] == 0) {
|
if($row['a_object_id'] == 0) {
|
||||||
@ -45,13 +45,23 @@
|
|||||||
} else {
|
} else {
|
||||||
echo '<td>'.$pillYes.'</td>';
|
echo '<td>'.$pillYes.'</td>';
|
||||||
}
|
}
|
||||||
if($row['editable'] == 0) {
|
|
||||||
echo '<td>'.$pillYes.'  <a title="Allow cable properties to be edited." class="linkEditable" data-action="unfinalize" data-cableID="'.$row['id'].'" href="javascript:void(0);">unFinalize</a></td>';
|
|
||||||
} else {
|
|
||||||
echo '<td>'.$pillNo.'  <a title="Remove the ability to edit cable properties." class="linkEditable" data-action="finalize" data-cableID="'.$row['id'].'" href="javascript:void(0);">Finalize</a></td>';
|
|
||||||
}
|
|
||||||
echo '<td>'.$mediaTypeTable[$row['mediaType']]['name'].'</td>';
|
echo '<td>'.$mediaTypeTable[$row['mediaType']]['name'].'</td>';
|
||||||
echo '<td>'.$length.'</td>';
|
echo '<td>'.$length.'</td>';
|
||||||
|
echo '<td>';
|
||||||
|
if($row['editable'] == 0) {
|
||||||
|
echo '<a title="Unlock cable for editing" class="linkEditable" data-action="unlock" data-cableID="'.$row['id'].'" href="javascript:void(0);">';
|
||||||
|
echo '<i class="fa fa-lock"></i>';
|
||||||
|
echo '</a>';
|
||||||
|
} else {
|
||||||
|
echo '<a title="Lock cable for editing" class="linkEditable" data-action="lock" data-cableID="'.$row['id'].'" href="javascript:void(0);">';
|
||||||
|
echo '<i class="fa fa-unlock"></i>';
|
||||||
|
echo '</a>';
|
||||||
|
}
|
||||||
|
echo '  ';
|
||||||
|
echo '<a title="Delete cable" class="linkEditable" data-action="delete" data-cableID="'.$row['id'].'" href="javascript:void(0);" data-toggle="modal" data-target="#modalConfirm">';
|
||||||
|
echo '<i class="fa fa-times"></i>';
|
||||||
|
echo '</a>';
|
||||||
|
echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
echo '</tbody>';
|
echo '</tbody>';
|
||||||
|
|||||||
@ -544,5 +544,6 @@ CREATE TABLE `{database_prefix}app_port_description` (
|
|||||||
`object_face` int(11) NOT NULL,
|
`object_face` int(11) NOT NULL,
|
||||||
`object_depth` int(11) NOT NULL,
|
`object_depth` int(11) NOT NULL,
|
||||||
`port_id` int(11) NOT NULL,
|
`port_id` int(11) NOT NULL,
|
||||||
|
`description` varchar(255) NOT NULL,
|
||||||
PRIMARY KEY(`id`)
|
PRIMARY KEY(`id`)
|
||||||
);
|
);
|
||||||
2
scan.php
2
scan.php
@ -78,7 +78,7 @@ $qls->Security->check_auth_page('operator.php');
|
|||||||
</table>
|
</table>
|
||||||
<button id="buttonFinalize" type="button" class="btn btn-success waves-effect waves-light m-t-10" style="display:none;" disabled>
|
<button id="buttonFinalize" type="button" class="btn btn-success waves-effect waves-light m-t-10" style="display:none;" disabled>
|
||||||
<span class="btn-label"><i class="fa fa-check"></i></span>
|
<span class="btn-label"><i class="fa fa-check"></i></span>
|
||||||
Finalize*
|
Lock*
|
||||||
</button>
|
</button>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user