Merge branch 'master' of github.com:webnotes/wnframework
This commit is contained in:
commit
2c8c0c93fe
8 changed files with 200 additions and 522 deletions
|
|
@ -5,25 +5,22 @@
|
|||
{
|
||||
'creation': '2009-05-12 11:19:11',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-12-21 11:07:20',
|
||||
'modified_by': 'sneha@webnotestech.com',
|
||||
'modified': '2011-08-25 14:02:26',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1303708853',
|
||||
'_last_update': '1311340897',
|
||||
'allow_attach': 1,
|
||||
'allow_copy': 0,
|
||||
'allow_email': 0,
|
||||
'allow_print': 0,
|
||||
'client_script': 'cur_frm.cscript[\'Change Password\']= function(doc, cdt, cdn) {\n var error = false;\n if ((!doc.new_password)||(!doc.retype_new_password)){\n alert("Both fields are required!");\n error = true;\n }\n if (doc.new_password.length<4) {\n alert("Password must be atleast 4 characters long");\n error = true;\n }\n if(doc.new_password!=doc.retype_new_password) {\n alert("Passwords must match");\n error = true;\n }\n if(!/[A-Z]/.test(doc.new_password) || !/[0-9]/.test(doc.new_password) || !/[\\W_]/.test(doc.new_password)) {\n msgprint(\'New password must contain atleast 1 capital letter, 1 numeric and 1 special character.\');\n error = true;\n doc.new_password = \'\';\n refresh_field(\'new_password\');\n }\n if(!error) {\n cur_frm.runscript(\'update_password\', \'\', function(r,t) {\n\tdoc.new_password = \'\';\n\tdoc.retype_new_password = \'\';\n refresh_many([\'new_password\',\'retype_new_password\']);\n });\n }\n}\n\ncur_frm.cscript.validate = function(doc, cdt, cdn) {\n doc.new_password = \'\';\n doc.retype_new_password = \'\';\n}',
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocType',
|
||||
'hide_heading': 0,
|
||||
'hide_toolbar': 0,
|
||||
'idx': 0,
|
||||
'in_create': 1,
|
||||
'issingle': 0,
|
||||
'istable': 0,
|
||||
'max_attachments': 1,
|
||||
|
|
@ -31,10 +28,9 @@
|
|||
'name': '__common__',
|
||||
'print_outline': 'Yes',
|
||||
'read_only': 0,
|
||||
'section_style': 'Tray',
|
||||
'server_code_error': ' ',
|
||||
'search_fields': 'first_name, last_name',
|
||||
'show_in_menu': 0,
|
||||
'version': 25
|
||||
'version': 32
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
|
|
@ -69,7 +65,6 @@
|
|||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': 0,
|
||||
'idx': 1,
|
||||
'permlevel': 0,
|
||||
'role': 'Administrator',
|
||||
'submit': 0
|
||||
|
|
@ -79,7 +74,6 @@
|
|||
{
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 2,
|
||||
'permlevel': 0,
|
||||
'role': 'System Manager'
|
||||
},
|
||||
|
|
@ -87,7 +81,6 @@
|
|||
# DocPerm
|
||||
{
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 3,
|
||||
'permlevel': 1,
|
||||
'role': 'Administrator'
|
||||
},
|
||||
|
|
@ -95,67 +88,17 @@
|
|||
# DocPerm
|
||||
{
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 4,
|
||||
'match': 'owner',
|
||||
'permlevel': 0,
|
||||
'role': 'All'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'hidden': 0,
|
||||
'idx': 1,
|
||||
'label': 'Details',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'hidden': 0,
|
||||
'idx': 2,
|
||||
'label': 'Picture',
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Image',
|
||||
'idx': 3,
|
||||
'label': 'Profile Picture',
|
||||
'oldfieldtype': 'Image',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 4,
|
||||
'label': 'Contact',
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'default': '1',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'enabled',
|
||||
'fieldtype': 'Check',
|
||||
'idx': 5,
|
||||
'label': 'Enabled',
|
||||
'oldfieldname': 'enabled',
|
||||
'oldfieldtype': 'Check',
|
||||
|
|
@ -164,24 +107,40 @@
|
|||
|
||||
# DocField
|
||||
{
|
||||
'default': '1',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'send_email_invite',
|
||||
'fieldname': 'password',
|
||||
'fieldtype': 'Password',
|
||||
'label': 'Password',
|
||||
'permlevel': 1,
|
||||
'hidden': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'registered',
|
||||
'fieldtype': 'Check',
|
||||
'idx': 6,
|
||||
'label': 'Send Email Invite',
|
||||
'oldfieldname': 'send_email_invite',
|
||||
'oldfieldtype': 'Check',
|
||||
'permlevel': 1
|
||||
'label': 'Registered',
|
||||
'permlevel': 0,
|
||||
'hidden': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'unsubscribed',
|
||||
'fieldtype': 'Check',
|
||||
'label': 'Unsubscribed',
|
||||
'permlevel': 0,
|
||||
'hidden': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'recent_documents',
|
||||
'fieldtype': 'Text',
|
||||
'hidden': 1,
|
||||
'idx': 8,
|
||||
'label': 'Recent Documents',
|
||||
'oldfieldname': 'recent_documents',
|
||||
'oldfieldtype': 'Text',
|
||||
|
|
@ -195,7 +154,6 @@
|
|||
'doctype': 'DocField',
|
||||
'fieldname': 'first_name',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 9,
|
||||
'label': 'First Name',
|
||||
'oldfieldname': 'first_name',
|
||||
'oldfieldtype': 'Data',
|
||||
|
|
@ -208,7 +166,6 @@
|
|||
'doctype': 'DocField',
|
||||
'fieldname': 'middle_name',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 10,
|
||||
'label': 'Middle Name (Optional)',
|
||||
'oldfieldname': 'middle_name',
|
||||
'oldfieldtype': 'Data',
|
||||
|
|
@ -220,46 +177,17 @@
|
|||
'doctype': 'DocField',
|
||||
'fieldname': 'last_name',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 11,
|
||||
'label': 'Last Name',
|
||||
'oldfieldname': 'last_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'email',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 12,
|
||||
'label': 'Email',
|
||||
'oldfieldname': 'email',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'birth_date',
|
||||
'fieldtype': 'Date',
|
||||
'idx': 13,
|
||||
'label': 'Birth Date',
|
||||
'oldfieldname': 'birth_date',
|
||||
'oldfieldtype': 'Date',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'gender',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 14,
|
||||
'label': 'Gender',
|
||||
'oldfieldname': 'gender',
|
||||
'oldfieldtype': 'Select',
|
||||
|
|
@ -271,51 +199,74 @@
|
|||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'occupation',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 15,
|
||||
'label': 'Designation',
|
||||
'oldfieldname': 'occupation',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0,
|
||||
'search_index': 0
|
||||
'fieldtype': 'Column Break',
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 1,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'email',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'label': 'Email',
|
||||
'oldfieldname': 'email',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'bio',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 16,
|
||||
'label': 'Bio',
|
||||
'oldfieldname': 'bio',
|
||||
'oldfieldtype': 'Text',
|
||||
'permlevel': 0,
|
||||
'search_index': 0
|
||||
'search_index': 0,
|
||||
'hidden': 1
|
||||
},
|
||||
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'interests',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 17,
|
||||
'label': 'Interests',
|
||||
'oldfieldname': 'interests',
|
||||
'oldfieldtype': 'Text',
|
||||
'permlevel': 0,
|
||||
'hidden': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'birth_date',
|
||||
'fieldtype': 'Date',
|
||||
'label': 'Birth Date',
|
||||
'oldfieldname': 'birth_date',
|
||||
'oldfieldtype': 'Date',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'activities',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 18,
|
||||
'label': 'Activities',
|
||||
'oldfieldname': 'activities',
|
||||
'oldfieldtype': 'Text',
|
||||
'permlevel': 0
|
||||
'permlevel': 0,
|
||||
'hidden': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
|
|
@ -323,7 +274,6 @@
|
|||
'doctype': 'DocField',
|
||||
'fieldname': 'messanger_status',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 19,
|
||||
'label': 'Messanger Status',
|
||||
'oldfieldname': 'messanger_status',
|
||||
'oldfieldtype': 'Data',
|
||||
|
|
@ -331,60 +281,11 @@
|
|||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'home_phone',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 20,
|
||||
'label': 'Home Phone',
|
||||
'oldfieldname': 'home_phone',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'office_phone',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 21,
|
||||
'label': 'Office Phone',
|
||||
'oldfieldname': 'office_phone',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'extension',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 22,
|
||||
'label': 'Extension',
|
||||
'oldfieldname': 'extension',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'cell_no',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 23,
|
||||
'label': 'Cell No',
|
||||
'oldfieldname': 'cell_no',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'user_type',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 24,
|
||||
'label': 'User Type',
|
||||
'oldfieldname': 'user_type',
|
||||
'oldfieldtype': 'Select',
|
||||
|
|
@ -392,150 +293,27 @@
|
|||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'last_login',
|
||||
'fieldtype': 'Read Only',
|
||||
'hidden': 0,
|
||||
'idx': 25,
|
||||
'label': 'Last Login',
|
||||
'oldfieldname': 'last_login',
|
||||
'oldfieldtype': 'Read Only',
|
||||
'permlevel': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'last_ip',
|
||||
'fieldtype': 'Read Only',
|
||||
'idx': 26,
|
||||
'label': 'Last IP',
|
||||
'oldfieldname': 'last_ip',
|
||||
'oldfieldtype': 'Read Only',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 27,
|
||||
'label': 'Address',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'line_1',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 28,
|
||||
'label': 'Line 1',
|
||||
'oldfieldname': 'line_1',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'line_2',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 29,
|
||||
'label': 'Line 2',
|
||||
'oldfieldname': 'line_2',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'city',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 30,
|
||||
'label': 'City / Town',
|
||||
'oldfieldname': 'city',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'district',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 31,
|
||||
'label': 'District',
|
||||
'oldfieldname': 'district',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'state',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 32,
|
||||
'label': 'State',
|
||||
'oldfieldname': 'state',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'country',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 33,
|
||||
'label': 'Country',
|
||||
'oldfieldname': 'country',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'pin',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 34,
|
||||
'label': 'Pin',
|
||||
'oldfieldname': 'pin',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 35,
|
||||
'label': 'User Role',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'hidden': 0,
|
||||
'idx': 36,
|
||||
'label': 'Roles',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 1,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'label': 'Roles',
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 1,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
|
|
@ -545,7 +323,6 @@
|
|||
'fieldname': 'userroles',
|
||||
'fieldtype': 'Table',
|
||||
'hidden': 0,
|
||||
'idx': 37,
|
||||
'label': 'User Roles',
|
||||
'oldfieldname': 'userroles',
|
||||
'oldfieldtype': 'Table',
|
||||
|
|
@ -558,10 +335,9 @@
|
|||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 38,
|
||||
'fieldtype': 'Column Break',
|
||||
'label': 'System Defaults',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 1,
|
||||
'width': '50%'
|
||||
},
|
||||
|
|
@ -574,7 +350,6 @@
|
|||
'fieldname': 'defaults',
|
||||
'fieldtype': 'Table',
|
||||
'hidden': 0,
|
||||
'idx': 39,
|
||||
'label': 'Defaults',
|
||||
'oldfieldname': 'defaults',
|
||||
'oldfieldtype': 'Table',
|
||||
|
|
@ -588,9 +363,35 @@
|
|||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 40,
|
||||
'label': 'Password',
|
||||
'label': 'Login Details',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0,
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'login_before',
|
||||
'fieldtype': 'Int',
|
||||
'label': 'Login Before',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'login_after',
|
||||
'fieldtype': 'Int',
|
||||
'label': 'Login After',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'restrict_ip',
|
||||
'fieldtype': 'Data',
|
||||
'label': 'Restrict IP',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
|
@ -598,25 +399,20 @@
|
|||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 41,
|
||||
'label': 'Change Your Password',
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 1,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'Pink:FEF2EA',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'password',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 1,
|
||||
'idx': 42,
|
||||
'label': 'Current Password',
|
||||
'oldfieldname': 'password',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 1,
|
||||
'fieldname': 'last_login',
|
||||
'fieldtype': 'Read Only',
|
||||
'hidden': 0,
|
||||
'label': 'Last Login',
|
||||
'oldfieldname': 'last_login',
|
||||
'oldfieldtype': 'Read Only',
|
||||
'permlevel': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
|
@ -624,139 +420,23 @@
|
|||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'new_password',
|
||||
'fieldtype': 'Password',
|
||||
'idx': 43,
|
||||
'label': 'New Password',
|
||||
'oldfieldname': 'new_password',
|
||||
'oldfieldtype': 'Password',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'retype_new_password',
|
||||
'fieldtype': 'Password',
|
||||
'idx': 44,
|
||||
'label': 'Retype New Password',
|
||||
'oldfieldname': 'retype_new_password',
|
||||
'oldfieldtype': 'Password',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'password_last_updated',
|
||||
'fieldtype': 'Date',
|
||||
'hidden': 1,
|
||||
'idx': 45,
|
||||
'label': 'Password Last Updated',
|
||||
'oldfieldname': 'password_last_updated',
|
||||
'oldfieldtype': 'Date',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 46,
|
||||
'label': 'Change Password',
|
||||
'oldfieldtype': 'Button',
|
||||
'permlevel': 1,
|
||||
'trigger': 'Client',
|
||||
'width': '120px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 47,
|
||||
'label': 'Attachment',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'default': '0',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'social_points',
|
||||
'fieldtype': 'Int',
|
||||
'idx': 48,
|
||||
'label': 'Social Points',
|
||||
'oldfieldname': 'social_points',
|
||||
'oldfieldtype': 'Int',
|
||||
'fieldname': 'last_ip',
|
||||
'fieldtype': 'Read Only',
|
||||
'label': 'Last IP',
|
||||
'oldfieldname': 'last_ip',
|
||||
'oldfieldtype': 'Read Only',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'social_badge',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 49,
|
||||
'label': 'Social Badge',
|
||||
'oldfieldname': 'social_badge',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'avatar',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 50,
|
||||
'label': 'Avatar',
|
||||
'oldfieldname': 'avatar',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 51,
|
||||
'label': 'Attachment HTML',
|
||||
'oldfieldtype': 'HTML',
|
||||
'options': 'First attachment must be the picture',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'file_list',
|
||||
'fieldtype': 'Text',
|
||||
'hidden': 1,
|
||||
'idx': 52,
|
||||
'label': 'File List',
|
||||
'oldfieldname': 'file_list',
|
||||
'oldfieldtype': 'Text',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'fiscal_year',
|
||||
'fieldtype': 'Select',
|
||||
'hidden': 1,
|
||||
'idx': 53,
|
||||
'in_filter': 1,
|
||||
'label': 'Fiscal Year',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'fiscal_year',
|
||||
'oldfieldtype': 'Select',
|
||||
'options': 'link:Fiscal Year',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'report_hide': 1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -87,10 +87,13 @@
|
|||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 1,
|
||||
'label': 'Details',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'fieldname': 'criteria_name',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 5,
|
||||
'label': 'Criteria Name',
|
||||
'oldfieldname': 'criteria_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
|
@ -135,41 +138,6 @@
|
|||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'criteria_name',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 5,
|
||||
'label': 'Criteria Name',
|
||||
'oldfieldname': 'criteria_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'description',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 6,
|
||||
'label': 'Description',
|
||||
'oldfieldname': 'description',
|
||||
'oldfieldtype': 'Text',
|
||||
'permlevel': 0,
|
||||
'width': '300px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 7,
|
||||
'label': 'Query Details',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
|
|
@ -189,7 +157,7 @@
|
|||
'doctype': 'DocField',
|
||||
'fieldname': 'filters',
|
||||
'fieldtype': 'Text',
|
||||
'hidden': 0,
|
||||
'hidden': 1,
|
||||
'idx': 9,
|
||||
'label': 'Filters',
|
||||
'oldfieldname': 'filters',
|
||||
|
|
@ -288,32 +256,6 @@
|
|||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'graph_series',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 17,
|
||||
'label': 'Graph Series',
|
||||
'oldfieldname': 'graph_series',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'graph_values',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 18,
|
||||
'label': 'Graph Values',
|
||||
'oldfieldname': 'graph_values',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
|
|
|
|||
|
|
@ -127,8 +127,9 @@ class LoginManager:
|
|||
# ---------------------------
|
||||
|
||||
def post_login(self):
|
||||
self.validate_ip_address()
|
||||
self.run_trigger()
|
||||
self.validate_ip_address()
|
||||
self.validate_hour()
|
||||
|
||||
# check password
|
||||
# --------------
|
||||
|
|
@ -186,16 +187,38 @@ class LoginManager:
|
|||
# -------------
|
||||
|
||||
def validate_ip_address(self):
|
||||
try:
|
||||
ip = webnotes.conn.sql("select ip_address from tabProfile where name = '%s'" % self.user)[0][0] or ''
|
||||
except: return
|
||||
ip_list = webnotes.conn.get_value('Profile', self.user, 'restrict_ip', ignore=True)
|
||||
|
||||
if not ip_list:
|
||||
return
|
||||
|
||||
ip_list = ip_list.replace(",", "\n").split('\n')
|
||||
ip_list = [i.strip() for i in ip_list]
|
||||
|
||||
for ip in ip_list:
|
||||
if webnotes.remote_ip.startswith(ip):
|
||||
return
|
||||
|
||||
ip = ip.replace(",", "\n").split('\n')
|
||||
ip = [i.strip() for i in ip]
|
||||
webnotes.msgprint('Not allowed from this IP Address', raise_exception=1)
|
||||
|
||||
def validate_hour(self):
|
||||
"""
|
||||
check if user is logging in during restricted hours
|
||||
"""
|
||||
login_before = int(webnotes.conn.get_value('Profile', self.user, 'login_before', ignore=True) or 0)
|
||||
login_after = int(webnotes.conn.get_value('Profile', self.user, 'login_after', ignore=True) or 0)
|
||||
|
||||
if not (login_before or login_after):
|
||||
return
|
||||
|
||||
if ret and ip:
|
||||
if not (webnotes.remote_ip.startswith(ip[0]) or (webnotes.remote_ip in ip)):
|
||||
raise Exception, 'Not allowed from this IP Address'
|
||||
from webnotes.utils import now_datetime
|
||||
current_hour = int(now_datetime().strftime('%H'))
|
||||
|
||||
if login_before and current_hour > login_before:
|
||||
webnotes.msgprint('Not allowed to login after restricted hour', raise_exception=1)
|
||||
|
||||
if login_after and current_hour < login_after:
|
||||
webnotes.msgprint('Not allowed to login before restricted hour', raise_exception=1)
|
||||
|
||||
# login as guest
|
||||
# --------------
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ class Database:
|
|||
# ======================================================================================
|
||||
# get a single value from a record
|
||||
|
||||
def get_value(self, doctype, docname, fieldname):
|
||||
def get_value(self, doctype, docname, fieldname, ignore=None):
|
||||
"""
|
||||
Get a single / multiple value from a record.
|
||||
|
||||
|
|
@ -266,8 +266,13 @@ class Database:
|
|||
if docname and (docname!=doctype or docname=='DocType'):
|
||||
if type(fieldname) in (list, tuple):
|
||||
fl = '`, `'.join(fieldname)
|
||||
|
||||
r = self.sql("select `%s` from `tab%s` where name='%s'" % (fl, doctype, docname))
|
||||
try:
|
||||
r = self.sql("select `%s` from `tab%s` where name='%s'" % (fl, doctype, docname))
|
||||
except Exception, e:
|
||||
if e.args[0]==1054 and ignore:
|
||||
return None
|
||||
else:
|
||||
raise e
|
||||
return r and (len(r[0]) > 1 and r[0] or r[0][0]) or None
|
||||
else:
|
||||
if type(fieldname) in (list, tuple):
|
||||
|
|
|
|||
|
|
@ -186,9 +186,11 @@ def commonify_doclist(doclist, with_comments=1):
|
|||
c[k] = doclist[0][k]
|
||||
return c
|
||||
|
||||
def strip_common(d):
|
||||
def strip_common_and_idx(d):
|
||||
for k in common_keys:
|
||||
if k in d: del d[k]
|
||||
|
||||
if 'idx' in d: del d['idx']
|
||||
return d
|
||||
|
||||
def make_common_dicts(doclist):
|
||||
|
|
@ -211,7 +213,7 @@ def commonify_doclist(doclist, with_comments=1):
|
|||
# make docs
|
||||
final = []
|
||||
for d in doclist:
|
||||
f = strip_common(get_diff_dict(common_dict[d['doctype']], d))
|
||||
f = strip_common_and_idx(get_diff_dict(common_dict[d['doctype']], d))
|
||||
f['doctype'] = d['doctype'] # keep doctype!
|
||||
|
||||
# strip name for child records (only an auto generated number!)
|
||||
|
|
@ -228,7 +230,7 @@ def commonify_doclist(doclist, with_comments=1):
|
|||
d['name']='__common__'
|
||||
if with_comments:
|
||||
d['##comment'] = 'These values are common for all ' + d['doctype']
|
||||
commons.append(strip_common(d))
|
||||
commons.append(strip_common_and_idx(d))
|
||||
|
||||
common_values = make_common(doclist)
|
||||
return [common_values]+commons+final
|
||||
|
|
@ -237,18 +239,32 @@ def uncommonify_doclist(dl):
|
|||
"""
|
||||
Expands an commonified doclist
|
||||
"""
|
||||
# first one has common values
|
||||
common_values = dl[0]
|
||||
common_dict = {}
|
||||
final = []
|
||||
idx_dict = {}
|
||||
|
||||
for d in dl[1:]:
|
||||
if 'name' in d and d['name']=='__common__':
|
||||
# common for a doctype -
|
||||
del d['name']
|
||||
common_dict[d['doctype']] = d
|
||||
else:
|
||||
dt = d['doctype']
|
||||
if not dt in idx_dict: idx_dict[dt] = 0;
|
||||
d1 = common_values.copy()
|
||||
d1.update(common_dict[d['doctype']])
|
||||
|
||||
# update from common and global
|
||||
d1.update(common_dict[dt])
|
||||
d1.update(d)
|
||||
|
||||
# idx by sequence
|
||||
d1['idx'] = idx_dict[dt]
|
||||
|
||||
# increment idx
|
||||
idx_dict[dt] += 1
|
||||
|
||||
final.append(d1)
|
||||
|
||||
return final
|
||||
|
|
|
|||
|
|
@ -121,7 +121,8 @@ if(this.docname){if(!this.check_doc_perm())return;if(!this.setup_done)this.setup
|
|||
if(this.doc.__islocal)
|
||||
this.is_editable[this.docname]=1;this.editable=this.is_editable[this.docname];if(!this.doc.__archived&&(this.editable||(!this.editable&&this.meta.istable))){if(this.print_wrapper){$dh(this.print_wrapper);$ds(this.page_layout.wrapper);}
|
||||
if(!this.meta.istable){this.refresh_header();this.sidebar&&this.sidebar.refresh();}
|
||||
this.runclientscript('refresh');this.refresh_tabs();this.refresh_fields();this.refresh_dependency();this.refresh_footer();if(this.layout)this.layout.show();if(is_onload)
|
||||
this.runclientscript('refresh');$(document).trigger('form_refresh')
|
||||
this.refresh_tabs();this.refresh_fields();this.refresh_dependency();this.refresh_footer();if(this.layout)this.layout.show();if(is_onload)
|
||||
this.runclientscript('onload_post_render',this.doctype,this.docname);}else{this.refresh_header();if(this.print_wrapper){this.refresh_print_layout();}
|
||||
this.runclientscript('edit_status_changed');}
|
||||
if(!this.display)this.show_the_frm();if(!this.meta.in_dialog)page_body.change_to('Forms');}}
|
||||
|
|
|
|||
|
|
@ -622,6 +622,11 @@ _f.Frm.prototype.refresh = function(docname) {
|
|||
// call trigger
|
||||
this.runclientscript('refresh');
|
||||
|
||||
// trigger global trigger
|
||||
// to use this
|
||||
// $(docuemnt).bind('form_refresh', function() { })
|
||||
$(document).trigger('form_refresh')
|
||||
|
||||
// tabs
|
||||
this.refresh_tabs();
|
||||
|
||||
|
|
|
|||
|
|
@ -507,7 +507,13 @@ _r.ReportBuilder.prototype.set_sort_options = function(l) {
|
|||
|
||||
empty_select(this.dt.sort_sel);
|
||||
|
||||
if(l) sl = add_lists(l, this.orig_sort_list)
|
||||
if(l) sl = add_lists(l, this.orig_sort_list);
|
||||
|
||||
// no sorts, add one
|
||||
if(!l.length) {
|
||||
l.push(['ID', 'name'])
|
||||
}
|
||||
|
||||
for(var i=0; i<sl.length; i++) {
|
||||
this.dt.add_sort_option(sl[i][0], sl[i][1]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue