diff --git a/frappe/core/doctype/docperm/docperm.json b/frappe/core/doctype/docperm/docperm.json index 8f11e823b7..be205b2fb7 100644 --- a/frappe/core/doctype/docperm/docperm.json +++ b/frappe/core/doctype/docperm/docperm.json @@ -14,6 +14,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "role_and_level", "fieldtype": "Section Break", "hidden": 0, @@ -38,6 +39,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "role", "fieldtype": "Link", "hidden": 0, @@ -67,6 +69,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "Filter records based on User Permissions defined for a user", "fieldname": "apply_user_permissions", "fieldtype": "Check", @@ -92,6 +95,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "Apply this rule if the User is the Owner", "fieldname": "if_owner", "fieldtype": "Check", @@ -118,6 +122,34 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "is_custom", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Is Custom", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, "fieldname": "column_break_2", "fieldtype": "Column Break", "hidden": 0, @@ -141,6 +173,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "0", "fieldname": "permlevel", "fieldtype": "Int", @@ -170,6 +203,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "", "description": "JSON list of DocTypes used to apply User Permissions. If empty, all linked DocTypes will be used to apply User Permissions.", "fieldname": "user_permission_doctypes", @@ -196,6 +230,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_4", "fieldtype": "Section Break", "hidden": 0, @@ -220,6 +255,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "read", "fieldtype": "Check", @@ -249,6 +285,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "write", "fieldtype": "Check", @@ -278,6 +315,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "create", "fieldtype": "Check", @@ -307,6 +345,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "delete", "fieldtype": "Check", @@ -332,6 +371,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_8", "fieldtype": "Column Break", "hidden": 0, @@ -355,6 +395,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "submit", "fieldtype": "Check", "hidden": 0, @@ -383,6 +424,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "cancel", "fieldtype": "Check", "hidden": 0, @@ -411,6 +453,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "amend", "fieldtype": "Check", "hidden": 0, @@ -439,6 +482,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "additional_permissions", "fieldtype": "Section Break", "hidden": 0, @@ -463,6 +507,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "report", "fieldtype": "Check", @@ -490,6 +535,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "export", "fieldtype": "Check", @@ -515,6 +561,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "import", "fieldtype": "Check", "hidden": 0, @@ -539,6 +586,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "This role update User Permissions for a user", "fieldname": "set_user_permissions", "fieldtype": "Check", @@ -564,6 +612,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_19", "fieldtype": "Column Break", "hidden": 0, @@ -587,6 +636,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "share", "fieldtype": "Check", @@ -613,6 +663,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "print", "fieldtype": "Check", @@ -638,6 +689,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "1", "fieldname": "email", "fieldtype": "Check", @@ -670,7 +722,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-11 03:27:59.695670", + "modified": "2016-09-29 08:07:20.450064", "modified_by": "Administrator", "module": "Core", "name": "DocPerm", @@ -679,5 +731,6 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, + "sort_order": "ASC", "track_seen": 0 } \ No newline at end of file diff --git a/frappe/data/Framework.sql b/frappe/data/Framework.sql index 8578cf6341..1c0a2a91b7 100644 --- a/frappe/data/Framework.sql +++ b/frappe/data/Framework.sql @@ -77,6 +77,7 @@ CREATE TABLE `tabDocPerm` ( `permlevel` int(11) DEFAULT '0', `role` varchar(255) DEFAULT NULL, `match` varchar(255) DEFAULT NULL, + `is_custom` int(1) NOT NULL DEFAULT 0, `read` int(1) NOT NULL DEFAULT 1, `write` int(1) NOT NULL DEFAULT 1, `create` int(1) NOT NULL DEFAULT 1, diff --git a/frappe/public/js/frappe/views/reports/print_grid.html b/frappe/public/js/frappe/views/reports/print_grid.html index b83c48ecc4..daae4fd030 100644 --- a/frappe/public/js/frappe/views/reports/print_grid.html +++ b/frappe/public/js/frappe/views/reports/print_grid.html @@ -2,7 +2,7 @@ {% if title %}

{{ __(title) }}


-{{ endif }} +{% endif %} @@ -27,7 +27,7 @@ {% var value = col.fieldname ? row[col.fieldname] : row[col.id]; %} {% endif %} {% endfor %} diff --git a/frappe/public/js/lib/microtemplate.js b/frappe/public/js/lib/microtemplate.js index 7630cc42c1..a68b475301 100644 --- a/frappe/public/js/lib/microtemplate.js +++ b/frappe/public/js/lib/microtemplate.js @@ -26,7 +26,7 @@ frappe.template.compile = function(str, name) { var i = frappe.utils.get_random(3); var len = frappe.utils.get_random(3); return "{% for (var "+i+"=0, "+len+"="+p2+".length; "+i+"<"+len+"; "+i+"++) { var " - +p1+" = "+p2+"["+i+"]; %}"; + +p1+" = "+p2+"["+i+"]; "+p1+"._index = "+i+"; %}"; } str = str.replace(/{%\s?for\s([a-z]+)\sin\s([a-z._]+)\s?%}/g, replacer);
{{ col.formatter - ? col.formatter(i, c, value, col, row, true) + ? col.formatter(row._index, col._index, value, col, row, true) : value }}