die('No option specified.');
}
-trigger_error("Option = ".$_REQUEST['option'],E_USER_NOTICE);
+trigger_error("Option = ".$_REQUEST['option'], E_USER_NOTICE);
switch($_REQUEST['option']) {
$facility = $Facilities->editEntry($facilityId);
//echo " <pre>".print_r($facility,1)."</pre>";
//die();
+
$view = 'facilityForm';
$templateData = array(
break;
default:
- die('No valid option provided');
+ die('Invalid option provided: '.$_REQUEST['option']);
break;
}
-<br>
-* Having problem with submit of edit on new faclilty<br>
-
<div class="wrap glm-associate-admin-wrap">
font-weight: bold;
margin-top: 10px;
font-size: 1.1em;
+ cursor: pointer;
}
.assets-column-title {
font-weight: bold;
<script>
jQuery(document).ready(function($){
-
var editFlag = false;
var facilityHoverId = false;
var currentFormAction = false;
- // File Line Hover Action
+ // Facility Line Hover Action
$('.facility-name').live( 'mouseenter', function() {
+ if (editFlag) {
+ return;
+ }
+ if (!facilityHoverId) {
+ facilityHoverId = $(this).attr('data-id');
+ $('.facility_' + facilityHoverId).removeClass('glm-hidden');
+ }
+ });
+
+ // Facility Line Click Action - For mobile browsers
+ $('.facility-name').live( 'click', function() {
if (editFlag) {
return;
}
if (facilityHoverId) {
$('.facility_' + facilityHoverId).addClass('glm-hidden');
+ facilityHoverId = false;
+ } else {
+ facilityHoverId = $(this).attr('data-id');
+ $('.facility_' + facilityHoverId).removeClass('glm-hidden');
}
- facilityHoverId = $(this).attr('data-id');
- $('.facility_' + facilityHoverId).removeClass('glm-hidden');
});
-
function fileLinksEditSelected() {
$('#facilityLinks_' + facilityHoverId).addClass('glm-hidden');
fileEditFlag = true;
// Submit Facility Form
$('#facilityForm').live('submit', function(event) {
-
+
if (currentFormAction == 'add') {
var thisOption = 'addNewFacility';
}
event.preventDefault();
$.ajax({
- url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=facilityManagement&option=' + thisOption,
+ url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=facilityManagement',
type: $(this).attr("method"),
dataType: 'html',
data: new FormData(this),
var status = data.charAt(0);
var html = data.substring(1);
- // If all is good add this facility to the top of the list for now
+ // If all is good add this facility to the top of the list for now or update if updating
if (status == 0) {
editFlag = false;
$('#facility_' + facilityHoverId).html(html);
$('#assetsDialog').dialog('close');
}
+
+ assetsFlashNotice($('#facility_' + facilityHoverId));
}
// if status....
});
});
- function flashNotice(notice) {
- notice.fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+ function assetsFlashNotice(notice) {
+ notice.fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500);
}
});