From f3810ae53218e825429e149cbb2c1e230513fb6b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 11 Mar 2014 16:13:27 +0530 Subject: [PATCH] rename Profile to User frappe/frappe#470 --- frappe/__init__.py | 10 +-- frappe/auth.py | 21 +++-- frappe/boot.py | 12 +-- frappe/cli.py | 4 +- frappe/config/setup.py | 2 +- frappe/config/website.py | 2 +- frappe/core/README.md | 2 +- .../doctype/communication/communication.py | 4 +- .../doctype/communication/communication.txt | 4 +- .../doctype/customize_form/customize_form.js | 4 +- frappe/core/doctype/defaultvalue/README.md | 2 +- frappe/core/doctype/event/event.py | 2 +- frappe/core/doctype/event/test_event.py | 4 +- frappe/core/doctype/event_user/README.md | 2 +- frappe/core/doctype/event_user/event_user.txt | 4 +- frappe/core/doctype/profile/README.md | 1 - frappe/core/doctype/profile/__init__.py | 4 - frappe/core/doctype/todo/todo.txt | 4 +- .../doctype/user}/__init__.py | 0 .../test_profile.py => user/test_user.py} | 42 +++++----- .../{profile/profile.css => user/user.css} | 0 .../{profile/profile.js => user/user.js} | 10 +-- .../{profile/profile.py => user/user.py} | 54 ++++++------ .../{profile/profile.txt => user/user.txt} | 52 ++++++------ frappe/core/doctype/userrole/README.md | 2 +- .../page/data_import_tool/data_import_tool.js | 2 +- frappe/core/page/messages/messages.py | 8 +- .../permission_manager/permission_manager.js | 20 ++--- .../permission_manager/permission_manager.py | 10 +-- .../page/user_properties/user_properties.js | 2 +- .../page/user_properties/user_properties.py | 2 +- frappe/core/report/todo/todo.py | 4 +- frappe/defaults.py | 7 +- frappe/patches.txt | 3 +- frappe/patches/4_0/rename_profile_to_user.py | 13 +++ frappe/public/js/frappe/defaults.js | 8 +- frappe/public/js/frappe/desk.js | 15 ++-- frappe/public/js/frappe/form/assign_to.js | 4 +- frappe/public/js/frappe/form/control.js | 2 +- frappe/public/js/frappe/form/toolbar.js | 2 +- frappe/public/js/frappe/misc/user.js | 6 +- frappe/public/js/frappe/model/create_new.js | 2 +- frappe/public/js/frappe/model/model.js | 22 ++--- frappe/public/js/frappe/ui/listing.js | 2 +- frappe/public/js/frappe/ui/toolbar/new.js | 2 +- frappe/public/js/frappe/ui/toolbar/recent.js | 6 +- frappe/public/js/frappe/ui/toolbar/report.js | 2 +- frappe/public/js/frappe/ui/toolbar/search.js | 2 +- .../public/js/frappe/views/communication.js | 4 +- frappe/public/js/frappe/views/doclistview.js | 2 +- frappe/public/js/frappe/views/reportview.js | 2 +- frappe/public/js/legacy/globals.js | 4 +- frappe/sessions.py | 6 +- frappe/templates/generators/website_group.py | 8 +- frappe/templates/includes/login.js | 4 +- frappe/templates/includes/post_editor.html | 6 +- .../templates/includes/profile_display.html | 9 -- .../includes/sitemap_permission.html | 10 +-- frappe/templates/includes/user_display.html | 9 ++ frappe/templates/pages/login.py | 22 ++--- frappe/templates/pages/update-password.html | 2 +- frappe/templates/website_group/forum.py | 2 +- frappe/templates/website_group/post.py | 18 ++-- frappe/templates/website_group/settings.html | 2 +- frappe/templates/website_group/settings.py | 30 +++---- frappe/tests/test_db.py | 22 ++--- frappe/tests/test_email.py | 12 +-- frappe/translate.py | 2 +- frappe/translations/ar.csv | 16 ++-- frappe/translations/de.csv | 16 ++-- frappe/translations/el.csv | 16 ++-- frappe/translations/es.csv | 16 ++-- frappe/translations/fr.csv | 16 ++-- frappe/translations/hi.csv | 16 ++-- frappe/translations/hr.csv | 16 ++-- frappe/translations/it.csv | 16 ++-- frappe/translations/nl.csv | 16 ++-- frappe/translations/pt-BR.csv | 16 ++-- frappe/translations/pt.csv | 16 ++-- frappe/translations/sr.csv | 16 ++-- frappe/translations/ta.csv | 16 ++-- frappe/translations/th.csv | 16 ++-- frappe/translations/zh-cn.csv | 16 ++-- frappe/translations/zh-tw.csv | 16 ++-- frappe/utils/__init__.py | 16 ++-- frappe/utils/email_lib/__init__.py | 2 +- frappe/utils/email_lib/bulk.py | 2 +- frappe/utils/install.py | 10 +-- frappe/{profile.py => utils/user.py} | 30 +++---- .../doctype/blog_post/test_blog_post.py | 10 +-- frappe/website/doctype/blogger/README.md | 2 +- frappe/website/doctype/blogger/blogger.py | 6 +- frappe/website/doctype/blogger/blogger.txt | 10 +-- frappe/website/doctype/post/post.txt | 4 +- .../website_route_permission.py | 2 +- .../website_route_permission.txt | 8 +- .../website_sitemap_permission.py | 16 ---- .../website_sitemap_permission.txt | 84 ------------------- frappe/website/js/website_group.js | 14 ++-- frappe/website/permissions.py | 32 +++---- frappe/widgets/form/test_form.py | 2 +- frappe/widgets/query_report.py | 4 +- 102 files changed, 496 insertions(+), 584 deletions(-) delete mode 100644 frappe/core/doctype/profile/README.md delete mode 100644 frappe/core/doctype/profile/__init__.py rename frappe/{website/doctype/website_sitemap_permission => core/doctype/user}/__init__.py (100%) rename frappe/core/doctype/{profile/test_profile.py => user/test_user.py} (68%) rename frappe/core/doctype/{profile/profile.css => user/user.css} (100%) rename frappe/core/doctype/{profile/profile.js => user/user.js} (96%) rename frappe/core/doctype/{profile/profile.py => user/user.py} (90%) rename frappe/core/doctype/{profile/profile.txt => user/user.txt} (95%) create mode 100644 frappe/patches/4_0/rename_profile_to_user.py delete mode 100644 frappe/templates/includes/profile_display.html create mode 100644 frappe/templates/includes/user_display.html rename frappe/{profile.py => utils/user.py} (90%) delete mode 100644 frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.py delete mode 100644 frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.txt diff --git a/frappe/__init__.py b/frappe/__init__.py index e77cfbcca6..8d02238975 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -57,7 +57,7 @@ def set_user_lang(user, user_language=None): from frappe.translate import get_lang_dict if not user_language: - user_language = db.get_value("Profile", user, "language") + user_language = db.get_value("User", user, "language") if user_language: lang_dict = get_lang_dict() @@ -225,9 +225,9 @@ def connect(site=None, db_name=None): set_user("Administrator") def set_user(username): - import frappe.profile + from frappe.utils.user import User local.session["user"] = username - local.user = frappe.profile.Profile(username) + local.user = User(username) local.restrictions = None local.user_perms = {} @@ -288,13 +288,13 @@ def clear_cache(user=None, doctype=None): reset_metadata_version() def get_roles(username=None): - import frappe.profile + from frappe.utils.user import User if not local.session: return ["Guest"] elif not username or username==local.session.user: return local.user.get_roles() else: - return frappe.profile.Profile(username).get_roles() + return User(username).get_roles() def has_permission(doctype, ptype="read", refdoc=None): import frappe.permissions diff --git a/frappe/auth.py b/frappe/auth.py index eb493df8c1..f7be90a07f 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe import frappe.database import frappe.utils -import frappe.profile +import frappe.utils.user from frappe import conf from frappe.sessions import Session @@ -39,8 +39,8 @@ class HTTPRequest: frappe.msgprint(frappe.db.get_global("__session_status_message")) raise frappe.SessionStopped('Session Stopped') - # load profile - self.setup_profile() + # load user + self.setup_user() # run login triggers if frappe.form_dict.get('cmd')=='login': @@ -72,8 +72,8 @@ class HTTPRequest: frappe.local.lang = code return - def setup_profile(self): - frappe.local.user = frappe.profile.Profile() + def setup_user(self): + frappe.local.user = frappe.utils.user.User() def get_db_name(self): """get database name from conf""" @@ -106,7 +106,7 @@ class LoginManager: self.set_user_info() def set_user_info(self): - info = frappe.db.get_value("Profile", self.user, + info = frappe.db.get_value("User", self.user, ["user_type", "first_name", "last_name", "user_image"], as_dict=1) if info.user_type=="Website User": frappe.local._response.set_cookie("system_user", "no") @@ -142,7 +142,7 @@ class LoginManager: """raise exception if user not enabled""" from frappe.utils import cint if user=='Administrator': return - if not cint(frappe.db.get_value('Profile', user, 'enabled')): + if not cint(frappe.db.get_value('User', user, 'enabled')): self.fail('User disabled or missing') def check_password(self, user, pwd): @@ -165,8 +165,7 @@ class LoginManager: def validate_ip_address(self): """check if IP Address is valid""" - ip_list = frappe.db.get_value('Profile', self.user, 'restrict_ip', ignore=True) - + ip_list = frappe.db.get_value('User', self.user, 'restrict_ip', ignore=True) if not ip_list: return @@ -182,8 +181,8 @@ class LoginManager: def validate_hour(self): """check if user is logging in during restricted hours""" - login_before = int(frappe.db.get_value('Profile', self.user, 'login_before', ignore=True) or 0) - login_after = int(frappe.db.get_value('Profile', self.user, 'login_after', ignore=True) or 0) + login_before = int(frappe.db.get_value('User', self.user, 'login_before', ignore=True) or 0) + login_after = int(frappe.db.get_value('User', self.user, 'login_after', ignore=True) or 0) if not (login_before or login_after): return diff --git a/frappe/boot.py b/frappe/boot.py index bbe520ac8c..81c2071a3e 100644 --- a/frappe/boot.py +++ b/frappe/boot.py @@ -18,8 +18,8 @@ def get_bootinfo(): hooks = frappe.get_hooks() doclist = [] - # profile - get_profile(bootinfo) + # user + get_user(bootinfo) # control panel cp = frappe.model.doc.getsingle('Control Panel') @@ -100,7 +100,7 @@ def get_fullnames(): concat(ifnull(first_name, ''), if(ifnull(last_name, '')!='', ' ', ''), ifnull(last_name, '')), user_image, gender, email - from tabProfile where ifnull(enabled, 0)=1""", as_list=1) + from tabUser where ifnull(enabled, 0)=1""", as_list=1) d = {} for r in ret: if not r[2]: @@ -118,9 +118,9 @@ def load_startup_js(bootinfo): for method in frappe.get_hooks().startup_js or []: bootinfo.startup_js += frappe.get_attr(method)() -def get_profile(bootinfo): - """get profile info""" - bootinfo['profile'] = frappe.user.load_profile() +def get_user(bootinfo): + """get user info""" + bootinfo['user'] = frappe.user.load_user() def add_home_page(bootinfo, doclist): """load home page""" diff --git a/frappe/cli.py b/frappe/cli.py index 980411f79e..cfbae67d56 100755 --- a/frappe/cli.py +++ b/frappe/cli.py @@ -741,8 +741,8 @@ def search_replace_with_prompt(fpath, txt1, txt2, force=False): def get_site_status(verbose=False): import frappe import frappe.utils - from frappe.profile import get_system_managers - from frappe.core.doctype.profile.profile import get_total_users, get_active_users, \ + from frappe.utils.user import get_system_managers + from frappe.core.doctype.user.user import get_total_users, get_active_users, \ get_website_users, get_active_website_users import json diff --git a/frappe/config/setup.py b/frappe/config/setup.py index 85042052f5..29907526cf 100644 --- a/frappe/config/setup.py +++ b/frappe/config/setup.py @@ -8,7 +8,7 @@ data = [ "items": [ { "type": "doctype", - "name": "Profile", + "name": "User", "description": _("System and Website Users") }, { diff --git a/frappe/config/website.py b/frappe/config/website.py index 062747405d..ebd8f55a19 100644 --- a/frappe/config/website.py +++ b/frappe/config/website.py @@ -18,7 +18,7 @@ data = [ { "type": "doctype", "name": "Blogger", - "description": _("Profile of a blog writer."), + "description": _("User ID of a blog writer."), }, { "type": "doctype", diff --git a/frappe/core/README.md b/frappe/core/README.md index 7feb0ee86b..8734419a1a 100644 --- a/frappe/core/README.md +++ b/frappe/core/README.md @@ -1 +1 @@ -Core module contains the models required for the basic functioning of frappe including DocType, Profile (user), Role and others. \ No newline at end of file +Core module contains the models required for the basic functioning of frappe including DocType, User (user), Role and others. \ No newline at end of file diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index f2393048c8..42b1d8d43a 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -65,7 +65,7 @@ def _make(doctype=None, name=None, content=None, subject=None, sent_or_received d.subject = subject d.content = content d.sent_or_received = sent_or_received - d.sender = sender or frappe.db.get_value("Profile", frappe.session.user, "email") + d.sender = sender or frappe.db.get_value("User", frappe.session.user, "email") d.recipients = recipients # add as child @@ -126,7 +126,7 @@ def send_comm_email(d, name, sent_via=None, print_html=None, attachments='[]', s msg=d.content, footer=footer, print_html=print_html if send_print_in_body else None) if send_me_a_copy: - mail.cc.append(frappe.db.get_value("Profile", frappe.session.user, "email")) + mail.cc.append(frappe.db.get_value("User", frappe.session.user, "email")) if print_html: print_html = scrub_urls(print_html) diff --git a/frappe/core/doctype/communication/communication.txt b/frappe/core/doctype/communication/communication.txt index 8ae2d70fda..2d6457e1df 100644 --- a/frappe/core/doctype/communication/communication.txt +++ b/frappe/core/doctype/communication/communication.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-29 10:47:14", "docstatus": 0, - "modified": "2014-01-24 13:01:24", + "modified": "2014-01-24 13:01:25", "modified_by": "Administrator", "owner": "Administrator" }, @@ -165,7 +165,7 @@ "fieldname": "user", "fieldtype": "Link", "label": "User", - "options": "Profile", + "options": "User", "read_only": 1 }, { diff --git a/frappe/core/doctype/customize_form/customize_form.js b/frappe/core/doctype/customize_form/customize_form.js index e52d57b201..7c762bea25 100644 --- a/frappe/core/doctype/customize_form/customize_form.js +++ b/frappe/core/doctype/customize_form/customize_form.js @@ -27,7 +27,7 @@ cur_frm.fields_dict.doc_type.get_query = function(doc, dt, dn) { filters:[ ['DocType', 'issingle', '=', 0], ['DocType', 'in_create', '=', 0], - ['DocType', 'name', 'not in', 'DocType, DocField, DocPerm, Profile, Role, UserRole,\ + ['DocType', 'name', 'not in', 'DocType, DocField, DocPerm, User, Role, UserRole,\ Page, Page Role, Module Def, Print Format, Report, Customize Form, Customize Form Field'] ] } @@ -81,7 +81,7 @@ cur_frm.cscript.hide_allow_attach = function(doc) { 'Support Ticket', 'Supplier', 'Style Settings', 'Stock Reconciliation', 'Stock Entry', 'Serial No', 'Sales Order', 'Sales Invoice', 'Quotation', 'Question', 'Purchase Receipt', 'Purchase Order', - 'Project', 'Profile', 'Production Order', 'Product', 'Print Format', + 'Project', 'User', 'Production Order', 'Product', 'Print Format', 'Price List', 'Purchase Invoice', 'Page', 'Module Def', 'Maintenance Visit', 'Maintenance Schedule', 'Letter Head', 'Leave Application', 'Lead', 'Journal Voucher', 'Item', 'Material Request', diff --git a/frappe/core/doctype/defaultvalue/README.md b/frappe/core/doctype/defaultvalue/README.md index d272a0fb93..327fb71c59 100644 --- a/frappe/core/doctype/defaultvalue/README.md +++ b/frappe/core/doctype/defaultvalue/README.md @@ -1 +1 @@ -Child table for **Profile** and **Role** where default keys and values are stored. They can also be created from the **User Properties** page. \ No newline at end of file +Child table for **User** and **Role** where default keys and values are stored. They can also be created from the **User Properties** page. \ No newline at end of file diff --git a/frappe/core/doctype/event/event.py b/frappe/core/doctype/event/event.py index 8b19043f9a..1c802baf46 100644 --- a/frappe/core/doctype/event/event.py +++ b/frappe/core/doctype/event/event.py @@ -51,7 +51,7 @@ def has_permission(doc, bean=None): def send_event_digest(): today = nowdate() for user in frappe.db.sql("""select name, email, language - from tabProfile where ifnull(enabled,0)=1 + from tabUser where ifnull(enabled,0)=1 and user_type='System User' and name not in ('Guest', 'Administrator')""", as_dict=1): events = get_events(today, today, user.name, for_reminder=True) if events: diff --git a/frappe/core/doctype/event/test_event.py b/frappe/core/doctype/event/test_event.py index f99efae18a..a866a85049 100644 --- a/frappe/core/doctype/event/test_event.py +++ b/frappe/core/doctype/event/test_event.py @@ -35,8 +35,8 @@ import unittest class TestEvent(unittest.TestCase): # def setUp(self): - # profile = frappe.bean("Profile", "test1@example.com") - # profile.get_controller().add_roles("Website Manager") + # user = frappe.bean("User", "test1@example.com") + # user.get_controller().add_roles("Website Manager") def tearDown(self): frappe.set_user("Administrator") diff --git a/frappe/core/doctype/event_user/README.md b/frappe/core/doctype/event_user/README.md index e3a5be425e..e7e13a5991 100644 --- a/frappe/core/doctype/event_user/README.md +++ b/frappe/core/doctype/event_user/README.md @@ -1 +1 @@ -Profile (user) with whom the parent Event is shared. \ No newline at end of file +User (user) with whom the parent Event is shared. \ No newline at end of file diff --git a/frappe/core/doctype/event_user/event_user.txt b/frappe/core/doctype/event_user/event_user.txt index b02cfefe86..d69d954284 100644 --- a/frappe/core/doctype/event_user/event_user.txt +++ b/frappe/core/doctype/event_user/event_user.txt @@ -2,7 +2,7 @@ { "creation": "2013-02-22 01:27:33", "docstatus": 0, - "modified": "2013-12-20 19:23:13", + "modified": "2013-12-20 19:23:14", "modified_by": "Administrator", "owner": "Administrator" }, @@ -22,7 +22,7 @@ "name": "__common__", "oldfieldname": "person", "oldfieldtype": "Select", - "options": "link:Profile", + "options": "link:User", "parent": "Event User", "parentfield": "fields", "parenttype": "DocType", diff --git a/frappe/core/doctype/profile/README.md b/frappe/core/doctype/profile/README.md deleted file mode 100644 index 7f3ccf91c2..0000000000 --- a/frappe/core/doctype/profile/README.md +++ /dev/null @@ -1 +0,0 @@ -Profile represents a user in the system. User privileges are based on the Roles assigned by the UserRoles DocType. \ No newline at end of file diff --git a/frappe/core/doctype/profile/__init__.py b/frappe/core/doctype/profile/__init__.py deleted file mode 100644 index e61caaf193..0000000000 --- a/frappe/core/doctype/profile/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt - -from __future__ import unicode_literals diff --git a/frappe/core/doctype/todo/todo.txt b/frappe/core/doctype/todo/todo.txt index 30e2a5336f..11c1458700 100644 --- a/frappe/core/doctype/todo/todo.txt +++ b/frappe/core/doctype/todo/todo.txt @@ -2,7 +2,7 @@ { "creation": "2012-07-03 13:30:35", "docstatus": 0, - "modified": "2014-01-24 16:23:16", + "modified": "2014-01-24 16:23:17", "modified_by": "Administrator", "owner": "Administrator" }, @@ -190,7 +190,7 @@ "fieldname": "assigned_by", "fieldtype": "Link", "label": "Assigned By", - "options": "Profile" + "options": "User" }, { "cancel": 0, diff --git a/frappe/website/doctype/website_sitemap_permission/__init__.py b/frappe/core/doctype/user/__init__.py similarity index 100% rename from frappe/website/doctype/website_sitemap_permission/__init__.py rename to frappe/core/doctype/user/__init__.py diff --git a/frappe/core/doctype/profile/test_profile.py b/frappe/core/doctype/user/test_user.py similarity index 68% rename from frappe/core/doctype/profile/test_profile.py rename to frappe/core/doctype/user/test_user.py index c3bbc69602..ca5cfe8470 100644 --- a/frappe/core/doctype/profile/test_profile.py +++ b/frappe/core/doctype/user/test_user.py @@ -5,19 +5,19 @@ import frappe, unittest from frappe.model.delete_doc import delete_doc, LinkExistsError -class TestProfile(unittest.TestCase): +class TestUser(unittest.TestCase): def test_delete(self): self.assertRaises(LinkExistsError, delete_doc, "Role", "_Test Role 2") frappe.db.sql("""delete from tabUserRole where role='_Test Role 2'""") delete_doc("Role","_Test Role 2") - profile = frappe.bean(copy=test_records[1]) - profile.doc.email = "_test@example.com" - profile.insert() + user = frappe.bean(copy=test_records[1]) + user.doc.email = "_test@example.com" + user.insert() frappe.bean({"doctype": "ToDo", "description": "_Test"}).insert() - delete_doc("Profile", "_test@example.com") + delete_doc("User", "_test@example.com") self.assertTrue(not frappe.db.sql("""select * from `tabToDo` where owner=%s""", ("_test@example.com",))) @@ -26,32 +26,32 @@ class TestProfile(unittest.TestCase): frappe.bean(copy=role_records[1]).insert() def test_get_value(self): - self.assertEquals(frappe.db.get_value("Profile", "test@example.com"), "test@example.com") - self.assertEquals(frappe.db.get_value("Profile", {"email":"test@example.com"}), "test@example.com") - self.assertEquals(frappe.db.get_value("Profile", {"email":"test@example.com"}, "email"), "test@example.com") - self.assertEquals(frappe.db.get_value("Profile", {"email":"test@example.com"}, ["first_name", "email"]), + self.assertEquals(frappe.db.get_value("User", "test@example.com"), "test@example.com") + self.assertEquals(frappe.db.get_value("User", {"email":"test@example.com"}), "test@example.com") + self.assertEquals(frappe.db.get_value("User", {"email":"test@example.com"}, "email"), "test@example.com") + self.assertEquals(frappe.db.get_value("User", {"email":"test@example.com"}, ["first_name", "email"]), ("_Test", "test@example.com")) - self.assertEquals(frappe.db.get_value("Profile", + self.assertEquals(frappe.db.get_value("User", {"email":"test@example.com", "first_name": "_Test"}, ["first_name", "email"]), ("_Test", "test@example.com")) - test_profile = frappe.db.sql("select * from tabProfile where name='test@example.com'", + test_user = frappe.db.sql("select * from tabUser where name='test@example.com'", as_dict=True)[0] - self.assertEquals(frappe.db.get_value("Profile", {"email":"test@example.com"}, "*", as_dict=True), - test_profile) + self.assertEquals(frappe.db.get_value("User", {"email":"test@example.com"}, "*", as_dict=True), + test_user) - self.assertEquals(frappe.db.get_value("Profile", "xxxtest@example.com"), None) + self.assertEquals(frappe.db.get_value("User", "xxxtest@example.com"), None) frappe.db.set_value("Control Panel", "Control Panel", "_test", "_test_val") self.assertEquals(frappe.db.get_value("Control Panel", None, "_test"), "_test_val") self.assertEquals(frappe.db.get_value("Control Panel", "Control Panel", "_test"), "_test_val") def test_doclist(self): - p_meta = frappe.get_doctype("Profile") + p_meta = frappe.get_doctype("User") - self.assertEquals(len(p_meta.get({"doctype": "DocField", "parent": "Profile", "fieldname": "first_name"})), 1) - self.assertEquals(len(p_meta.get({"doctype": "DocField", "parent": "Profile", "fieldname": "^first"})), 1) + self.assertEquals(len(p_meta.get({"doctype": "DocField", "parent": "User", "fieldname": "first_name"})), 1) + self.assertEquals(len(p_meta.get({"doctype": "DocField", "parent": "User", "fieldname": "^first"})), 1) self.assertEquals(len(p_meta.get({"fieldname": ["!=", "first_name"]})), len(p_meta) - 1) self.assertEquals(len(p_meta.get({"fieldname": ["in", ["first_name", "last_name"]]})), 2) self.assertEquals(len(p_meta.get({"fieldname": ["not in", ["first_name", "last_name"]]})), len(p_meta) - 2) @@ -60,7 +60,7 @@ class TestProfile(unittest.TestCase): test_records = [ [ { - "doctype":"Profile", + "doctype":"User", "email": "test@example.com", "first_name": "_Test", "new_password": "testpassword", @@ -79,7 +79,7 @@ test_records = [ ], [ { - "doctype":"Profile", + "doctype":"User", "email": "test1@example.com", "first_name": "_Test1", "new_password": "testpassword" @@ -87,7 +87,7 @@ test_records = [ ], [ { - "doctype":"Profile", + "doctype":"User", "email": "test2@example.com", "first_name": "_Test2", "new_password": "testpassword" @@ -95,7 +95,7 @@ test_records = [ ], [ { - "doctype":"Profile", + "doctype":"User", "email": "testdelete@example.com", "first_name": "_Test", "new_password": "testpassword", diff --git a/frappe/core/doctype/profile/profile.css b/frappe/core/doctype/user/user.css similarity index 100% rename from frappe/core/doctype/profile/profile.css rename to frappe/core/doctype/user/user.css diff --git a/frappe/core/doctype/profile/profile.js b/frappe/core/doctype/user/user.js similarity index 96% rename from frappe/core/doctype/profile/profile.js rename to frappe/core/doctype/user/user.js index a8127a39c8..d7de077f58 100644 --- a/frappe/core/doctype/profile/profile.js +++ b/frappe/core/doctype/user/user.js @@ -11,14 +11,14 @@ cur_frm.cscript.onload = function(doc, dt, dn, callback) { } cur_frm.cscript.before_load = function(doc, dt, dn, callback) { - var update_language_select = function(profile_language) { + var update_language_select = function(user_language) { cur_frm.set_df_property("language", "options", frappe.languages || ["", "English"]); callback && callback(); } if(!frappe.languages) { frappe.call({ - method: "frappe.core.doctype.profile.profile.get_languages", + method: "frappe.core.doctype.user.user.get_languages", callback: function(r) { frappe.languages = r.message; update_language_select(); @@ -34,7 +34,7 @@ cur_frm.cscript.user_image = function(doc) { } cur_frm.cscript.refresh = function(doc) { - if(!doc.__unsaved && frappe.languages && doc.language !== frappe.boot.profile.language) { + if(!doc.__unsaved && frappe.languages && doc.language !== frappe.boot.user.language) { msgprint("Refreshing..."); window.location.reload(); } @@ -94,7 +94,7 @@ frappe.RoleEditor = Class.extend({ this.wrapper = wrapper; $(wrapper).html('
Loading...
') return frappe.call({ - method: 'frappe.core.doctype.profile.profile.get_all_roles', + method: 'frappe.core.doctype.user.user.get_all_roles', callback: function(r) { me.roles = r.message; me.show_roles(); @@ -209,7 +209,7 @@ frappe.RoleEditor = Class.extend({ this.make_perm_dialog() $(this.perm_dialog.body).empty(); return frappe.call({ - method: 'frappe.core.doctype.profile.profile.get_perm_info', + method: 'frappe.core.doctype.user.user.get_perm_info', args: {role: role}, callback: function(r) { var $body = $(me.perm_dialog.body); diff --git a/frappe/core/doctype/profile/profile.py b/frappe/core/doctype/user/user.py similarity index 90% rename from frappe/core/doctype/profile/profile.py rename to frappe/core/doctype/user/user.py index b8a441daaa..5bd3bce4fe 100644 --- a/frappe/core/doctype/profile/profile.py +++ b/frappe/core/doctype/user/user.py @@ -18,7 +18,7 @@ class DocType: self.doc.email = self.doc.email.strip() self.doc.name = self.doc.email - if frappe.db.exists("Profile", self.doc.name): + if frappe.db.exists("User", self.doc.name): throw(_("Name Exists")) def validate(self): @@ -67,7 +67,7 @@ class DocType: if 'max_users' in conf and self.doc.enabled and \ self.doc.name not in ["Administrator", "Guest"] and \ cstr(self.doc.user_type).strip() in ("", "System User"): - active_users = frappe.db.sql("""select count(*) from tabProfile + active_users = frappe.db.sql("""select count(*) from tabUser where ifnull(enabled, 0)=1 and docstatus<2 and ifnull(user_type, "System User") = "System User" and name not in ('Administrator', 'Guest', %s)""", (self.doc.name,))[0][0] @@ -117,15 +117,15 @@ class DocType: from frappe.utils import random_string, get_url key = random_string(32) - frappe.db.set_value("Profile", self.doc.name, "reset_password_key", key) + frappe.db.set_value("User", self.doc.name, "reset_password_key", key) self.password_reset_mail(get_url("/update-password?key=" + key)) def get_other_system_managers(self): return frappe.db.sql("""select distinct parent from tabUserRole user_role where role='System Manager' and docstatus<2 and parent not in ('Administrator', %s) and exists - (select * from `tabProfile` profile - where profile.name=user_role.parent and enabled=1)""", (self.doc.name,)) + (select * from `tabUser` user + where user.name=user_role.parent and enabled=1)""", (self.doc.name,)) def get_fullname(self): """get first_name space last_name""" @@ -148,7 +148,7 @@ class DocType: def send_login_mail(self, subject, template, add_args): """send mail with login details""" - from frappe.profile import get_user_fullname + from frappe.utils.user import get_user_fullname from frappe.utils import get_url mail_titles = frappe.get_hooks().get("login_mail_title", []) @@ -249,7 +249,7 @@ class DocType: # set email frappe.db.sql("""\ - update `tabProfile` set email=%s + update `tabUser` set email=%s where name=%s""", (newdn, newdn)) # update __Auth table @@ -298,7 +298,7 @@ def get_perm_info(arg=None): def update_password(new_password, key=None, old_password=None): # verify old password if key: - user = frappe.db.get_value("Profile", {"reset_password_key":key}) + user = frappe.db.get_value("User", {"reset_password_key":key}) if not user: return _("Cannot Update: Incorrect / Expired Link.") elif old_password: @@ -309,7 +309,7 @@ def update_password(new_password, key=None, old_password=None): _update_password(user, new_password) - frappe.db.set_value("Profile", user, "reset_password_key", "") + frappe.db.set_value("User", user, "reset_password_key", "") frappe.local.login_manager.logout() @@ -317,27 +317,27 @@ def update_password(new_password, key=None, old_password=None): @frappe.whitelist(allow_guest=True) def sign_up(email, full_name): - profile = frappe.db.get("Profile", {"email": email}) - if profile: - if profile.disabled: + user = frappe.db.get("User", {"email": email}) + if user: + if user.disabled: return _("Registered but disabled.") else: return _("Already Registered") else: - if frappe.db.sql("""select count(*) from tabProfile where + if frappe.db.sql("""select count(*) from tabUser where TIMEDIFF(%s, modified) > '1:00:00' """, now())[0][0] > 200: - raise Exception, "Too Many New Profiles" + raise Exception, "Too Many New Users" from frappe.utils import random_string - profile = frappe.bean({ - "doctype":"Profile", + user = frappe.bean({ + "doctype":"User", "email": email, "first_name": full_name, "enabled": 1, "new_password": random_string(10), "user_type": "Website User" }) - profile.ignore_permissions = True - profile.insert() + user.ignore_permissions = True + user.insert() return _("Registration Details Emailed.") @frappe.whitelist(allow_guest=True) @@ -346,19 +346,19 @@ def reset_password(user): if user in ["demo@erpnext.com", "Administrator"]: return "Not allowed" - if frappe.db.sql("""select name from tabProfile where name=%s""", (user,)): + if frappe.db.sql("""select name from tabUser where name=%s""", (user,)): # Hack! frappe.session["user"] = "Administrator" - profile = frappe.bean("Profile", user) - profile.get_controller().reset_password() + user = frappe.bean("User", user) + user.get_controller().reset_password() return "Password reset details sent to your email." else: return "No such user (%s)" % user -def profile_query(doctype, txt, searchfield, start, page_len, filters): +def user_query(doctype, txt, searchfield, start, page_len, filters): from frappe.widgets.reportview import get_match_cond return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name) - from `tabProfile` + from `tabUser` where ifnull(enabled, 0)=1 and docstatus < 2 and name not in ('Administrator', 'Guest') @@ -376,25 +376,25 @@ def profile_query(doctype, txt, searchfield, start, page_len, filters): def get_total_users(): """Returns total no. of system users""" - return frappe.db.sql("""select count(*) from `tabProfile` + return frappe.db.sql("""select count(*) from `tabUser` where enabled = 1 and user_type != 'Website User' and name not in ('Administrator', 'Guest')""")[0][0] def get_active_users(): """Returns No. of system users who logged in, in the last 3 days""" - return frappe.db.sql("""select count(*) from `tabProfile` + return frappe.db.sql("""select count(*) from `tabUser` where enabled = 1 and user_type != 'Website User' and name not in ('Administrator', 'Guest') and hour(timediff(now(), last_login)) < 72""")[0][0] def get_website_users(): """Returns total no. of website users""" - return frappe.db.sql("""select count(*) from `tabProfile` + return frappe.db.sql("""select count(*) from `tabUser` where enabled = 1 and user_type = 'Website User'""")[0][0] def get_active_website_users(): """Returns No. of website users who logged in, in the last 3 days""" - return frappe.db.sql("""select count(*) from `tabProfile` + return frappe.db.sql("""select count(*) from `tabUser` where enabled = 1 and user_type = 'Website User' and hour(timediff(now(), last_login)) < 72""")[0][0] diff --git a/frappe/core/doctype/profile/profile.txt b/frappe/core/doctype/user/user.txt similarity index 95% rename from frappe/core/doctype/profile/profile.txt rename to frappe/core/doctype/user/user.txt index 9fdd7675c1..49ba8436e7 100644 --- a/frappe/core/doctype/profile/profile.txt +++ b/frappe/core/doctype/user/user.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-03-07 11:54:44", + "creation": "2014-03-11 14:55:00", "docstatus": 0, - "modified": "2014-02-27 18:01:32", + "modified": "2014-03-11 16:04:13", "modified_by": "Administrator", "owner": "Administrator" }, @@ -11,7 +11,7 @@ "allow_copy": 0, "allow_import": 1, "allow_rename": 1, - "description": "Profile Represents a User in the system.", + "description": "Represents a User in the system.", "doctype": "DocType", "document_type": "Master", "hide_heading": 0, @@ -28,7 +28,7 @@ { "doctype": "DocField", "name": "__common__", - "parent": "Profile", + "parent": "User", "parentfield": "fields", "parenttype": "DocType" }, @@ -37,14 +37,16 @@ "delete": 0, "doctype": "DocPerm", "name": "__common__", - "parent": "Profile", + "parent": "User", "parentfield": "permissions", "parenttype": "DocType", - "read": 1 + "read": 1, + "report": 1, + "submit": 0 }, { "doctype": "DocType", - "name": "Profile" + "name": "User" }, { "doctype": "DocField", @@ -133,19 +135,6 @@ "options": "Loading...", "permlevel": 0 }, - { - "default": "System User", - "doctype": "DocField", - "fieldname": "user_type", - "fieldtype": "Select", - "label": "User Type", - "oldfieldname": "user_type", - "oldfieldtype": "Select", - "options": "System User\nWebsite User", - "permlevel": 0, - "read_only": 1, - "reqd": 1 - }, { "doctype": "DocField", "fieldname": "change_password", @@ -256,7 +245,7 @@ "permlevel": 0 }, { - "description": "Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.", + "description": "Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.", "doctype": "DocField", "fieldname": "sb1", "fieldtype": "Section Break", @@ -359,7 +348,7 @@ "fieldname": "defaults", "fieldtype": "Table", "hidden": 1, - "label": "Profile Defaults", + "label": "User Defaults", "options": "DefaultValue", "permlevel": 0 }, @@ -372,6 +361,20 @@ "permlevel": 0, "read_only": 1 }, + { + "default": "System User", + "description": "User Type \"System User\" can access Desktop. \"Website User\" can only be logged into the website and portal pages. ", + "doctype": "DocField", + "fieldname": "user_type", + "fieldtype": "Select", + "label": "User Type", + "oldfieldname": "user_type", + "oldfieldtype": "Select", + "options": "System User\nWebsite User", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, { "description": "Allow user to login only after this hour (0-24)", "doctype": "DocField", @@ -506,9 +509,7 @@ "email": 1, "permlevel": 0, "print": 1, - "report": 1, "role": "System Manager", - "submit": 0, "write": 1 }, { @@ -517,6 +518,7 @@ "email": 1, "permlevel": 0, "print": 1, + "restricted": 1, "role": "All", "write": 0 }, @@ -525,9 +527,7 @@ "create": 0, "doctype": "DocPerm", "permlevel": 1, - "report": 1, "role": "System Manager", - "submit": 0, "write": 1 } ] \ No newline at end of file diff --git a/frappe/core/doctype/userrole/README.md b/frappe/core/doctype/userrole/README.md index a89fc32996..2c2c8facc1 100644 --- a/frappe/core/doctype/userrole/README.md +++ b/frappe/core/doctype/userrole/README.md @@ -1 +1 @@ -Role belonging to parent Profile \ No newline at end of file +Role belonging to parent User \ No newline at end of file diff --git a/frappe/core/page/data_import_tool/data_import_tool.js b/frappe/core/page/data_import_tool/data_import_tool.js index 2d9338282f..3be83eebad 100644 --- a/frappe/core/page/data_import_tool/data_import_tool.js +++ b/frappe/core/page/data_import_tool/data_import_tool.js @@ -6,7 +6,7 @@ frappe.pages['data-import-tool'].onload = function(wrapper) { }); // check permission for import - if(!((frappe.boot.profile.can_import && frappe.boot.profile.can_import.length) || + if(!((frappe.boot.user.can_import && frappe.boot.user.can_import.length) || user_roles.indexOf("System Manager")!==-1)) { frappe.show_not_permitted("data-import-tool"); return false; diff --git a/frappe/core/page/messages/messages.py b/frappe/core/page/messages/messages.py index ffb0d4c96e..920fc192b8 100644 --- a/frappe/core/page/messages/messages.py +++ b/frappe/core/page/messages/messages.py @@ -46,9 +46,9 @@ def get_list(arg=None): @frappe.whitelist() def get_active_users(arg=None): return frappe.db.sql("""select name, - (select count(*) from tabSessions where user=tabProfile.name + (select count(*) from tabSessions where user=tabUser.name and timediff(now(), lastupdate) < time("01:00:00")) as has_session - from tabProfile + from tabUser where ifnull(enabled,0)=1 and docstatus < 2 and ifnull(user_type, '')!='Website User' and @@ -90,8 +90,8 @@ def notify(arg=None): from frappe.utils import cstr, get_fullname, get_url frappe.sendmail(\ - recipients=[frappe.db.get_value("Profile", arg["contact"], "email") or arg["contact"]], - sender= frappe.db.get_value("Profile", frappe.session.user, "email"), + recipients=[frappe.db.get_value("User", arg["contact"], "email") or arg["contact"]], + sender= frappe.db.get_value("User", frappe.session.user, "email"), subject="New Message from " + get_fullname(frappe.user.name), message=frappe.get_template("templates/emails/new_message.html").render({ "from": get_fullname(frappe.user.name), diff --git a/frappe/core/page/permission_manager/permission_manager.js b/frappe/core/page/permission_manager/permission_manager.js index af440e4c00..91529311ed 100644 --- a/frappe/core/page/permission_manager/permission_manager.js +++ b/frappe/core/page/permission_manager/permission_manager.js @@ -238,7 +238,7 @@ frappe.PermissionEngine = Class.extend({ }, callback: function(r) { r.message = $.map(r.message, function(p) { - return ''+p+''; + return ''+p+''; }) msgprint("

Users with role "+role+":

" + r.message.join("
")); @@ -415,18 +415,18 @@ frappe.PermissionEngine = Class.extend({ } }); }, - get_profile_fields: function(doctype) { - var profile_fields = frappe.model.get("DocField", {parent:doctype, - fieldtype:"Link", options:"Profile"}); + get_user_fields: function(doctype) { + var user_fields = frappe.model.get("DocField", {parent:doctype, + fieldtype:"Link", options:"User"}); - profile_fields = profile_fields.concat(frappe.model.get("DocField", {parent:doctype, - fieldtype:"Select", link_doctype:"Profile"})) + user_fields = user_fields.concat(frappe.model.get("DocField", {parent:doctype, + fieldtype:"Select", link_doctype:"User"})) - return profile_fields + return user_fields }, get_link_fields: function(doctype) { return link_fields = frappe.model.get("DocField", {parent:doctype, - fieldtype:"Link", options:["not in", ["Profile", '[Select]']]}); + fieldtype:"Link", options:["not in", ["User", '[Select]']]}); } }) @@ -443,8 +443,8 @@ var permissions_help = ['' + __("Setup > Profile") + ')', + __('Roles can be set for users from their User page.') + + ' (' + __("Setup > User") + ')', '', '
  • ', __('The system provides many pre-defined roles. You can add new roles to set finer permissions.') diff --git a/frappe/core/page/permission_manager/permission_manager.py b/frappe/core/page/permission_manager/permission_manager.py index 7ad5b1effe..d2f54da872 100644 --- a/frappe/core/page/permission_manager/permission_manager.py +++ b/frappe/core/page/permission_manager/permission_manager.py @@ -77,12 +77,12 @@ def clear_doctype_cache(doctype): @frappe.whitelist() def get_users_with_role(role): frappe.only_for("System Manager") - return [p[0] for p in frappe.db.sql("""select distinct tabProfile.name - from tabUserRole, tabProfile where + return [p[0] for p in frappe.db.sql("""select distinct tabUser.name + from tabUserRole, tabUser where tabUserRole.role=%s - and tabProfile.name != "Administrator" - and tabUserRole.parent = tabProfile.name - and ifnull(tabProfile.enabled,0)=1""", role)] + and tabUser.name != "Administrator" + and tabUserRole.parent = tabUser.name + and ifnull(tabUser.enabled,0)=1""", role)] @frappe.whitelist() def get_standard_permissions(doctype): diff --git a/frappe/core/page/user_properties/user_properties.js b/frappe/core/page/user_properties/user_properties.js index a7fe659859..ab00811b99 100644 --- a/frappe/core/page/user_properties/user_properties.js +++ b/frappe/core/page/user_properties/user_properties.js @@ -160,7 +160,7 @@ frappe.UserProperties = Class.extend({ $.each(this.prop_list, function(i, d) { var row = $("
  • ").appendTo(me.table.find("tbody")); - $(" + - - - + + + diff --git a/frappe/templates/includes/user_display.html b/frappe/templates/includes/user_display.html new file mode 100644 index 0000000000..4e6bab9e9d --- /dev/null +++ b/frappe/templates/includes/user_display.html @@ -0,0 +1,9 @@ +
    +
    + +
    +
    +
    {{ user.first_name or "" }} {{ user.last_name or "" }}
    +
    {{ user.location or "" }}
    +
    +
    \ No newline at end of file diff --git a/frappe/templates/pages/login.py b/frappe/templates/pages/login.py index 210d8a1a14..b4637d6eeb 100644 --- a/frappe/templates/pages/login.py +++ b/frappe/templates/pages/login.py @@ -33,7 +33,7 @@ oauth2_providers = { "redirect_uri": "/api/method/frappe.templates.pages.login.login_via_google", "auth_url_data": { - "scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email", + "scope": "https://www.googleapis.com/auth/userinfo.user https://www.googleapis.com/auth/userinfo.email", "response_type": "code" }, @@ -162,7 +162,7 @@ def login_via_oauth2(provider, code, decoder=None): def login_oauth_user(data, provider=None): user = data["email"] - if not frappe.db.exists("Profile", user): + if not frappe.db.exists("User", user): create_oauth_user(data, provider) frappe.local.login_manager.user = user @@ -183,8 +183,8 @@ def create_oauth_user(data, provider): if isinstance(data.get("location"), dict): data["location"] = data.get("location").get("name") - profile = frappe.bean({ - "doctype":"Profile", + user = frappe.bean({ + "doctype":"User", "first_name": data.get("first_name") or data.get("given_name") or data.get("name"), "last_name": data.get("last_name") or data.get("family_name"), "email": data["email"], @@ -198,18 +198,18 @@ def create_oauth_user(data, provider): }) if provider=="facebook": - profile.doc.fields.update({ + user.doc.fields.update({ "fb_username": data["username"], "fb_userid": data["id"], "user_image": "https://graph.facebook.com/{username}/picture".format(username=data["username"]) }) elif provider=="google": - profile.doc.google_userid = data["id"] + user.doc.google_userid = data["id"] elif provider=="github": - profile.doc.github_userid = data["id"] - profile.doc.github_username = data["login"] + user.doc.github_userid = data["id"] + user.doc.github_username = data["login"] - profile.ignore_permissions = True - profile.get_controller().no_welcome_mail = True - profile.insert() + user.ignore_permissions = True + user.get_controller().no_welcome_mail = True + user.insert() diff --git a/frappe/templates/pages/update-password.html b/frappe/templates/pages/update-password.html index f08173ceb5..dcccd80b86 100644 --- a/frappe/templates/pages/update-password.html +++ b/frappe/templates/pages/update-password.html @@ -56,7 +56,7 @@ $(document).ready(function() { frappe.call({ type: "POST", - method: "frappe.core.doctype.profile.profile.update_password", + method: "frappe.core.doctype.user.user.update_password", btn: $("#update"), args: args, callback: function(r) { diff --git a/frappe/templates/website_group/forum.py b/frappe/templates/website_group/forum.py index eab00239a0..70fae3ee97 100644 --- a/frappe/templates/website_group/forum.py +++ b/frappe/templates/website_group/forum.py @@ -54,7 +54,7 @@ def get_post_list_html(group, view, limit_start=0, limit_length=20): posts = frappe.db.sql("""select p.*, pr.user_image, pr.first_name, pr.last_name, (select count(pc.name) from `tabPost` pc where pc.parent_post=p.name) as post_reply_count - from `tabPost` p, `tabProfile` pr + from `tabPost` p, `tabUser` pr where p.website_group = %s and pr.name = p.owner and ifnull(p.parent_post, '')='' {conditions} order by {order_by} limit %s, %s""".format(conditions=conditions, order_by=order_by), tuple(values), as_dict=True, debug=True) diff --git a/frappe/templates/website_group/post.py b/frappe/templates/website_group/post.py index 25e359b64d..1563158975 100644 --- a/frappe/templates/website_group/post.py +++ b/frappe/templates/website_group/post.py @@ -26,16 +26,16 @@ def get_post_context(context): return frappe.cache().get_value(cache_key, lambda: _get_post_context()) def get_parent_post_html(post, context): - profile = frappe.bean("Profile", post.owner).doc + user = frappe.bean("User", post.owner).doc for fieldname in ("first_name", "last_name", "user_image", "location"): - post.fields[fieldname] = profile.fields[fieldname] + post.fields[fieldname] = user.fields[fieldname] return frappe.get_template("templates/includes/inline_post.html")\ .render({"post": post.fields, "view": context.view}) def get_child_posts_html(post, context): posts = frappe.db.sql("""select p.*, pr.user_image, pr.first_name, pr.last_name - from tabPost p, tabProfile pr + from tabPost p, tabUser pr where p.parent_post=%s and pr.name = p.owner order by p.creation asc""", (post.name,), as_dict=True) @@ -139,17 +139,17 @@ def process_picture(post, picture_name, picture): @frappe.whitelist() def suggest_user(group, term): """suggest a user that has read permission in this group tree""" - profiles = frappe.db.sql("""select + users = frappe.db.sql("""select pr.name, pr.first_name, pr.last_name, pr.user_image, pr.location - from `tabProfile` pr + from `tabUser` pr where (pr.first_name like %(term)s or pr.last_name like %(term)s) and pr.user_type = 'Website User' and pr.enabled=1""", {"term": "%{}%".format(term), "group": group}, as_dict=True) - template = frappe.get_template("templates/includes/profile_display.html") + template = frappe.get_template("templates/includes/user_display.html") return [{ "value": "{} {}".format(pr.first_name or "", pr.last_name or "").strip(), - "profile_html": template.render({"profile": pr}), - "profile": pr.name - } for pr in profiles] + "user_html": template.render({"user": pr}), + "user": pr.name + } for pr in users] diff --git a/frappe/templates/website_group/settings.html b/frappe/templates/website_group/settings.html index 32d230875b..646d16cb45 100644 --- a/frappe/templates/website_group/settings.html +++ b/frappe/templates/website_group/settings.html @@ -62,7 +62,7 @@ - {% for profile in profiles %} + {% for user in users %} {% include "templates/includes/sitemap_permission.html" %} {% endfor %} diff --git a/frappe/templates/website_group/settings.py b/frappe/templates/website_group/settings.py index 66233297bf..702263ed40 100644 --- a/frappe/templates/website_group/settings.py +++ b/frappe/templates/website_group/settings.py @@ -13,25 +13,25 @@ def suggest_user(term, group): if not get_access(pathname).get("admin"): raise frappe.PermissionError - profiles = frappe.db.sql("""select pr.name, pr.first_name, pr.last_name, + users = frappe.db.sql("""select pr.name, pr.first_name, pr.last_name, pr.user_image, pr.location - from `tabProfile` pr + from `tabUser` pr where (pr.first_name like %(term)s or pr.last_name like %(term)s) and pr.user_type = "Website User" and pr.user_image is not null and pr.enabled=1 and not exists(select wsp.name from `tabWebsite Route Permission` wsp - where wsp.website_route=%(group)s and wsp.profile=pr.name)""", + where wsp.website_route=%(group)s and wsp.user=pr.name)""", {"term": "%{}%".format(term), "group": pathname}, as_dict=True) - template = frappe.get_template("templates/includes/profile_display.html") + template = frappe.get_template("templates/includes/user_display.html") return [{ "value": "{} {}".format(pr.first_name or "", pr.last_name or ""), - "profile_html": template.render({"profile": pr}), - "profile": pr.name - } for pr in profiles] + "user_html": template.render({"user": pr}), + "user": pr.name + } for pr in users] @frappe.whitelist() -def add_sitemap_permission(group, profile): +def add_sitemap_permission(group, user): pathname = get_pathname(group) if not get_access(pathname).get("admin"): raise frappe.PermissionError @@ -39,26 +39,26 @@ def add_sitemap_permission(group, profile): permission = frappe.bean({ "doctype": "Website Route Permission", "website_route": pathname, - "profile": profile, + "user": user, "read": 1 }) permission.insert(ignore_permissions=True) - profile = permission.doc.fields - profile.update(frappe.db.get_value("Profile", profile.profile, + user = permission.doc.fields + user.update(frappe.db.get_value("User", user.user, ["name", "first_name", "last_name", "user_image", "location"], as_dict=True)) return frappe.get_template("templates/includes/sitemap_permission.html").render({ - "profile": profile + "user": user }) @frappe.whitelist() -def update_permission(group, profile, perm, value): +def update_permission(group, user, perm, value): pathname = get_pathname(group) if not get_access(pathname).get("admin"): raise frappe.PermissionError - permission = frappe.bean("Website Route Permission", {"website_route": pathname, "profile": profile}) + permission = frappe.bean("Website Route Permission", {"website_route": pathname, "user": user}) permission.doc.fields[perm] = int(value) permission.save(ignore_permissions=True) @@ -68,7 +68,7 @@ def update_permission(group, profile, perm, value): subject = "You have been made Administrator of Group " + group_title - send(recipients=[profile], + send(recipients=[user], subject= subject, add_unsubscribe_link=False, message="""

    Group Notification

    \

    %s

    \ diff --git a/frappe/tests/test_db.py b/frappe/tests/test_db.py index 7802d3273e..8d827accfc 100644 --- a/frappe/tests/test_db.py +++ b/frappe/tests/test_db.py @@ -10,21 +10,21 @@ class TestDB(unittest.TestCase): def test_get_value(self): from frappe.utils import now_datetime import time - frappe.db.sql("""delete from `tabProfile` where name not in ('Administrator', 'Guest')""") + frappe.db.sql("""delete from `tabUser` where name not in ('Administrator', 'Guest')""") now = now_datetime() - self.assertEquals(frappe.db.get_value("Profile", {"name": ["=", "Administrator"]}), "Administrator") - self.assertEquals(frappe.db.get_value("Profile", {"name": ["like", "Admin%"]}), "Administrator") - self.assertEquals(frappe.db.get_value("Profile", {"name": ["!=", "Guest"]}), "Administrator") - self.assertEquals(frappe.db.get_value("Profile", {"modified": ["<", now]}), "Administrator") - self.assertEquals(frappe.db.get_value("Profile", {"modified": ["<=", now]}), "Administrator") + self.assertEquals(frappe.db.get_value("User", {"name": ["=", "Administrator"]}), "Administrator") + self.assertEquals(frappe.db.get_value("User", {"name": ["like", "Admin%"]}), "Administrator") + self.assertEquals(frappe.db.get_value("User", {"name": ["!=", "Guest"]}), "Administrator") + self.assertEquals(frappe.db.get_value("User", {"modified": ["<", now]}), "Administrator") + self.assertEquals(frappe.db.get_value("User", {"modified": ["<=", now]}), "Administrator") time.sleep(2) - if "Profile" in frappe.local.test_objects: - del frappe.local.test_objects["Profile"] - make_test_records("Profile") + if "User" in frappe.local.test_objects: + del frappe.local.test_objects["User"] + make_test_records("User") - self.assertEquals("test1@example.com", frappe.db.get_value("Profile", {"modified": [">", now]})) - self.assertEquals("test1@example.com", frappe.db.get_value("Profile", {"modified": [">=", now]})) + self.assertEquals("test1@example.com", frappe.db.get_value("User", {"modified": [">", now]})) + self.assertEquals("test1@example.com", frappe.db.get_value("User", {"modified": [">=", now]})) \ No newline at end of file diff --git a/frappe/tests/test_email.py b/frappe/tests/test_email.py index 1c8bae347d..6f875728fe 100644 --- a/frappe/tests/test_email.py +++ b/frappe/tests/test_email.py @@ -7,11 +7,11 @@ import os, sys import unittest, frappe from frappe.test_runner import make_test_records -make_test_records("Profile") +make_test_records("User") class TestEmail(unittest.TestCase): def setUp(self): - frappe.db.sql("""update tabProfile set unsubscribed=0""") + frappe.db.sql("""update tabUser set unsubscribed=0""") frappe.db.sql("""delete from `tabBulk Email`""") def test_send(self): @@ -22,7 +22,7 @@ class TestEmail(unittest.TestCase): from frappe.utils.email_lib.bulk import send send(recipients = ['test@example.com', 'test1@example.com'], sender="admin@example.com", - doctype='Profile', email_field='email', + doctype='User', email_field='email', subject='Testing Bulk', message='This is a bulk mail!') bulk = frappe.db.sql("""select * from `tabBulk Email` where status='Not Sent'""", as_dict=1) @@ -44,7 +44,7 @@ class TestEmail(unittest.TestCase): from frappe.utils.email_lib.bulk import unsubscribe, send frappe.local.form_dict = { 'email':'test@example.com', - 'type':'Profile', + 'type':'User', 'email_field':'email', "from_test": True } @@ -52,7 +52,7 @@ class TestEmail(unittest.TestCase): send(recipients = ['test@example.com', 'test1@example.com'], sender="admin@example.com", - doctype='Profile', email_field='email', + doctype='User', email_field='email', subject='Testing Bulk', message='This is a bulk mail!') bulk = frappe.db.sql("""select * from `tabBulk Email` where status='Not Sent'""", @@ -67,7 +67,7 @@ class TestEmail(unittest.TestCase): self.assertRaises(BulkLimitCrossedError, send, recipients=['test@example.com']*1000, sender="admin@example.com", - doctype='Profile', email_field='email', + doctype='User', email_field='email', subject='Testing Bulk', message='This is a bulk mail!') diff --git a/frappe/translate.py b/frappe/translate.py index 783d20d45c..223bb4c83e 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -21,7 +21,7 @@ import frappe, os, re, codecs, json def get_user_lang(user=None): if not user: user = frappe.session.user - user_lang = frappe.db.get_value("Profile", user, "language") + user_lang = frappe.db.get_value("User", user, "language") return get_lang_dict().get(user_lang!="Loading..." and user_lang or "english") def get_all_languages(): diff --git a/frappe/translations/ar.csv b/frappe/translations/ar.csv index 3d51f7a2a8..5999373952 100644 --- a/frappe/translations/ar.csv +++ b/frappe/translations/ar.csv @@ -132,7 +132,7 @@ Center,مركز "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.",يجب أن لا يتم تغيير بعض الوثائق النهائية مرة واحدة، مثل الفاتورة على سبيل المثال. ويسمى قدمت الدولة النهائية لهذه الوثائق. يمكنك تقييد الأدوار التي يمكن أن تقدم. Chat,الدردشة Check,تحقق -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,تحقق أدوار ازل / المسندة إلى الملف. انقر على دور لمعرفة ما الأذونات التي الدور الذي. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,تحقق أدوار ازل / المسندة إلى الملف. انقر على دور لمعرفة ما الأذونات التي الدور الذي. Check this to make this the default letter head in all prints,التحقق من ذلك لجعل هذه الرسالة الافتراضية الرأس في جميع الطبعات Checked,فحص Child Tables are shown as a Grid in other DocTypes.,وتظهر جداول الطفل بأنه في الشبكة DocTypes أخرى. @@ -603,11 +603,11 @@ Print Width,طباعة العرض Print...,طباعة ... Priority,أفضلية Private,خاص -Profile,الملف الشخصي -Profile Defaults,الملف الشخصي الافتراضيات -Profile Represents a User in the system.,الملف الشخصي يمثل مستخدم في النظام. -Profile of a Blogger,الملف الشخصي من مدون -Profile of a blog writer.,الملف الشخصي للكاتب بلوق. +User,الملف الشخصي +User Defaults,الملف الشخصي الافتراضيات +User Represents a User in the system.,الملف الشخصي يمثل مستخدم في النظام. +User of a Blogger,الملف الشخصي من مدون +User of a blog writer.,الملف الشخصي للكاتب بلوق. Properties,خصائص Property,ممتلكات Property Setter,الملكية واضعة @@ -815,7 +815,7 @@ To,إلى "To further restrict permissions based on certain values in a document, use the 'Condition' settings.",لفرض مزيد من القيود أذونات استنادا إلى قيم معينة في وثيقة، استخدم 'حالة' الإعدادات. To restrict a User of a particular Role to documents that are explicitly assigned to them,لتقييد المستخدم من دور خاص للوثائق التي تم تعيينها بشكل صريح لهم To restrict a User of a particular Role to documents that are only self-created.,لتقييد المستخدم من دور خاص للوثائق التي ليست سوى الذاتي الإنشاء. -"To set user roles, just go to Setup > Users and click on the user to assign roles.",لتعيين أدوار المستخدمين، واذهبوا إلى إعداد المستخدمين> وانقر على المستخدم لتعيين الأدوار. +"To set user roles, just go to Setup > Users and click on the user to assign roles.",لتعيين أدوار المستخدمين، واذهبوا إلى إعداد المستخدمين> وانقر على المستخدم لتعيين الأدوار. ToDo,قائمة المهام Tools,أدوات Top Bar,مقهى الأعلى @@ -944,7 +944,7 @@ circle-arrow-up,دائرة السهم إلى أعلى cog,تحكم في comment,تعليق comments,تعليقات -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,إنشاء حقل مخصص من نوع لينك (الملف الشخصي) ثم استخدام 'حالة' إعدادات لتعيين هذا الحقل إلى الحكم إذن. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,إنشاء حقل مخصص من نوع لينك (الملف الشخصي) ثم استخدام 'حالة' إعدادات لتعيين هذا الحقل إلى الحكم إذن. dd-mm-yyyy,DD-MM-YYYY dd/mm/yyyy,اليوم / الشهر / السنة does not exist,غير موجود diff --git a/frappe/translations/de.csv b/frappe/translations/de.csv index 31c9e825f1..1d572a49d0 100644 --- a/frappe/translations/de.csv +++ b/frappe/translations/de.csv @@ -128,7 +128,7 @@ Center,Zentrum "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Bestimmte Dokumente sollten nicht geändert werden, nachdem endgültig angesehen werden, wie eine Rechnung zum Beispiel. Der Endzustand für solche Dokumente wird als Eingereicht . Sie können einschränken, welche Rollen können Sie auf Absenden." Chat,Plaudern Check,Überprüfen -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,"Aktivieren / Deaktivieren zugewiesenen Rollen der Profile. Klicken Sie auf die Rolle, um herauszufinden, welche Berechtigungen dieser Rolle hat." +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,"Aktivieren / Deaktivieren zugewiesenen Rollen der User. Klicken Sie auf die Rolle, um herauszufinden, welche Berechtigungen dieser Rolle hat." Check this to make this the default letter head in all prints,"Aktivieren Sie diese Option, um es als Standard-Briefkopf in allen Ausdrucke" Checked,Geprüft Child Tables are shown as a Grid in other DocTypes.,Child-Tabellen werden als Grid in anderen DocTypes gezeigt. @@ -593,11 +593,11 @@ Print Width,Druckbreite Print...,Drucken ... Priority,Priorität Private,Privat -Profile,Profil -Profile Defaults,Profil Defaults -Profile Represents a User in the system.,Stellt ein Benutzerprofil im System. -Profile of a Blogger,Profil eines Blogger -Profile of a blog writer.,Profil eines Blog-Schreiber. +User,Profil +User Defaults,Profil Defaults +User Represents a User in the system.,Stellt ein Benutzerprofil im System. +User of a Blogger,Profil eines Blogger +User of a blog writer.,Profil eines Blog-Schreiber. Properties,Eigenschaften Property,Eigentum Property Setter,Property Setter @@ -791,7 +791,7 @@ Title Prefix,Title Prefix "To report an issue, go to ", To restrict a User of a particular Role to documents that are explicitly assigned to them,"Um einen Benutzer einer bestimmten Rolle zu Dokumenten, die ihnen ausdrücklich zugeordnet beschränken" To restrict a User of a particular Role to documents that are only self-created.,"Um einen Benutzer einer bestimmten Rolle zu Dokumenten, die nur selbst erstellte sind zu beschränken." -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Benutzerrollen, nur um Setup> Benutzer und klicken Sie auf den Benutzer Rollen zuweisen." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Benutzerrollen, nur um Setup> Benutzer und klicken Sie auf den Benutzer Rollen zuweisen." ToDo,ToDo Tools,Werkzeuge Top Bar,Top Bar @@ -918,7 +918,7 @@ circle-arrow-right,circle-arrow-right circle-arrow-up,circle-arrow-up cog,Zahn comment,Kommentar -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,"erstellen ein benutzerdefiniertes Feld vom Typ Link (Profile) und dann die 'Bedingung' Einstellungen, um das Feld der Erlaubnis der Regel abzubilden." +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,"erstellen ein benutzerdefiniertes Feld vom Typ Link (User) und dann die 'Bedingung' Einstellungen, um das Feld der Erlaubnis der Regel abzubilden." dd-mm-yyyy,dd-mm-yyyy dd/mm/yyyy,dd / mm / yyyy does not exist,nicht vorhanden diff --git a/frappe/translations/el.csv b/frappe/translations/el.csv index cfb5d397de..b704763fe5 100644 --- a/frappe/translations/el.csv +++ b/frappe/translations/el.csv @@ -132,7 +132,7 @@ Center,Κέντρο "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Ορισμένα έγγραφα δεν πρέπει να αλλάζονται μία φορά τελικό, όπως ένα τιμολόγιο για παράδειγμα. Η τελική κατάσταση των εν λόγω εγγράφων ονομάζεται Υποβλήθηκε. Μπορείτε να περιορίσετε το ποιοι ρόλοι θα μπορούν να υποβάλουν." Chat,Κουβέντα Check,Έλεγχος -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Ελέγξτε / ρόλους Αποεπιλέξτε ανατεθεί στο προφίλ. Κάντε κλικ για το ρόλο για να μάθετε ποια είναι τα δικαιώματα που έχει ο ρόλος. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Ελέγξτε / ρόλους Αποεπιλέξτε ανατεθεί στο προφίλ. Κάντε κλικ για το ρόλο για να μάθετε ποια είναι τα δικαιώματα που έχει ο ρόλος. Check this to make this the default letter head in all prints,Επιλέξτε το για να κάνουν αυτό το κεφάλι επιστολή προεπιλογή σε όλες τις εκτυπώσεις Checked,Δανεισμός Child Tables are shown as a Grid in other DocTypes.,Οι πίνακες παιδιών απεικονίζεται ως πλέγμα σε άλλες doctypes. @@ -603,11 +603,11 @@ Print Width,Πλάτος Εκτύπωση Print...,Εκτύπωση ... Priority,Προτεραιότητα Private,Ιδιωτικός -Profile,Προφίλ -Profile Defaults,Προεπιλογές Προφίλ -Profile Represents a User in the system.,Προφίλ Εκπροσωπεί ένα χρήστη στο σύστημα. -Profile of a Blogger,Προφίλ του Blogger -Profile of a blog writer.,Προφίλ του blog συγγραφέας. +User,Προφίλ +User Defaults,Προεπιλογές Προφίλ +User Represents a User in the system.,Προφίλ Εκπροσωπεί ένα χρήστη στο σύστημα. +User of a Blogger,Προφίλ του Blogger +User of a blog writer.,Προφίλ του blog συγγραφέας. Properties,Ακίνητα Property,Ιδιοκτησία Property Setter,Setter Ακινήτου @@ -815,7 +815,7 @@ To,Να "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Για να περιορίσετε περαιτέρω δικαιώματα βασίζεται σε ορισμένες αξίες σε ένα έγγραφο, χρησιμοποιήστε τα «Κατάσταση» ρυθμίσεις." To restrict a User of a particular Role to documents that are explicitly assigned to them,Για να περιορίσετε ένα χρήστη από ένα συγκεκριμένο ρόλο σε έγγραφα που έχουν ανατεθεί ρητά σε αυτούς To restrict a User of a particular Role to documents that are only self-created.,Για να περιορίσετε ένα χρήστη από ένα συγκεκριμένο ρόλο σε έγγραφα που είναι μόνο αυτο-δημιουργήθηκε. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Για να ορίσετε τους ρόλους χρήστη, απλά πηγαίνετε να στήσετε χρηστών> και κάντε κλικ στο χρήστη να αναθέσει ρόλους." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Για να ορίσετε τους ρόλους χρήστη, απλά πηγαίνετε να στήσετε χρηστών> και κάντε κλικ στο χρήστη να αναθέσει ρόλους." ToDo,Εκκρεμότητες Tools,Εργαλεία Top Bar,Top Bar @@ -944,7 +944,7 @@ circle-arrow-up,κύκλο-arrow-up cog,δόντι τροχού comment,σχόλιο comments,σχόλια -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,δημιουργήσετε ένα προσαρμοσμένο πεδίο της σύνδεσης τύπου (Profile) και στη συνέχεια να χρησιμοποιούν τις «Κατάσταση» τις ρυθμίσεις για να χαρτογραφήσει αυτό το πεδίο στον κανόνα άδεια. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,δημιουργήσετε ένα προσαρμοσμένο πεδίο της σύνδεσης τύπου (User) και στη συνέχεια να χρησιμοποιούν τις «Κατάσταση» τις ρυθμίσεις για να χαρτογραφήσει αυτό το πεδίο στον κανόνα άδεια. dd-mm-yyyy,dd-mm-yyyy dd/mm/yyyy,ηη / μμ / εεεε does not exist,δεν υπάρχει diff --git a/frappe/translations/es.csv b/frappe/translations/es.csv index 37b561e310..d4dd5570be 100644 --- a/frappe/translations/es.csv +++ b/frappe/translations/es.csv @@ -132,7 +132,7 @@ Center,Centro "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Algunos documentos no se deben cambiar una vez final, como una factura, por ejemplo. El estado final de dichos documentos se llama Enviado. Puede restringir qué roles pueden Submit." Chat,Charlar Check,Comprobar -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Compruebe / roles Desmarcar asignado al perfil. Haga clic en la función para averiguar qué permisos que rol tiene. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Compruebe / roles Desmarcar asignado al perfil. Haga clic en la función para averiguar qué permisos que rol tiene. Check this to make this the default letter head in all prints,Marca esta casilla para hacer esta cabeza defecto la carta en todas las impresiones Checked,Comprobado Child Tables are shown as a Grid in other DocTypes.,Tablas secundarias se muestran como una cuadrícula en DocTypes otros. @@ -603,11 +603,11 @@ Print Width,Ancho de impresión Print...,Imprimir ... Priority,Prioridad Private,Privado -Profile,Perfil -Profile Defaults,Predeterminados del perfil -Profile Represents a User in the system.,Representa un perfil de usuario en el sistema. -Profile of a Blogger,Perfil de un Blogger -Profile of a blog writer.,Perfil de un escritor de blog. +User,Perfil +User Defaults,Predeterminados del perfil +User Represents a User in the system.,Representa un perfil de usuario en el sistema. +User of a Blogger,Perfil de un Blogger +User of a blog writer.,Perfil de un escritor de blog. Properties,Propiedades Property,Propiedad Property Setter,Propiedad Setter @@ -815,7 +815,7 @@ To,A "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Para restringir aún más permisos en función de determinados valores en un documento, utilice la "condición" de configuración." To restrict a User of a particular Role to documents that are explicitly assigned to them,Para restringir un usuario de un papel especial a los documentos que están expresamente asignadas To restrict a User of a particular Role to documents that are only self-created.,Para restringir un usuario de un rol de particular a documentos que sólo son de creación propia. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Para definir funciones de usuario, basta con ir a Configuración> Usuarios y haga clic en el usuario para asignar roles." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Para definir funciones de usuario, basta con ir a Configuración> Usuarios y haga clic en el usuario para asignar roles." ToDo,ToDo Tools,Instrumentos Top Bar,Bar Top @@ -944,7 +944,7 @@ circle-arrow-up,"círculo, flecha hacia arriba" cog,diente comment,comentario comments,comentarios -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,crear un campo personalizado de enlace tipo (perfil) y luego usar la "condición" configuración para asignar ese campo a la regla de permiso. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,crear un campo personalizado de enlace tipo (perfil) y luego usar la "condición" configuración para asignar ese campo a la regla de permiso. dd-mm-yyyy,dd-mm-aaaa dd/mm/yyyy,dd / mm / aaaa does not exist,no existe diff --git a/frappe/translations/fr.csv b/frappe/translations/fr.csv index ad5bf32b8b..f3ea5573ec 100644 --- a/frappe/translations/fr.csv +++ b/frappe/translations/fr.csv @@ -132,7 +132,7 @@ Center,Centre "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Certains documents ne doivent pas être modifiés une fois définitif, comme une facture par exemple. L'état final de ces documents est appelée Soumis. Vous pouvez restreindre les rôles qui peuvent Soumettre." Chat,Bavarder Check,Vérifier -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Vérifiez / Décochez les rôles assignés au profil. Cliquez sur le Rôle de savoir ce que ce rôle a des autorisations. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Vérifiez / Décochez les rôles assignés au profil. Cliquez sur le Rôle de savoir ce que ce rôle a des autorisations. Check this to make this the default letter head in all prints,Cochez cette case pour faire de cette tête de lettre par défaut dans toutes les copies Checked,Vérifié Child Tables are shown as a Grid in other DocTypes.,Tableaux pour enfants sont présentés comme une grille dans DocTypes autres. @@ -603,11 +603,11 @@ Print Width,Largeur d'impression Print...,Imprimer ... Priority,Priorité Private,Privé -Profile,Profil -Profile Defaults,Par défaut le profil -Profile Represents a User in the system.,Représente un profil utilisateur dans le système. -Profile of a Blogger,Profil d'un Blogger -Profile of a blog writer.,Profil d'un auteur de blog. +User,Profil +User Defaults,Par défaut le profil +User Represents a User in the system.,Représente un profil utilisateur dans le système. +User of a Blogger,Profil d'un Blogger +User of a blog writer.,Profil d'un auteur de blog. Properties,Propriétés Property,Propriété Property Setter,Setter propriété @@ -815,7 +815,7 @@ To,À "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Afin de restreindre les autorisations sur la base de certaines valeurs dans un document, utilisez la «condition» des paramètres." To restrict a User of a particular Role to documents that are explicitly assigned to them,Pour limiter un utilisateur d'un rôle particulier aux documents qui sont explicitement affectés à leur To restrict a User of a particular Role to documents that are only self-created.,Pour limiter un utilisateur d'un rôle particulier aux documents qui ne sont auto-créé. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Pour définir les rôles des utilisateurs, allez à Configuration> Utilisateurs et cliquez sur l'utilisateur d'attribuer des rôles." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Pour définir les rôles des utilisateurs, allez à Configuration> Utilisateurs et cliquez sur l'utilisateur d'attribuer des rôles." ToDo,ToDo Tools,Outils Top Bar,Top Bar @@ -944,7 +944,7 @@ circle-arrow-up,cercle-flèche-haut cog,dent comment,commenter comments,commentaires -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,"créer un champ personnalisé de type de lien (profil), puis utiliser la «condition» des paramètres de cartographier ce domaine à la règle d'autorisation." +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,"créer un champ personnalisé de type de lien (profil), puis utiliser la «condition» des paramètres de cartographier ce domaine à la règle d'autorisation." dd-mm-yyyy,jj-mm-aaaa dd/mm/yyyy,jj / mm / aaaa does not exist,n'existe pas diff --git a/frappe/translations/hi.csv b/frappe/translations/hi.csv index ea87a6ee8a..b5d59166ca 100644 --- a/frappe/translations/hi.csv +++ b/frappe/translations/hi.csv @@ -132,7 +132,7 @@ Center,केंद्र "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","कुछ दस्तावेजों एक बार अंतिम नहीं उदाहरण के लिए एक चालान की तरह बदल गया है,. ऐसे दस्तावेजों के लिए अंतिम राज्य प्रस्तुत कहा जाता है. आप को सीमित कर सकते हैं जो भूमिका प्रस्तुत कर सकते हैं." Chat,बातचीत Check,चेक -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,/ अनचेक करें प्रोफ़ाइल को सौंपा भूमिकाओं की जाँच करें. रोल पर क्लिक करें पता लगाने के लिए अनुमति है कि क्या भूमिका है. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,/ अनचेक करें प्रोफ़ाइल को सौंपा भूमिकाओं की जाँच करें. रोल पर क्लिक करें पता लगाने के लिए अनुमति है कि क्या भूमिका है. Check this to make this the default letter head in all prints,इस जाँच के लिए सभी प्रिंट में इस डिफ़ॉल्ट पत्र सिर Checked,जाँचा गया Child Tables are shown as a Grid in other DocTypes.,बाल टेबल्स अन्य doctypes में एक ग्रिड के रूप में दिखाया जाता है. @@ -603,11 +603,11 @@ Print Width,प्रिंट चौड़ाई Print...,प्रिंट ... Priority,प्राथमिकता Private,निजी -Profile,रूपरेखा -Profile Defaults,प्रोफ़ाइल डिफ़ॉल्ट्स -Profile Represents a User in the system.,प्रणाली में एक उपयोगकर्ता का प्रतिनिधित्व करता है. -Profile of a Blogger,एक ब्लॉगर की प्रोफाइल -Profile of a blog writer.,एक ब्लॉग लेखक का प्रोफ़ाइल. +User,रूपरेखा +User Defaults,प्रोफ़ाइल डिफ़ॉल्ट्स +User Represents a User in the system.,प्रणाली में एक उपयोगकर्ता का प्रतिनिधित्व करता है. +User of a Blogger,एक ब्लॉगर की प्रोफाइल +User of a blog writer.,एक ब्लॉग लेखक का प्रोफ़ाइल. Properties,गुण Property,संपत्ति Property Setter,संपत्ति सेटर @@ -815,7 +815,7 @@ To,से "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","आगे एक दस्तावेज़ में कुछ मूल्यों के आधार पर अनुमति को प्रतिबंधित करने के लिए, 'स्थिति' सेटिंग का उपयोग करें." To restrict a User of a particular Role to documents that are explicitly assigned to them,दस्तावेजों है कि स्पष्ट रूप से उन्हें करने के लिए आवंटित कर रहे हैं एक विशेष भूमिका के एक प्रयोक्ता को प्रतिबंधित To restrict a User of a particular Role to documents that are only self-created.,दस्तावेजों कि केवल स्वयं बनाया हैं एक विशेष भूमिका के एक प्रयोक्ता को प्रतिबंधित. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","उपयोगकर्ता भूमिकाओं सेट, बस जाने के सेटअप> उपयोगकर्ता और उपयोगकर्ता पर क्लिक करने के लिए भूमिकाएँ असाइन." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","उपयोगकर्ता भूमिकाओं सेट, बस जाने के सेटअप> उपयोगकर्ता और उपयोगकर्ता पर क्लिक करने के लिए भूमिकाएँ असाइन." ToDo,ToDo Tools,उपकरण Top Bar,शीर्ष बार @@ -944,7 +944,7 @@ circle-arrow-up,वृत्त - तीर अप cog,दांत comment,टिप्पणी comments,टिप्पणियां -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,प्रकार लिंक (प्रोफाइल) के एक कस्टम फ़ील्ड बना सकते हैं और फिर 'स्थिति' सेटिंग का उपयोग करने के लिए अनुमति शासन करने के लिए है कि क्षेत्र के नक्शे. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,प्रकार लिंक (प्रोफाइल) के एक कस्टम फ़ील्ड बना सकते हैं और फिर 'स्थिति' सेटिंग का उपयोग करने के लिए अनुमति शासन करने के लिए है कि क्षेत्र के नक्शे. dd-mm-yyyy,डीडी-mm-yyyy dd/mm/yyyy,dd / mm / yyyy does not exist,मौजूद नहीं है diff --git a/frappe/translations/hr.csv b/frappe/translations/hr.csv index a8a8edefa2..532cbf232c 100644 --- a/frappe/translations/hr.csv +++ b/frappe/translations/hr.csv @@ -132,7 +132,7 @@ Center,Centar "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Određene dokumente ne treba mijenjati jednom finalu, kao i račun za primjer. Konačno stanje za takvim dokumentima se zove Postavio. Možete ograničiti koje uloge mogu Submit." Chat,Razgovor Check,Provjeriti -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Provjerite / Odznačite uloge dodijeljene profil. Kliknite na ulozi saznati što dozvole da uloga. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Provjerite / Odznačite uloge dodijeljene profil. Kliknite na ulozi saznati što dozvole da uloga. Check this to make this the default letter head in all prints,Provjerite to napraviti ovu glavu zadani slovo u svim otisaka Checked,Provjeren Child Tables are shown as a Grid in other DocTypes.,Dijete Tablice su prikazane kao Grid u drugim DocTypes. @@ -603,11 +603,11 @@ Print Width,Širina ispisa Print...,Ispis ... Priority,Prioritet Private,Privatan -Profile,Profil -Profile Defaults,Profil Zadano -Profile Represents a User in the system.,Profil Predstavlja korisnika u sustavu. -Profile of a Blogger,Profil od Bloggeru -Profile of a blog writer.,Profil blog pisac. +User,Profil +User Defaults,Profil Zadano +User Represents a User in the system.,Profil Predstavlja korisnika u sustavu. +User of a Blogger,Profil od Bloggeru +User of a blog writer.,Profil blog pisac. Properties,Nekretnine Property,Vlasništvo Property Setter,Nekretnine seter @@ -815,7 +815,7 @@ To,Na "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Kako bi se dodatno ograničiti dozvole na temelju određenih vrijednosti u dokumentu, koristite 'stanje' postavke." To restrict a User of a particular Role to documents that are explicitly assigned to them,Da biste ograničili korisnik određenu ulogu na dokumente koji su izričito dodijeljene im To restrict a User of a particular Role to documents that are only self-created.,Da biste ograničili korisnik određenu ulogu dokumentima koji su samo self-kreirana. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Da biste postavili korisničke uloge, samo idite na Postavke> Korisnici i kliknite na korisnika dodijeliti uloge." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Da biste postavili korisničke uloge, samo idite na Postavke> Korisnici i kliknite na korisnika dodijeliti uloge." ToDo,ToDo Tools,Alat Top Bar,Najbolje Bar @@ -944,7 +944,7 @@ circle-arrow-up,krug sa strelicom prema gore cog,vršak comment,komentirati comments,komentari -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,"stvoriti Custom Field tipa Link (Profil), a zatim koristiti 'stanje' postavke na karti koje polje na dozvole vladavine." +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,"stvoriti Custom Field tipa Link (Profil), a zatim koristiti 'stanje' postavke na karti koje polje na dozvole vladavine." dd-mm-yyyy,dd-mm-yyyy dd/mm/yyyy,dd / mm / gggg does not exist,ne postoji diff --git a/frappe/translations/it.csv b/frappe/translations/it.csv index da70959505..4f21d53290 100644 --- a/frappe/translations/it.csv +++ b/frappe/translations/it.csv @@ -132,7 +132,7 @@ Center,Centro "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Alcuni documenti non devono essere modificati una volta definiti, come una fattura, per esempio. Lo stato finale di tali documenti è chiamato Inserito. È possibile limitare quali ruoli possono Inviare." Chat,Chat Check,Seleziona -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Seleziona / Deseleziona ruoli assegnati al profilo. Fare clic sul ruolo per scoprire quali autorizzazioni ha il ruolo. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Seleziona / Deseleziona ruoli assegnati al profilo. Fare clic sul ruolo per scoprire quali autorizzazioni ha il ruolo. Check this to make this the default letter head in all prints,Seleziona per usare questa intestazione in tutte le stampe Checked,Selezionato Child Tables are shown as a Grid in other DocTypes.,Tabelle figlio sono mostrati come una griglia in altre DOCTYPE. @@ -603,11 +603,11 @@ Print Width,Larghezza di stampa Print...,Stampa ... Priority,Priorità Private,Privato -Profile,Profilo -Profile Defaults,Defaults Profilo -Profile Represents a User in the system.,Profilo Rappresenta un utente nel sistema. -Profile of a Blogger,Profilo di un Blogger -Profile of a blog writer.,Profilo di uno scrittore blog. +User,Profilo +User Defaults,Defaults Profilo +User Represents a User in the system.,Profilo Rappresenta un utente nel sistema. +User of a Blogger,Profilo di un Blogger +User of a blog writer.,Profilo di uno scrittore blog. Properties,Proprietà Property,Proprietà Property Setter,Setter Proprietà @@ -815,7 +815,7 @@ To,A "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Per limitare ulteriormente i permessi in base a determinati valori di un documento, utilizzare le impostazioni di 'condizione'." To restrict a User of a particular Role to documents that are explicitly assigned to them,Per impedire a un utente di un particolare ruolo a documenti che sono esplicitamente assegnati a loro To restrict a User of a particular Role to documents that are only self-created.,Per impedire a un utente di un particolare ruolo a documenti che sono solo auto-creato. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Per impostare i ruoli utente, basta andare su Impostazioni> Utenti e fare clic sull'utente per assegnare ruoli." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Per impostare i ruoli utente, basta andare su Impostazioni> Utenti e fare clic sull'utente per assegnare ruoli." ToDo,ToDo Tools,Strumenti Top Bar,Top Bar @@ -944,7 +944,7 @@ circle-arrow-up,cerchio-freccia-up cog,COG comment,commento comments,commenti -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,Creare un campo personalizzato di tipo Link (profilo) e quindi utilizzare le impostazioni di 'condizione' di mappare il campo per la regola di autorizzazione. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,Creare un campo personalizzato di tipo Link (profilo) e quindi utilizzare le impostazioni di 'condizione' di mappare il campo per la regola di autorizzazione. dd-mm-yyyy,gg-mm-aaaa dd/mm/yyyy,gg / mm / aaaa does not exist,non esiste diff --git a/frappe/translations/nl.csv b/frappe/translations/nl.csv index 744bfe8795..26805549cc 100644 --- a/frappe/translations/nl.csv +++ b/frappe/translations/nl.csv @@ -132,7 +132,7 @@ Center,Centrum "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Bepaalde documenten mogen niet worden gewijzigd zodra de definitieve, zoals een factuur bijvoorbeeld. De eindtoestand van deze documenten wordt genoemd Ingediend. U kunt beperken welke rollen kunnen op Verzenden." Chat,Praten Check,Controleren -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Controleer / Deselecteer rollen toegewezen aan het profiel. Klik op de rol om uit te vinden welke permissies die taak. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Controleer / Deselecteer rollen toegewezen aan het profiel. Klik op de rol om uit te vinden welke permissies die taak. Check this to make this the default letter head in all prints,Vink dit aan om deze de standaard briefpapier maken in alle afdrukken Checked,Geruit Child Tables are shown as a Grid in other DocTypes.,Onderliggende tabellen worden weergegeven als een tabel in andere DocTypes. @@ -603,11 +603,11 @@ Print Width,Printbreedte Print...,Print ... Priority,Prioriteit Private,Prive- -Profile,Profiel -Profile Defaults,Profiel Standaardwaarden -Profile Represents a User in the system.,Profiel Geeft een gebruiker in het systeem. -Profile of a Blogger,Profiel van een Blogger -Profile of a blog writer.,Profiel van een blog schrijver. +User,Profiel +User Defaults,Profiel Standaardwaarden +User Represents a User in the system.,Profiel Geeft een gebruiker in het systeem. +User of a Blogger,Profiel van een Blogger +User of a blog writer.,Profiel van een blog schrijver. Properties,Eigenschappen Property,Eigendom Property Setter,Onroerend goed Setter @@ -815,7 +815,7 @@ To,Naar "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Om verder te beperken rechten op basis van bepaalde waarden in een document, gebruikt u de 'Staat' instellingen." To restrict a User of a particular Role to documents that are explicitly assigned to them,Een gebruiker van een bepaalde rol beperken tot documenten die expliciet aan hen toegewezen To restrict a User of a particular Role to documents that are only self-created.,Om een ​​gebruiker van een bepaalde rol te beperken tot documenten die alleen zelfgeschapen. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Om gebruikersrollen in te stellen, ga je gewoon naar > Gebruikers Setup en op de gebruiker Klik om rollen toe te wijzen." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Om gebruikersrollen in te stellen, ga je gewoon naar > Gebruikers Setup en op de gebruiker Klik om rollen toe te wijzen." ToDo,ToDo Tools,Gereedschap Top Bar,Top Bar @@ -944,7 +944,7 @@ circle-arrow-up,cirkel-pijl-up cog,tand comment,commentaar comments,reacties -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,een aangepast veld van het type Link (Profile) en gebruik dan de 'Staat' instellingen om dat veld toe te wijzen aan de toestemming regel. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,een aangepast veld van het type Link (User) en gebruik dan de 'Staat' instellingen om dat veld toe te wijzen aan de toestemming regel. dd-mm-yyyy,dd-mm-jjjj dd/mm/yyyy,dd / mm / yyyy does not exist,bestaat niet diff --git a/frappe/translations/pt-BR.csv b/frappe/translations/pt-BR.csv index aaab865697..d30d5d65bb 100644 --- a/frappe/translations/pt-BR.csv +++ b/frappe/translations/pt-BR.csv @@ -132,7 +132,7 @@ Center,Centro "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Alguns documentos não devem ser alterados uma vez finalizados, como uma nota fiscal, por exemplo. O estado final de tais documentos é chamado Enviado. Você pode restringir as funções que podem Enviar." Chat,Conversar Check,Verificar -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Marque / Desmarque funções atribuídas ao perfil. Clique sobre a Função para verificar que permissões a função tem. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Marque / Desmarque funções atribuídas ao perfil. Clique sobre a Função para verificar que permissões a função tem. Check this to make this the default letter head in all prints,Marque esta opção para tornar este o cabeçalho padrão em todas as impressões Checked,Marcado Child Tables are shown as a Grid in other DocTypes.,Tabelas-filhas são mostradas como uma grade nos outros DocTypes. @@ -603,11 +603,11 @@ Print Width,Largura de impressão Print...,Imprimir ... Priority,Prioridade Private,Privado -Profile,Perfil -Profile Defaults,Padrões de Perfil -Profile Represents a User in the system.,Perfil representa um usuário no sistema. -Profile of a Blogger,Perfil de um Blogger -Profile of a blog writer.,Perfil de um escritor do blog. +User,Perfil +User Defaults,Padrões de Perfil +User Represents a User in the system.,Perfil representa um usuário no sistema. +User of a Blogger,Perfil de um Blogger +User of a blog writer.,Perfil de um escritor do blog. Properties,Propriedades Property,Propriedade Property Setter,Setter propriedade @@ -815,7 +815,7 @@ To,Para "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Para restringir ainda mais as permissões com base em determinados valores em um documento, use as definições de 'Condição'." To restrict a User of a particular Role to documents that are explicitly assigned to them,Para restringir um usuário de uma função a documentos que são explicitamente atribuídos a ele To restrict a User of a particular Role to documents that are only self-created.,Para restringir um usuário de uma função a apenas documentos que ele próprio criou. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Para definir funções ao usuário, basta ir a Configuração> Usuários e clicar sobre o usuário para atribuir funções." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Para definir funções ao usuário, basta ir a Configuração> Usuários e clicar sobre o usuário para atribuir funções." ToDo,Lista de Tarefas Tools,Ferramentas Top Bar,Barra Superior @@ -944,7 +944,7 @@ circle-arrow-up,círculo de seta para cima cog,roda dentada comment,comentário comments,comentários -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,Criar um Campo Personalizado do tipo ligação (Perfil) e depois usar as configurações de 'Condição' para mapear o campo para a regra de Permissão. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,Criar um Campo Personalizado do tipo ligação (Perfil) e depois usar as configurações de 'Condição' para mapear o campo para a regra de Permissão. dd-mm-yyyy,dd-mm-aaaa dd/mm/yyyy,dd/mm/aaaa does not exist,não existe diff --git a/frappe/translations/pt.csv b/frappe/translations/pt.csv index 308f82f61e..74676907a9 100644 --- a/frappe/translations/pt.csv +++ b/frappe/translations/pt.csv @@ -132,7 +132,7 @@ Center,Centro "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Alguns documentos não deve ser alterado, uma vez final, como uma nota fiscal, por exemplo. O estado final de tais documentos é chamado Enviado. Você pode restringir as funções que podem Enviar." Chat,Conversar Check,Verificar -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Verifique / Desmarque papéis atribuídos ao perfil. Clique sobre o Papel para descobrir o que as permissões que papel tem. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Verifique / Desmarque papéis atribuídos ao perfil. Clique sobre o Papel para descobrir o que as permissões que papel tem. Check this to make this the default letter head in all prints,Marque esta opção para tornar esta a cabeça carta padrão em todas as impressões Checked,Verificado Child Tables are shown as a Grid in other DocTypes.,Mesas para crianças são mostrados como uma grade no DOCTYPEs outros. @@ -603,11 +603,11 @@ Print Width,Largura de impressão Print...,Imprimir ... Priority,Prioridade Private,Privado -Profile,Perfil -Profile Defaults,Padrões de Perfil -Profile Represents a User in the system.,Perfil Representa um usuário no sistema. -Profile of a Blogger,Perfil de um Blogger -Profile of a blog writer.,Perfil de um escritor do blog. +User,Perfil +User Defaults,Padrões de Perfil +User Represents a User in the system.,Perfil Representa um usuário no sistema. +User of a Blogger,Perfil de um Blogger +User of a blog writer.,Perfil de um escritor do blog. Properties,Propriedades Property,Propriedade Property Setter,Setter propriedade @@ -815,7 +815,7 @@ To,Para "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Para restringir ainda mais permissões com base em determinados valores em um documento, use a 'condição' definições." To restrict a User of a particular Role to documents that are explicitly assigned to them,Para restringir um usuário de um papel especial a documentos que são explicitamente atribuídos a eles To restrict a User of a particular Role to documents that are only self-created.,Para restringir um usuário de um papel especial a documentos que são apenas auto-criado. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Para definir funções de usuário, basta ir a Configuração> Usuários e clique sobre o usuário para atribuir funções." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Para definir funções de usuário, basta ir a Configuração> Usuários e clique sobre o usuário para atribuir funções." ToDo,ToDo Tools,Ferramentas Top Bar,Top Bar @@ -944,7 +944,7 @@ circle-arrow-up,círculo de seta para cima cog,roda dentada comment,comentário comments,reacties -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,Criar um campo personalizado de ligação tipo (perfil) e depois usar as configurações de 'condição' para mapear o campo para a regra de permissão. +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,Criar um campo personalizado de ligação tipo (perfil) e depois usar as configurações de 'condição' para mapear o campo para a regra de permissão. dd-mm-yyyy,dd-mm-aaaa dd/mm/yyyy,dd / mm / aaaa does not exist,não existe diff --git a/frappe/translations/sr.csv b/frappe/translations/sr.csv index a9edc560d2..0262e0e4a3 100644 --- a/frappe/translations/sr.csv +++ b/frappe/translations/sr.csv @@ -132,7 +132,7 @@ Center,Центар "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.","Одређене документи не треба мењати једном финалу, као фактура за пример. Коначно стање таквих докумената зове Поднет. Можете да ограничите које улоге могу да поднесу." Chat,Ћаскање Check,Проверити -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,Проверите / поништите улоге додељене профил. Кликните на улогу да сазнате шта дозволе које улога. +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,Проверите / поништите улоге додељене профил. Кликните на улогу да сазнате шта дозволе које улога. Check this to make this the default letter head in all prints,Проверите то да овај главу подразумевану писмо у свим отисцима Checked,Проверен Child Tables are shown as a Grid in other DocTypes.,Дете Столови су приказани као Грид у другим ДоцТипес. @@ -603,11 +603,11 @@ Print Width,Ширина штампе Print...,Штампа ... Priority,Приоритет Private,Приватан -Profile,Профил -Profile Defaults,Профил Дефаултс -Profile Represents a User in the system.,Профил Представља корисника у систему. -Profile of a Blogger,Профил од Блоггер -Profile of a blog writer.,Профил од блога писца. +User,Профил +User Defaults,Профил Дефаултс +User Represents a User in the system.,Профил Представља корисника у систему. +User of a Blogger,Профил од Блоггер +User of a blog writer.,Профил од блога писца. Properties,Некретнине Property,Имовина Property Setter,Имовина сетер @@ -815,7 +815,7 @@ To,До "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","Да би се даље ограничавају дозволе на основу одређених вредности у документу, користите "Стање" подешавања." To restrict a User of a particular Role to documents that are explicitly assigned to them,Да бисте ограничили корисник посебну улогу у документима који су експлицитно додељене на њих To restrict a User of a particular Role to documents that are only self-created.,Да бисте ограничили корисник посебну улогу у документима које су само себи створио. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","Да бисте поставили улоге корисника, само идите на Подешавање корисника> и кликните на корисника да доделите улоге." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","Да бисте поставили улоге корисника, само идите на Подешавање корисника> и кликните на корисника да доделите улоге." ToDo,ТоДо Tools,Алат Top Bar,Топ Бар @@ -944,7 +944,7 @@ circle-arrow-up,круг-уп арров cog,зубац comment,коментар comments,Коментари -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,"креирате Цустом поље типа Линк (профил), а затим користите "Стање" поставке да мапира то поље на Дозвола правила." +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,"креирате Цустом поље типа Линк (профил), а затим користите "Стање" поставке да мапира то поље на Дозвола правила." dd-mm-yyyy,дд-мм-гггг dd/mm/yyyy,дд / мм / гггг does not exist,не постоји diff --git a/frappe/translations/ta.csv b/frappe/translations/ta.csv index 523d6c1cbd..c15f769f11 100644 --- a/frappe/translations/ta.csv +++ b/frappe/translations/ta.csv @@ -132,7 +132,7 @@ Center,மையம் "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.",சில ஆவணங்களை உதாரணமாக ஒரு விலைப்பட்டியல் போன்ற முறை இறுதி மாற்ற கூடாது. அத்தகைய ஆவணங்களை இறுதி மாநில Submitted அழைக்கப்படுகிறது. நீங்கள் நடிக்க சமர்ப்பி இது கட்டுப்படுத்த முடியும். Chat,அரட்டை Check,சோதனை -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,பதிவு செய்தது ஒதுக்கப்படும் / தேர்வுநீக்கு வேடங்களில் பாருங்கள். பங்கு உண்டு என்று என்ன அனுமதிகள் கண்டுபிடிக்க பங்கு கிளிக். +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,பதிவு செய்தது ஒதுக்கப்படும் / தேர்வுநீக்கு வேடங்களில் பாருங்கள். பங்கு உண்டு என்று என்ன அனுமதிகள் கண்டுபிடிக்க பங்கு கிளிக். Check this to make this the default letter head in all prints,அனைத்து அச்சிட்டு இந்த முன்னிருப்பு கடிதம் தலை செய்ய இந்த சோதனை Checked,சதுர அமைப்பு கொண்டுள்ள Child Tables are shown as a Grid in other DocTypes.,குழந்தை அட்டவணைகள் மற்ற டாக்டைப்கள் ஒரு கட்டம் காட்டப்படும். @@ -603,11 +603,11 @@ Print Width,அச்சு அகலம் Print...,அச்சு ... Priority,முதன்மை Private,தனிப்பட்ட -Profile,சுயவிவரத்தை -Profile Defaults,சுயவிவரத்தை இயல்புநிலைகளுக்கு -Profile Represents a User in the system.,சுயவிவரத்தை கணினியில் ஒரு பயனர் குறிக்கிறது. -Profile of a Blogger,", ஒரு, பிளாகரின் சுயவிவரத்தை" -Profile of a blog writer.,ஒரு வலைப்பதிவு எழுத்தாளர் பற்றிய சுயவிவரத்தை. +User,சுயவிவரத்தை +User Defaults,சுயவிவரத்தை இயல்புநிலைகளுக்கு +User Represents a User in the system.,சுயவிவரத்தை கணினியில் ஒரு பயனர் குறிக்கிறது. +User of a Blogger,", ஒரு, பிளாகரின் சுயவிவரத்தை" +User of a blog writer.,ஒரு வலைப்பதிவு எழுத்தாளர் பற்றிய சுயவிவரத்தை. Properties,பண்புகள் Property,சொத்து Property Setter,சொத்து செட்டர் @@ -815,7 +815,7 @@ To,வேண்டும் "To further restrict permissions based on certain values in a document, use the 'Condition' settings.","மேலும் ஒரு ஆவணத்தில் குறிப்பிட்ட மதிப்புகள் அடிப்படையில் அனுமதிகளை கட்டுப்படுத்த, 'கண்டிஷன்' அமைப்புகளை பயன்படுத்த." To restrict a User of a particular Role to documents that are explicitly assigned to them,வெளிப்படையாக அவர்களுக்கு ஒதுக்கப்படும் என்று ஆவணங்களை ஒரு குறிப்பிட்ட கதாபாத்திரம் ஒரு பயனர் தடை To restrict a User of a particular Role to documents that are only self-created.,ஒரே சுய உருவாக்கப்பட்ட என்று ஆவணங்களை ஒரு குறிப்பிட்ட கதாபாத்திரம் ஒரு பயனர் கட்டுப்படுத்துகின்றது. -"To set user roles, just go to Setup > Users and click on the user to assign roles.","பயனர் பாத்திரங்களை அமைக்க, தான் சென்று > பயனர்கள் அமைக்கவும் மற்றும் பாத்திரங்கள் ஒதுக்க பயனர் கிளிக்." +"To set user roles, just go to Setup > Users and click on the user to assign roles.","பயனர் பாத்திரங்களை அமைக்க, தான் சென்று > பயனர்கள் அமைக்கவும் மற்றும் பாத்திரங்கள் ஒதுக்க பயனர் கிளிக்." ToDo,TODO Tools,கருவிகள் Top Bar,மேல் பட்டை @@ -944,7 +944,7 @@ circle-arrow-up,வட்டத்தை-அம்பு அப் cog,இயந்திர சக்கரத்தின் பல் comment,கருத்து comments,கருத்துக்கள் -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,"வகை இணைப்பு (செய்தது) ஒரு தனிப்பயன் புலம் உருவாக்க, பின்னர் அனுமதி ஆட்சிக்கு என்று துறையில் கண்டறிவதில் 'கண்டிஷன்' அமைப்புகளை பயன்படுத்த." +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,"வகை இணைப்பு (செய்தது) ஒரு தனிப்பயன் புலம் உருவாக்க, பின்னர் அனுமதி ஆட்சிக்கு என்று துறையில் கண்டறிவதில் 'கண்டிஷன்' அமைப்புகளை பயன்படுத்த." dd-mm-yyyy,dd-mm-yyyy dd/mm/yyyy,dd / mm / yyyy does not exist,இல்லை diff --git a/frappe/translations/th.csv b/frappe/translations/th.csv index b1d94a28ab..defbc221e3 100644 --- a/frappe/translations/th.csv +++ b/frappe/translations/th.csv @@ -132,7 +132,7 @@ Center,ศูนย์ "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.",เอกสารบางอย่างไม่ควรจะมีการเปลี่ยนแปลงครั้งสุดท้ายเช่นใบแจ้งหนี้สำหรับตัวอย่าง รัฐสุดท้ายสำหรับเอกสารดังกล่าวเรียกว่า Submitted คุณสามารถ จำกัด การซึ่งสามารถส่งบทบาท Chat,พูดคุย Check,ตรวจสอบ -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,ตรวจสอบ / บทบาทที่กำหนดให้ยกเลิกการเลือกรายละเอียด คลิกที่บทบาทเพื่อหาสิ่งที่สิทธิ์บทบาทที่ได้ +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,ตรวจสอบ / บทบาทที่กำหนดให้ยกเลิกการเลือกรายละเอียด คลิกที่บทบาทเพื่อหาสิ่งที่สิทธิ์บทบาทที่ได้ Check this to make this the default letter head in all prints,ตรวจสอบนี้จะทำให้เรื่องนี้หัวจดหมายเริ่มต้นในการพิมพ์ทั้งหมด Checked,ถูกตรวจสอบ Child Tables are shown as a Grid in other DocTypes.,ตารางเด็กจะปรากฏเป็นเส้นตารางใน doctypes อื่น ๆ @@ -603,11 +603,11 @@ Print Width,ความกว้างพิมพ์ Print...,พิมพ์ ... Priority,บุริมสิทธิ์ Private,ส่วนตัว -Profile,รายละเอียด -Profile Defaults,ค่าดี​​ฟอลต์รายละเอียด -Profile Represents a User in the system.,รายละเอียดหมายถึงผู้ใช้ในระบบ -Profile of a Blogger,ดูรายละเอียดของ Blogger -Profile of a blog writer.,ดูรายละเอียดของนักเขียนบล็อก +User,รายละเอียด +User Defaults,ค่าดี​​ฟอลต์รายละเอียด +User Represents a User in the system.,รายละเอียดหมายถึงผู้ใช้ในระบบ +User of a Blogger,ดูรายละเอียดของ Blogger +User of a blog writer.,ดูรายละเอียดของนักเขียนบล็อก Properties,สรรพคุณ Property,คุณสมบัติ Property Setter,สถานที่ให้บริการ Setter @@ -815,7 +815,7 @@ To,ไปยัง "To further restrict permissions based on certain values in a document, use the 'Condition' settings.",เพื่อ จำกัด สิทธิ์ตามค่าบางอย่างในเอกสารให้ใช้การตั้งค่า 'สภาพ' To restrict a User of a particular Role to documents that are explicitly assigned to them,เพื่อ จำกัด ผู้ใช้โดยเฉพาะอย่างยิ่งบทบาทของเอกสารที่ได้รับมอบหมายอย่างชัดเจนเพื่อให้พวกเขา To restrict a User of a particular Role to documents that are only self-created.,เพื่อ จำกัด ผู้ใช้โดยเฉพาะอย่างยิ่งบทบาทของเอกสารที่มีเฉพาะที่สร้างขึ้นเอง -"To set user roles, just go to Setup > Users and click on the user to assign roles.",การตั้งบทบาทผู้ใช้เพียงแค่ไปที่ การตั้งค่า> Users และคลิกที่ผู้ใช้สามารถกำหนดบทบาท +"To set user roles, just go to Setup > Users and click on the user to assign roles.",การตั้งบทบาทผู้ใช้เพียงแค่ไปที่ การตั้งค่า> Users และคลิกที่ผู้ใช้สามารถกำหนดบทบาท ToDo,สิ่งที่ต้องทำ Tools,เครื่องมือ Top Bar,Bar สถานที่ยอด @@ -944,7 +944,7 @@ circle-arrow-up,วงกลมลูกศรขึ้น cog,ฟันเฟือง comment,ความเห็น comments,ความเห็น -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,สร้างฟิลด์ที่กำหนดเองของ Link ชนิด (รายละเอียด) แล้วใช้การตั้งค่า 'สภาพ' to map เขตข้อมูลนั้นไปกฎการอนุญาต +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,สร้างฟิลด์ที่กำหนดเองของ Link ชนิด (รายละเอียด) แล้วใช้การตั้งค่า 'สภาพ' to map เขตข้อมูลนั้นไปกฎการอนุญาต dd-mm-yyyy,dd-mm-yyyy dd/mm/yyyy,วัน / เดือน / ปี does not exist,ไม่ได้อยู่ diff --git a/frappe/translations/zh-cn.csv b/frappe/translations/zh-cn.csv index c24f7c6422..06427f5203 100644 --- a/frappe/translations/zh-cn.csv +++ b/frappe/translations/zh-cn.csv @@ -132,7 +132,7 @@ Center,中心 "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.",某些文件不应该改变最后一次,像发票为例。对这些文件的最后状态被称为提交 。您可以限制哪些角色可以提交。 Chat,聊天 Check,查 -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,查看/取消选中分配给个人的角色。点击角色,找出哪些权限的角色了。 +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,查看/取消选中分配给个人的角色。点击角色,找出哪些权限的角色了。 Check this to make this the default letter head in all prints,勾选这个来让这个默认的信头中的所有打印 Checked,检查 Child Tables are shown as a Grid in other DocTypes.,子表中显示为其他文档类型的Grid。 @@ -603,11 +603,11 @@ Print Width,打印宽度 Print...,打印... Priority,优先 Private,私人 -Profile,轮廓 -Profile Defaults,简介默认 -Profile Represents a User in the system.,资料表示系统中的一个用户。 -Profile of a Blogger,是Blogger的个人资料 -Profile of a blog writer.,一个博客作家简介。 +User,轮廓 +User Defaults,简介默认 +User Represents a User in the system.,资料表示系统中的一个用户。 +User of a Blogger,是Blogger的个人资料 +User of a blog writer.,一个博客作家简介。 Properties,属性 Property,属性 Property Setter,属性setter @@ -815,7 +815,7 @@ To,至 "To further restrict permissions based on certain values in a document, use the 'Condition' settings.",为了进一步限制基于文档中的某些价值观的权限,使用'条件'的设置。 To restrict a User of a particular Role to documents that are explicitly assigned to them,要限制某一特定角色的用户来显式分配给他们的文件 To restrict a User of a particular Role to documents that are only self-created.,要限制某一特定角色的用户到只有自己创建的文档。 -"To set user roles, just go to Setup > Users and click on the user to assign roles.",要设置用户角色,只要进入设置>用户 ,然后单击分配角色的用户。 +"To set user roles, just go to Setup > Users and click on the user to assign roles.",要设置用户角色,只要进入设置>用户 ,然后单击分配角色的用户。 ToDo,待办事项 Tools,工具 Top Bar,顶栏 @@ -944,7 +944,7 @@ circle-arrow-up,圆圈箭头行动 cog,COG comment,评论 comments,评论 -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,创建类型链接(配置文件)的自定义字段,然后使用“条件”设置到该字段映射到权限规则。 +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,创建类型链接(配置文件)的自定义字段,然后使用“条件”设置到该字段映射到权限规则。 dd-mm-yyyy,日 - 月 - 年 dd/mm/yyyy,日/月/年 does not exist,不存在 diff --git a/frappe/translations/zh-tw.csv b/frappe/translations/zh-tw.csv index 0e0bbac61d..508e30619f 100644 --- a/frappe/translations/zh-tw.csv +++ b/frappe/translations/zh-tw.csv @@ -132,7 +132,7 @@ Center,中心 "Certain documents should not be changed once final, like an Invoice for example. The final state for such documents is called Submitted. You can restrict which roles can Submit.",某些文件不應該改變最後一次,像發票為例。對這些文件的最後狀態被稱為提交 。您可以限制哪些角色可以提交。 Chat,聊天 Check,查 -Check / Uncheck roles assigned to the Profile. Click on the Role to find out what permissions that Role has.,查看/取消選中分配給個人的角色。點擊角色,找出哪些權限的角色了。 +Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has.,查看/取消選中分配給個人的角色。點擊角色,找出哪些權限的角色了。 Check this to make this the default letter head in all prints,勾選這個來讓這個默認的信頭中的所有打印 Checked,檢查 Child Tables are shown as a Grid in other DocTypes.,子表中顯示為其他文檔類型的Grid。 @@ -603,11 +603,11 @@ Print Width,打印寬度 Print...,打印... Priority,優先 Private,私人 -Profile,輪廓 -Profile Defaults,簡介默認 -Profile Represents a User in the system.,資料表示系統中的一個用戶。 -Profile of a Blogger,是Blogger的個人資料 -Profile of a blog writer.,一個博客作家簡介。 +User,輪廓 +User Defaults,簡介默認 +User Represents a User in the system.,資料表示系統中的一個用戶。 +User of a Blogger,是Blogger的個人資料 +User of a blog writer.,一個博客作家簡介。 Properties,屬性 Property,屬性 Property Setter,屬性setter @@ -815,7 +815,7 @@ To,至 "To further restrict permissions based on certain values in a document, use the 'Condition' settings.",為了進一步限制基於文檔中的某些價值觀的權限,使用'條件'的設置。 To restrict a User of a particular Role to documents that are explicitly assigned to them,要限制某一特定角色的用戶來顯式分配給他們的文件 To restrict a User of a particular Role to documents that are only self-created.,要限制某一特定角色的用戶到只有自己創建的文檔。 -"To set user roles, just go to Setup > Users and click on the user to assign roles.",要設置用戶角色,只要進入設置>用戶 ,然後單擊分配角色的用戶。 +"To set user roles, just go to Setup > Users and click on the user to assign roles.",要設置用戶角色,只要進入設置>用戶 ,然後單擊分配角色的用戶。 ToDo,待辦事項 Tools,工具 Top Bar,頂欄 @@ -944,7 +944,7 @@ circle-arrow-up,圓圈箭頭行動 cog,COG comment,評論 comments,評論 -create a Custom Field of type Link (Profile) and then use the 'Condition' settings to map that field to the Permission rule.,創建類型鏈接(配置文件)的自定義字段,然後使用“條件”設置到該字段映射到權限規則。 +create a Custom Field of type Link (User) and then use the 'Condition' settings to map that field to the Permission rule.,創建類型鏈接(配置文件)的自定義字段,然後使用“條件”設置到該字段映射到權限規則。 dd-mm-yyyy,日 - 月 - 年 dd/mm/yyyy,日/月/年 does not exist,不存在 diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index b868ea14b9..b74fd9e1a7 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -31,20 +31,20 @@ def getCSVelement(v): return '"'+v+'"' else: return v or '' -def get_fullname(profile): - """get the full name (first name + last name) of the user from Profile""" +def get_fullname(user): + """get the full name (first name + last name) of the user from User""" if not hasattr(frappe.local, "fullnames"): frappe.local.fullnames = {} - if not frappe.local.fullnames.get(profile): - p = frappe.db.get_value("Profile", profile, ["first_name", "last_name"], as_dict=True) + if not frappe.local.fullnames.get(user): + p = frappe.db.get_value("User", user, ["first_name", "last_name"], as_dict=True) if p: - frappe.local.fullnames[profile] = " ".join(filter(None, - [p.get('first_name'), p.get('last_name')])) or profile + frappe.local.fullnames[user] = " ".join(filter(None, + [p.get('first_name'), p.get('last_name')])) or user else: - frappe.local.fullnames[profile] = profile + frappe.local.fullnames[user] = user - return frappe.local.fullnames.get(profile) + return frappe.local.fullnames.get(user) def get_formatted_email(user): """get email id of user formatted as: John Doe """ diff --git a/frappe/utils/email_lib/__init__.py b/frappe/utils/email_lib/__init__.py index 58620b09e4..a2831118ce 100644 --- a/frappe/utils/email_lib/__init__.py +++ b/frappe/utils/email_lib/__init__.py @@ -39,4 +39,4 @@ def get_system_managers(): WHERE role='System Manager' AND parent!='Administrator' AND parent IN - (SELECT email FROM tabProfile WHERE enabled=1)""") \ No newline at end of file + (SELECT email FROM tabUser WHERE enabled=1)""") \ No newline at end of file diff --git a/frappe/utils/email_lib/bulk.py b/frappe/utils/email_lib/bulk.py index 110e03dcab..ffdd6e2094 100644 --- a/frappe/utils/email_lib/bulk.py +++ b/frappe/utils/email_lib/bulk.py @@ -13,7 +13,7 @@ from frappe.utils import cint, get_url, nowdate class BulkLimitCrossedError(frappe.ValidationError): pass -def send(recipients=None, sender=None, doctype='Profile', email_field='email', +def send(recipients=None, sender=None, doctype='User', email_field='email', subject='[No Subject]', message='[No Content]', ref_doctype=None, ref_docname=None, add_unsubscribe_link=True): def is_unsubscribed(rdata): diff --git a/frappe/utils/install.py b/frappe/utils/install.py index 14e1f078b9..96c70bbffc 100644 --- a/frappe/utils/install.py +++ b/frappe/utils/install.py @@ -16,14 +16,14 @@ def after_install(): # core users / roles install_docs = [ - {'doctype':'Profile', 'name':'Administrator', 'first_name':'Administrator', + {'doctype':'User', 'name':'Administrator', 'first_name':'Administrator', 'email':'admin@localhost', 'enabled':1}, - {'doctype':'Profile', 'name':'Guest', 'first_name':'Guest', + {'doctype':'User', 'name':'Guest', 'first_name':'Guest', 'email':'guest@localhost', 'enabled':1}, {'doctype':'UserRole', 'parent': 'Administrator', 'role': 'Administrator', - 'parenttype':'Profile', 'parentfield':'user_roles'}, + 'parenttype':'User', 'parentfield':'user_roles'}, {'doctype':'UserRole', 'parent': 'Guest', 'role': 'Guest', - 'parenttype':'Profile', 'parentfield':'user_roles'}, + 'parenttype':'User', 'parentfield':'user_roles'}, {'doctype': "Role", "role_name": "Report Manager"} ] @@ -34,7 +34,7 @@ def after_install(): pass # all roles to admin - frappe.bean("Profile", "Administrator").get_controller().add_roles(*frappe.db.sql_list(""" + frappe.bean("User", "Administrator").get_controller().add_roles(*frappe.db.sql_list(""" select name from tabRole""")) # update admin password diff --git a/frappe/profile.py b/frappe/utils/user.py similarity index 90% rename from frappe/profile.py rename to frappe/utils/user.py index f31e656e0d..32e85b8cae 100644 --- a/frappe/profile.py +++ b/frappe/utils/user.py @@ -5,10 +5,10 @@ from __future__ import unicode_literals import frappe, json -class Profile: +class User: """ - A profile object is created at the beginning of every request with details of the use. - The global profile object is `frappe.user` + A user object is created at the beginning of every request with details of the use. + The global user object is `frappe.user` """ def __init__(self, name=''): self.defaults = None @@ -149,10 +149,10 @@ class Profile: self.build_permissions() return self.can_read - def load_profile(self): + def load_user(self): d = frappe.db.sql("""select email, first_name, last_name, email_signature, background_image, user_type, language - from tabProfile where name = %s""", (self.name,), as_dict=1)[0] + from tabUser where name = %s""", (self.name,), as_dict=1)[0] if not self.can_read: self.build_permissions() @@ -173,15 +173,15 @@ class Profile: return d def get_user_fullname(user): - fullname = frappe.db.sql("SELECT CONCAT_WS(' ', first_name, last_name) FROM `tabProfile` WHERE name=%s", (user,)) + fullname = frappe.db.sql("SELECT CONCAT_WS(' ', first_name, last_name) FROM `tabUser` WHERE name=%s", (user,)) return fullname and fullname[0][0] or '' def get_system_managers(only_name=False): - """returns all system manager's profile details""" + """returns all system manager's user details""" import email.utils system_managers = frappe.db.sql("""select distinct name, concat_ws(" ", if(first_name="", null, first_name), if(last_name="", null, last_name)) - as fullname from tabProfile p + as fullname from tabUser p where docstatus < 2 and enabled = 1 and name not in ("Administrator", "Guest") and exists (select * from tabUserRole ur @@ -192,13 +192,13 @@ def get_system_managers(only_name=False): else: return [email.utils.formataddr((p.fullname, p.name)) for p in system_managers] -def add_role(profile, role): - profile_wrapper = frappe.bean("Profile", profile).get_controller().add_roles(role) +def add_role(user, role): + user_wrapper = frappe.bean("User", user).get_controller().add_roles(role) def add_system_manager(email, first_name=None, last_name=None): - # add profile - profile = frappe.new_bean("Profile") - profile.doc.fields.update({ + # add user + user = frappe.new_bean("User") + user.doc.fields.update({ "name": email, "email": email, "enabled": 1, @@ -206,12 +206,12 @@ def add_system_manager(email, first_name=None, last_name=None): "last_name": last_name, "user_type": "System User" }) - profile.insert() + user.insert() # add roles roles = frappe.db.sql_list("""select name from `tabRole` where name not in ("Administrator", "Guest", "All")""") - profile.get_controller().add_roles(*roles) + user.get_controller().add_roles(*roles) def get_roles(username=None, with_standard=True): """get roles of current user""" diff --git a/frappe/website/doctype/blog_post/test_blog_post.py b/frappe/website/doctype/blog_post/test_blog_post.py index 167345dfc4..58f878e7c6 100644 --- a/frappe/website/doctype/blog_post/test_blog_post.py +++ b/frappe/website/doctype/blog_post/test_blog_post.py @@ -29,7 +29,7 @@ import unittest from frappe.core.page.user_properties.user_properties import add, remove, get_properties, clear_restrictions -test_dependencies = ["Profile"] +test_dependencies = ["User"] class TestBlogPost(unittest.TestCase): def setUp(self): frappe.db.sql("""update tabDocPerm set `restricted`=0 where parent='Blog Post' @@ -39,11 +39,11 @@ class TestBlogPost(unittest.TestCase): frappe.clear_cache(doctype="Blog Post") - profile = frappe.bean("Profile", "test1@example.com") - profile.get_controller().add_roles("Website Manager") + user = frappe.bean("User", "test1@example.com") + user.get_controller().add_roles("Website Manager") - profile = frappe.bean("Profile", "test2@example.com") - profile.get_controller().add_roles("Blogger") + user = frappe.bean("User", "test2@example.com") + user.get_controller().add_roles("Blogger") frappe.set_user("test1@example.com") diff --git a/frappe/website/doctype/blogger/README.md b/frappe/website/doctype/blogger/README.md index 13ddecda70..994e686ad2 100644 --- a/frappe/website/doctype/blogger/README.md +++ b/frappe/website/doctype/blogger/README.md @@ -1 +1 @@ -Profile of blog writer in "Blog" section. \ No newline at end of file +User of blog writer in "Blog" section. \ No newline at end of file diff --git a/frappe/website/doctype/blogger/blogger.py b/frappe/website/doctype/blogger/blogger.py index 3b7197cf4b..3b71838336 100644 --- a/frappe/website/doctype/blogger/blogger.py +++ b/frappe/website/doctype/blogger/blogger.py @@ -12,14 +12,14 @@ class DocType: self.doc, self.doclist = d, dl def on_update(self): - "if profile is set, then update all older blogs" + "if user is set, then update all older blogs" from frappe.website.doctype.blog_post.blog_post import clear_blog_cache clear_blog_cache() - if self.doc.profile: + if self.doc.user: for blog in frappe.db.sql_list("""select name from `tabBlog Post` where owner=%s - and ifnull(blogger,'')=''""", self.doc.profile): + and ifnull(blogger,'')=''""", self.doc.user): b = frappe.bean("Blog Post", blog) b.doc.blogger = self.doc.name b.save() \ No newline at end of file diff --git a/frappe/website/doctype/blogger/blogger.txt b/frappe/website/doctype/blogger/blogger.txt index c093e8d4d1..3d7f343ea2 100644 --- a/frappe/website/doctype/blogger/blogger.txt +++ b/frappe/website/doctype/blogger/blogger.txt @@ -2,7 +2,7 @@ { "creation": "2013-03-25 16:00:51", "docstatus": 0, - "modified": "2013-12-20 19:23:57", + "modified": "2013-12-20 19:23:58", "modified_by": "Administrator", "owner": "Administrator" }, @@ -10,7 +10,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "field:short_name", - "description": "Profile of a Blogger", + "description": "User ID of a Blogger", "doctype": "DocType", "document_type": "Master", "icon": "icon-user", @@ -66,10 +66,10 @@ }, { "doctype": "DocField", - "fieldname": "profile", + "fieldname": "user", "fieldtype": "Link", - "label": "Profile", - "options": "Profile" + "label": "User", + "options": "User" }, { "doctype": "DocField", diff --git a/frappe/website/doctype/post/post.txt b/frappe/website/doctype/post/post.txt index 75f2ac4cd3..a9970af463 100644 --- a/frappe/website/doctype/post/post.txt +++ b/frappe/website/doctype/post/post.txt @@ -2,7 +2,7 @@ { "creation": "2014-01-07 14:00:04", "docstatus": 0, - "modified": "2014-03-03 14:53:18", + "modified": "2014-03-03 14:53:19", "modified_by": "Administrator", "owner": "Administrator" }, @@ -96,7 +96,7 @@ "fieldname": "assigned_to", "fieldtype": "Link", "label": "Assigned To", - "options": "Profile" + "options": "User" }, { "doctype": "DocField", diff --git a/frappe/website/doctype/website_route_permission/website_route_permission.py b/frappe/website/doctype/website_route_permission/website_route_permission.py index f3aaad70b0..3a840cd7df 100644 --- a/frappe/website/doctype/website_route_permission/website_route_permission.py +++ b/frappe/website/doctype/website_route_permission/website_route_permission.py @@ -12,5 +12,5 @@ class DocType: def on_update(self): remove_empty_permissions() - clear_permissions(self.doc.profile) + clear_permissions(self.doc.user) \ No newline at end of file diff --git a/frappe/website/doctype/website_route_permission/website_route_permission.txt b/frappe/website/doctype/website_route_permission/website_route_permission.txt index 9297fae96d..ee5e3390b7 100644 --- a/frappe/website/doctype/website_route_permission/website_route_permission.txt +++ b/frappe/website/doctype/website_route_permission/website_route_permission.txt @@ -2,7 +2,7 @@ { "creation": "2014-01-29 17:56:29", "docstatus": 0, - "modified": "2014-02-24 13:17:17", + "modified": "2014-02-24 13:17:18", "modified_by": "Administrator", "owner": "Administrator" }, @@ -54,10 +54,10 @@ }, { "doctype": "DocField", - "fieldname": "profile", + "fieldname": "user", "fieldtype": "Link", - "label": "Profile", - "options": "Profile", + "label": "User", + "options": "User", "reqd": 1, "search_index": 1 }, diff --git a/frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.py b/frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.py deleted file mode 100644 index 8f77cdfbb7..0000000000 --- a/frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt - -from __future__ import unicode_literals -import frappe - -from frappe.website.permissions import remove_empty_permissions, clear_permissions - -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - - def on_update(self): - remove_empty_permissions() - clear_permissions(self.doc.profile) - diff --git a/frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.txt b/frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.txt deleted file mode 100644 index 55a86f5826..0000000000 --- a/frappe/website/doctype/website_sitemap_permission/website_sitemap_permission.txt +++ /dev/null @@ -1,84 +0,0 @@ -[ - { - "creation": "2014-01-29 17:56:29", - "docstatus": 0, - "modified": "2014-02-11 19:26:33", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "WSP.######", - "doctype": "DocType", - "icon": "icon-shield", - "module": "Website", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Website Route Permission", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "export": 1, - "import": 0, - "name": "__common__", - "parent": "Website Route Permission", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 1, - "role": "Website Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Website Route Permission" - }, - { - "doctype": "DocField", - "fieldname": "website_route", - "fieldtype": "Link", - "label": "Website Route", - "options": "Website Route", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "profile", - "fieldtype": "Link", - "label": "Profile", - "options": "Profile", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "read", - "fieldtype": "Check", - "label": "Read" - }, - { - "doctype": "DocField", - "fieldname": "write", - "fieldtype": "Check", - "label": "Write" - }, - { - "doctype": "DocField", - "fieldname": "admin", - "fieldtype": "Check", - "label": "Admin" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file diff --git a/frappe/website/js/website_group.js b/frappe/website/js/website_group.js index 0505b2e697..f42ad93ebb 100644 --- a/frappe/website/js/website_group.js +++ b/frappe/website/js/website_group.js @@ -166,7 +166,7 @@ $.extend(website, { close.on("click", function() { // clear assignment $post_editor.find(".assigned-to").addClass("hide"); - $post_editor.find(".assigned-profile").html(""); + $post_editor.find(".assigned-user").html(""); $post_editor.find('[data-fieldname="assigned_to"]').val(null); $control_assign.val(null); }); @@ -178,7 +178,7 @@ $.extend(website, { $control: $control_assign, select: function(value, item) { var $assigned_to = $post_editor.find(".assigned-to").removeClass("hide"); - $assigned_to.find(".assigned-profile").html(item.profile_html); + $assigned_to.find(".assigned-user").html(item.user_html); $post_editor.find('[data-fieldname="assigned_to"]').val(value); bind_close(); }, @@ -358,12 +358,12 @@ $.extend(website, { }, select: function(event, ui) { opts.$control.val(""); - opts.select(ui.item.profile, ui.item); + opts.select(ui.item.user, ui.item); } }); $user_suggest.data( "ui-autocomplete" )._renderItem = function(ul, item) { - return $("
  • ").html("" + item.profile_html + "") + return $("
  • ").html("" + item.user_html + "") .css("padding", "5px") .appendTo(ul); }; @@ -502,7 +502,7 @@ $.extend(website, { type: "POST", data: { cmd: "frappe.templates.website_group.settings.update_permission", - profile: $tr.attr("data-profile"), + user: $tr.attr("data-user"), perm: $chk.attr("data-perm"), value: $chk.prop("checked") ? "1" : "0", group: website.group @@ -523,13 +523,13 @@ $.extend(website, { }, }); }, - add_sitemap_permission: function(profile) { + add_sitemap_permission: function(user) { $.ajax({ url: "/", type: "POST", data: { cmd: "frappe.templates.website_group.settings.add_sitemap_permission", - profile: profile, + user: user, group: website.group }, success: function(data) { diff --git a/frappe/website/permissions.py b/frappe/website/permissions.py index b440f2b7f3..4c418f2d3f 100644 --- a/frappe/website/permissions.py +++ b/frappe/website/permissions.py @@ -6,7 +6,7 @@ import frappe def remove_empty_permissions(): - permissions_cache_to_be_cleared = frappe.db.sql_list("""select distinct profile + permissions_cache_to_be_cleared = frappe.db.sql_list("""select distinct user from `tabWebsite Route Permission` where ifnull(`read`, 0)=0 and ifnull(`write`, 0)=0 and ifnull(`admin`, 0)=0""") @@ -15,19 +15,19 @@ def remove_empty_permissions(): clear_permissions(permissions_cache_to_be_cleared) -def get_access(sitemap_page, profile=None): - profile = profile or frappe.session.user - key = "website_route_permissions:{}".format(profile) +def get_access(sitemap_page, user=None): + user = user or frappe.session.user + key = "website_route_permissions:{}".format(user) cache = frappe.cache() permissions = cache.get_value(key) or {} if not permissions.get(sitemap_page): - permissions[sitemap_page] = _get_access(sitemap_page, profile) + permissions[sitemap_page] = _get_access(sitemap_page, user) cache.set_value(key, permissions) return permissions.get(sitemap_page) -def _get_access(sitemap_page, profile): +def _get_access(sitemap_page, user): lft, rgt, public_read, public_write, page_or_generator = frappe.db.get_value("Website Route", sitemap_page, ["lft", "rgt", "public_read", "public_write", "page_or_generator"]) @@ -38,7 +38,7 @@ def _get_access(sitemap_page, profile): if not (lft and rgt): raise frappe.ValidationError("Please rebuild Website Route Tree") - if profile == "Guest": + if user == "Guest": return { "read": public_read, "write": 0, "admin": 0 } @@ -50,8 +50,8 @@ def _get_access(sitemap_page, profile): for perm in frappe.db.sql("""select wsp.`read`, wsp.`write`, wsp.`admin`, ws.lft, ws.rgt, ws.name from `tabWebsite Route Permission` wsp, `tabWebsite Route` ws - where wsp.profile = %s and wsp.website_route = ws.name - order by lft asc""", (profile,), as_dict=True): + where wsp.user = %s and wsp.website_route = ws.name + order by lft asc""", (user,), as_dict=True): if perm.lft <= lft and perm.rgt >= rgt: if not (public_read or private_read): private_read = perm.read if not read: read = perm.read @@ -67,12 +67,12 @@ def _get_access(sitemap_page, profile): return { "read": read, "write": write, "admin": admin, "private_read": private_read } -def clear_permissions(profiles=None): - if isinstance(profiles, basestring): - profiles = [profiles] - elif profiles is None: - profiles = frappe.db.sql_list("""select name from `tabProfile`""") +def clear_permissions(users=None): + if isinstance(users, basestring): + users = [users] + elif users is None: + users = frappe.db.sql_list("""select name from `tabUser`""") cache = frappe.cache() - for profile in profiles: - cache.delete_value("website_route_permissions:{}".format(profile)) + for user in users: + cache.delete_value("website_route_permissions:{}".format(user)) diff --git a/frappe/widgets/form/test_form.py b/frappe/widgets/form/test_form.py index 09b0759bbe..e228de197e 100644 --- a/frappe/widgets/form/test_form.py +++ b/frappe/widgets/form/test_form.py @@ -9,7 +9,7 @@ from frappe.widgets.form.utils import get_linked_docs class TestForm(unittest.TestCase): def test_linked_with(self): results = get_linked_docs("Role", "System Manager") - self.assertTrue("Profile" in results) + self.assertTrue("User" in results) self.assertTrue("DocType" in results) if __name__=="__main__": diff --git a/frappe/widgets/query_report.py b/frappe/widgets/query_report.py index 2130308a8d..384c6979f1 100644 --- a/frappe/widgets/query_report.py +++ b/frappe/widgets/query_report.py @@ -120,7 +120,7 @@ def get_filtered_data(ref_doctype, columns, data): for row in data: match = True - if not ("owner" in match_filters and matched_columns.get("profile", None)==match_filters["owner"]): + if not ("owner" in match_filters and matched_columns.get("user", None)==match_filters["owner"]): for col, idx in matched_columns.items(): if row[idx] not in match_filters[col]: match = False @@ -157,7 +157,7 @@ def get_user_match_filters(doctypes, ref_doctype): def get_matched_columns(linked_doctypes, match_filters): if "owner" in match_filters: - match_filters["profile"] = match_filters["owner"] + match_filters["user"] = match_filters["owner"] col_idx_map = {} for dt, idx in linked_doctypes.items():
  • ").html('' + $("").html('' +d.parent+'').appendTo(row); $("").html(d.defkey).appendTo(row); $("").html(d.defvalue).appendTo(row); diff --git a/frappe/core/page/user_properties/user_properties.py b/frappe/core/page/user_properties/user_properties.py index 1fbf0a9756..f78c412dd8 100644 --- a/frappe/core/page/user_properties/user_properties.py +++ b/frappe/core/page/user_properties/user_properties.py @@ -9,7 +9,7 @@ import frappe.permissions @frappe.whitelist() def get_users_and_links(): return { - "users": frappe.db.sql_list("""select name from tabProfile where + "users": frappe.db.sql_list("""select name from tabUser where ifnull(enabled,0)=1 and name not in ("Administrator", "Guest")"""), "link_fields": get_restrictable_doctypes() diff --git a/frappe/core/report/todo/todo.py b/frappe/core/report/todo/todo.py index c69de044a1..3524224fc3 100644 --- a/frappe/core/report/todo/todo.py +++ b/frappe/core/report/todo/todo.py @@ -18,8 +18,8 @@ def execute(filters=None): todo.date and getdate(todo.date) or getdate("1900-01-01")), reverse=True) columns = [_("ID")+":Link/ToDo:90", _("Priority")+"::60", _("Date")+ ":Date", - _("Description")+"::150", _("Assigned To/Owner") + ":Link/Profile:120", - _("Assigned By")+":Link/Profile:120", _("Reference")+"::200"] + _("Description")+"::150", _("Assigned To/Owner") + ":Link/User:120", + _("Assigned By")+":Link/User:120", _("Reference")+"::200"] result = [] for todo in todo_list: diff --git a/frappe/defaults.py b/frappe/defaults.py index 13030baf81..4fb34e0873 100644 --- a/frappe/defaults.py +++ b/frappe/defaults.py @@ -162,6 +162,11 @@ def clear_cache(user=None): if user: to_clear = [user] elif frappe.flags.in_install_app!="frappe": - to_clear = frappe.db.sql_list("select name from tabProfile") + try: + to_clear = frappe.db.sql_list("select name from tabUser") + except Exception, e: + if e.args[0]!=1146: + # special case, in rename patch + raise for p in to_clear + common_keys: frappe.cache().delete_value("__defaults:" + p) \ No newline at end of file diff --git a/frappe/patches.txt b/frappe/patches.txt index 57e2485f60..1455d35e14 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -20,4 +20,5 @@ frappe.patches.4_0.set_website_route_idx execute:import frappe.installer;frappe.installer.make_site_dirs() #2014-02-19 frappe.patches.4_0.private_backups frappe.patches.4_0.set_module_in_report -frappe.patches.4_0.remove_old_parent \ No newline at end of file +frappe.patches.4_0.remove_old_parent +frappe.patches.4_0.rename_profile_to_user \ No newline at end of file diff --git a/frappe/patches/4_0/rename_profile_to_user.py b/frappe/patches/4_0/rename_profile_to_user.py new file mode 100644 index 0000000000..d3f409373a --- /dev/null +++ b/frappe/patches/4_0/rename_profile_to_user.py @@ -0,0 +1,13 @@ +import frappe + +from frappe.model import rename_field + +def execute(): + tables = frappe.db.sql_list("show tables") + if "tabUser" not in tables: + frappe.rename_doc("DocType", "tabUser", "User", force=True) + + frappe.reload_doc("website", "doctype", "website_route_permission") + frappe.reload_doc("website", "doctype", "blogger") + rename_field("Website Route Permission", "profile", "user") + rename_field("Blogger", "profile", "user") diff --git a/frappe/public/js/frappe/defaults.js b/frappe/public/js/frappe/defaults.js index 904d6c98eb..cdaeca429e 100644 --- a/frappe/public/js/frappe/defaults.js +++ b/frappe/public/js/frappe/defaults.js @@ -3,12 +3,12 @@ frappe.defaults = { get_user_default: function(key) { - var d = frappe.boot.profile.defaults[key]; + var d = frappe.boot.user.defaults[key]; if($.isArray(d)) d = d[0]; return d; }, get_user_defaults: function(key) { - var d = frappe.boot.profile.defaults[key]; + var d = frappe.boot.user.defaults[key]; if(!$.isArray(d)) d = [d]; return d; }, @@ -26,7 +26,7 @@ frappe.defaults = { if(typeof value=="string") value = JSON.stringify(value); - frappe.boot.profile.defaults[key] = value; + frappe.boot.user.defaults[key] = value; return frappe.call({ method: "frappe.client.set_default", args: { @@ -37,7 +37,7 @@ frappe.defaults = { }); }, get_default: function(key) { - var value = frappe.boot.profile.defaults[key]; + var value = frappe.boot.user.defaults[key]; if(value) { try { return JSON.parse(value) diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index 19eab3f16e..564fa09d3d 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -28,7 +28,7 @@ frappe.Application = Class.extend({ callback: function(r, rt) { frappe.provide('frappe.boot'); frappe.boot = r; - if(frappe.boot.profile.name==='Guest' || frappe.boot.profile.user_type==="Website User") { + if(frappe.boot.user.name==='Guest' || frappe.boot.user.user_type==="Website User") { window.location = 'index'; return; } @@ -73,7 +73,7 @@ frappe.Application = Class.extend({ }, set_user_display_settings: function() { - frappe.ui.set_user_background(frappe.boot.profile.background_image); + frappe.ui.set_user_background(frappe.boot.user.background_image); }, load_bootinfo: function() { @@ -128,12 +128,11 @@ frappe.Application = Class.extend({ set_globals: function() { // for backward compatibility - profile = frappe.boot.profile; - user = frappe.boot.profile.name; + user = frappe.boot.user.name; user_fullname = frappe.user_info(user).fullname; - user_defaults = profile.defaults; - user_roles = profile.roles; - user_email = profile.email; + user_defaults = frappe.boot.user.defaults; + user_roles = frappe.boot.user.roles; + user_email = frappe.boot.user.email; sys_defaults = frappe.boot.sysdefaults; }, sync_pages: function() { @@ -154,7 +153,7 @@ frappe.Application = Class.extend({ }, set_as_guest: function() { // for backward compatibility - profile = {name:'Guest'}; + user = {name:'Guest'}; user = 'Guest'; user_fullname = 'Guest'; user_defaults = {}; diff --git a/frappe/public/js/frappe/form/assign_to.js b/frappe/public/js/frappe/form/assign_to.js index 5dc6c50d8e..8dfe9d8b1a 100644 --- a/frappe/public/js/frappe/form/assign_to.js +++ b/frappe/public/js/frappe/form/assign_to.js @@ -83,7 +83,7 @@ frappe.ui.form.AssignTo = Class.extend({ title: frappe._('Add to To Do'), width: 350, fields: [ - {fieldtype:'Link', fieldname:'assign_to', options:'Profile', + {fieldtype:'Link', fieldname:'assign_to', options:'User', label:frappe._("Assign To"), description:frappe._("Add to To Do List of"), reqd:true}, {fieldtype:'Data', fieldname:'description', label:frappe._("Comment")}, @@ -132,7 +132,7 @@ frappe.ui.form.AssignTo = Class.extend({ }); } } - me.dialog.fields_dict.assign_to.get_query = "frappe.core.doctype.profile.profile.profile_query"; + me.dialog.fields_dict.assign_to.get_query = "frappe.core.doctype.user.user.user_query"; } me.dialog.clear(); diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index e07e149ad6..93ad0133ff 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -27,7 +27,7 @@ frappe.ui.form.Control = Class.extend({ this.make(); // if developer_mode=1, show fieldname as tooltip - if(frappe.boot.profile && frappe.boot.profile.name==="Administrator" && + if(frappe.boot.user && frappe.boot.user.name==="Administrator" && frappe.boot.developer_mode===1 && this.$wrapper) { this.$wrapper.attr("title", frappe._(this.df.fieldname)); } diff --git a/frappe/public/js/frappe/form/toolbar.js b/frappe/public/js/frappe/form/toolbar.js index 9b5497df9b..cf8ecc7e42 100644 --- a/frappe/public/js/frappe/form/toolbar.js +++ b/frappe/public/js/frappe/form/toolbar.js @@ -138,7 +138,7 @@ frappe.ui.form.Toolbar = Class.extend({ } // copy - if(in_list(profile.can_create, me.frm.doctype) && !me.frm.meta.allow_copy) { + if(in_list(frappe.boot.user.can_create, me.frm.doctype) && !me.frm.meta.allow_copy) { this.appframe.add_dropdown_button("File", frappe._("Copy"), function() { me.frm.copy_doc();}, 'icon-file'); } diff --git a/frappe/public/js/frappe/misc/user.js b/frappe/public/js/frappe/misc/user.js index 88e261dffd..0b52c29511 100644 --- a/frappe/public/js/frappe/misc/user.js +++ b/frappe/public/js/frappe/misc/user.js @@ -40,7 +40,7 @@ frappe.ui.set_user_background = function(src) { frappe.provide('frappe.user'); $.extend(frappe.user, { - name: (frappe.boot ? frappe.boot.profile.name : 'Guest'), + name: (frappe.boot ? frappe.boot.user.name : 'Guest'), full_name: function(uid) { return uid===user ? "You" : @@ -56,7 +56,7 @@ $.extend(frappe.user, { if(typeof rl=='string') rl = [rl]; for(var i in rl) { - if((frappe.boot ? frappe.boot.profile.roles : ['Guest']).indexOf(rl[i])!=-1) + if((frappe.boot ? frappe.boot.user.roles : ['Guest']).indexOf(rl[i])!=-1) return true; } }, @@ -94,7 +94,7 @@ $.extend(frappe.user, { var ret = null; switch(type) { case "module": - if(frappe.boot.profile.allow_modules.indexOf(m)!=-1) + if(frappe.boot.user.allow_modules.indexOf(m)!=-1) ret = m; break; case "page": diff --git a/frappe/public/js/frappe/model/create_new.js b/frappe/public/js/frappe/model/create_new.js index 6637cf26fb..48bd5c3e5f 100644 --- a/frappe/public/js/frappe/model/create_new.js +++ b/frappe/public/js/frappe/model/create_new.js @@ -83,7 +83,7 @@ $.extend(frappe.model, { }, get_default_from_boot_docs: function(df, doc, parent_doc) { - // set default from partial docs passed during boot like ":Profile" + // set default from partial docs passed during boot like ":User" if(frappe.model.get(df["default"]).length > 0) { var ref_fieldname = df["default"].slice(1).toLowerCase().replace(" ", "_"); var ref_value = parent_doc ? diff --git a/frappe/public/js/frappe/model/model.js b/frappe/public/js/frappe/model/model.js index 02d9928ed0..e02d2f5157 100644 --- a/frappe/public/js/frappe/model/model.js +++ b/frappe/public/js/frappe/model/model.js @@ -122,29 +122,29 @@ $.extend(frappe.model, { }, can_create: function(doctype) { - return frappe.boot.profile.can_create.indexOf(doctype)!==-1; + return frappe.boot.user.can_create.indexOf(doctype)!==-1; }, can_read: function(doctype) { - return frappe.boot.profile.can_read.indexOf(doctype)!==-1; + return frappe.boot.user.can_read.indexOf(doctype)!==-1; }, can_write: function(doctype) { - return frappe.boot.profile.can_write.indexOf(doctype)!==-1; + return frappe.boot.user.can_write.indexOf(doctype)!==-1; }, can_get_report: function(doctype) { - return frappe.boot.profile.can_get_report.indexOf(doctype)!==-1; + return frappe.boot.user.can_get_report.indexOf(doctype)!==-1; }, can_delete: function(doctype) { if(!doctype) return false; - return frappe.boot.profile.can_delete.indexOf(doctype)!==-1; + return frappe.boot.user.can_delete.indexOf(doctype)!==-1; }, can_cancel: function(doctype) { if(!doctype) return false; - return frappe.boot.profile.can_cancel.indexOf(doctype)!==-1; + return frappe.boot.user.can_cancel.indexOf(doctype)!==-1; }, is_submittable: function(doctype) { @@ -157,7 +157,7 @@ $.extend(frappe.model, { if(user_roles.indexOf("System Manager")!==-1) return true; if(frm) return frm.perm[0].import===1; - return frappe.boot.profile.can_import.indexOf(doctype)!==-1; + return frappe.boot.user.can_import.indexOf(doctype)!==-1; }, can_export: function(doctype, frm) { @@ -165,17 +165,17 @@ $.extend(frappe.model, { if(user_roles.indexOf("System Manager")!==-1) return true; if(frm) return frm.perm[0].export===1; - return frappe.boot.profile.can_export.indexOf(doctype)!==-1; + return frappe.boot.user.can_export.indexOf(doctype)!==-1; }, can_print: function(doctype, frm) { if(frm) return frm.perm[0].print===1; - return frappe.boot.profile.can_print.indexOf(doctype)!==-1; + return frappe.boot.user.can_print.indexOf(doctype)!==-1; }, can_email: function(doctype, frm) { if(frm) return frm.perm[0].email===1; - return frappe.boot.profile.can_email.indexOf(doctype)!==-1; + return frappe.boot.user.can_email.indexOf(doctype)!==-1; }, can_restrict: function(doctype, frm) { @@ -183,7 +183,7 @@ $.extend(frappe.model, { if(user_roles.indexOf("System Manager")!==-1) return true; if(frm) return frm.perm[0].restrict===1; - return frappe.boot.profile.can_restrict.indexOf(doctype)!==-1; + return frappe.boot.user.can_restrict.indexOf(doctype)!==-1; }, has_value: function(dt, dn, fn) { diff --git a/frappe/public/js/frappe/ui/listing.js b/frappe/public/js/frappe/ui/listing.js index 2e9edc656f..3d04dcd5f5 100644 --- a/frappe/public/js/frappe/ui/listing.js +++ b/frappe/public/js/frappe/ui/listing.js @@ -42,7 +42,7 @@ frappe.ui.Listing = Class.extend({ }, prepare_opts: function() { if(this.opts.new_doctype) { - if(frappe.boot.profile.can_create.indexOf(this.opts.new_doctype)==-1) { + if(frappe.boot.user.can_create.indexOf(this.opts.new_doctype)==-1) { this.opts.new_doctype = null; } else { this.opts.new_doctype = this.opts.new_doctype; diff --git a/frappe/public/js/frappe/ui/toolbar/new.js b/frappe/public/js/frappe/ui/toolbar/new.js index 635749d339..1509e7edac 100644 --- a/frappe/public/js/frappe/ui/toolbar/new.js +++ b/frappe/public/js/frappe/ui/toolbar/new.js @@ -11,6 +11,6 @@ frappe.ui.toolbar.NewDialog = frappe.ui.toolbar.SelectorDialog.extend({ }); // get new types - this.set_values(profile.can_create.join(',').split(',')); + this.set_values(frappe.boot.user.can_create.join(',').split(',')); } }); diff --git a/frappe/public/js/frappe/ui/toolbar/recent.js b/frappe/public/js/frappe/ui/toolbar/recent.js index fbba036535..20bf63ac5c 100644 --- a/frappe/public/js/frappe/ui/toolbar/recent.js +++ b/frappe/public/js/frappe/ui/toolbar/recent.js @@ -48,9 +48,9 @@ frappe.ui.toolbar.RecentDocs = Class.extend({ }, setup: function() { // add menu items - if(!profile) return; - var rlist = JSON.parse(profile.recent||"[]"); - + if(!user) return; + var rlist = JSON.parse(frappe.boot.user.recent||"[]"); + if(!rlist) return; var m = rlist.length; if(m>15)m=15; for (var i=0;i"); diff --git a/frappe/public/js/frappe/views/doclistview.js b/frappe/public/js/frappe/views/doclistview.js index 480dbbcd75..3ef29a112a 100644 --- a/frappe/public/js/frappe/views/doclistview.js +++ b/frappe/public/js/frappe/views/doclistview.js @@ -223,7 +223,7 @@ frappe.views.DocListView = frappe.ui.Listing.extend({ }, make_no_result: function() { - var new_button = frappe.boot.profile.can_create.indexOf(this.doctype)!=-1 + var new_button = frappe.boot.user.can_create.indexOf(this.doctype)!=-1 ? ('

    ') diff --git a/frappe/public/js/frappe/views/reportview.js b/frappe/public/js/frappe/views/reportview.js index de6e6f2c33..5108568ee1 100644 --- a/frappe/public/js/frappe/views/reportview.js +++ b/frappe/public/js/frappe/views/reportview.js @@ -316,7 +316,7 @@ frappe.views.ReportView = frappe.ui.Listing.extend({ if(docfield.fieldname !== "idx" && frappe.model.std_fields_list.indexOf(docfield.fieldname)!==-1) { frappe.throw(frappe._("Cannot edit standard fields")); - } else if(frappe.boot.profile.can_write.indexOf(this.doctype)===-1) { + } else if(frappe.boot.user.can_write.indexOf(this.doctype)===-1) { frappe.throw(frappe._("No permission to edit")); } var me = this; diff --git a/frappe/public/js/legacy/globals.js b/frappe/public/js/legacy/globals.js index 5d997c1aae..4697c0ce52 100644 --- a/frappe/public/js/legacy/globals.js +++ b/frappe/public/js/legacy/globals.js @@ -5,7 +5,7 @@ frappe.provide('frappe.widgets.form'); frappe.provide('frappe.widgets.report'); frappe.provide('frappe.utils'); frappe.provide('frappe.model'); -frappe.provide('frappe.profile'); +frappe.provide('frappe.user'); frappe.provide('frappe.session'); frappe.provide('_f'); frappe.provide('_p'); @@ -21,7 +21,7 @@ frappe.settings.no_history = 1; var NEWLINE = '\n'; // user -var profile=null; +var user=null; var user=null; var user_defaults=null; var user_roles=null; diff --git a/frappe/sessions.py b/frappe/sessions.py index 607c211779..0442333742 100644 --- a/frappe/sessions.py +++ b/frappe/sessions.py @@ -75,7 +75,7 @@ def get(): bootinfo = frappe.cache().get_value('bootinfo:' + frappe.session.user) if bootinfo: bootinfo['from_cache'] = 1 - bootinfo["profile"]["recent"] = json.dumps(frappe.cache().get_value("recent:" + frappe.session.user)) + bootinfo["user"]["recent"] = json.dumps(frappe.cache().get_value("recent:" + frappe.session.user)) bootinfo["notification_info"].update(get_notifications()) if not bootinfo: @@ -129,8 +129,8 @@ class Session: frappe.db.begin() self.insert_session_record() - # update profile - frappe.db.sql("""UPDATE tabProfile SET last_login = '%s', last_ip = '%s' + # update user + frappe.db.sql("""UPDATE tabUser SET last_login = '%s', last_ip = '%s' where name='%s'""" % (frappe.utils.now(), frappe.get_request_header('REMOTE_ADDR'), self.data['user'])) frappe.db.commit() diff --git a/frappe/templates/generators/website_group.py b/frappe/templates/generators/website_group.py index 76ad5b5594..fae44481ac 100644 --- a/frappe/templates/generators/website_group.py +++ b/frappe/templates/generators/website_group.py @@ -73,12 +73,12 @@ def build_view_context(context): context.post = frappe.doc("Post", frappe.form_dict.name).fields if context.post.assigned_to: - context.profile = frappe.doc("Profile", context.post.assigned_to) + context.user = frappe.doc("User", context.post.assigned_to) elif context.view.name == "settings": - context.profiles = frappe.db.sql("""select p.*, wsp.`read`, wsp.`write`, wsp.`admin` - from `tabProfile` p, `tabWebsite Route Permission` wsp - where wsp.website_route=%s and wsp.profile=p.name""", context.pathname, as_dict=True) + context.users = frappe.db.sql("""select p.*, wsp.`read`, wsp.`write`, wsp.`admin` + from `tabUser` p, `tabWebsite Route Permission` wsp + where wsp.website_route=%s and wsp.user=p.name""", context.pathname, as_dict=True) elif context.view.name == "post": context.update(get_post_context(context)) diff --git a/frappe/templates/includes/login.js b/frappe/templates/includes/login.js index 0700b884e2..039a15488b 100644 --- a/frappe/templates/includes/login.js +++ b/frappe/templates/includes/login.js @@ -24,7 +24,7 @@ login.bind_events = function() { $(".form-signup").on("submit", function() { event.preventDefault(); var args = {}; - args.cmd = "frappe.core.doctype.profile.profile.sign_up"; + args.cmd = "frappe.core.doctype.user.user.sign_up"; args.email = ($("#signup_email").val() || "").trim(); args.full_name = ($("#signup_fullname").val() || "").trim(); if(!args.email || !valid_email(args.email) || !args.full_name) { @@ -37,7 +37,7 @@ login.bind_events = function() { $(".form-forgot").on("submit", function() { event.preventDefault(); var args = {}; - args.cmd = "frappe.core.doctype.profile.profile.reset_password"; + args.cmd = "frappe.core.doctype.user.user.reset_password"; args.user = ($("#forgot_email").val() || "").trim(); if(!args.user) { frappe.msgprint("Valid Login id required."); diff --git a/frappe/templates/includes/post_editor.html b/frappe/templates/includes/post_editor.html index dad75acd60..93afda2ed3 100644 --- a/frappe/templates/includes/post_editor.html +++ b/frappe/templates/includes/post_editor.html @@ -21,9 +21,9 @@ style="margin: 10px 0px;">
    - diff --git a/frappe/templates/includes/profile_display.html b/frappe/templates/includes/profile_display.html deleted file mode 100644 index d14f2bc21d..0000000000 --- a/frappe/templates/includes/profile_display.html +++ /dev/null @@ -1,9 +0,0 @@ -
    -
    - -
    -
    -
    {{ profile.first_name or "" }} {{ profile.last_name or "" }}
    -
    {{ profile.location or "" }}
    -
    -
    \ No newline at end of file diff --git a/frappe/templates/includes/sitemap_permission.html b/frappe/templates/includes/sitemap_permission.html index 665b9e9053..4b1fdf3e20 100644 --- a/frappe/templates/includes/sitemap_permission.html +++ b/frappe/templates/includes/sitemap_permission.html @@ -1,8 +1,8 @@ -
    - {% include "templates/includes/profile_display.html" %} + {% include "templates/includes/user_display.html" %}