Permalink
Browse files

fixed context menu for forms

  • Loading branch information...
jaradatnubuilder committed Oct 27, 2016
1 parent 7ca0d44 commit 86863181ea95929d3340c16d67a021d0e24ecfec
Showing with 37 additions and 38 deletions.
  1. +1 −1 nuajax.js
  2. +0 −1 nuapi.php
  3. +1 −1 nucommon.php
  4. +32 −32 nuform.js
  5. +2 −2 nuform.php
  6. +1 −1 nusqlclass.php
@@ -22,7 +22,7 @@ function nuAjax(w,successCallback,errorCallback) {
errorLog[0][0] = jqXHR.responseText;
errorLog[0][1] = "";
errorLog[0][2] = 0;
nuPopup("nuerror", "-1", errorLog);
if (errorCallback !== undefined) {
@@ -9,7 +9,6 @@
if(!isset($_SESSION['SESSIONID'])){
$_SESSION['SESSIONID'] = nuID();
}
nudebug('call ' . $P['call_type'] . ' ' . print_r($_POST['nuSTATE'],1));
$_POST['nuErrors'] = array();
$s = nuCheckSession();
@@ -1026,7 +1026,7 @@ function nuAddToHashList($J, $run){
$ignore[] = 'sre_layout';
$ignore[] = 'slp_php';
$ignore[] = 'sre_php';
nudebug('jjj ' . print_r($J,1));
foreach($J as $key => $v){ //-- add current hash variables
if(!in_array($key, $ignore)){
@@ -52,7 +52,8 @@ function nuBuildForm(f){
nuAddHolder('nuRecordHolder');
nuAddBreadcrumbs();
nuAddEditTabs('', f);
nuOptions('nuTabHolder', f.form_id, f.global_access);
nuOptions('', f.form_id, 'form', f.global_access);
nuAddActionButtons(f);
nuRecordProperties(f, '');
@@ -772,7 +773,7 @@ function nuSUBFORM(w, i, l, p, prop){
$('#' + id).append(tabDiv);
$('#' + tabId).css({'top' : 0,
'left' : 0,
'width' : rowWidth - 45,
'width' : rowWidth,
'height' : rowTop,
'overflow-x' : 'hidden',
'overflow-y' : 'hidden',
@@ -784,7 +785,7 @@ function nuSUBFORM(w, i, l, p, prop){
}
nuOptions(id, SF.sf_form_id, w.global_access);
nuOptions(id, SF.sf_form_id, 'subform', w.global_access);
var scrId = id + 'scrollDiv';
var scrDiv = document.createElement('div');
@@ -1090,7 +1091,7 @@ function nuAddEditTabs(p, w){
if(w.browse_columns.length > 0){
nuBrowseTable();
nuOptions('nuBrowseTitle' + (w.browse_columns.length - 1), w.form_id, w.global_access);
nuOptions('nuBrowseTitle' + (w.browse_columns.length - 1), w.form_id, 'browse', w.global_access);
}
@@ -1194,24 +1195,23 @@ function nuEditTab(p, t, i){
}
function nuOptions(p, f, access){
function nuOptions(p, f, t, access){
// var icon = $('#' + t.id);
// var off = icon.offset();
// var top = off.top;
// var left = off.left;
var R = window.nuFORM.current.record_id;
if(R != '-2') {
var id = p + 'nuOptions';
var id = 'nuOptions';
var img = document.createElement('img');
img.setAttribute('id', id);
$('#' + p).append(img);
if(t == 'browse') {
$('#' + p).append(img);
} else {
$('#' + p + 'nuTabHolder').append(img);
}
$('#' + id)
.attr('src', 'nuoptions.png')
.attr('title', 'Options')
@@ -1227,23 +1227,21 @@ function nuOptions(p, f, access){
}, function(){
$( this ).attr('src', 'nuoptions.png');
});
if(R == ''){
// if(p == 'nuTabHolder'){
$('#' + id)
.css('top', 0)
.css('right', 0);
}else{
if(t == 'form'){
$('#' + id)
.css('top', 66)
.css('right', 10);
} else {
$('#' + id)
.css('top', 0)
.css('right', 0);
}
}
}
function nuGetOptionsList(f, t, p, a){
var icon = $('#' + t.id);
@@ -1270,6 +1268,11 @@ function nuGetOptionsList(f, t, p, a){
}
//hide all other listboxes
$('#nuOptionsListBox').remove();
$('.nuIframe').contents().find('#nuOptionsListBox').remove();
$('#nuOptionsListBox', window.parent.document).remove();
var id = 'nuOptionsListBox';
var div = document.createElement('div');
@@ -1312,14 +1315,14 @@ function nuGetOptionsList(f, t, p, a){
.html('X')
.addClass('nuSearchListClose');
nuBuildOptionsList(list);
nuBuildOptionsList(list, p);
}
function nuBuildOptionsList(l){ //-- loop through adding options to menu
function nuBuildOptionsList(l, p){ //-- loop through adding options to menu
var icon = $('#nuOptions');
var icon = $('#' + p + 'nuOptions');
var off = icon.offset();
var top = off.top;
var left = off.left;
@@ -1334,10 +1337,10 @@ function nuBuildOptionsList(l){ //-- loop through adding options to m
for(var i = 0 ; i < l.length ; i++){
var t = l[i][0];
var f = l[i][1];
var c = l[i][2];
var top = 30 + (i * 20);
var t = l[i][0];
var f = l[i][1];
var c = l[i][2];
var itemtop = 30 + (i * 20);
var icon = document.createElement('img');
var icon_id = 'nuOptionList' + i.toString();
@@ -1348,13 +1351,10 @@ function nuBuildOptionsList(l){ //-- loop through adding options to m
$('#' + icon.id)
.css(prop)
.css({'top' : top, 'left' : 5, 'width' : 15, 'height' : 15})
.css({'top' : itemtop, 'left' : 5, 'width' : 15, 'height' : 15})
.attr('onclick', f)
.attr('src', c);
var desc = document.createElement('div');
var desc_id = 'nuOptionText' + i.toString();
@@ -1364,7 +1364,7 @@ function nuBuildOptionsList(l){ //-- loop through adding options to m
$('#' + desc.id)
.css(prop)
.css({'top' : top,'left' : 30})
.css({'top' : itemtop,'left' : 30})
.html(t)
.attr('onclick', f)
.addClass('nuOptionsItem');
@@ -377,7 +377,7 @@ function nuBreadcrumbDescription($r, $R){
if($R == '') {return $r->sfo_description;} //-- Browse Form
if($R == '-1'){return $r->sfo_description;} //-- new record
if(trim($r->sfo_breadcrumb_title) == '') {return $r->sfo_description;} //-- no breadcrumb
nudebug(print_r($_POST['nuHash'],1));
return nuReplaceHashVariables($r->sfo_breadcrumb_title);
@@ -501,7 +501,7 @@ function nuSelectOptions($sql) {
} else { //-- comma delimited string
$t = explode('|', nuRemoveNonCharacters($sql));
nudebug(print_r($t,1));
for ($i = 0; $i < count($t); $i++) {
$r = array();
@@ -124,7 +124,7 @@ function test111(){
$SQL->addBracketsToWhere();
print $SQL->SQL() . '<br><br><br>';
$Q = new nuSqlClass($SQL->SQL());
nudebug(print_r($Q,1));
print $Q->SQL() . '<br><br><br>';
}

0 comments on commit 8686318

Please sign in to comment.