Ver código fonte

fixed permission, module setup pages

version-14
Rushabh Mehta 10 anos atrás
pai
commit
15a1f42eb3
21 arquivos alterados com 147 adições e 183 exclusões
  1. +24
    -19
      frappe/core/page/desktop/desktop.css
  2. +1
    -1
      frappe/core/page/desktop/desktop.js
  3. +10
    -7
      frappe/core/page/modules_setup/modules_setup.js
  4. +18
    -108
      frappe/core/page/permission_manager/permission_manager.js
  5. +41
    -0
      frappe/core/page/permission_manager/permission_manager_help.html
  6. +18
    -21
      frappe/core/page/user_permissions/user_permissions.js
  7. +2
    -4
      frappe/desk/doctype/feed/feed.py
  8. +1
    -1
      frappe/model/delete_doc.py
  9. +3
    -0
      frappe/modules/import_file.py
  10. +2
    -2
      frappe/public/css/bootstrap.css
  11. +1
    -1
      frappe/public/css/desk.css
  12. +1
    -1
      frappe/public/js/frappe/form/control.js
  13. +1
    -1
      frappe/public/js/frappe/form/dashboard.js
  14. +2
    -0
      frappe/public/js/frappe/form/grid_form.html
  15. +1
    -1
      frappe/public/js/frappe/ui/toolbar/awesome_bar.js
  16. +1
    -1
      frappe/public/js/frappe/views/module_section.html
  17. +12
    -7
      frappe/public/js/legacy/loaders.js
  18. +1
    -1
      frappe/public/less/desk.less
  19. +2
    -2
      frappe/templates/styles/modern.css
  20. +2
    -2
      frappe/website/doctype/about_us_settings/about_us_settings.json
  21. +3
    -3
      frappe/website/doctype/website_settings/website_settings.json

+ 24
- 19
frappe/core/page/desktop/desktop.css Ver arquivo

@@ -31,34 +31,39 @@
/*text-shadow: 1px 1px 3px rgba(0, 0, 0, 1), 0px 3px 15px rgba(0, 0, 0, 0.5);*/ /*text-shadow: 1px 1px 3px rgba(0, 0, 0, 1), 0px 3px 15px rgba(0, 0, 0, 0.5);*/
} }


.circle {
position: absolute;
top: 0px;
right: 15px;
width: 10px;
height: 10px;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
line-height: none;
background: #FF5858;
z-index: 5;
}

/*.circle-text {
color: white;
display: inline-block;
min-width: 15px;
}*/

@media (max-width: 768px) { @media (max-width: 768px) {
.case-wrapper { .case-wrapper {
margin: 9px; margin: 9px;
width: 70px; width: 70px;
height: 80px;
height: 90px;
} }
.case-label { .case-label {
padding-top: 2px; padding-top: 2px;
font-size: 85%; font-size: 85%;
} }
.circle {
right: 3px;
}
} }


.circle {
position: absolute;
top: -10px;
right: 5px;
border-radius: 30px;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
line-height: 15px;
background: #FF5858;
padding: 5px;
z-index: 5;
}

.circle-text {
color: white;
display: inline-block;
min-width: 15px;
}



+ 1
- 1
frappe/core/page/desktop/desktop.js Ver arquivo

@@ -196,7 +196,7 @@ frappe.desktop.show_pending_notifications = function() {
var notifier = $("#module-count-" + frappe.get_module(module)._id); var notifier = $("#module-count-" + frappe.get_module(module)._id);
if(notifier.length) { if(notifier.length) {
notifier.toggle(sum ? true : false); notifier.toggle(sum ? true : false);
notifier.find(".circle-text").html(sum || "");
// notifier.find(".circle-text").html(sum || "");
} }
} }
}); });


+ 10
- 7
frappe/core/page/modules_setup/modules_setup.js Ver arquivo

@@ -1,18 +1,22 @@


frappe.pages['modules_setup'].onload = function(wrapper) { frappe.pages['modules_setup'].onload = function(wrapper) {
frappe.ui.make_app_page({
var page = frappe.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: __('Show or Hide Modules'), title: __('Show or Hide Modules'),
single_column: true single_column: true
}); });


frappe.add_breadcrumbs("Setup");

wrapper.page.set_primary_action(__("Update"), function() { wrapper.page.set_primary_action(__("Update"), function() {
frappe.modules_setup.update(this); frappe.modules_setup.update(this);
})
});

page.main.css({"padding":"15px"});


$('<div class="alert alert-info">'
+__("Select modules to be shown (based on permission). If hidden, they will be hidden for all users.")+'</div>').appendTo($(wrapper).find(".layout-main"));
$('<div id="modules-list">').appendTo($(wrapper).find(".layout-main"));
$('<p>'
+__("Select modules to be shown (based on permission). If hidden, they will be hidden for all users.")+'</p>').appendTo($(wrapper).find(".layout-main"));
$('<div id="modules-list">').appendTo(page.main);


frappe.modules_setup.refresh_page(); frappe.modules_setup.refresh_page();
} }
@@ -27,8 +31,7 @@ frappe.modules_setup = {
if(m!="Setup") { if(m!="Setup") {
var row = $('<div class="list-group-item">\ var row = $('<div class="list-group-item">\
<span class="check-area" style="margin-right: 10px;"></span> ' <span class="check-area" style="margin-right: 10px;"></span> '
+frappe.ui.app_icon.get_html(m, true)
+ " <span> " + __(m) +'</span></div>').appendTo("#modules-list");
+ " <span> " + __(m) +'</span></div>').appendTo("#modules-list");
var $chk = $("<input type='checkbox' data-module='"+m+"' style='margin-top: -2px'>") var $chk = $("<input type='checkbox' data-module='"+m+"' style='margin-top: -2px'>")
.appendTo(row.find(".check-area")); .appendTo(row.find(".check-area"));
if(!frappe.boot.hidden_modules || frappe.boot.hidden_modules.indexOf(m)==-1) { if(!frappe.boot.hidden_modules || frappe.boot.hidden_modules.indexOf(m)==-1) {


+ 18
- 108
frappe/core/page/permission_manager/permission_manager.js Ver arquivo

@@ -1,12 +1,15 @@
frappe.pages['permission-manager'].onload = function(wrapper) { frappe.pages['permission-manager'].onload = function(wrapper) {
frappe.ui.make_app_page({
var page = frappe.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: __('Role Permissions Manager'), title: __('Role Permissions Manager'),
icon: "icon-lock", icon: "icon-lock",
single_column: true single_column: true
}); });
$(wrapper).find(".layout-main").html("<div class='perm-engine' style='min-height: 200px;'></div>"
+ permissions_help);

frappe.add_breadcrumbs("Setup");

$("<div class='perm-engine' style='min-height: 200px; padding: 15px;'></div>").appendTo(page.main);
$(frappe.render_template("permission_manager_help", {})).appendTo(page.main);
wrapper.permission_engine = new frappe.PermissionEngine(wrapper); wrapper.permission_engine = new frappe.PermissionEngine(wrapper);


} }
@@ -102,7 +105,7 @@ frappe.PermissionEngine = Class.extend({
}); });


// show standard permissions // show standard permissions
var $d = $(d.wrapper).find(".frappe-confirm-message").append("<hr><h4>Standard Permissions</h4>");
var $d = $(d.wrapper).find(".frappe-confirm-message").append("<hr><h4>Standard Permissions:</h4><br>");
var $wrapper = $("<p></p>").appendTo($d); var $wrapper = $("<p></p>").appendTo($d);
$.each(data.message, function(i, d) { $.each(data.message, function(i, d) {
d.rights = []; d.rights = [];
@@ -130,11 +133,11 @@ frappe.PermissionEngine = Class.extend({
refresh: function() { refresh: function() {
var me = this; var me = this;
if(!me.doctype_select) { if(!me.doctype_select) {
this.body.html("<div class='alert alert-info'>" + __("Loading") + "...</div>");
this.body.html("<p class='text-muted'>" + __("Loading") + "...</div>");
return; return;
} }
if(!me.get_doctype() && !me.get_role()) { if(!me.get_doctype() && !me.get_role()) {
this.body.html("<div class='alert alert-info'>"+__("Select Document Type or Role to start.")+"</div>");
this.body.html("<p class='text-muted'>"+__("Select Document Type or Role to start.")+"</div>");
return; return;
} }
// get permissions // get permissions
@@ -155,8 +158,8 @@ frappe.PermissionEngine = Class.extend({
this.body.empty(); this.body.empty();
this.perm_list = perm_list || []; this.perm_list = perm_list || [];
if(!this.perm_list.length) { if(!this.perm_list.length) {
this.body.html("<div class='alert alert-warning'>"
+__("No Permissions set for this criteria.")+"</div>");
this.body.html("<p class='text-muted'>"
+__("No Permissions set for this criteria.")+"</p>");
} else { } else {
this.show_permission_table(this.perm_list); this.show_permission_table(this.perm_list);
} }
@@ -242,8 +245,8 @@ frappe.PermissionEngine = Class.extend({
setup_user_permissions: function(d, role_cell) { setup_user_permissions: function(d, role_cell) {
var me = this; var me = this;
d.help = frappe.render('<ul class="user-permission-help small hidden" style="margin-left: -10px;">\ d.help = frappe.render('<ul class="user-permission-help small hidden" style="margin-left: -10px;">\
<li style="margin-top: 7px;"><a class="show-user-permission-doctypes">{%= __("Select Document Types") %}</a></li>\
<li style="margin-top: 3px;"><a class="show-user-permissions">{%= __("Show User Permissions") %}</a></li>\
<li style="margin-top: 7px;"><a class="show-user-permission-doctypes grey">{%= __("Select Document Types") %}</a></li>\
<li style="margin-top: 3px;"><a class="show-user-permissions grey">{%= __("Show User Permissions") %}</a></li>\
</ul>', {}); </ul>', {});


var checkbox = this.add_check(role_cell, d, "apply_user_permissions") var checkbox = this.add_check(role_cell, d, "apply_user_permissions")
@@ -270,7 +273,7 @@ frappe.PermissionEngine = Class.extend({
"print", "email", "report", "import", "export", "set_user_permissions"], "print", "email", "report", "import", "export", "set_user_permissions"],


set_show_users: function(cell, role) { set_show_users: function(cell, role) {
cell.html("<a href='#'>"+__(role)+"</a>")
cell.html("<a class='grey' href='#'>"+__(role)+"</a>")
.find("a") .find("a")
.attr("data-role", role) .attr("data-role", role)
.click(function() { .click(function() {
@@ -295,7 +298,7 @@ frappe.PermissionEngine = Class.extend({
}, },
add_delete_button: function(row, d) { add_delete_button: function(row, d) {
var me = this; var me = this;
$("<button class='btn btn-default btn-small'><i class='icon-remove'></i></button>")
$("<button class='btn btn-default btn-sm'><i class='icon-remove'></i></button>")
.appendTo($("<td>").appendTo(row)) .appendTo($("<td>").appendTo(row))
.attr("data-name", d.name) .attr("data-name", d.name)
.attr("data-doctype", d.parent) .attr("data-doctype", d.parent)
@@ -352,7 +355,7 @@ frappe.PermissionEngine = Class.extend({
}, },
show_add_rule: function() { show_add_rule: function() {
var me = this; var me = this;
$("<button class='btn btn-default btn-primary'><i class='icon-plus'></i> "
$("<button class='btn btn-default btn-primary btn-sm'><i class='icon-plus'></i> "
+__("Add A New Rule")+"</button>") +__("Add A New Rule")+"</button>")
.appendTo($("<p class='permission-toolbar'>").appendTo(this.body)) .appendTo($("<p class='permission-toolbar'>").appendTo(this.body))
.click(function() { .click(function() {
@@ -480,7 +483,7 @@ frappe.PermissionEngine = Class.extend({


make_reset_button: function() { make_reset_button: function() {
var me = this; var me = this;
$('<button class="btn btn-default" style="margin-left: 10px;">\
$('<button class="btn btn-default btn-sm" style="margin-left: 10px;">\
<i class="icon-refresh"></i> ' + __("Restore Original Permissions") + '</button>') <i class="icon-refresh"></i> ' + __("Restore Original Permissions") + '</button>')
.appendTo(this.body.find(".permission-toolbar")) .appendTo(this.body.find(".permission-toolbar"))
.on("click", function() { .on("click", function() {
@@ -504,97 +507,4 @@ frappe.PermissionEngine = Class.extend({
return frappe.get_children("DocType", doctype, "fields", return frappe.get_children("DocType", doctype, "fields",
{fieldtype:"Link", options:["not in", ["User", '[Select]']]}); {fieldtype:"Link", options:["not in", ["User", '[Select]']]});
} }
})

var permissions_help = ['<table class="table table-bordered" style="background-color: #f9f9f9; margin-top: 30px;">',
'<tr><td>',
'<h4><i class="icon-question-sign"></i> ',
__('Quick Help for Setting Permissions'),
':</h4>',
'<ol>',
'<li>',
__('Permissions are set on Roles and Document Types (called DocTypes) by setting rights like Read, Write, Create, Delete, Submit, Cancel, Amend, Report, Import, Export, Print, Email and Set User Permissions.'),
'</li>',
'<li>',
__('Permissions get applied on Users based on what Roles they are assigned.'),
'</li>',
'<li>',
__('Roles can be set for users from their User page.')
+ ' (<a href="#List/User">' + __("Setup > User") + '</a>)',
'</li>',
'<li>',
__('The system provides many pre-defined roles. You can add new roles to set finer permissions.')
+ ' (<a href="#List/Role">' + __("Add a New Role") + '</a>)',
'</li>',
'<li>',
__('Permissions are automatically translated to Standard Reports and Searches.'),
'</li>',
'<li>',
__('As a best practice, do not assign the same set of permission rule to different Roles. Instead, set multiple Roles to the same User.'),
'</li>',
'</ol>',
'</td></tr>',
'<tr><td>',
'<h4><i class="icon-hand-right"></i> ',
__('Meaning of Submit, Cancel, Amend'),
':</h4>',
'<ol>',
'<li>',
__('Certain documents, like an Invoice, should not be changed once final. The final state for such documents is called Submitted. You can restrict which roles can Submit.'),
'</li>',
'<li>',
__('You can change Submitted documents by cancelling them and then, amending them.'),
'</li>',
'<li>',
__('When you Amend a document after Cancel and save it, it will get a new number that is a version of the old number.'),
'</li>',
'<li>',
__("For example if you cancel and amend 'INV004' it will become a new document 'INV004-1'. This helps you to keep track of each amendment."),
'</li>',
'</ol>',
'</td></tr>',
'<tr><td>',
'<h4><i class="icon-signal"></i> ',
__('Permission Levels'),
':</h4>',
'<ol>',
'<li>',
__("Permissions at level 0 are 'Document Level' permissions, i.e. they are primary for access to the document."),
'</li>',
'<li>',
__('If a Role does not have access at Level 0, then higher levels are meaningless.'),
'</li>',
'<li>',
__("Permissions at higher levels are 'Field Level' permissions. All Fields have a 'Permission Level' set against them and the rules defined at that permissions apply to the field. This is useful in case you want to hide or make certain field read-only for certain Roles."),
'</li>',
'<li>',
__('You can use Customize Form to set levels on fields.')
+ ' (<a href="#Form/Customize Form">Setup > Customize Form</a>)',
'</li>',
'</ol>',
'</td></tr>',
'<tr><td>',
'<h4><i class="icon-shield"></i> ',
__('User Permissions'),
':</h4>',
'<ol>',
'<li>',
__("To give acess to a role for only specific records, check the 'Apply User Permissions'. User Permissions are used to limit users with such role to specific records.")
+ ' (<a href="#user-permissions">' + __('Setup > User Permissions Manager') + '</a>)',
'</li>',
'<li>',
__("Select Document Types to set which User Permissions are used to limit access."),
'</li>',
'<li>',
__("Once you have set this, the users will only be able access documents (eg. Blog Post) where the link exists (eg. Blogger)."),
'</li>',
'<li>',
__("Apart from System Manager, roles with 'Set User Permissions' right can set permissions for other users for that Document Type."),
'</li>',
'</ol>',
'</td></tr>',
'</table>',
'<p>',
__("If these instructions where not helpful, please add in your suggestions on GitHub Issues.")
+ ' (<a href="https://github.com/frappe/frappe/issues" target="_blank">' + __("Submit an Issue") + '</a>)',
'</p>'].join("\n");
});

+ 41
- 0
frappe/core/page/permission_manager/permission_manager_help.html Ver arquivo

@@ -0,0 +1,41 @@
<hr>
<div style="padding: 0px 15px;">
<h4>{%= __("Quick Help for Setting Permissions") %}:</h4>
<ol>
<li>{%= __("Permissions are set on Roles and Document Types (called DocTypes) by setting rights like Read, Write, Create, Delete, Submit, Cancel, Amend, Report, Import, Export, Print, Email and Set User Permissions.") %}</li>
<li>{%= __("Permissions get applied on Users based on what Roles they are assigned.") %}</li>
<li>{%= __("Roles can be set for users from their User page.") %}
<a href="#List/User">{%= __("Setup > User") %}</a></li>
<li>{%= __("The system provides many pre-defined roles. You can add new roles to set finer permissions.") %}<a href="#List/Role"> {%= __("Add a New Role") %}</a></li>
<li>{%= __("Permissions are automatically translated to Standard Reports and Searches.") %}</li>
<li>{%= __("As a best practice, do not assign the same set of permission rule to different Roles. Instead, set multiple Roles to the same User.") %}</li>
</ol>
<hr>
<h4>{%= __("Meaning of Submit, Cancel, Amend") %}:</h4>
<ol>
<li>{%= __("Certain documents, like an Invoice, should not be changed once final. The final state for such documents is called Submitted. You can restrict which roles can Submit.") %}</li>
<li>{%= __("You can change Submitted documents by cancelling them and then, amending them.") %}</li>
<li>{%= __("When you Amend a document after Cancel and save it, it will get a new number that is a version of the old number.") %}</li>
<li>{%= __("For example if you cancel and amend INV004 it will become a new document INV004-1. This helps you to keep track of each amendment.") %}</li>
</ol>
<hr>
<h4>{%= __("Permission Levels") %}:</h4>
<ol>
<li>{%= __("Permissions at level 0 are Document Level permissions, i.e. they are primary for access to the document.") %}</li>
<li>{%= __("If a Role does not have access at Level 0, then higher levels are meaningless.") %}</li>
<li>{%= __("Permissions at higher levels are Field Level permissions. All Fields have a Permission Level set against them and the rules defined at that permissions apply to the field. This is useful in case you want to hide or make certain field read-only for certain Roles.") %}</li>
<li>{%= __("You can use Customize Form to set levels on fields.") %} <a href="#Form/Customize Form">Setup > Customize Form</a></li>
</ol>
<hr>
<h4>{%= __("User Permissions") %}:</h4>
<ol>
<li>{%= __("To give acess to a role for only specific records, check the Apply User Permissions. User Permissions are used to limit users with such role to specific records.") %}
<a href="#user-permissions">{%= __("Setup > User Permissions Manager") %}</a></li>
<li>{%= __("Select Document Types to set which User Permissions are used to limit access.") %}</li>
<li>{%= __("Once you have set this, the users will only be able access documents (eg. Blog Post) where the link exists (eg. Blogger).") %}</li>
<li>{%= __("Apart from System Manager, roles with Set User Permissions right can set permissions for other users for that Document Type.") %}</li>
</ol>
<p>{%= __("If these instructions where not helpful, please add in your suggestions on GitHub Issues.") %}
<a href="https://github.com/frappe/frappe/issues" target="_blank">{%= __("Submit an Issue") %}</a>
</p>
</div>

+ 18
- 21
frappe/core/page/user_permissions/user_permissions.js Ver arquivo

@@ -1,20 +1,19 @@
frappe.pages['user-permissions'].onload = function(wrapper) { frappe.pages['user-permissions'].onload = function(wrapper) {
frappe.ui.make_app_page({
var page = frappe.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: __("User Permissions Manager"), title: __("User Permissions Manager"),
icon: "icon-shield", icon: "icon-shield",
single_column: true single_column: true
}); });


$(wrapper).find(".layout-main").html("<div class='user-settings' \
style='min-height: 200px;'></div>\
<p style='margin-top: 15px;'>\
<a class='view-role-permissions'><i class='icon-chevron-right'></i> " + __("Edit Role Permissions") + "</a>\
</p>\
<table class='table table-bordered' \
style='background-color: #f9f9f9; margin-top: 15px;'>\
<tr><td>\
<h4><i class='icon-question-sign'></i> "+__("Quick Help for User Permissions")+":</h4>\
frappe.add_breadcrumbs("Setup");

$("<div class='user-settings' \
style='min-height: 200px; padding: 15px;'></div>\
<p style='padding: 15px; padding-bottom: 0px;'>\
<a class='view-role-permissions grey'>" + __("Edit Role Permissions") + "</a>\
</p><hr><div style='padding: 0px 15px;'>\
<h4>"+__("Help for User Permissions")+":</h4>\
<ol>\ <ol>\
<li>" <li>"
+ __("Apart from Role based Permission Rules, you can apply User Permissions based on DocTypes.") + __("Apart from Role based Permission Rules, you can apply User Permissions based on DocTypes.")
@@ -31,9 +30,7 @@ frappe.pages['user-permissions'].onload = function(wrapper) {
+ "<li>" + "<li>"
+ __("A user can be permitted to multiple records of the same DocType.") + __("A user can be permitted to multiple records of the same DocType.")
+ "</li>\ + "</li>\
</ol>\
</tr></td>\
</table>");
</ol></div>").appendTo(page.main);
wrapper.user_permissions = new frappe.UserPermissions(wrapper); wrapper.user_permissions = new frappe.UserPermissions(wrapper);
} }


@@ -131,10 +128,10 @@ frappe.UserPermissions = Class.extend({
fields: [ fields: [
{ {
fieldtype:"HTML", fieldtype:"HTML",
options: '<div class="alert alert-warning"><ol>'+
options: '<p class="text-muted"><ol>'+
"<li>"+__("Upload CSV file containing all user permissions in the same format as Download.")+"</li>"+ "<li>"+__("Upload CSV file containing all user permissions in the same format as Download.")+"</li>"+
"<li><strong>"+__("Any existing permission will be deleted / overwritten.")+"</strong></li>"+ "<li><strong>"+__("Any existing permission will be deleted / overwritten.")+"</strong></li>"+
'</div>'
'</p>'
}, },
{ {
fieldtype:"Attach", fieldname:"attach", fieldtype:"Attach", fieldname:"attach",
@@ -200,16 +197,16 @@ frappe.UserPermissions = Class.extend({
this.show_add_user_permission(); this.show_add_user_permission();
}, },
add_message: function(txt) { add_message: function(txt) {
$('<div class="alert alert-info">' + txt + '</div>').appendTo(this.body);
$('<p class="text-muted">' + txt + '</p>').appendTo(this.body);
}, },
refresh: function() { refresh: function() {
var me = this; var me = this;
if(!me.filters.user) { if(!me.filters.user) {
this.body.html("<div class='alert alert-info'>"+__("Loading")+"...</div>");
this.body.html("<p class='text-muted'>"+__("Loading")+"...</p>");
return; return;
} }
if(!me.get_user() && !me.get_doctype()) { if(!me.get_user() && !me.get_doctype()) {
this.body.html("<div class='alert alert-warning'>"+__("Select User or DocType to start.")+"</div>");
this.body.html("<p class='text-muted'>"+__("Select User or DocType to start.")+"</p>");
return; return;
} }
// get permissions // get permissions
@@ -244,7 +241,7 @@ frappe.UserPermissions = Class.extend({
$.each(this.prop_list, function(i, d) { $.each(this.prop_list, function(i, d) {
var row = $("<tr>").appendTo(me.table.find("tbody")); var row = $("<tr>").appendTo(me.table.find("tbody"));


$("<td>").html('<a href="#Form/User/'+encodeURIComponent(d.parent)+'">'
$("<td>").html('<a class="grey" href="#Form/User/'+encodeURIComponent(d.parent)+'">'
+d.parent+'</a>').appendTo(row); +d.parent+'</a>').appendTo(row);
$("<td>").html(d.defkey).appendTo(row); $("<td>").html(d.defkey).appendTo(row);
$("<td>").html(d.defvalue).appendTo(row); $("<td>").html(d.defvalue).appendTo(row);
@@ -255,7 +252,7 @@ frappe.UserPermissions = Class.extend({
}, },
add_delete_button: function(row, d) { add_delete_button: function(row, d) {
var me = this; var me = this;
$("<button class='btn btn-small btn-default'><i class='icon-remove'></i></button>")
$("<button class='btn btn-sm btn-default'><i class='icon-remove'></i></button>")
.appendTo($("<td>").appendTo(row)) .appendTo($("<td>").appendTo(row))
.attr("data-name", d.name) .attr("data-name", d.name)
.attr("data-user", d.parent) .attr("data-user", d.parent)
@@ -285,7 +282,7 @@ frappe.UserPermissions = Class.extend({


show_add_user_permission: function() { show_add_user_permission: function() {
var me = this; var me = this;
$("<button class='btn btn-primary'>"+__("Add A User Permission")+"</button>")
$("<button class='btn btn-default btn-sm'>"+__("Add A User Permission")+"</button>")
.appendTo($("<p>").appendTo(this.body)) .appendTo($("<p>").appendTo(this.body))
.click(function() { .click(function() {
var d = new frappe.ui.Dialog({ var d = new frappe.ui.Dialog({


+ 2
- 4
frappe/desk/doctype/feed/feed.py Ver arquivo

@@ -53,12 +53,10 @@ def has_permission(doc, user):


def update_feed(doc, method=None): def update_feed(doc, method=None):
"adds a new feed" "adds a new feed"
if doc.doctype == "Feed":
return

if frappe.flags.in_patch or frappe.flags.in_install_app or frappe.flags.in_import: if frappe.flags.in_patch or frappe.flags.in_install_app or frappe.flags.in_import:
return return

if doc.doctype == "Feed":
return


if hasattr(doc, "get_feed"): if hasattr(doc, "get_feed"):
feed = doc.get_feed() feed = doc.get_feed()


+ 1
- 1
frappe/model/delete_doc.py Ver arquivo

@@ -166,7 +166,7 @@ def delete_linked_todos(doc):
def insert_feed(doc): def insert_feed(doc):
from frappe.utils import get_fullname from frappe.utils import get_fullname


if frappe.flags.in_install_app:
if frappe.flags.in_install_app or frappe.flags.in_import:
return return


frappe.get_doc({ frappe.get_doc({


+ 3
- 0
frappe/modules/import_file.py Ver arquivo

@@ -88,6 +88,7 @@ ignore_values = {
ignore_doctypes = ["Page Role", "DocPerm"] ignore_doctypes = ["Page Role", "DocPerm"]


def import_doc(docdict, force=False, data_import=False): def import_doc(docdict, force=False, data_import=False):
frappe.flags.in_import = True
docdict["__islocal"] = 1 docdict["__islocal"] = 1
doc = frappe.get_doc(docdict) doc = frappe.get_doc(docdict)


@@ -118,3 +119,5 @@ def import_doc(docdict, force=False, data_import=False):
doc.ignore_mandatory = True doc.ignore_mandatory = True
doc.ignore_user_permissions = True doc.ignore_user_permissions = True
doc.insert() doc.insert()

frappe.flags.in_import = False

+ 2
- 2
frappe/public/css/bootstrap.css
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 1
- 1
frappe/public/css/desk.css Ver arquivo

@@ -273,7 +273,7 @@ em.link-option {
/* module */ /* module */
.module-item { .module-item {
margin: 0px; margin: 0px;
padding: 15px 10px;
padding: 5px 0px;
border-bottom: 1px solid #d1d8dd; border-bottom: 1px solid #d1d8dd;
cursor: pointer; cursor: pointer;
} }


+ 1
- 1
frappe/public/js/frappe/form/control.js Ver arquivo

@@ -584,7 +584,7 @@ frappe.ui.form.ControlAttach = frappe.ui.form.ControlData.extend({
make_input: function() { make_input: function() {
var me = this; var me = this;
this.$input = $('<button class="btn btn-default btn-sm">') this.$input = $('<button class="btn btn-default btn-sm">')
.html(__("Upload"))
.html(__("Attach"))
.prependTo(me.input_area) .prependTo(me.input_area)
.on("click", function() { .on("click", function() {
me.onclick(); me.onclick();


+ 1
- 1
frappe/public/js/frappe/form/dashboard.js Ver arquivo

@@ -42,7 +42,7 @@ frappe.ui.form.Dashboard = Class.extend({
var badge = $(repl('<div class="col-md-4">\ var badge = $(repl('<div class="col-md-4">\
<div class="alert-badge">\ <div class="alert-badge">\
<a class="badge-link grey">%(label)s</a>\ <a class="badge-link grey">%(label)s</a>\
<span class="badge pull-right">-</span>\
<span class="badge">-</span>\
</div></div>', {label:label, icon: frappe.boot.doctype_icons[doctype]})) </div></div>', {label:label, icon: frappe.boot.doctype_icons[doctype]}))
.appendTo(this.body) .appendTo(this.body)




+ 2
- 0
frappe/public/js/frappe/form/grid_form.html Ver arquivo

@@ -2,6 +2,8 @@
<div class="toolbar"> <div class="toolbar">
<span class="panel-title"> <span class="panel-title">
{%= __("Editing Row") %} #<span class="grid-form-row-index"></span></span> {%= __("Editing Row") %} #<span class="grid-form-row-index"></span></span>
<button class="btn btn-default btn-xs pull-right"style="margin-left: 7px;">
{%= __("Done") %}</button>
<button class="btn btn-default btn-xs pull-right grid-insert-row" <button class="btn btn-default btn-xs pull-right grid-insert-row"
style="margin-left: 7px;"> style="margin-left: 7px;">
{%= __("Insert Above") %}</button> {%= __("Insert Above") %}</button>


+ 1
- 1
frappe/public/js/frappe/ui/toolbar/awesome_bar.js Ver arquivo

@@ -144,7 +144,7 @@ frappe.search.verbs = [
frappe.search.find(frappe.boot.user.can_create, txt.substr(4), function(match) { frappe.search.find(frappe.boot.user.can_create, txt.substr(4), function(match) {
return { return {
value:__("New {0}", ["<b>"+match+"</b>"]), value:__("New {0}", ["<b>"+match+"</b>"]),
route:["Form", match, "New " + match]
onclick: function() { new_doc(match); }
} }
}); });
} }


+ 1
- 1
frappe/public/js/frappe/views/module_section.html Ver arquivo

@@ -11,7 +11,7 @@
{% } %} {% } %}
{% if (item.description) { %} {% if (item.description) { %}
</h4> </h4>
<p class="text-muted">{%= item.description %}</p>
<p class="text-muted small">{%= item.description %}</p>
{% } else { %}</h5>{% } %} {% } else { %}</h5>{% } %}
</div> </div>
<div class="col-md-3 text-muted text-right small" style="padding-top: 5px;"> <div class="col-md-3 text-muted text-right small" style="padding-top: 5px;">


+ 12
- 7
frappe/public/js/legacy/loaders.js Ver arquivo

@@ -1,29 +1,34 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
// MIT License. See license.txt


function loadreport(dt, rep_name, onload) { function loadreport(dt, rep_name, onload) {
if(rep_name) if(rep_name)
frappe.set_route('Report', dt, rep_name); frappe.set_route('Report', dt, rep_name);
else else
frappe.set_route('Report', dt); frappe.set_route('Report', dt);
}
}


function loaddoc(doctype, name, onload) { function loaddoc(doctype, name, onload) {
frappe.model.with_doctype(doctype, function() { frappe.model.with_doctype(doctype, function() {
if(locals.DocType[doctype].in_dialog) { if(locals.DocType[doctype].in_dialog) {
_f.edit_record(doctype, name); _f.edit_record(doctype, name);
} else { } else {
frappe.set_route('Form', doctype, name);
frappe.set_route('Form', doctype, name);
} }
}) })
} }
var load_doc = loaddoc; var load_doc = loaddoc;


frappe.create_routes = {};
function new_doc(doctype, in_form) { function new_doc(doctype, in_form) {
frappe.model.with_doctype(doctype, function() { frappe.model.with_doctype(doctype, function() {
var new_name = frappe.model.make_new_doc_and_get_name(doctype);
frappe.set_route("Form", doctype, new_name);
})
if(frappe.create_routes[doctype]) {
frappe.set_route(frappe.create_routes[doctype]);
} else {
var new_name = frappe.model.make_new_doc_and_get_name(doctype);
frappe.set_route("Form", doctype, new_name);
}
});
} }
var newdoc = new_doc; var newdoc = new_doc;


@@ -32,6 +37,6 @@ function loadpage(page_name, call_back, no_history) {
frappe.set_route(page_name); frappe.set_route(page_name);
} }


function loaddocbrowser(dt) {
function loaddocbrowser(dt) {
frappe.set_route('List', dt); frappe.set_route('List', dt);
} }

+ 1
- 1
frappe/public/less/desk.less Ver arquivo

@@ -325,7 +325,7 @@ em.link-option {


.module-item { .module-item {
margin: 0px; margin: 0px;
padding: 15px 10px;
padding: 5px 0px;
border-bottom: 1px solid @border-color; border-bottom: 1px solid @border-color;
cursor: pointer; cursor: pointer;
} }


+ 2
- 2
frappe/templates/styles/modern.css Ver arquivo

@@ -8,10 +8,10 @@
border-bottom: 3px solid #aaa; border-bottom: 3px solid #aaa;
} }


table.table-bordered {
.print-format table.table-bordered {
border-top: 3px solid #aaa; border-top: 3px solid #aaa;
} }


th {
.print-format th {
background-color: #eee; background-color: #eee;
} }

+ 2
- 2
frappe/website/doctype/about_us_settings/about_us_settings.json Ver arquivo

@@ -1,5 +1,5 @@
{ {
"creation": "2013-03-19 12:02:15",
"creation": "2013-03-19 12:02:15",
"description": "Settings for the About Us Page", "description": "Settings for the About Us Page",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@@ -81,7 +81,7 @@
"icon": "icon-group", "icon": "icon-group",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2014-05-28 17:14:48.015912",
"modified": "2015-01-01 15:01:14.701018",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Website", "module": "Website",
"name": "About Us Settings", "name": "About Us Settings",


+ 3
- 3
frappe/website/doctype/website_settings/website_settings.json Ver arquivo

@@ -1,5 +1,5 @@
{ {
"creation": "2013-04-30 12:58:46",
"creation": "2013-04-30 12:58:46",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Other", "document_type": "Other",
@@ -21,7 +21,7 @@
"reqd": 0 "reqd": 0
}, },
{ {
"description": "The name of your company / website as you want to appear on browser title bar. All pages will have this as the prefix to the title.",
"description": "",
"fieldname": "title_prefix", "fieldname": "title_prefix",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
@@ -226,7 +226,7 @@
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"max_attachments": 10, "max_attachments": 10,
"modified": "2014-08-20 12:55:53.402229",
"modified": "2015-01-01 14:30:06.250845",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Website", "module": "Website",
"name": "Website Settings", "name": "Website Settings",


Carregando…
Cancelar
Salvar