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( + '
\ + Help\ +
'); + $('#fields_help').click(function() { + var d = new wn.widgets.Dialog({ + title: 'Help: Field Properties', + width: 600 + }); + + var help = + "\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
LabelSet the display label for the field
OptionsSpecify 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\ +
ReqdMark the field as Mandatory
In FilterUse the field to filter records
HiddenHide field in form
Print HideHide field in Standard Print Format
Report HideHide field in Report Builder
Allow on SubmitAllow 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.\ +
DescriptionShow a description below the field
DefaultSpecify a default value
Press Esc to close\ +
" + + $y(d.body, {padding: '32px', textAlign: 'center', lineHeight: '200%'}); + + $a(d.body, 'div', '', {textAlign: 'left'}, help); + + d.show(); + + cur_frm.fields_help_dialog = d; + + }); +} diff --git a/py/core/doctype/doclayer/doclayer.txt b/py/core/doctype/doclayer/doclayer.txt index 57638c65b5..699b734b84 100644 --- a/py/core/doctype/doclayer/doclayer.txt +++ b/py/core/doctype/doclayer/doclayer.txt @@ -5,14 +5,14 @@ { 'creation': '2011-11-16 16:09:34', 'docstatus': 0, - 'modified': '2011-11-23 13:49:21', + 'modified': '2011-11-23 18:01:26', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1322036338', + '_last_update': '1322050979', 'autoname': 'DL.####', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -23,7 +23,7 @@ 'search_fields': 'doc_type', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 40 + 'version': 74 }, # These values are common for all DocField @@ -79,7 +79,7 @@ 'doctype': 'DocField', 'fieldname': 'doc_type', 'fieldtype': 'Select', - 'label': 'Type', + 'label': 'Select Form Type', 'options': 'Link:DocType', 'permlevel': 0 }, @@ -105,13 +105,14 @@ 'doctype': 'DocField', 'fieldname': 'autoname', 'fieldtype': 'Data', + 'hidden': 1, 'label': 'Auto Name', - 'permlevel': 0 + 'permlevel': 2 }, # DocField { - 'description': 'Fields separated by comma (,) will be included in the Search By list of Search dialog box', + 'description': 'Fields separated by comma (,) will be included in the
Search By list of Search dialog box', 'doctype': 'DocField', 'fieldname': 'search_fields', 'fieldtype': 'Data', @@ -185,6 +186,7 @@ # DocField { + 'description': 'Note: maximum attachment size = 1mb', 'doctype': 'DocField', 'fieldname': 'allow_attach', 'fieldtype': 'Check', diff --git a/py/webnotes/model/doctype.py b/py/webnotes/model/doctype.py index b57b2d6514..9be2666117 100644 --- a/py/webnotes/model/doctype.py +++ b/py/webnotes/model/doctype.py @@ -235,7 +235,7 @@ class _DocType: # override properties in the main doctype if dt in property_dict: - for p in property_dict[self.name]: + for p in property_dict[dt]: doclist[0].fields[p['property']] = p['value']