ns-export
Version:
Export Record Type metadata to JSON
342 lines (302 loc) • 12.7 kB
HTML
<html>
<head>
<link href="../../jquery-ui.css" rel="stylesheet">
<link href="../../schema-browser.css" rel="stylesheet">
<script src="../../javascript/jquery-1.10.2.min.js"></script>
<script src="../../javascript/jquery-ui.min.js"></script>
<script src="../../menudefs.js"></script>
<script src="../../javascript/menubuilder.js"></script>
<script>
(function( $ ){
//plugin buttonset vertical
$.fn.buttonsetv = function() {
$(':radio, :checkbox, :button', this).wrap('<div style="margin: 1px"/>');
$(this).buttonset();
$('label:first', this).removeClass('ui-corner-left').addClass('ui-corner-top');
$('label:last', this).removeClass('ui-corner-right').addClass('ui-corner-bottom');
mw = 0; // max witdh
$('label', this).each(function(index){
w = $(this).width();
if (w > mw) mw = w;
})
$('label', this).each(function(index){
$(this).width(mw);
})
};
})( jQuery );
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
</script>
<style>
.custom-combobox {
position: relative;
display: inline-block;
}
.custom-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
/* support: IE7 */
*height: 1.7em;
*top: 0.1em;
}
.custom-combobox-input {
margin: 0;
padding: 0.3em;
}
</style>
<script>
(function( $ ) {
$.widget( "custom.combobox_with_optgroup", {
_create: function() {
this.wrapper = $( "<span>" )
.addClass( "custom-combobox" )
.insertAfter( this.element );
this.element.hide();
this._createAutocomplete();
this._createShowAllButton();
},
_createAutocomplete: function() {
var selected = this.element.find( ":selected" ),
value = selected.val() ? selected.text() : "";
this.input = $( "<input>" )
.appendTo( this.wrapper )
.val( value )
.attr( "title", "" )
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
.autocomplete({
delay: 0,
minLength: 0,
source: $.proxy( this, "_source" )
})
.tooltip({
tooltipClass: "ui-state-highlight"
})
;
this._on( this.input, {
autocompleteselect: function( event, ui ) {
ui.item.option.selected = true;
window.location.href=ui.item.href;
// this._trigger( "select", event, {
// item: ui.item.option
// });
},
autocompletechange: "_removeIfInvalid"
});
this.input.data("uiAutocomplete")._renderMenu = function(ul, items) {
var self = this,
currentCategory = "";
var itemCounter=100;
$.each(items, function(index, item) {
itemCounter=itemCounter+1;
if (item.category != currentCategory) {
if (item.category) {
ul.append("<li class='custom-autocomplete-category'>" + item.category + "</li>");
}
currentCategory = item.category;
}
self._renderItem= function( ul, item ) {
return $( "<li>").attr("class",item.class)
.append( $( "<a>" ).attr("href",item.href).text( item.label ) )
.appendTo( ul );
};
self._renderItemData(ul, item);
});
};
},
_createShowAllButton: function() {
var input = this.input,
wasOpen = false;
$( "<a>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All" )
.tooltip()
.appendTo( this.wrapper )
.button({
/* icons: {
primary: "ui-icon-triangle-1-s"
},*/
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "custom-combobox-toggle ui-corner-right" )
.mousedown(function() {
wasOpen = input.autocomplete( "widget" ).is( ":visible" );
})
.click(function() {
input.focus();
if ( wasOpen ) {
return;
}
input.autocomplete( "search", "" );
});
},
_source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( this.element.find( "option" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text,
value: text,
option: this,
class: $(this).attr("class"),
href: $(this).attr("href"),
category: $(this).closest("optgroup").attr("label")
};
}) );
},
_removeIfInvalid: function( event, ui ) {
if ( ui.item ) {
return;
}
var value = this.input.val(),
valueLowerCase = value.toLowerCase(),
valid = false;
this.element.find( "option" ).each(function() {
if ( $( this ).text().toLowerCase() === valueLowerCase ) {
this.selected = valid = true;
return false;
}
});
if ( valid ) {
return;
}
this.input
.val( "" )
.attr( "title", value + " not found" )
.tooltip( "open" );
this.element.val( "" );
this._delay(function() {
this.input.tooltip( "close" ).attr( "title", "" );
}, 2500 );
this.input.data( "ui-autocomplete" ).term = "";
},
_destroy: function() {
this.wrapper.remove();
this.element.show();
},
getInput: function(){
return this.input;
}
});
})( jQuery );
</script>
</head>
<body>
<div id='header'></div>
<script>
$(function() {
$('#header').html(createHeader('script','record__pricelevel','../..'));
});
</script>
<div id='leftpanel'></div>
<script>
$(function() {
$('#leftpanel').html(createLeftPanel('script','record__pricelevel','../..'));
});
</script>
<script type="text/javascript">
$().ready(function(){
$(".jtable th").each(function(){
$(this).addClass("ui-state-default");
});
$(".jtable td").each(function(){
$(this).addClass("ui-widget-content");
});
});
</script>
<div id="contentPanel">
<H1>Price Level</H1>
<H3>Internal ID: pricelevel</H3>
<H2>Fields</H2>
<table class="jtable">
<tr><th class="rt_fname">Internal ID</th><th class="rt_ftype">Type</th><th class="rt_fdle">nlapiSubmitField</th><th class="rt_flabel">Label</th><th class="rt_freq">Required</th><th class="rt_fhelp">Help</th></tr>
<tr id="field_discountpct">
<td class="rt_fname">discountpct</td>
<td class="rt_ftype">percent</td>
<td class="rt_fdle">false</td>
<td class="rt_flabel">Markup/Discount %</td>
<td class="rt_freq">false</td>
<td class="rt_fhelp">If you like, enter a positive or negative percentage to mark up or discount prices for this price level.
Prices for this level are calculated by applying the positive or negative percentage to the Base Price level.
If you want to update all items using this price level, you must also check the Update Existing Prices box.
After you click Save, your prices automatically update.
Note: Any value you enter is rounded to the nearest 0.01% </td>
</tr>
<tr id="field_externalid">
<td class="rt_fname">externalid</td>
<td class="rt_ftype">text</td>
<td class="rt_fdle">false</td>
<td class="rt_flabel">ExternalId</td>
<td class="rt_freq">false</td>
<td class="rt_fhelp"></td>
</tr>
<tr id="field_isinactive">
<td class="rt_fname">isinactive</td>
<td class="rt_ftype">checkbox</td>
<td class="rt_fdle">false</td>
<td class="rt_flabel">Inactive</td>
<td class="rt_freq">false</td>
<td class="rt_fhelp"></td>
</tr>
<tr id="field_isonline">
<td class="rt_fname">isonline</td>
<td class="rt_ftype">checkbox</td>
<td class="rt_fdle">false</td>
<td class="rt_flabel">Online Price Level</td>
<td class="rt_freq">false</td>
<td class="rt_fhelp"></td>
</tr>
<tr id="field_name">
<td class="rt_fname">name</td>
<td class="rt_ftype">text</td>
<td class="rt_fdle">false</td>
<td class="rt_flabel">Price Level</td>
<td class="rt_freq">true</td>
<td class="rt_fhelp">Enter the name for this category, group, method, message, status, type or term.</td>
</tr>
<tr id="field_updateexistingprices">
<td class="rt_fname">updateexistingprices</td>
<td class="rt_ftype">checkbox</td>
<td class="rt_fdle">false</td>
<td class="rt_flabel">Update Existing Prices</td>
<td class="rt_freq">false</td>
<td class="rt_fhelp"></td>
</tr>
</table>
<H2>Search Filters</H2>
<table class="jtable">
<tr><th class="rt_iname">Internal ID</th><th class="rt_itype">Type</th><th class="rt_ilabel">Label</th></tr>
<tr>
<td class="rt_iname">externalid</td>
<td class="rt_itype">select</td>
<td class="rt_ilabel">External ID</td>
</tr>
<tr>
<td class="rt_iname">externalidstring</td>
<td class="rt_itype">text</td>
<td class="rt_ilabel">External ID (Text)</td>
</tr>
</table>
<H2>Search Columns</H2>
<table class="jtable">
<tr><th class="rt_cname">Internal ID</th><th class="rt_ctype">Type</th><th class="rt_clabel">Label</th></tr>
<tr>
<td class="rt_cname">externalid</td>
<td class="rt_ctype">select</td>
<td class="rt_clabel">External ID</td>
</tr>
</table>
<p> </p>
</div>
<script>
$(function() {
wrapBodyDiv('script','contentPanel');
});
</script>
</body>
</html>