diff --git a/py/core/doctype/doclayer/doclayer.js b/py/core/doctype/doclayer/doclayer.js index c453f58dfd..c71c310fc0 100644 --- a/py/core/doctype/doclayer/doclayer.js +++ b/py/core/doctype/doclayer/doclayer.js @@ -13,6 +13,8 @@ cur_frm.cscript.onload = function(doc, dt, dn) { p = cur_frm.grids[0].grid.tbar_tab.children[0].children[0]; p.removeChild(p.children[0]) p.removeChild(p.children[0]) + cur_frm.tip_wrapper.id = 'tip_wrapper'; + cur_frm.add_fields_help(); } cur_frm.cscript.refresh = function(doc, dt, dn) { @@ -20,10 +22,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.frm_head.timestamp_area.hidden = true; cur_frm.frm_head.page_head.buttons.Save.hidden = true; cur_frm.page_layout.footer.hidden = true; - cur_frm.tip_wrapper.id = 'tip_wrapper'; if(doc.doc_type) { $('#tip_wrapper').slideUp('slow'); } - cur_frm.add_custom_button('Update', function() { if(cur_frm.fields_dict['doc_type'].value) { $c_obj(make_doclist(dt, dn), 'post', '', function(r, rt) { @@ -51,7 +51,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { }, 1); if(!doc.doc_type) { - cur_frm.set_tip('You can start by selecting a Type from the drop down menu') + cur_frm.set_tip('You can start by selecting a Form Type from the drop down menu') $('#tip_wrapper').fadeIn(); var page_head = cur_frm.frm_head.page_head; page_head.buttons['Update'].disabled = true; @@ -60,6 +60,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } } + cur_frm.confirm = function(msg, doc, dt, dn) { var d = new wn.widgets.Dialog({ title: 'Reset To Defaults', @@ -101,3 +102,100 @@ cur_frm.confirm = function(msg, doc, dt, dn) { cur_frm.confirm.dialog = d; d.show(); } + + +cur_frm.add_fields_help = function() { + $(cur_frm.grids[0].parent).before( + '
| Label | \ +Set the display label for the field | \ +
| Options | \ +Specify the value of the field | \ +
| Perm Level | \ +\
+ Assign a permission level to the field. \ + (Permissions can be managed via Setup > Permission Manager)\ + | \
+
| Width | \ +\
+ Width of the input box \ + Example: 120px\ + | \
+
| Reqd | \ +Mark the field as Mandatory | \ +
| In Filter | \ +Use the field to filter records | \ +
| Hidden | \ +Hide field in form | \ +
| Print Hide | \ +Hide field in Standard Print Format | \ +
| Report Hide | \ +Hide field in Report Builder | \ +
| Allow on Submit | \ +Allow field to remain editable even after submission | \ +
| Depends On | \ +\
+ Show field if a condition is met \ + Example: eval:doc.status=='Cancelled'\
+ on a field like \"reason_for_cancellation\" will reveal \
+ \"Reason for Cancellation\" only if the record is Cancelled.\
+ | \
+
| Description | \ +Show a description below the field | \ +
| Default | \ +Specify a default value | \ +
| \ + | Press Esc to close\ + | \ +